Jonathan,
My understanding of the situation is this: whenever you output a solution
in parallel, each processor loops over all the cells that it owns and
stores the associated DoFs. On a cell that a processor owns, it is possible
that not all the DoFs will belong to said processor. So to output the
solution correctly, you will also need to have some of the locally relevant
DoFs, which is something that your code does not have.
This can be achieved by changing the beginning of the output function to:
-----------------------------------------------------------------------------------------------------------------
template <int dim>
void EigenvalueProblem<dim>::output_results () const
{
std::vector<DataComponentInterpretation::DataComponentInterpretation>
data_component_interpretation
(dim, DataComponentInterpretation::component_is_part_of_vector);
DataOut<dim> data_out;
data_out.attach_dof_handler (dof_handler);
* std::vector<Vector<double>> eigenvectorZ;*
* eigenvectorZ.resize(eigenvectors.size());*
for (unsigned int i=0; i<eigenvectors.size(); ++i)
{
* eigenvectorZ[i].resize(dof_handler.n_dofs());*
* eigenvectorZ[i] = eigenvectors[i];*
data_out.add_data_vector (eigenvectorZ,
std::string("Mode_") +
Utilities::int_to_string(i+1),
DataOut<dim>::type_dof_data,
data_component_interpretation);
}
// Print out the first eigenvector to a file
....
-----------------------------------------------------------------------------------------------------------------
Artur
--
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.