VAPOR3 3.9.4
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
VAPoR::DC::Mesh Class Reference

Metadata describing a computational mesh. More...

#include <DC.h>

Public Types

enum  Type { STRUCTURED , UNSTRUC_2D , UNSTRUC_LAYERED , UNSTRUC_3D }
 Type of mesh. More...
 
enum  Location { NODE , EDGE , FACE , VOLUME }
 Location of sampled data variables within the mesh. More...
 

Public Member Functions

 Mesh ()
 
 Mesh (std::string name, std::vector< string > dim_names, std::vector< string > coord_vars)
 
 Mesh (std::string name, size_t max_nodes_per_face, size_t max_faces_per_node, std::string node_dim_name, std::string face_dim_name, std::vector< std::string > coord_vars, std::string face_node_var, std::string node_face_var)
 
 Mesh (std::string name, size_t max_nodes_per_face, size_t max_faces_per_node, std::string node_dim_name, std::string face_dim_name, std::string layers_dim_name, std::vector< std::string > coord_vars, std::string face_node_var, std::string node_face_var)
 
 Mesh (std::string name, int max_nodes_per_face, int max_faces_per_node, std::string node_dim_name, std::string face_dim_name, std::vector< string > coord_vars)
 
Mesh::Type GetMeshType () const
 
string GetName () const
 Get mesh name.
 
std::vector< string > GetDimNames () const
 
std::vector< string > GetCoordVars () const
 
void SetCoordVars (std::vector< string > coord_vars)
 
size_t GetGeometryDim () const
 
size_t GetMaxNodesPerFace () const
 
size_t GetMaxFacesPerNode () const
 
string GetNodeDimName () const
 
string GetFaceDimName () const
 
string GetLayersDimName () const
 
string GetFaceNodeVar () const
 
void SetFaceNodeVar (std::string face_node_var)
 
string GetNodeFaceVar () const
 
void SetNodeFaceVar (std::string node_face_var)
 
void SetEdgeDimName (std::string edge_dim_name)
 
std::string GetEdgeDimName () const
 
void SetEdgeNodeVar (std::string edge_node_var)
 
std::string GetEdgeNodeVar () const
 
void SetFaceEdgeVar (std::string face_edge_var)
 
std::string GetFaceEdgeVar () const
 
void SetFaceFaceVar (std::string face_face_var)
 
std::string GetFaceFaceVar () const
 
void SetEdgeFaceVar (std::string edge_face_var)
 
std::string GetEdgeFaceVar () const
 
size_t GetTopologyDim () const
 

Static Public Member Functions

static string MakeMeshName (std::vector< string > s)
 

Friends

std::ostream & operator<< (std::ostream &o, const Mesh &mesh)
 

Detailed Description

Metadata describing a computational mesh.

Version
3.1

This class describes the properties of a computational mesh upon which data variables are sampled. The class can represent both structured and unstructured grids. The design of the Mesh class is inspired by the capabilities of the UGRID conventions: UGRID

Towards that end we adopt some of UGRID's terminology:

Definitions

Parameters
[in]nameA string containing the name of the mesh.
[in]coord_varsA list of names of the coordinate variables, each specifying the X, Y, or Z spatial coordinates for the nodes in the mesh. If a coordinate variable for an X, Y, or Z axis is not specified the node's coordinate's for the missing axis are assumed to be zero. The dimensionality of the coordinate variable may be less than that of the dimensionality of the grid, in which case the coordinates along the unspecified dimension are assumed invariant.
[in]max_nodes_per_faceSpecifies maximum number of nodes (or edges) a face of the mesh may have.
[in]max_faces_per_nodeSpecifies maximum number of faces that may share a node
[in]node_dim_nameA string containing the name of the dimension specifying the total number of nodes in the unstructured portion of the mesh; for layered-grid unstructured meshes node_dim_name specifies the number of nodes in a single layer
[in]face_dim_nameA string containing the name of the dimension specifying the total number of faces in the unstructured portion of the mesh; for layered-grid unstructured meshes face_dim_name specifies the number of faces in a single layer
[in]face_node_varThe name of a 2D Auxiliary variable (See DC:AuxVar) with integer type identifying for every face the indices of its corner nodes. The corner nodes should be specified in anticlockwise direction as viewed from above The connectivity array will be a matrix of size face_dim x max_nodes_per_face, where face_dim is the length of the dimension named by face_dim_name, and is the slowest varying of the two dimensions. If a face has less corner nodes max_nodes_per_face then the last node indices shall be equal to -1. Indecies start from zero.
[in]node_face_varThe name of a 2D Auxiliary variable (See DC:AuxVar) with integer type identifying for every node the indices of the faces that share the node. The faces should be specified in anticlockwise direction as viewed from above The connectivity array will be a matrix of size node_dim x max_faces_per_node , where node_dim is the length of the dimension named by node_dim_name, and is the slowest varying of the two dimensions. If a node has less faces then max_faces_per_node then the last face indices shall be equal to -1. Indecies start from zero.
Note
The node_face_var is not defined by the UGRID conventions

