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,
234 &data_component_interpretation);
243 *data_postprocessor);
255 get_cell_data_value(
const unsigned int cell_number,
265 DoFHandlerType::space_dimension> &fe_patch_values,
267 std::vector<double> &patch_values)
const = 0;
277 DoFHandlerType::space_dimension> &fe_patch_values,
286 get_function_gradients(
288 DoFHandlerType::space_dimension> &fe_patch_values,
291 &patch_gradients)
const = 0;
299 get_function_gradients(
301 DoFHandlerType::space_dimension> &fe_patch_values,
304 &patch_gradients_system)
const = 0;
311 get_function_hessians(
313 DoFHandlerType::space_dimension> &fe_patch_values,
324 get_function_hessians(
326 DoFHandlerType::space_dimension> &fe_patch_values,
329 &patch_hessians_system)
const = 0;
336 is_complex_valued()
const = 0;
359 const std::vector<std::string>
names;
375 const ::DataPostprocessor<DoFHandlerType::space_dimension>>
404 template <
int dim,
int spacedim>
408 const unsigned int n_datasets,
409 const unsigned int n_subdivisions,
410 const std::vector<unsigned int> &n_postprocessor_outputs,
416 const bool use_face_values);
420 template <
typename DoFHandlerType>
422 reinit_all_fe_values(
424 const typename ::Triangulation<dim, spacedim>::cell_iterator
429 get_present_fe_values(
const unsigned int dataset)
const;
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>
659 attach_dof_handler(
const DoFHandlerType &);
671 attach_triangulation(
const Triangulation<DoFHandlerType::dimension,
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>
858 add_data_vector(
const DoFHandlerType &dof_handler,
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>
895 add_mg_data_vector(
const DoFHandlerType & dof_handler,
897 const std::string & name);
906 clear_data_vectors();
919 clear_input_data_references();
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> &
1010 get_patches()
const override;
1016 virtual std::vector<std::string>
1017 get_dataset_names()
const override;
1025 DoFHandlerType::space_dimension>>>
1032 virtual std::vector<
1033 std::tuple<
unsigned int,
1037 get_nonscalar_data_ranges()
const override;
1041 template <
class,
int,
int>
1046 template <
int,
class>
1047 friend class MGDataOut;
1053 template <
class VectorType>
1055 add_data_vector_internal(
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)
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;
void merge_patches(const DataOut_DoFData< DoFHandlerType2, patch_dim, patch_space_dim > &source, const Point< patch_space_dim > &shift=Point< patch_space_dim >())
static const unsigned int invalid_unsigned_int
static ::ExceptionBase & ExcNoTriangulationSelected()
static ::ExceptionBase & ExcIncompatiblePatchLists()
#define DeclException2(Exception2, type1, type2, outsequence)
const std::vector< std::shared_ptr<::hp::FECollection< dim, spacedim > > > finite_elements
virtual std::vector< std::string > get_dataset_names() const override
unsigned int n_output_variables
static ::ExceptionBase & ExcOldDataStillPresent()
static ::ExceptionBase & ExcInvalidVectorSize(int arg1, int arg2, int arg3)
static ::ExceptionBase & ExcInvalidNumberOfSubdivisions(int arg1)
typename Triangulation< DoFHandlerType::dimension, DoFHandlerType::space_dimension >::cell_iterator cell_iterator
static ::ExceptionBase & ExcIncompatibleDatasetNames()
std::vector< std::shared_ptr< internal::DataOutImplementation::DataEntryBase< DoFHandlerType > > > dof_data
static ::ExceptionBase & ExcMessage(std::string arg1)
static ::ExceptionBase & ExcNoDoFHandlerSelected()
#define DeclException1(Exception1, type1, outsequence)
#define Assert(cond, exc)
Abstract base class for mapping classes.
static ::ExceptionBase & ExcInvalidNumberOfNames(int arg1, int arg2)
static ::ExceptionBase & ExcInvalidVectorDeclaration(int arg1, std::string arg2)
#define DeclExceptionMsg(Exception, defaulttext)
const unsigned int n_datasets
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcInvalidCharacter(std::string arg1, size_t arg2)
std::vector< Patch > patches
void add_data_vector(const VectorType &data, const std::vector< std::string > &names, const DataVectorType type=type_automatic, const std::vector< DataComponentInterpretation::DataComponentInterpretation > &data_component_interpretation=std::vector< DataComponentInterpretation::DataComponentInterpretation >())
SmartPointer< const ::DataPostprocessor< DoFHandlerType::space_dimension > > postprocessor
DataPostprocessorInputs::Scalar< spacedim > patch_values_scalar
virtual const std::vector< Patch > & get_patches() const override
const ::hp::MappingCollection< dim, spacedim > mapping_collection
static ::ExceptionBase & ExcInvalidTensorDeclaration(int arg1, std::string arg2)
DataComponentInterpretation
DataPostprocessorInputs::Vector< spacedim > patch_values_system
const unsigned int n_subdivisions
virtual std::vector< std::tuple< unsigned int, unsigned int, std::string, DataComponentInterpretation::DataComponentInterpretation > > get_nonscalar_data_ranges() const override
SmartPointer< const DoFHandlerType > dof_handler
#define DEAL_II_NAMESPACE_OPEN
const UpdateFlags update_flags
const std::vector< std::string > names
#define DeclException3(Exception3, type1, type2, type3, outsequence)
const ::parallel::distributed::Triangulation< dim, spacedim > * triangulation
SmartPointer< const Triangulation< DoFHandlerType::dimension, DoFHandlerType::space_dimension > > triangulation
std::vector< std::shared_ptr<::hp::FEValues< dim, spacedim > > > x_fe_values
std::vector< std::shared_ptr< internal::DataOutImplementation::DataEntryBase< DoFHandlerType > > > cell_data
const std::vector< DataComponentInterpretation::DataComponentInterpretation > data_component_interpretation
SmartPointer< const DoFHandlerType > dofs
std::vector< std::vector<::Vector< double > > > postprocessed_values
std::vector< std::shared_ptr<::hp::FEFaceValues< dim, spacedim > > > x_fe_face_values
std::enable_if< std::is_fundamental< T >::value, std::size_t >::type memory_consumption(const T &t)