15 #ifndef GEOSX_MESH_ELEMENTREGIONBASE_HPP 16 #define GEOSX_MESH_ELEMENTREGIONBASE_HPP 18 #include "CellElementSubRegion.hpp" 20 #include "WellElementSubRegion.hpp" 85 GEOSX_ERROR(
"ElementRegionBase::GenerateMesh() should be overriden if called." );
120 template<
typename SUBREGIONTYPE=ElementSubRegionBase >
129 template<
typename SUBREGIONTYPE=ElementSubRegionBase >
141 template<
typename SUBREGIONTYPE=ElementSubRegionBase >
150 template<
typename SUBREGIONTYPE=ElementSubRegionBase >
180 numElem += cellBlock.size();
201 template<
typename CONSTITUTIVE_TYPE >
217 template<
typename LAMBDA >
220 forElementSubRegions< CellElementSubRegion, FaceElementSubRegion, WellElementSubRegion, EmbeddedSurfaceSubRegion >( std::forward< LAMBDA >( lambda ) );
226 template<
typename LAMBDA >
229 forElementSubRegions< CellElementSubRegion, FaceElementSubRegion, WellElementSubRegion, EmbeddedSurfaceSubRegion >( std::forward< LAMBDA >( lambda ) );
237 template<
typename SUBREGIONTYPE,
typename ... SUBREGIONTYPES,
typename LAMBDA >
241 elementSubRegions->
forSubGroups< SUBREGIONTYPE, SUBREGIONTYPES... >( std::forward< LAMBDA >( lambda ) );
247 template<
typename SUBREGIONTYPE,
typename ... SUBREGIONTYPES,
typename LAMBDA >
251 elementSubRegions->
forSubGroups< SUBREGIONTYPE, SUBREGIONTYPES... >( std::forward< LAMBDA >( lambda ) );
259 template<
typename LAMBDA >
262 forElementSubRegionsIndex< CellElementSubRegion, FaceElementSubRegion, WellElementSubRegion, EmbeddedSurfaceSubRegion >( std::forward< LAMBDA >( lambda ) );
268 template<
typename LAMBDA >
271 forElementSubRegionsIndex< CellElementSubRegion, FaceElementSubRegion, WellElementSubRegion, EmbeddedSurfaceSubRegion >( std::forward< LAMBDA >( lambda ) );
282 template<
typename SUBREGIONTYPE,
typename ... SUBREGIONTYPES,
typename LAMBDA >
288 applyLambdaToContainer< SUBREGIONTYPE, SUBREGIONTYPES... >( subRegion, [&](
auto const & castedSubRegion )
290 lambda( esr, castedSubRegion );
298 template<
typename SUBREGIONTYPE,
typename ... SUBREGIONTYPES,
typename LAMBDA >
306 lambda( esr, castedSubRegion );
336 string m_numericalMethod;
352 template<
typename CONSTITUTIVE_TYPE >
356 for(
string const & matName : m_materialList )
358 Group const *
const matModel = this->
GetSubRegion( 0 )->GetConstitutiveModels()->GetGroup( matName );
359 if( dynamic_cast< CONSTITUTIVE_TYPE const * >( matModel ) !=
nullptr )
void forElementSubRegions(LAMBDA &&lambda) const
Apply LAMBDA to the subregions with the specific subregion types listed in the template.
SUBREGIONTYPE * GetSubRegion(localIndex const &index)
Get a pointer to a subregion by specifying its index.
void forElementSubRegions(LAMBDA &&lambda) const
Apply a lambda to all subregions.
subGroupMap & GetSubRegions()
Get a collection of the subregions.
ElementRegionBase()=delete
Deleted default constructor.
string_array getConstitutiveNames() const
Get the name of the constiutive in the element region.
string_array & getMaterialList()
Get the material list in the element region.
localIndex numSubRegions() const
Get the number of subregions in the region.
subGroupMap 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...
SUBREGIONTYPE const * GetSubRegion(localIndex const &index) const
Get a pointer to a subregion by specifying its index.
virtual void GenerateMesh(Group *const cellBlocks)
Generate mesh.
void forElementSubRegionsIndex(LAMBDA &&lambda) const
Apply LAMBDA to the subregions with the specific subregion types listed in the template, loop using subregion indices.
std::enable_if_t< _NDIM==1 > emplace_back(ARGS &&... args)
Construct a value in place at the end of the array.
static constexpr auto materialListString
String key for the material list.
string_array const & getMaterialList() const
Get the material list in the element region.
The ObjectManagerBase is the base object of all object managers in the mesh data hierachy.
void forElementSubRegionsIndex(LAMBDA &&lambda) const
Apply LAMBDA to the subregions, loop using subregion indices.
SUBREGIONTYPE const * GetSubRegion(string const ®ionName) const
Get a pointer to a subregion by specifying its name.
void forElementSubRegionsIndex(LAMBDA &&lambda)
Apply LAMBDA to the subregions, loop using subregion indices.
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...
static constexpr auto elementSubRegions
String key for the element subregions.
void forElementSubRegions(LAMBDA &&lambda)
Apply a lambda to all subregions.
virtual ~ElementRegionBase() override
Default destructor.
#define GEOSX_ERROR(msg)
Raise a hard error and terminate the program.
void forElementSubRegions(LAMBDA &&lambda)
Apply a lambda to all subregions.
The ElementRegionBase is the base class to manage the data stored at the element level.
#define GEOSX_UNUSED_VAR(...)
Mark an unused variable and silence compiler warnings.
std::ptrdiff_t localIndex
Local index type (for indexing objects within an MPI partition).
void forElementSubRegionsIndex(LAMBDA &&lambda)
Apply LAMBDA to the subregions, loop using subregion indices.
void forSubGroups(LAMBDA lambda)
Apply the given functor to subgroups that can be casted to one of specified types.
This class provides a fixed dimensional resizeable array interface in addition to an interface simila...
struct to serve as a container for variable strings and keys
T * GetGroup(localIndex index)
Retrieve a sub-group from the current Group using an index.
SUBREGIONTYPE * GetSubRegion(string const ®ionName)
Get a pointer to a subregion by specifying its name.
Struct to serve as a container for variable strings and keys.