Definition at line 310 of file DC.h.

Member Enumeration Documentation

◆ Location

Location of sampled data variables within the mesh.

Enumerator
NODE 

Samples located at mesh nodes.

EDGE 

Samples located at mesh edge centers.

FACE 

Samples located at mesh face centers.

VOLUME 

Samples located at mesh volume centers.

Definition at line 323 of file DC.h.

◆ Type

Type of mesh.

Enumerator
STRUCTURED 

A structured mesh.

UNSTRUC_2D 

An unstructured mesh with 2D topology.

UNSTRUC_LAYERED 

An unstructured layered mesh.

UNSTRUC_3D 

An fully unstructured mesh with 3D topology.

Definition at line 314 of file DC.h.

Constructor & Destructor Documentation

◆ Mesh() [1/5]

VAPoR::DC::Mesh::Mesh ( )
inline

Definition at line 330 of file DC.h.

◆ Mesh() [2/5]

VAPoR::DC::Mesh::Mesh ( std::string  name,
std::vector< string >  dim_names,
std::vector< string >  coord_vars 
)

Construct structured mesh

This method constructs a structured mesh.

Parameters
[in]nameName of the mesh. If name is the empty string a name will be created from the concatenation of the elements of the dim_names parameter
[in]dim_namesAn ordered list of names of the spatial dimensions of the mesh. The ordering is from fastest varying dimension to slowest. The number of elements in dim_names determines the dimensionality of the mesh, but not, in general, the topological dimension of the mesh. The rank of dim_names defines the topological dimension.

◆ Mesh() [3/5]

VAPoR::DC::Mesh::Mesh ( std::string  name,
size_t  max_nodes_per_face,
size_t  max_faces_per_node,
std::string  node_dim_name,
std::string  face_dim_name,
std::vector< std::string >  coord_vars,
std::string  face_node_var,
std::string  node_face_var 
)

Construct unstructured 2D mesh

This method constructs an unstructured mesh with 2D topology.

◆ Mesh() [4/5]

VAPoR::DC::Mesh::Mesh ( std::string  name,
size_t  max_nodes_per_face,
size_t  max_faces_per_node,
std::string  node_dim_name,
std::string  face_dim_name,
std::string  layers_dim_name,
std::vector< std::string >  coord_vars,
std::string  face_node_var,
std::string  node_face_var 
)

Construct unstructured layered mesh

This method constructs an unstructured layered mesh.

Parameters
[in]layers_dim_nameName of dimension specifying the number of layers in the mesh.

◆ Mesh() [5/5]

VAPoR::DC::Mesh::Mesh ( std::string  name,
int  max_nodes_per_face,
int  max_faces_per_node,
std::string  node_dim_name,
std::string  face_dim_name,
std::vector< string >  coord_vars 
)

Construct unstructured 3d mesh

This method constructs an unstructured 3d mesh.

Parameters
[in]layers_dim_nameName of dimension specifying the number of layers in the mesh.

Member Function Documentation

◆ GetCoordVars()

std::vector< string > VAPoR::DC::Mesh::GetCoordVars ( ) const
inline

Get coordinate variable names

Returns the list of coordinate variable names associated with the nodes of the mesh.

Definition at line 432 of file DC.h.

◆ GetDimNames()

std::vector< string > VAPoR::DC::Mesh::GetDimNames ( ) const
inline

Get dim names

Returns ordered list of dimension names for the mesh nodes. The ordering is from fastest to slowest varying dimension. For structured meshes the size of the returned vector matches the topological dimensionality of the mesh.

