Dear Timo,
Regarding using MappingQEulerian class in parallel, I did what you said for
the vector type template argument. It works when I run the code on my own
machine but I got the following error when I run it on cluster:
An error occurred in line <1480> of file
</shared/hpc/deal.ii-candi/deal.II-v8.4.1/include/deal.II/base/index_set.h>
in function
dealii::IndexSet::size_type
dealii::IndexSet::index_within_set(dealii::IndexSet::size_type) const
The violated condition was:
is_element(n) == true
The name and call sequence of the exception was:
ExcIndexNotPresent (n)
Additional Information:
The global index 0 is not an element of this set.
Stacktrace:
-----------
#0 ./parallel_large-strain_PT: dealii::IndexSet::index_within_set(unsigned
int) const
#1 /shared/hpc/deal.ii-candi/deal.II-v8.4.1/lib/libdeal_II.g.so.8.4.1:
dealii::PETScWrappers::internal::VectorReference::operator double() const
#2 ./parallel_large-strain_PT: PhaseField::Solid<3>::output_results() const
#3 ./parallel_large-strain_PT: PhaseField::Solid<3>::run()
#4 ./parallel_large-strain_PT: main
--------------------------------------------------------
Following is my out_put object. problem is related to the MappingQEulerian
since when I uncomment it (the red lines) I don't get error.
template <int dim>
void Solid<dim>::output_results() const
{
DataOut<dim> data_out;
std::vector<std::string> displacement_names;
switch (dim)
{
case 1:
displacement_names.push_back ("displacement");
break;
case 2:
displacement_names.push_back ("x_displacement");
displacement_names.push_back ("y_displacement");
break;
case 3:
displacement_names.push_back ("x_displacement");
displacement_names.push_back ("y_displacement");
displacement_names.push_back ("z_displacement");
break;
default:
Assert (false, ExcNotImplemented());
}
data_out.add_data_vector (dof_handler, solution, displacement_names);
data_out.add_data_vector (dof_handler_eta, solution_eta,
"order_parameter");
LA::MPI::Vector soln ;
soln.reinit(locally_owned_dofs,mpi_communicator);
for (unsigned int i = 0; i < soln.size(); ++i)
soln(i) = solution(i);
MappingQEulerian<dim, LA::MPI::Vector > q_mapping(degree, dof_handler,
soln);
Vector<float> subdomain (triangulation.n_active_cells());
for (unsigned int i=0; i<subdomain.size(); ++i)
subdomain(i) = triangulation.locally_owned_subdomain();
data_out.add_data_vector (subdomain, "subdomain");
data_out.build_patches(q_mapping, degree);
const unsigned int cycle = time.get_timestep();
const std::string filename = ("solution-" +
Utilities::int_to_string (cycle, 2) +
"." +
Utilities::int_to_string
(triangulation.locally_owned_subdomain(),
4));
std::ofstream output ((filename + ".vtu").c_str());
data_out.write_vtu (output);
if (Utilities::MPI::this_mpi_process(mpi_communicator) == 0)
{
std::vector<std::string> filenames;
for (unsigned int i=0;
i<Utilities::MPI::n_mpi_processes(mpi_communicator);
++i)
filenames.push_back ("solution-" +
Utilities::int_to_string (cycle, 2) +
"." +
Utilities::int_to_string (i, 4) +
".vtu");
std::ofstream master_output (("solution-" +
Utilities::int_to_string (cycle, 2) +
".pvtu").c_str());
data_out.write_pvtu_record (master_output, filenames);
}
}
}
It would be appreciated if you could give me any clue to resolve the error.
Thanks,
Hamed
On Sunday, October 16, 2016 at 7:58:40 AM UTC-5, Timo Heister wrote:
>
> > "To enable the use of the MappingQ1Eulerian class also in the context of
> > parallel codes using the PETSc wrapper classes, the type of the vector
> can
> > be specified as template parameter EulerVectorType Not specifying this
> > template argument in applications using the PETSc vector classes leads
> to
> > the construction of a copy of the vector which is not accessible
> > afterwards!"
> > I can't understatnd what it means and what changes I should make.
>
> The class MappingQ1Eulerian has a template argument for the vector
> type. You need to set this to be a parallel vector (like
> PETScWrappers::MPI::Vector).
>
> --
> Timo Heister
> http://www.math.clemson.edu/~heister/
>
--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see
https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.