16 #ifndef GEOS_MESH_ELEMENTREGIONBASE_HPP 
   17 #define GEOS_MESH_ELEMENTREGIONBASE_HPP 
   19 #include "CellElementSubRegion.hpp" 
   21 #include "WellElementSubRegion.hpp" 
   83                                     string const & meshBodyBlockName );
 
   98   template< 
typename SUBREGION_TYPE >
 
  141   template< 
typename SUBREGIONTYPE=ElementSubRegionBase, 
typename KEY_TYPE=
void >
 
  150   template< 
typename SUBREGIONTYPE=ElementSubRegionBase, 
typename KEY_TYPE=
void >
 
  163   template< 
typename T=ElementSubRegionBase >
 
  194       numElem += group.size();
 
  215   template< 
typename CONSTITUTIVE_TYPE >
 
  230   { 
return dynamicCast< ElementRegionBase const & >( subRegion.
getParent().
getParent() ); }
 
  245   template< 
typename LAMBDA >
 
  248     forElementSubRegions< CellElementSubRegion, FaceElementSubRegion, WellElementSubRegion, EmbeddedSurfaceSubRegion >( std::forward< LAMBDA >( lambda ) );
 
  254   template< 
typename LAMBDA >
 
  257     forElementSubRegions< CellElementSubRegion, FaceElementSubRegion, WellElementSubRegion, EmbeddedSurfaceSubRegion >( std::forward< LAMBDA >( lambda ) );
 
  265   template< 
typename SUBREGIONTYPE, 
typename ... SUBREGIONTYPES, 
typename LAMBDA >
 
  274   template< 
typename SUBREGIONTYPE, 
typename ... SUBREGIONTYPES, 
typename LAMBDA >
 
  285   template< 
typename LAMBDA >
 
  288     forElementSubRegionsIndex< CellElementSubRegion, FaceElementSubRegion, WellElementSubRegion, EmbeddedSurfaceSubRegion >( std::forward< LAMBDA >( lambda ) );
 
  294   template< 
typename LAMBDA >
 
  297     forElementSubRegionsIndex< CellElementSubRegion, FaceElementSubRegion, WellElementSubRegion, EmbeddedSurfaceSubRegion >( std::forward< LAMBDA >( lambda ) );
 
  308   template< 
typename SUBREGIONTYPE, 
typename ... SUBREGIONTYPES, 
typename LAMBDA >
 
  314       applyLambdaToContainer< SUBREGIONTYPE, SUBREGIONTYPES... >( subRegion, [&]( 
auto const & castedSubRegion )
 
  316         lambda( esr, castedSubRegion );
 
  324   template< 
typename SUBREGIONTYPE, 
typename ... SUBREGIONTYPES, 
typename LAMBDA >
 
  332         lambda( esr, castedSubRegion );
 
  377 template< 
typename CONSTITUTIVE_TYPE >
 
  381   for( 
string const & matName : m_materialList )
 
  383     if( this->
getSubRegion( 0 ).getConstitutiveModels().hasGroup< CONSTITUTIVE_TYPE >( matName ) )
 
  385       rval.emplace_back( matName );
 
  392 template< 
typename SUBREGION_TYPE >
 
The ElementRegionBase is the base class to manage the data stored at the element level.
 
SUBREGION_TYPE & createElementSubRegion(string const &name)
Create a Element Sub Region object.
 
ElementRegionBase(string const &name, Group *const parent)
Main constructor.
 
bool hasSubRegion(string const &name) const
Check to see if this region has a subregion.
 
virtual void generateMesh(Group const &blocks)=0
Generate mesh.
 
virtual ~ElementRegionBase() override
Default destructor.
 
void forElementSubRegions(LAMBDA &&lambda)
Apply a lambda to all subregions.
 
void forElementSubRegionsIndex(LAMBDA &&lambda)
Apply LAMBDA to the subregions, loop using subregion indices.
 
Group const  & getSubRegions() const
Get a collection of the subregions.
 
localIndex getNumberOfElements() const
Get the number of elements in the region for specific subregion types provided as template arguments.
 
static ElementRegionBase & getParentRegion(ElementSubRegionBase &subRegion)
 
void forElementSubRegions(LAMBDA &&lambda) const
Apply LAMBDA to the subregions with the specific subregion types listed in the template.
 
void forElementSubRegions(LAMBDA &&lambda) const
Apply a lambda to all subregions.
 
string_array const  & getMaterialList() const
Get the material list in the element region.
 
void forElementSubRegionsIndex(LAMBDA &&lambda) const
Apply LAMBDA to the subregions, loop using subregion indices.
 
Group & getSubRegions()
Get a collection of the subregions.
 
void forElementSubRegions(LAMBDA &&lambda)
Apply a lambda to all subregions.
 
SUBREGIONTYPE & getSubRegion(KEY_TYPE const &key)
Get a reference to a subregion.
 
static string verifyMeshBodyName(Group const &meshBodies, string const &meshBodyBlockName)
verify that the meshBody name specified exists in the meshBodies group. If there is only one meshBody...
 
ElementRegionBase(const ElementRegionBase &init)
Copy constructor.
 
string_array getConstitutiveNames() const
Get the name of the constiutive in the element region.
 
void forElementSubRegionsIndex(LAMBDA &&lambda) const
Apply LAMBDA to the subregions with the specific subregion types listed in the template,...
 
string_array & getMaterialList()
Get the material list in the element region.
 
localIndex numSubRegions() const
Get the number of subregions in the region.
 
SUBREGIONTYPE const  & getSubRegion(KEY_TYPE const &key) const
Get a reference to a subregion.
 
static ElementRegionBase const  & getParentRegion(ElementSubRegionBase const &subRegion)
 
void forElementSubRegionsIndex(LAMBDA &&lambda)
Apply LAMBDA to the subregions, loop using subregion indices.
 
ElementRegionBase()=delete
Deleted default constructor.
 
The ObjectManagerBase is the base object of all object managers in the mesh data hierachy.
 
localIndex numSubGroups() const
return the number of sub groups in this Group
 
T & getGroup(KEY const &key)
Return a reference to a sub-group of the current Group.
 
Group & getParent()
Access the group's parent.
 
static bool applyLambdaToContainer(CONTAINERTYPE &container, LAMBDA &&lambda)
Apply a given functor to a container if the container can be cast to one of the specified types.
 
stdVector< string > string_array
A 1-dimensional array of geos::string types.
 
GEOS_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
 
Struct to serve as a container for variable strings and keys.
 
static constexpr char const  * elementSubRegions()
 
static constexpr char const  * materialListString()
 
static constexpr char const  * meshBodyString()
 
struct to serve as a container for variable strings and keys