For unstructured meshes the returned contains the names of the node dimensions.

Definition at line 425 of file DC.h.

◆ GetEdgeDimName()

std::string VAPoR::DC::Mesh::GetEdgeDimName ( ) const
inline

Get the name of the optional edge dimension

This method gets the name of the optional edge dimension. If not explicitly set with SetEdgeDimName() an empty string is returned.

Definition at line 522 of file DC.h.

◆ GetEdgeFaceVar()

std::string VAPoR::DC::Mesh::GetEdgeFaceVar ( ) const
inline

Get the name of optional face edge connectivity index variable

An emptry string is returned if not explicitly set with SetEdgeFaceVar()

Definition at line 631 of file DC.h.

◆ GetEdgeNodeVar()

std::string VAPoR::DC::Mesh::GetEdgeNodeVar ( ) const
inline

Get the name of optional edge node connectivity index variable

An emptry string is returned if not explicitly set with SetEdgeNodeVar()

Definition at line 545 of file DC.h.

◆ GetFaceDimName()

string VAPoR::DC::Mesh::GetFaceDimName ( ) const
inline

Get the name of the face dimension

For unstructured meshes this method returns the name of the face dimension. For structured meshes an emptry string is returned.

Definition at line 472 of file DC.h.

◆ GetFaceEdgeVar()

std::string VAPoR::DC::Mesh::GetFaceEdgeVar ( ) const
inline

Get the name of optional face edge connectivity index variable

An emptry string is returned if not explicitly set with SetFaceEdgeVar()

Definition at line 574 of file DC.h.

◆ GetFaceFaceVar()

std::string VAPoR::DC::Mesh::GetFaceFaceVar ( ) const
inline

Get the name of optional face edge connectivity index variable

An emptry string is returned if not explicitly set with SetFaceFaceVar()

Definition at line 603 of file DC.h.

◆ GetFaceNodeVar()

string VAPoR::DC::Mesh::GetFaceNodeVar ( ) const
inline

Get the name of face node connectivity var

Return the name of the face node connecity variable

Definition at line 485 of file DC.h.

◆ GetGeometryDim()

size_t VAPoR::DC::Mesh::GetGeometryDim ( ) const
inline

Get geometric dimension of cells

Returns the geometric dimension of the cells in the mesh. I.e. the number of spatial spatial coordinates for each grid point. Valid values are 0..3. The geometric dimension must be equal to or greater than the topology dimension.

See also
GetTopologyDim()

Definition at line 444 of file DC.h.

◆ GetLayersDimName()

string VAPoR::DC::Mesh::GetLayersDimName ( ) const
inline

Get the name of the layers dimension

For unstructured layered meshes this method returns the name of the node dimension. For other meshes an empty string is returned.

Definition at line 479 of file DC.h.

◆ GetMaxFacesPerNode()

size_t VAPoR::DC::Mesh::GetMaxFacesPerNode ( ) const
inline

Get the maximum number of faces per node

Return the maximum number of faces that a node in the mesh may have. For structured meshes this value is always four.

Definition at line 458 of file DC.h.

◆ GetMaxNodesPerFace()

size_t VAPoR::DC::Mesh::GetMaxNodesPerFace ( ) const
inline

Get the maximum number of nodes per face

Return the maximum number of nodes that a face in the mesh may have. For structured meshes this value is always four.

Definition at line 451 of file DC.h.

◆ GetMeshType()

Mesh::Type VAPoR::DC::Mesh::GetMeshType ( ) const
inline

Return the type of mesh

Returns one of:

  • STRUCTURED A structured mesh
  • UNSTRUC_2D An unstructured mesh with 2D topology
  • UNSTRUC_LAYERED An unstructured layered mesh
  • UNSTRUC_3D An fully unstructured mesh with 3D topology

Definition at line 407 of file DC.h.

◆ GetName()

string VAPoR::DC::Mesh::GetName ( ) const
inline

Get mesh name.

Definition at line 411 of file DC.h.

◆ GetNodeDimName()

string VAPoR::DC::Mesh::GetNodeDimName ( ) const
inline

Get the name of the node dimension

For unstructured meshes this method returns the name of the node dimension. For structured meshes an emptry string is returned.

Definition at line 465 of file DC.h.

◆ GetNodeFaceVar()

string VAPoR::DC::Mesh::GetNodeFaceVar ( ) const
inline

