16 #ifndef dealii_data_out_dof_data_h
17 #define dealii_data_out_dof_data_h
51 namespace DataOutImplementation
58 <<
"The number of subdivisions per patch, " << arg1
59 <<
", is not valid. It needs to be greater or equal to "
60 "one, or zero if you want it to be determined "
67 "For the operation you are attempting, you first need to "
68 "tell the DataOut or related object which DoFHandler or "
69 "triangulation you would like to work on.");
75 "For the operation you are attempting, you first need to "
76 "tell the DataOut or related object which DoFHandler "
77 "you would like to work on.");
86 <<
"The vector has size " << arg1
87 <<
" but the DoFHandler object says that there are " << arg2
88 <<
" degrees of freedom and there are " << arg3
89 <<
" active cells. The size of your vector needs to be"
90 <<
" either equal to the number of degrees of freedom, or"
91 <<
" equal to the number of active cells.");
99 <<
"Please use only the characters [a-zA-Z0-9_<>()] for" << std::endl
100 <<
"description strings since some graphics formats will only accept these."
102 <<
"The string you gave was <" << arg1
103 <<
">, within which the invalid character is <" << arg1[arg2] <<
">."
110 "When attaching a triangulation or DoFHandler object, it is "
111 "not allowed if old data vectors are still referenced. If "
112 "you want to reuse an object of the current type, you first "
113 "need to call the 'clear_data_vector()' function.");
120 <<
"You have to give one name per component in your "
121 <<
"data vector. The number you gave was " << arg1
122 <<
", but the number of components is " << arg2 <<
".");
127 "While merging sets of patches, the two sets to be merged "
128 "need to refer to data that agrees on the names of the "
129 "various variables represented. In other words, you "
130 "cannot merge sets of patches that originate from "
131 "entirely unrelated simulations.");
136 "While merging sets of patches, the two sets to be merged "
137 "need to refer to data that agrees on the number of "
138 "subdivisions and other properties. In other words, you "
139 "cannot merge sets of patches that originate from "
140 "entirely unrelated simulations.");
145 <<
"When declaring that a number of components in a data "
146 <<
"set to be output logically form a vector instead of "
147 <<
"simply a set of scalar fields, you need to specify "
148 <<
"this for all relevant components. Furthermore, "
149 <<
"vectors must always consist of exactly <dim> "
150 <<
"components. However, the vector component at "
151 <<
"position " << arg1 <<
" with name <" << arg2
152 <<
"> does not satisfy these conditions.");
157 <<
"When declaring that a number of components in a data "
158 <<
"set to be output logically form a tensor instead of "
159 <<
"simply a set of scalar fields, you need to specify "
160 <<
"this for all relevant components. Furthermore, "
161 <<
"tensors must always consist of exactly <dim*dim> "
162 <<
"components. However, the tensor component at "
163 <<
"position " << arg1 <<
" with name <" << arg2
164 <<
"> does not satisfy these conditions.");
172 namespace DataOutImplementation
221 template <
typename DoFHandlerType>
231 const std::vector<std::string> &
names,
243 *data_postprocessor);
265 DoFHandlerType::space_dimension> &fe_patch_values,
267 std::vector<double> &patch_values)
const = 0;
277 DoFHandlerType::space_dimension> &fe_patch_values,
288 DoFHandlerType::space_dimension> &fe_patch_values,
291 &patch_gradients)
const = 0;
301 DoFHandlerType::space_dimension> &fe_patch_values,
304 &patch_gradients_system)
const = 0;
313 DoFHandlerType::space_dimension> &fe_patch_values,
326 DoFHandlerType::space_dimension> &fe_patch_values,
329 &patch_hessians_system)
const = 0;
359 const std::vector<std::string>
names;
375 const ::DataPostprocessor<DoFHandlerType::space_dimension>>
404 template <
int dim,
int spacedim>
410 const std::vector<unsigned int> &n_postprocessor_outputs,
416 const bool use_face_values);
420 template <
typename DoFHandlerType>
424 const typename ::Triangulation<dim, spacedim>::cell_iterator
443 std::shared_ptr<::hp::FECollection<dim, spacedim>>>
447 std::vector<std::shared_ptr<::hp::FEValues<dim, spacedim>>>
449 std::vector<std::shared_ptr<::hp::FEFaceValues<dim, spacedim>>>
599 template <
typename DoFHandlerType,
601 int patch_space_dim = patch_dim>
672 DoFHandlerType::space_dimension> &);
742 template <
class VectorType>
746 const std::vector<std::string> &names,
748 const std::vector<DataComponentInterpretation::DataComponentInterpretation>
749 &data_component_interpretation = std::vector<
768 template <
class VectorType>
772 const std::string & name,
774 const std::vector<DataComponentInterpretation::DataComponentInterpretation>
775 &data_component_interpretation = std::vector<
793 template <
class VectorType>
796 const DoFHandlerType & dof_handler,
798 const std::vector<std::string> &names,
799 const std::vector<DataComponentInterpretation::DataComponentInterpretation>
800 &data_component_interpretation = std::vector<
808 template <
class VectorType>
811 const DoFHandlerType &dof_handler,
813 const std::string & name,
814 const std::vector<DataComponentInterpretation::DataComponentInterpretation>
815 &data_component_interpretation = std::vector<
844 template <
class VectorType>
848 &data_postprocessor);
856 template <
class VectorType>
861 &data_postprocessor);
880 template <
class VectorType>
883 const DoFHandlerType & dof_handler,
885 const std::vector<std::string> & names,
886 const std::vector<DataComponentInterpretation::DataComponentInterpretation>
887 &data_component_interpretation = std::vector<
893 template <
class VectorType>
897 const std::string & name);
944 template <
typename DoFHandlerType2>
976 DoFHandlerType::space_dimension>>
987 std::vector<std::shared_ptr<
994 std::vector<std::shared_ptr<
1009 virtual const std::vector<Patch> &
1016 virtual std::vector<std::string>
1025 DoFHandlerType::space_dimension>>>
1032 virtual std::vector<
1033 std::tuple<
unsigned int,
1041 template <
class,
int,
int>
1046 template <
int,
class>
1053 template <
class VectorType>
1056 const DoFHandlerType * dof_handler,
1058 const std::vector<std::string> &names,
1060 const std::vector<DataComponentInterpretation::DataComponentInterpretation>
1061 & data_component_interpretation,
1062 const bool deduce_output_names);
1068 template <
typename DoFHandlerType,
int patch_dim,
int patch_space_dim>
1069 template <
typename VectorType>
1073 const std::string & name,
1075 const std::vector<DataComponentInterpretation::DataComponentInterpretation>
1076 &data_component_interpretation)
1080 std::vector<std::string> names(1, name);
1081 add_data_vector_internal(
1082 dofs, vec, names, type, data_component_interpretation,
true);
1087 template <
typename DoFHandlerType,
int patch_dim,
int patch_space_dim>
1088 template <
typename VectorType>
1092 const std::vector<std::string> &names,
1094 const std::vector<DataComponentInterpretation::DataComponentInterpretation>
1095 &data_component_interpretation)
1099 add_data_vector_internal(
1100 dofs, vec, names, type, data_component_interpretation,
false);
1105 template <
typename DoFHandlerType,
int patch_dim,
int patch_space_dim>
1106 template <
typename VectorType>
1109 const DoFHandlerType &dof_handler,
1111 const std::string & name,
1112 const std::vector<DataComponentInterpretation::DataComponentInterpretation>
1113 &data_component_interpretation)
1115 std::vector<std::string> names(1, name);
1116 add_data_vector_internal(&dof_handler,
1120 data_component_interpretation,
1126 template <
typename DoFHandlerType,
int patch_dim,
int patch_space_dim>
1127 template <
typename VectorType>
1130 const DoFHandlerType & dof_handler,
1132 const std::vector<std::string> &names,
1133 const std::vector<DataComponentInterpretation::DataComponentInterpretation>
1134 &data_component_interpretation)
1136 add_data_vector_internal(&dof_handler,
1140 data_component_interpretation,
1146 template <
typename DoFHandlerType,
int patch_dim,
int patch_space_dim>
1147 template <
typename VectorType>
1155 add_data_vector(*dofs, vec, data_postprocessor);
1160 template <
typename DoFHandlerType,
int patch_dim,
int patch_space_dim>
1161 template <
typename DoFHandlerType2>
1167 const std::vector<Patch> &source_patches = source.
get_patches();
1168 Assert((patches.size() != 0) && (source_patches.size() != 0),
1169 ExcMessage(
"When calling this function, both the current "
1170 "object and the one being merged need to have a "
1171 "nonzero number of patches associated with it. "
1172 "Either you called this function on objects that "
1173 "are empty, or you may have forgotten to call "
1174 "the 'build_patches()' function."));
1193 Assert(patches[0].n_subdivisions == source_patches[0].n_subdivisions,
1195 Assert(patches[0].data.n_cols() == source_patches[0].data.n_cols(),
1197 Assert((patches[0].data.n_rows() +
1198 (patches[0].points_are_available ? 0 : patch_space_dim)) ==
1199 (source_patches[0].data.n_rows() +
1200 (source_patches[0].points_are_available ? 0 : patch_space_dim)),
1205 Assert(get_nonscalar_data_ranges().size() ==
1207 ExcMessage(
"Both sources need to declare the same components "
1209 for (
unsigned int i = 0; i < get_nonscalar_data_ranges().size(); ++i)
1211 Assert(std::get<0>(get_nonscalar_data_ranges()[i]) ==
1213 ExcMessage(
"Both sources need to declare the same components "
1215 Assert(std::get<1>(get_nonscalar_data_ranges()[i]) ==
1217 ExcMessage(
"Both sources need to declare the same components "
1219 Assert(std::get<2>(get_nonscalar_data_ranges()[i]) ==
1221 ExcMessage(
"Both sources need to declare the same components "
1229 const unsigned int old_n_patches = patches.size();
1230 patches.insert(patches.end(), source_patches.begin(), source_patches.end());
1234 for (
unsigned int i = old_n_patches; i < patches.size(); ++i)
1236 patches[i].vertices[v] +=
shift;
1239 for (
unsigned int i = old_n_patches; i < patches.size(); ++i)
1240 patches[i].patch_index += old_n_patches;
1243 for (
unsigned int i = old_n_patches; i < patches.size(); ++i)
1245 if (patches[i].neighbors[n] != Patch::no_neighbor)
1246 patches[i].neighbors[n] += old_n_patches;