Public Member Functions | |
virtual | ~DataPostprocessor () |
virtual void | compute_derived_quantities_scalar (const std::vector< double > &uh, const std::vector< Tensor< 1, dim > > &duh, const std::vector< Tensor< 2, dim > > &dduh, const std::vector< Point< dim > > &normals, std::vector< Vector< double > > &computed_quantities) const |
virtual void | compute_derived_quantities_vector (const std::vector< Vector< double > > &uh, const std::vector< std::vector< Tensor< 1, dim > > > &duh, const std::vector< std::vector< Tensor< 2, dim > > > &dduh, const std::vector< Point< dim > > &normals, std::vector< Vector< double > > &computed_quantities) const |
virtual std::vector< std::string > | get_names () const =0 |
virtual std::vector < DataComponentInterpretation::DataComponentInterpretation > | get_data_component_interpretation () const |
virtual UpdateFlags | get_needed_update_flags () const =0 |
virtual unsigned int | n_output_variables () const =0 |
A data vector and an object of a derived class can be given to the DataOut::add_data_vector
function, which will write the derived quantities instead of the provided data to the output file. Note, that the DataPostprocessor has to live until build_patches
has been called. DataOutFaces and DataOutRotation can be used as well.
In order not to perform needless calculations, DataPostprocessor has to provide the information, which input data is needed for the calculation of the derived quantities, i.e. whether it needs the values, the first derivative and/or the second derivative of the provided data. DataPostprocessor objects which are used in combination with a DataOutFaces object can also ask for the normal vectors at each point. The information, which data is needed has to be provided via the UpdateFlags returned by the virtual function get_needed_update_flags
. It is your responsibility to use only those values which were updated in the calculation of derived quantities. The DataOut object will provide references to the requested data in the call to compute_derived_quantities_scalar() or compute_derived_quantities_vector() (DataOut decides which of the two functions to call depending on whether the finite element in use has only a single, or multiple vector components).
Furthermore, derived classes have to implement the get_names
and n_output_variables
functions, where the number of output variables returned by the latter function has to match the size of the vector returned by the former. Furthermore, this number has to match the number of computed quantities, of course.
virtual DataPostprocessor< dim >::~DataPostprocessor | ( | ) | [virtual] |
Virtual desctructor for safety. Does not do anything so far.
virtual void DataPostprocessor< dim >::compute_derived_quantities_scalar | ( | const std::vector< double > & | uh, | |
const std::vector< Tensor< 1, dim > > & | duh, | |||
const std::vector< Tensor< 2, dim > > & | dduh, | |||
const std::vector< Point< dim > > & | normals, | |||
std::vector< Vector< double > > & | computed_quantities | |||
) | const [virtual] |
This is the main function which actually performs the postprocessing. The last argument is a reference to the postprocessed data which has correct size already and must be filled by this function. uh
is a reference to a vector of data values at all points, duh
the same for gradients, dduh
for second derivatives and normals
is a reference to the normal vectors. Note, that the last four references will only contain valid data, if the respective flags are returned by get_needed_update_flags
, otherwise those vectors will be in an unspecified state. normals
will always be an empty vector when working on cells, not on faces.
This function is called when the original data vector represents scalar data, i.e. the finite element in use has only a single vector component.
virtual void DataPostprocessor< dim >::compute_derived_quantities_vector | ( | const std::vector< Vector< double > > & | uh, | |
const std::vector< std::vector< Tensor< 1, dim > > > & | duh, | |||
const std::vector< std::vector< Tensor< 2, dim > > > & | dduh, | |||
const std::vector< Point< dim > > & | normals, | |||
std::vector< Vector< double > > & | computed_quantities | |||
) | const [virtual] |
Same as above function, but this function is called when the original data vector represents vector data, i.e. the finite element in use has multiple vector components.
virtual std::vector<std::string> DataPostprocessor< dim >::get_names | ( | ) | const [pure virtual] |
Return the vector of strings describing the names of the computed quantities.
virtual std::vector<DataComponentInterpretation::DataComponentInterpretation> DataPostprocessor< dim >::get_data_component_interpretation | ( | ) | const [virtual] |
This functions returns information about how the individual components of output files that consist of more than one data set are to be interpreted.
For example, if one has a finite element for the Stokes equations in 2d, representing components (u,v,p), one would like to indicate that the first two, u and v, represent a logical vector so that later on when we generate graphical output we can hand them off to a visualization program that will automatically know to render them as a vector field, rather than as two separate and independent scalar fields.
The default implementation of this function returns a vector of values DataComponentInterpretation::component_is_scalar, indicating that all output components are independent scalar fields. However, if a derived class produces data that represents vectors, it may return a vector that contains values DataComponentInterpretation::component_is_part_of_vector. In the example above, one would return a vector with components (DataComponentInterpretation::component_is_part_of_vector, DataComponentInterpretation::component_is_part_of_vector, DataComponentInterpretation::component_is_scalar) for (u,v,p).
virtual UpdateFlags DataPostprocessor< dim >::get_needed_update_flags | ( | ) | const [pure virtual] |
Return, which data has to be provided to compute the derived quantities. This has to be a combination of update_values
, update_gradients
and update_hessians
. If the DataPostprocessor is to be used in combination with DataOutFaces, you may also ask for a update of normals via the update_normal_vectors
flag.
virtual unsigned int DataPostprocessor< dim >::n_output_variables | ( | ) | const [pure virtual] |
Number of postprocessed variables. Has to match the number of entries filled by compute_derived_quantities_scalar() or compute_derived_quantities_vector() as well as the size of the vector of names returned by get_names().