GEOS
Public Types | Public Member Functions | List of all members
geos::MeshObjectPath Class Reference

Class to hold the path to a collection of mesh objects. More...

#include <MeshObjectPath.hpp>

Public Types

enum class  ObjectTypes : int {
  nodes , edges , faces , elems ,
  invalid
}
 Contains enums for the types of objects. More...
 
using permutationMapType = std::map< string, std::map< string, std::map< string, std::vector< string > > > >
 The container type that holds the path information The first key is the name of a MeshBody The second key is the name of a MeshLevel The third key is the name of an ElementRegion The third value is a vector of subregion names.
 

Public Member Functions

 MeshObjectPath (string const path, dataRepository::Group const &meshBodies)
 Construct a new Mesh Object Path object. More...
 
void processPath (string const path, dataRepository::Group const &meshBodies)
 Processes the path string into the permutation container. More...
 
ObjectTypes const & getObjectType () const
 Get the Object Type object. More...
 
permutationMapType const & pathPermutations () const
 Get the m_pathPermutations object. More...
 
bool containsMeshLevel (MeshLevel const &meshLevel) const
 Helper function to decide whether a given meshLevel is in the objectPath. More...
 
template<typename OBJECT_TYPE = dataRepository::Group, typename FUNC >
void forObjectsInPath (dataRepository::Group &meshBodies, FUNC &&func) const
 LLoop over objects in the path and execute a callback function. More...
 
template<typename OBJECT_TYPE = dataRepository::Group, typename FUNC >
void forObjectsInPath (dataRepository::Group const &meshBodies, FUNC &&func) const
 Loop over objects in the path and execute a callback function. More...
 
template<typename OBJECT_TYPE = dataRepository::Group, typename FUNC >
void forObjectsInPath (MeshLevel &level, FUNC &&func) const
 Loop over objects in the path and execute a callback function. More...
 

Detailed Description

Class to hold the path to a collection of mesh objects.

Definition at line 36 of file MeshObjectPath.hpp.

Member Enumeration Documentation

◆ ObjectTypes

Contains enums for the types of objects.

Enumerator
nodes 

a NodeManager

edges 

an EdgeManager

faces 

a FaceManager

elems 

a ElementManager

invalid 

an invalide object

Definition at line 52 of file MeshObjectPath.hpp.

Constructor & Destructor Documentation

◆ MeshObjectPath()

geos::MeshObjectPath::MeshObjectPath ( string const  path,
dataRepository::Group const &  meshBodies 
)

Construct a new Mesh Object Path object.

Parameters
pathThe path string
meshBodiesThe Group that contains all MeshBody objects
Exceptions
InputErrorwhen the input path is wrong.

Member Function Documentation

◆ containsMeshLevel()

bool geos::MeshObjectPath::containsMeshLevel ( MeshLevel const &  meshLevel) const

Helper function to decide whether a given meshLevel is in the objectPath.

Parameters
[in]meshLevelthe mesh level that we want to search for in the objectPath
Returns
true if the meshLevel is in the objectPath, false otherwise

An example use case is in the validation of boundary conditions

◆ forObjectsInPath() [1/3]

template<typename OBJECT_TYPE , typename FUNC >
void geos::MeshObjectPath::forObjectsInPath ( dataRepository::Group meshBodies,
FUNC &&  func 
) const

LLoop over objects in the path and execute a callback function.

Template Parameters
OBJECT_TYPEThe type of object to loop over
FUNCThe type of function that is executed on the OBJECT_TYPE. Takes a single OBJECT_TYPE as an argument. func( dynamic_cast< OBJECT_TYPE & >(object) );
Parameters
meshBodiesGroup that contains the MeshBody objects.
funcThe function that is executed on the OBJECT_TYPE

Definition at line 336 of file MeshObjectPath.hpp.

◆ forObjectsInPath() [2/3]

template<typename OBJECT_TYPE , typename FUNC >
void geos::MeshObjectPath::forObjectsInPath ( dataRepository::Group const &  meshBodies,
FUNC &&  func 
) const

Loop over objects in the path and execute a callback function.

Template Parameters
OBJECT_TYPEThe type of object to loop over
FUNCThe type of function that is executed on the OBJECT_TYPE. Takes a single OBJECT_TYPE as an argument. func( dynamic_cast< OBJECT_TYPE & >(object) );
Parameters
meshBodiesGroup that contains the MeshBody objects.
funcThe function that is executed on the OBJECT_TYPE

Definition at line 347 of file MeshObjectPath.hpp.

◆ forObjectsInPath() [3/3]

template<typename OBJECT_TYPE , typename FUNC >
void geos::MeshObjectPath::forObjectsInPath ( MeshLevel level,
FUNC &&  func 
) const

Loop over objects in the path and execute a callback function.

Template Parameters
OBJECT_TYPEThe type of object to loop over
FUNCThe type of function that is executed on the OBJECT_TYPE. Takes a single OBJECT_TYPE as an argument. func( dynamic_cast< OBJECT_TYPE & >(object) );
Parameters
levelThe MeshLevel that contains OBJECT_TYPE to be executed on.
funcThe function that is executed on the OBJECT_TYPE

Definition at line 364 of file MeshObjectPath.hpp.

◆ getObjectType()

ObjectTypes const& geos::MeshObjectPath::getObjectType ( ) const
inline

Get the Object Type object.

Returns
ObjectTypes const&

Definition at line 84 of file MeshObjectPath.hpp.

◆ pathPermutations()

permutationMapType const& geos::MeshObjectPath::pathPermutations ( ) const
inline

Get the m_pathPermutations object.

Returns
permutationMapType const&

Definition at line 94 of file MeshObjectPath.hpp.

◆ processPath()

void geos::MeshObjectPath::processPath ( string const  path,
dataRepository::Group const &  meshBodies 
)

Processes the path string into the permutation container.

Parameters
pathThe path string
meshBodiesThe Group that contains all MeshBody objects

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