15 #ifndef GEOS_MESH_ELEMENTREGIONBASE_HPP
16 #define GEOS_MESH_ELEMENTREGIONBASE_HPP
18 #include "CellElementSubRegion.hpp"
20 #include "WellElementSubRegion.hpp"
82 string const & meshBodyBlockName );
97 template<
typename SUBREGION_TYPE >
140 template<
typename SUBREGIONTYPE=ElementSubRegionBase,
typename KEY_TYPE=
void >
149 template<
typename SUBREGIONTYPE=ElementSubRegionBase,
typename KEY_TYPE=
void >
162 template<
typename T=ElementSubRegionBase >
193 numElem += group.size();
214 template<
typename CONSTITUTIVE_TYPE >
230 template<
typename LAMBDA >
233 forElementSubRegions< CellElementSubRegion, FaceElementSubRegion, WellElementSubRegion, EmbeddedSurfaceSubRegion >( std::forward< LAMBDA >( lambda ) );
239 template<
typename LAMBDA >
242 forElementSubRegions< CellElementSubRegion, FaceElementSubRegion, WellElementSubRegion, EmbeddedSurfaceSubRegion >( std::forward< LAMBDA >( lambda ) );
250 template<
typename SUBREGIONTYPE,
typename ... SUBREGIONTYPES,
typename LAMBDA >
259 template<
typename SUBREGIONTYPE,
typename ... SUBREGIONTYPES,
typename LAMBDA >
270 template<
typename LAMBDA >
273 forElementSubRegionsIndex< CellElementSubRegion, FaceElementSubRegion, WellElementSubRegion, EmbeddedSurfaceSubRegion >( std::forward< LAMBDA >( lambda ) );
279 template<
typename LAMBDA >
282 forElementSubRegionsIndex< CellElementSubRegion, FaceElementSubRegion, WellElementSubRegion, EmbeddedSurfaceSubRegion >( std::forward< LAMBDA >( lambda ) );
293 template<
typename SUBREGIONTYPE,
typename ... SUBREGIONTYPES,
typename LAMBDA >
299 applyLambdaToContainer< SUBREGIONTYPE, SUBREGIONTYPES... >( subRegion, [&](
auto const & castedSubRegion )
301 lambda( esr, castedSubRegion );
309 template<
typename SUBREGIONTYPE,
typename ... SUBREGIONTYPES,
typename LAMBDA >
317 lambda( esr, castedSubRegion );
362 template<
typename CONSTITUTIVE_TYPE >
366 for(
string const & matName : m_materialList )
368 if( this->
getSubRegion( 0 ).getConstitutiveModels().hasGroup< CONSTITUTIVE_TYPE >( matName ) )
370 rval.emplace_back( matName );
377 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.
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.
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.
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.
array1d< string > string_array
A 1-dimensional array of geos::string types.
GEOSX_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