fe(FE_Q<dim>(poly_degree), dim, // displacement
FE_DGPMonomial<dim>(poly_degree - 1), 1, // pressure
FE_DGPMonomial<dim>(poly_degree - 1), 1), // dilatation
DataOut<dim> data_out;
data_out.attach_dof_handler(dof_handler);
// displacement output
const std::vector<DataComponentInterpretation::DataComponentInterpretation>
data_component_interpretation(dim, DataComponentInterpretation::component_is_part_of_vector);
data_out.add_data_vector(system_solution,
std::vector<std::string> (dim, "displacement"),
DataOut<dim>::type_dof_data, data_component_interpretation);
const std::vector<DataComponentInterpretation::DataComponentInterpretation>
data_component_interpretation(dim+2, DataComponentInterpretation::component_is_part_of_vector);
data_out.add_data_vector(system_solution,
std::vector<std::string> (dim+2, "displacement"),
DataOut<dim>::type_dof_data, data_component_interpretation);
data_out.add_data_vector(system_solution,
std::vector<std::string> (dim, "displacement"),
DataOut<dim>::type_dof_data, data_component_interpretation);
--------------------------------------------------------
An error occurred in line <984> of file <../source/numerics/data_out_dof_data.cc> in function
void dealii::DataOut_DoFData<dealii::DoFHandler<2, 2>, 2, 2>::add_data_vector(const VectorType &, const std::vector<std::string> &, const dealii::DataOut_DoFData::DataVectorType, const std::vector<DataComponentInterpretation::DataComponentInterpretation> &) [VectorType = dealii::Vector<double>]
The violated condition was:
names.size() == dofs->get_fe().n_components()
The name and call sequence of the exception was:
Exceptions::DataOut::ExcInvalidNumberOfNames (names.size(), dofs->get_fe().n_components())
Additional Information:
You have to give one name per component in your data vector. The number you gave was 2, but the number of components is 4.
...
StrainPostprocessor<dim> strain_disp;
...
data_out.add_data_vector(present_solution, strain_disp);
...
template <int dim>
void MartTran<dim>::output()
{
std::vector<std::string> solution_names(dim, "displacement");
solution_names.emplace_back("order_parameter");
std::vector<DataComponentInterpretation::DataComponentInterpretation>
data_component_interpretation(dim, DataComponentInterpretation::component_is_part_of_vector);
data_component_interpretation.push_back(DataComponentInterpretation::component_is_scalar);
StrainPostprocessor<dim> strain_disp;
DataOut<dim> data_out;
data_out.attach_dof_handler(dof_handler);
data_out.add_data_vector(present_solution,
solution_names,
DataOut<dim>::type_dof_data,
data_component_interpretation);
data_out.add_data_vector(present_solution, strain_disp);
data_out.build_patches();
const std::string filename =
"solution-" + Utilities::int_to_string(timestep_number, 5) + ".vtk";
std::ofstream output(filename);
data_out.write_vtk(output);
}
--
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 dealii+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/27d0ba99-fa31-8cf8-c392-fec78f831481%40colostate.edu.
For more options, visit https://groups.google.com/d/optout.