[P]arallel [Hi]gh-order [Li]brary for [P]DEs  Latest
Parallel High-Order Library for PDEs through hp-adaptive Discontinuous Galerkin methods
PHiLiP::GridRefinement::MshOut< dim, real > Class Template Reference

Output class for GMSH .msh v4.1 file format. More...

#include <msh_out.h>

Collaboration diagram for PHiLiP::GridRefinement::MshOut< dim, real >:

Public Member Functions

 MshOut (const dealii::DoFHandler< dim > &dof_handler)
 Construct mesh output handler. More...
 
template<typename T >
void add_data_vector (std::vector< T > data, StorageType storage_type)
 Add data vector of specified storage type and values. More...
 
template<typename T >
void add_data_vector (std::vector< T > data, StorageType storage_type, std::string name)
 Add data vector of specified storage type and values with name. More...
 
void write_msh (std::ostream &out)
 Output formatted .msh v4.1 file with mesh description and data field. More...
 

Private Attributes

const dealii::DoFHandler< dim > & dof_handler
 Mesh description for acccess to node location and connecitviity information.
 
std::vector< std::shared_ptr< MshOutData< dim > > > data_vector
 Vector of data field entries stored in MshOutDataInternal based on data type of entries.
 

Detailed Description

template<int dim, typename real>
class PHiLiP::GridRefinement::MshOut< dim, real >

Output class for GMSH .msh v4.1 file format.

Contains functionality for writing the mesh connectivity and node position data as well as keeping track of several storage fields (of potentionally different types and storage locations). Class functions to write this collection data in standard form allowing extended data types to be read in GMSH for visualization or as a method of interfacing with the external LpCVT mesh generator using elementwise metric data. Note: Currently this class only supports p1 all-quad mesh types with information accesed through a dealii::DoFHandler.

Definition at line 208 of file msh_out.h.

Constructor & Destructor Documentation

◆ MshOut()

template<int dim, typename real>
PHiLiP::GridRefinement::MshOut< dim, real >::MshOut ( const dealii::DoFHandler< dim > &  dof_handler)
inlineexplicit

Construct mesh output handler.

Mesh description dealii::DoFHandler used to specify the linear mesh to be written along with any additional data fields in a consistent way.

Definition at line 215 of file msh_out.h.

Member Function Documentation

◆ add_data_vector() [1/2]

template<int dim, typename real>
template<typename T >
void PHiLiP::GridRefinement::MshOut< dim, real >::add_data_vector ( std::vector< T >  data,
StorageType  storage_type 
)
inline

Add data vector of specified storage type and values.

Data can be stored at nodes, elements ($C^0$) or nodes of elements ($C^1$). Internal data structure can take the form of a Scalar (double), Vector (dealii::Tensor<1,dim,double>) or Matrix (dealii::Tensor<2,dim,double>) which is augmented to be output in the 3D space along with the mesh. Each additional data vector corresponds to an additional section in the written .msh v4.1 output file as $NodeData, $ElementData or $ElementNodeData respectively.

Definition at line 229 of file msh_out.h.

◆ add_data_vector() [2/2]

template<int dim, typename real>
template<typename T >
void PHiLiP::GridRefinement::MshOut< dim, real >::add_data_vector ( std::vector< T >  data,
StorageType  storage_type,
std::string  name 
)
inline

Add data vector of specified storage type and values with name.

Data can be stored at nodes, elements ($C^0$) or nodes of elements ($C^1$). Internal data structure can take the form of a Scalar (double), Vector (dealii::Tensor<1,dim,double>) or Matrix (dealii::Tensor<2,dim,double>) which is augmented to be output in the 3D space along with the mesh. Each additional data vector corresponds to an additional section in the written .msh v4.1 output file as $NodeData, $ElementData or $ElementNodeData respectively. Name can be used to differentiate between data fields.

Definition at line 250 of file msh_out.h.

◆ write_msh()

template<int dim, typename real >
void PHiLiP::GridRefinement::MshOut< dim, real >::write_msh ( std::ostream &  out)

Output formatted .msh v4.1 file with mesh description and data field.

Formatted based on the standard GMSH .msh v4.1 file format. Basic mesh description is written in $MeshFormat (description), $Nodes (mesh points), $Elements (connectivity). An additional data field is written for each added data_vector entry in the corresponding storage type sections: $NodeData (data stored nodewise), $ElementData (data stored elementwise) or $ElementNodeData (data stored at the nodes of each element). These can take the form of Scalar, Vector or Matrix entries. Note: Currently the geometric description of the domain and its boundaries included in the $Entities subsection has not been implemented.

Definition at line 31 of file msh_out.cpp.


The documentation for this class was generated from the following files: