GenericDataOut< dim, number > Class Template Reference
|
Developer Documentation
|
A generic utility for managing simulation output data in the MeltPoolDG context. More...
#include <generic_data_out.hpp>
Public Types | |
| using | VectorType = dealii::LinearAlgebra::distributed::Vector< number > |
| The distributed vector type used for parallel computations. Used for DoF output vectors. | |
| using | ElementWiseVectorType = dealii::Vector< number > |
| The element-wise (non-distributed) vector type. Used for element-wise output vectors. | |
Public Member Functions | |
| GenericDataOut (const dealii::Mapping< dim > &mapping, const number current_time, const std::vector< std::string > &req_vars_in={"all"}) | |
| Constructor. | |
| void | add_data_vector (const dealii::DoFHandler< dim > &dof_handler, const VectorType &data, const std::vector< std::string > &names, const std::vector< dealii::DataComponentInterpretation::DataComponentInterpretation > &data_component_interpretation=std::vector< dealii::DataComponentInterpretation::DataComponentInterpretation >(), const bool force_output=false) |
| Add a distributed vector with multiple components and custom interpretations. | |
| void | add_data_vector (const dealii::DoFHandler< dim > &dof_handler, const VectorType &data, const std::string &name, const bool force_output=false) |
| Add a distributed vector with a single scalar component. | |
| void | add_data_vector (const dealii::DoFHandler< dim > *dof_handler, const VectorType *data, const dealii::DataPostprocessor< dim > *data_postprocessor, const bool force_output=false) |
| void | add_element_wise_data_vector (const ElementWiseVectorType &data, const std::string &name, const bool force_output=false) |
| Add an element-wise vector. | |
| const VectorType & | get_vector (const std::string &name) const |
| const dealii::DataPostprocessor< dim > & | get_data_postprocessor (const std::string &name) const |
| const dealii::DoFHandler< dim > & | get_dof_handler (const std::string &name) const |
| Retrieve the DoFHandler associated with a named distributed vector. | |
| const dealii::Mapping< dim > & | get_mapping () const |
| Access the stored Mapping used in the constructor. | |
| const number & | get_time () const |
| Get the time value associated with this output. | |
| bool | is_requested (const std::string &var) const |
| Determine if a variable has been requested for output. | |
| std::vector< unsigned int > | get_indices_data_request (const std::vector< std::string > &req_var) const |
| Retrieve the entry indices of requested variables. | |
Public Attributes | |
| std::vector< std::tuple< const dealii::DoFHandler< dim > *, const VectorType *, const ElementWiseVectorType *, const std::vector< std::string >, std::vector< dealii::DataComponentInterpretation::DataComponentInterpretation > > > | entries |
| Storage of registered data entries. | |
| std::vector< std::tuple< const dealii::DoFHandler< dim > *, const VectorType *, const dealii::DataPostprocessor< dim > * > > | data_postprocessor_entries |
Private Attributes | |
| std::map< std::string, unsigned int > | entry_id |
| Maps variable names to their entry index. | |
| const dealii::Mapping< dim > & | mapping |
| Mapping object reference. | |
| number | current_time |
| Time associated with the current output. | |
| const std::vector< std::string > | req_vars |
| List of requested variable names. | |
| std::map< std::string, bool > | req_vars_info |
| Caching mechanism to store whether a variable is requested. | |
| const bool | req_all = false |
| Flag indicating if all variables are requested. | |
Detailed Description
class MeltPoolDG::GenericDataOut< dim, number >
A generic utility for managing simulation output data in the MeltPoolDG context.
This class provides a structured interface to collect and access simulation data vectors, either from degrees of freedom (DoF) based structures or from element-wise results. It allows for filtered output based on a list of requested variables and supports scalar and interpreted component data. The class also verifies correct usage and provides meaningful diagnostics.
- Template Parameters
-
dim Spatial dimension (1D, 2D, or 3D). number Numeric type of the underlying data (e.g., float, double).
Member Typedef Documentation
◆ ElementWiseVectorType
| using MeltPoolDG::GenericDataOut< dim, number >::ElementWiseVectorType = dealii::Vector<number> |
The element-wise (non-distributed) vector type. Used for element-wise output vectors.
◆ VectorType
| using MeltPoolDG::GenericDataOut< dim, number >::VectorType = dealii::LinearAlgebra::distributed::Vector<number> |
The distributed vector type used for parallel computations. Used for DoF output vectors.
Constructor & Destructor Documentation
◆ GenericDataOut()
| MeltPoolDG::GenericDataOut< dim, number >::GenericDataOut | ( | const dealii::Mapping< dim > & | mapping, |
| const number | current_time, | ||
| const std::vector< std::string > & | req_vars_in = {"all"} |
||
| ) |
Constructor.
- Parameters
-
mapping Reference to the mapping object used for geometry transformation. current_time The time value associated with the output. req_vars_in List of requested variable names (defaults to {"all"}).
Member Function Documentation
◆ add_data_vector() [1/3]
| void MeltPoolDG::GenericDataOut< dim, number >::add_data_vector | ( | const dealii::DoFHandler< dim > & | dof_handler, |
| const VectorType & | data, | ||
| const std::string & | name, | ||
| const bool | force_output = false |
||
| ) |
Add a distributed vector with a single scalar component.
- Parameters
-
dof_handler The associated DoFHandler. data The distributed vector. name The name of the variable. force_output If true, forces the data to be added regardless of request filtering.
◆ add_data_vector() [2/3]
| void MeltPoolDG::GenericDataOut< dim, number >::add_data_vector | ( | const dealii::DoFHandler< dim > & | dof_handler, |
| const VectorType & | data, | ||
| const std::vector< std::string > & | names, | ||
| const std::vector< dealii::DataComponentInterpretation::DataComponentInterpretation > & | data_component_interpretation = std::vector< dealii::DataComponentInterpretation::DataComponentInterpretation >(), |
||
| const bool | force_output = false |
||
| ) |
Add a distributed vector with multiple components and custom interpretations.
Only adds the data if the first component name is among the requested variables or if force_output is true.
- Parameters
-
dof_handler The associated DoFHandler. data The distributed vector. names Component names. data_component_interpretation Interpretations of each component (optional). force_output If true, forces the addition even if not requested.
◆ add_data_vector() [3/3]
| void MeltPoolDG::GenericDataOut< dim, number >::add_data_vector | ( | const dealii::DoFHandler< dim > * | dof_handler, |
| const VectorType * | data, | ||
| const dealii::DataPostprocessor< dim > * | data_postprocessor, | ||
| const bool | force_output = false |
||
| ) |
Add a data postprocessor with an associated vector and dof handler.
- Parameters
-
dof_handler The associated DoFHandler. data The distributed vector. data_postprocessor The data postprocessor that defines the output variables.
◆ add_element_wise_data_vector()
| void MeltPoolDG::GenericDataOut< dim, number >::add_element_wise_data_vector | ( | const ElementWiseVectorType & | data, |
| const std::string & | name, | ||
| const bool | force_output = false |
||
| ) |
Add an element-wise vector.
These are typically used for cell-wise scalar quantities not tied to a DoFHandler.
- Parameters
-
data The element-wise vector. name The name of the output variable. force_output If true, forces the data to be added regardless of request filtering.
◆ get_data_postprocessor()
| const dealii::DataPostprocessor< dim > & MeltPoolDG::GenericDataOut< dim, number >::get_data_postprocessor | ( | const std::string & | name | ) | const |
Retrieve the data postprocessor who has the provided name among its output variables.
- Parameters
-
name The name of the variable.
- Returns
- Reference to the associated data postprocessor.
- Exceptions
-
If no matching data postprocessor is found, an exception is thrown.
◆ get_dof_handler()
| const DoFHandler< dim > & MeltPoolDG::GenericDataOut< dim, number >::get_dof_handler | ( | const std::string & | name | ) | const |
Retrieve the DoFHandler associated with a named distributed vector.
Throws if the variable name is not found or if it corresponds to element-wise data.
- Parameters
-
name The name of the variable.
- Returns
- Reference to the associated DoFHandler.
◆ get_indices_data_request()
| std::vector< unsigned int > MeltPoolDG::GenericDataOut< dim, number >::get_indices_data_request | ( | const std::vector< std::string > & | req_var | ) | const |
Retrieve the entry indices of requested variables.
Validates consistency of the request. If the request is ambiguous or no match is found, an exception with diagnostics is thrown.
- Parameters
-
req_var The list of requested variable names.
- Returns
- Indices of valid entries in the internal storage.
◆ get_mapping()
| const Mapping< dim > & MeltPoolDG::GenericDataOut< dim, number >::get_mapping | ( | ) | const |
Access the stored Mapping used in the constructor.
- Returns
- The mapping reference.
◆ get_time()
| const number & MeltPoolDG::GenericDataOut< dim, number >::get_time | ( | ) | const |
Get the time value associated with this output.
- Returns
- The current simulation time.
◆ get_vector()
| const GenericDataOut< dim, number >::VectorType & MeltPoolDG::GenericDataOut< dim, number >::get_vector | ( | const std::string & | name | ) | const |
Retrieve a previously added distributed vector by name. This can also include vectors associated with a previously added data postprocessor.
Throws if the variable name is not found or if it is an element-wise vector.
- Parameters
-
name The name of the vector.
- Returns
- A reference to the vector.
◆ is_requested()
| bool MeltPoolDG::GenericDataOut< dim, number >::is_requested | ( | const std::string & | var | ) | const |
Determine if a variable has been requested for output.
The logic caches lookup results for performance and returns true if either req_vars = {"all"} or if the specific variable was listed.
- Parameters
-
name Name of the variable.
- Returns
- True if the variable is to be output.
Member Data Documentation
◆ current_time
|
private |
Time associated with the current output.
◆ data_postprocessor_entries
| std::vector<std::tuple<const dealii::DoFHandler<dim> * , const VectorType *, const dealii::DataPostprocessor<dim> *> > MeltPoolDG::GenericDataOut< dim, number >::data_postprocessor_entries |
Storage of registered data postprocessor entries. Each entry contains:
- a pointer to the DoFHandler (or nullptr if not applicable),
- a pointer to the distributed vector (or nullptr if not applicable),
- a pointer to the data postprocessor defining and computing the output variables.
◆ entries
| std::vector< std::tuple<const dealii::DoFHandler<dim> * , const VectorType *, const ElementWiseVectorType * , const std::vector<std::string>, std::vector<dealii::DataComponentInterpretation::DataComponentInterpretation> > > MeltPoolDG::GenericDataOut< dim, number >::entries |
Storage of registered data entries.
Each entry contains:
- a pointer to the DoFHandler (or nullptr for element-wise),
- a pointer to the distributed vector (or nullptr for element-wise),
- a pointer to the element-wise vector (or nullptr for DoF-based data),
- a list of variable/component names,
- the component interpretations.
◆ entry_id
|
private |
Maps variable names to their entry index.
◆ mapping
|
private |
Mapping object reference.
◆ req_all
|
private |
Flag indicating if all variables are requested.
◆ req_vars
|
private |
List of requested variable names.
◆ req_vars_info
|
mutableprivate |
Caching mechanism to store whether a variable is requested.
The documentation for this class was generated from the following files:
- include/meltpooldg/post_processing/generic_data_out.hpp
- source/post_processing/generic_data_out.cpp
Generated by