Thank you, Daniel.

I solved my problem already in the following way before reading your post:

DataOut<dim> data_out;
data_out.attach_dof_handler(dof_handler);

// ========================[ DISPLACEMENT COMPONENTS 
]=========================

std::vector<std::string> displacement_components;
switch (dim)
{
case 1:
displacement_components.push_back("displacement_x");
break;
case 2:
displacement_components.push_back("displacement_x");
displacement_components.push_back("displacement_y");
break;
case 3:
displacement_components.push_back("displacement_x");
displacement_components.push_back("displacement_y");
displacement_components.push_back("displacement_z");
break;
default:
Assert(false, ExcInternalError())
;
}

std::vector<DataComponentInterpretation::DataComponentInterpretation> 
displacement_component_interpretation(dim, 
DataComponentInterpretation::component_is_scalar);

// Collect data output
data_out.add_data_vector(incremental_displacement, displacement_components, 
DataOut<dim>::type_dof_data, displacement_component_interpretation);

// ========================[ DISPLACEMENTS MAGNITUDE 
]=========================

std::vector<std::string> displacement_magnitude(dim, "displacement");

std::vector<DataComponentInterpretation::DataComponentInterpretation> 
displacement_magnitude_interpretation(dim, 
DataComponentInterpretation::component_is_part_of_vector);

data_out.add_data_vector(incremental_displacement, displacement_magnitude, 
DataOut<dim>::type_dof_data, displacement_magnitude_interpretation);


I thought there would be a more elegant solution than this, which is why I 
asked here. But it seems your suggestion is similar to my approach. 
Regarding the DataPostprocessor class, I am just using it for quantities at 
integration points, e.g. strains etc. 

Kind regards,
S. A. Mohseni


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to