Hi Bruno,
sorry for the late response. I get the following error:
An error occurred in line <1469> of file </calculate/temp/iwtm009/spack-stage-dealii-9.3.3-h7vrbckbqhxjllhyiwpmxjdp3242wjvv/spack-src/include/deal.II/lac/trilinos_vector.h> in function
dealii::IndexSet dealii::TrilinosWrappers::MPI::Vector::locally_owned_elements() const
The violated condition was:
owned_elements.size() == size()
Additional information:
The locally owned elements have not been properly initialized! This
happens for example if this object has been initialized with exactly
one overlapping IndexSet.
at the bolded line in this code snippet of kinsol.cc
template <typename VectorType>
unsigned int
{
unsigned int system_size = initial_guess_and_solution.size();
// The solution is stored in
// solution. Here we take only a
// view of it.
# ifdef DEAL_II_WITH_MPI
{
const IndexSet is = initial_guess_and_solution.locally_owned_elements();
const unsigned int local_system_size = is.n_elements();
solution =
N_VNew_Parallel(communicator, local_system_size, system_size);
u_scale = N_VNew_Parallel(communicator, local_system_size, system_size);
N_VConst_Parallel(1.e0, u_scale);
f_scale = N_VNew_Parallel(communicator, local_system_size, system_size);
N_VConst_Parallel(1.e0, f_scale);
}
else
which is expected as how I reinit my solution vector and distributed vectors
solution.reinit(locally_relevant_dofs,
MPI_COMM_WORLD);
distributed_vector.reinit(locally_owned_dofs,
locally_relevant_dofs,
MPI_COMM_WORLD,
true);
Nonetheless this is my standard reinit call for my parallel applications following the scheme of step-32. I thought it might had to do with the reinit lambda passed to KINSOL
nonlinear_solver.reinit_vector = [&](dealii::LinearAlgebraTrilinos::MPI::Vector &x)
{
x.reinit(locally_relevant_dofs,
MPI_COMM_WORLD);
};
but I get the above error even if I use the reinit call for distributed vectors.
So my question is how should one reinit the vectors in parallel applications using KINSOL. As a side question, how should one reinit the vector in the reinit_vector lambda? As the solution vector or as a distributed vector?
Attached is the source code for the modified step-77.
Cheers,
Jose