16 #ifndef GEOS_MESH_PARTICLEREGIONBASE_HPP
17 #define GEOS_MESH_PARTICLEREGIONBASE_HPP
19 #include "ParticleSubRegion.hpp"
78 string const & meshBodyBlockName );
92 GEOS_ERROR(
"ParticleRegionBase::GenerateMesh() should be overriden if called." );
127 template<
typename SUBREGIONTYPE=ParticleSubRegionBase,
typename KEY_TYPE=
void >
136 template<
typename SUBREGIONTYPE=ParticleSubRegionBase,
typename KEY_TYPE=
void >
166 numParticle += group.size();
187 template<
typename CONSTITUTIVE_TYPE >
204 template<
typename LAMBDA >
207 forParticleSubRegions< ParticleSubRegion >( std::forward< LAMBDA >( lambda ) );
213 template<
typename LAMBDA >
216 forParticleSubRegions< ParticleSubRegion >( std::forward< LAMBDA >( lambda ) );
224 template<
typename SUBREGIONTYPE,
typename ... SUBREGIONTYPES,
typename LAMBDA >
233 template<
typename SUBREGIONTYPE,
typename ... SUBREGIONTYPES,
typename LAMBDA >
244 template<
typename LAMBDA >
247 forParticleSubRegionsIndex< ParticleSubRegion >( std::forward< LAMBDA >( lambda ) );
253 template<
typename LAMBDA >
256 forParticleSubRegionsIndex< ParticleSubRegion >( std::forward< LAMBDA >( lambda ) );
267 template<
typename SUBREGIONTYPE,
typename ... SUBREGIONTYPES,
typename LAMBDA >
273 applyLambdaToContainer< SUBREGIONTYPE, SUBREGIONTYPES... >( subRegion, [&](
auto const & castedSubRegion )
275 lambda( esr, castedSubRegion );
283 template<
typename SUBREGIONTYPE,
typename ... SUBREGIONTYPES,
typename LAMBDA >
291 lambda( esr, castedSubRegion );
336 template<
typename CONSTITUTIVE_TYPE >
340 for(
string const & matName : m_materialList )
342 if( this->
getSubRegion( 0 ).getConstitutiveModels().hasGroup< CONSTITUTIVE_TYPE >( matName ) )
344 rval.emplace_back( matName );
#define GEOS_UNUSED_VAR(...)
Mark an unused variable and silence compiler warnings.
#define GEOS_ERROR(msg)
Raise a hard error and terminate the program.
The ObjectManagerBase is the base object of all object managers in the mesh data hierachy.
The ParticleRegionBase is the base class to manage the data stored at the particle level.
virtual void generateMesh(Group &particleBlocks)
Generate mesh.
string_array & getMaterialList()
Get the material list in the particle region.
string_array const & getMaterialList() const
Get the material list in the particle region.
subGroupMap const & getSubRegions() const
Get a collection of the subregions.
void forParticleSubRegions(LAMBDA &&lambda) const
Apply a lambda to all particle subregions.
ParticleRegionBase(string const &name, Group *const parent)
Main constructor.
void forParticleSubRegionsIndex(LAMBDA &&lambda) const
Apply LAMBDA to the subregions with the specific subregion types listed in the template,...
void forParticleSubRegions(LAMBDA &&lambda)
Apply a lambda to all particle subregions.
localIndex getNumberOfParticles() const
Get the number of particles in the region for specific subregion types provided as template arguments...
void forParticleSubRegionsIndex(LAMBDA &&lambda)
Apply LAMBDA to the subregions, loop using subregion indices.
SUBREGIONTYPE & getSubRegion(KEY_TYPE const &key)
Get a reference to a subregion.
ParticleRegionBase()=delete
Deleted default constructor.
ParticleRegionBase(const ParticleRegionBase &init)
Copy constructor.
virtual ~ParticleRegionBase() override
Default destructor.
void forParticleSubRegions(LAMBDA &&lambda)
Apply a lambda to all particle subregions.
subGroupMap & getSubRegions()
Get a collection of the subregions.
string_array getConstitutiveNames() const
Get the name of the constitutive in the particle region.
void forParticleSubRegionsIndex(LAMBDA &&lambda)
Apply LAMBDA to the subregions, loop using subregion indices.
localIndex numSubRegions() const
Get the number of subregions in the region.
void forParticleSubRegions(LAMBDA &&lambda) const
Apply LAMBDA to the subregions with the specific subregion types listed in the template.
SUBREGIONTYPE const & getSubRegion(KEY_TYPE const &key) const
Get a reference to a subregion.
void forParticleSubRegionsIndex(LAMBDA &&lambda) const
Apply LAMBDA to the subregions, loop using subregion indices.
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...
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.
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
Struct to serve as a container for variable strings and keys.
static constexpr char const * particleSubRegions()
static constexpr char const * materialListString()
static constexpr char const * meshBodyString()