Get the name of node face connectivity var

Return the name of the node face connecity variable

Definition at line 496 of file DC.h.

◆ GetTopologyDim()

size_t VAPoR::DC::Mesh::GetTopologyDim ( ) const

Get topological dimension of the mesh

Return the number of topological dimensions for the mesh cells. Valid values are in the range 0..3, with, for example, 0 corresponding to points; 1 to lines; 2 to triangles, quadrilaterals, etc.; and 3 to hexahedron, tetrahedron, etc.

See also
GetGeometryDim()

◆ MakeMeshName()

static string VAPoR::DC::Mesh::MakeMeshName ( std::vector< string >  s)
static

Generate a mesh name from a list of strings. The generated name is simply the join of the elements of s using 'x' as a delimiter

◆ SetCoordVars()

void VAPoR::DC::Mesh::SetCoordVars ( std::vector< string >  coord_vars)
inline

Definition at line 433 of file DC.h.

◆ SetEdgeDimName()

void VAPoR::DC::Mesh::SetEdgeDimName ( std::string  edge_dim_name)
inline

Set the name of the optional edge dimension

For unstructured meshes this method sets the name of the optional edge dimension. It is only needed if data are located on mesh edges.

Parameters
[in]edge_dim_nameName of the edge dimension

Definition at line 510 of file DC.h.

◆ SetEdgeFaceVar()

void VAPoR::DC::Mesh::SetEdgeFaceVar ( std::string  edge_face_var)
inline

Set the name of optional edge-face connectivity index variable

The name of an optional 2D Auxiliary variable (See DC:AuxVar) with integer type. If specified, names an index variable identifying for every edge the indices of its adjacent faces. This connectivity array is thus a matrix of size edge_dim x 2, where edge_dim is the dimension length named by edge_dim_name, and is the slowest varying of the two dimensions. It is intended to be used in combination with data defined on edges. The starting index is 0.

See also
SetEdgeDimName()

Definition at line 620 of file DC.h.

◆ SetEdgeNodeVar()

void VAPoR::DC::Mesh::SetEdgeNodeVar ( std::string  edge_node_var)
inline

Set the name of optional edge node connectivity index variable

For meshes with data located on edges this method specifies the name of an index variable identifying for every edge the indices of its begining and ending nodes. The connectivity array will thus be a matrix of size edge_dim x 2, where edge_dim is the dimension length named by edge_dim_name.

See also
GetEdgeDimName()

Definition at line 534 of file DC.h.

◆ SetFaceEdgeVar()

void VAPoR::DC::Mesh::SetFaceEdgeVar ( std::string  face_edge_var)
inline

Set the name of optional face edge connectivity index variable

The name of an optional 2D Auxiliary variable (See DC:AuxVar) with integer type. If specified, names an index variable identifying for every face the indices of its edges. The edges should be specified in anticlockwise direction as viewed from above. This connectivity array will be a matrix of size face_dim x max_faces_per_node, where face_dim is the dimension length named by face_dim_name, and is the slowest varying of the two dimensions. If a face has less corners/edges than max_faces_per_node then the last edge indices shall be equal to -1. The starting index is 0.

Definition at line 563 of file DC.h.

◆ SetFaceFaceVar()

void VAPoR::DC::Mesh::SetFaceFaceVar ( std::string  face_face_var)
inline

Set the name of optional face-face connectivity index variable

The name of an optional 2D Auxiliary variable (See DC:AuxVar) with integer type. If specified, names an index variable identifying for every face the indices of its adjacent faces. The faces should be specified in anticlockwise direction as viewed from above. This connectivity array will be a matrix of size face_dim x max_faces_per_node, where face_dim is the dimension length named by face_dim_name, and is the slowest varying of the two dimensions. If a face has less corners/edges than max_faces_per_node then the last face indices shall be equal to -1. The starting index is 0.

Definition at line 592 of file DC.h.

◆ SetFaceNodeVar()

void VAPoR::DC::Mesh::SetFaceNodeVar ( std::string  face_node_var)
inline

Definition at line 486 of file DC.h.

◆ SetNodeFaceVar()

void VAPoR::DC::Mesh::SetNodeFaceVar ( std::string  node_face_var)
inline

Definition at line 497 of file DC.h.

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  o,
const Mesh mesh 
)
friend

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