19 #ifndef GEOSX_MESH_PARTICLEREGIONMANAGER_HPP
20 #define GEOSX_MESH_PARTICLEREGIONMANAGER_HPP
22 #include "generators/ParticleBlock.hpp"
24 #include "constitutive/ConstitutiveManager.hpp"
26 #include "ParticleSubRegion.hpp"
34 class DomainPartition;
58 template<
typename VIEWTYPE >
66 template<
typename VIEWTYPE >
74 template<
typename VIEWTYPE >
81 template<
typename VIEWTYPE >
89 template<
typename VIEWTYPE >
96 template<
typename CONSTITUTIVE_TYPE >
104 {
return "ParticleManager"; }
129 template<
typename T = ParticleSubRegionBase >
135 numParticle += particleSubRegion.
size();
170 integer documentationType )
override;
212 template<
typename T=ParticleRegionBase,
typename KEY_TYPE=
void >
223 template<
typename T=ParticleRegionBase,
typename KEY_TYPE=
void >
235 template<
typename T=ParticleRegionBase >
262 template<
typename REGIONTYPE =
ParticleRegionBase,
typename ... REGIONTYPES,
typename LAMBDA >
274 template<
typename REGIONTYPE =
ParticleRegionBase,
typename ... REGIONTYPES,
typename LAMBDA >
288 template<
typename REGIONTYPE =
ParticleRegionBase,
typename ... REGIONTYPES,
typename LOOKUP_CONTAINER,
typename LAMBDA >
302 template<
typename REGIONTYPE =
ParticleRegionBase,
typename ... REGIONTYPES,
typename LOOKUP_CONTAINER,
typename LAMBDA >
313 template<
typename LAMBDA >
316 forParticleRegionsComplete< ParticleRegion >( std::forward< LAMBDA >( lambda ) );
324 template<
typename LAMBDA >
327 forParticleRegionsComplete< ParticleRegion >( std::forward< LAMBDA >( lambda ) );
336 template<
typename REGIONTYPE,
typename ... REGIONTYPES,
typename LAMBDA >
345 lambda( er, castedRegion );
356 template<
typename REGIONTYPE,
typename ... REGIONTYPES,
typename LAMBDA >
365 lambda( er, castedRegion );
377 template<
typename LOOKUP_CONTAINER,
typename LAMBDA >
380 forParticleRegionsComplete< ParticleRegion >( targetRegions, std::forward< LAMBDA >( lambda ) );
390 template<
typename LOOKUP_CONTAINER,
typename LAMBDA >
393 forParticleRegionsComplete< ParticleRegion >( targetRegions, std::forward< LAMBDA >( lambda ) );
404 template<
typename REGIONTYPE,
typename ... REGIONTYPES,
typename LOOKUP_CONTAINER,
typename LAMBDA >
408 auto & particleRegion )
410 lambda( targetIndex, particleRegion.getIndexInParent(), particleRegion );
422 template<
typename REGIONTYPE,
typename ... REGIONTYPES,
typename LOOKUP_CONTAINER,
typename LAMBDA >
426 auto const & particleRegion )
428 lambda( targetIndex, particleRegion.getIndexInParent(), particleRegion );
437 template<
typename LAMBDA >
440 forParticleSubRegions< ParticleSubRegion >( std::forward< LAMBDA >( lambda ) );
449 template<
typename LAMBDA >
452 forParticleSubRegions< ParticleSubRegion >( std::forward< LAMBDA >( lambda ) );
462 template<
typename LOOKUP_CONTAINER,
typename LAMBDA >
465 forParticleSubRegions< ParticleSubRegion >( targetRegions, std::forward< LAMBDA >( lambda ) );
475 template<
typename LOOKUP_CONTAINER,
typename LAMBDA >
478 forParticleSubRegions< ParticleSubRegion >( targetRegions, std::forward< LAMBDA >( lambda ) );
487 template<
typename SUBREGIONTYPE,
typename ... SUBREGIONTYPES,
typename LAMBDA >
491 [lambda = std::forward< LAMBDA >( lambda )](
localIndex const,
507 template<
typename SUBREGIONTYPE,
typename ... SUBREGIONTYPES,
typename LAMBDA >
511 [lambda = std::forward< LAMBDA >( lambda )](
localIndex const,
514 auto const & subRegion )
528 template<
typename SUBREGIONTYPE,
typename ... SUBREGIONTYPES,
typename LOOKUP_CONTAINER,
typename LAMBDA >
532 [lambda = std::forward< LAMBDA >( lambda )](
localIndex const targetIndex,
538 lambda( targetIndex, subRegion );
550 template<
typename SUBREGIONTYPE,
typename ... SUBREGIONTYPES,
typename LOOKUP_CONTAINER,
typename LAMBDA >
554 [lambda = std::forward< LAMBDA >( lambda )](
localIndex const targetIndex,
558 auto const & subRegion )
560 lambda( targetIndex, subRegion );
569 template<
typename LAMBDA >
572 forParticleSubRegionsComplete< ParticleSubRegion >( std::forward< LAMBDA >( lambda ) );
580 template<
typename LAMBDA >
583 forParticleSubRegionsComplete< ParticleSubRegion >( std::forward< LAMBDA >( lambda ) );
593 template<
typename LOOKUP_CONTAINER,
typename LAMBDA >
596 forParticleSubRegionsComplete< ParticleSubRegion >( targetRegions, std::forward< LAMBDA >( lambda ) );
606 template<
typename LOOKUP_CONTAINER,
typename LAMBDA >
609 forParticleSubRegionsComplete< ParticleSubRegion >( targetRegions, std::forward< LAMBDA >( lambda ) );
618 template<
typename SUBREGIONTYPE,
typename ... SUBREGIONTYPES,
typename LAMBDA >
631 lambda( er, esr, particleRegion, castedSubRegion );
643 template<
typename SUBREGIONTYPE,
typename ... SUBREGIONTYPES,
typename LAMBDA >
656 lambda( er, esr, particleRegion, castedSubRegion );
670 template<
typename SUBREGIONTYPE,
typename ... SUBREGIONTYPES,
typename LOOKUP_CONTAINER,
typename LAMBDA >
685 lambda( targetIndex, er, esr, particleRegion, castedSubRegion );
700 template<
typename SUBREGIONTYPE,
typename ... SUBREGIONTYPES,
typename LOOKUP_CONTAINER,
typename LAMBDA >
715 lambda( targetIndex, er, esr, particleRegion, castedSubRegion );
729 template<
typename FIELD_TRAIT >
730 ParticleViewAccessor< traits::ViewTypeConst< typename FIELD_TRAIT::type > >
740 template<
typename VIEWTYPE,
typename LHS=VIEWTYPE >
741 ParticleViewAccessor< LHS >
751 template<
typename VIEWTYPE,
typename LHS=VIEWTYPE >
752 ParticleViewAccessor< LHS >
764 template<
typename T,
int NDIM,
typename PERM = defaultLayout< NDIM > >
765 ParticleViewAccessor< ArrayView< T const, NDIM, getUSD< PERM > > >
775 template<
typename VIEWTYPE >
776 ParticleViewAccessor< ReferenceWrapper< VIEWTYPE > >
786 template<
typename VIEWTYPE >
787 ParticleViewAccessor< ReferenceWrapper< VIEWTYPE > >
797 template<
typename VIEWTYPE,
typename LHS=VIEWTYPE >
798 MaterialViewAccessor< LHS >
800 constitutive::ConstitutiveManager
const & cm )
const;
809 template<
typename VIEWTYPE,
typename LHS=VIEWTYPE >
810 MaterialViewAccessor< LHS >
812 constitutive::ConstitutiveManager
const & cm );
824 template<
typename FIELD_TRAIT >
825 ParticleViewAccessor< traits::ViewTypeConst< typename FIELD_TRAIT::type > >
828 bool const allowMissingViews =
false )
const;
839 template<
typename MATERIAL_TYPE,
typename FIELD_TRAIT >
840 ParticleViewAccessor< traits::ViewTypeConst< typename FIELD_TRAIT::type > >
854 template<
typename VIEWTYPE,
typename LHS=VIEWTYPE >
855 ParticleViewAccessor< LHS >
858 string const & materialKeyName,
859 bool const allowMissingViews =
false )
const;
872 template<
typename VIEWTYPE,
typename LHS=VIEWTYPE >
873 ParticleViewAccessor< LHS >
876 string const & materialKeyName,
877 bool const allowMissingViews =
false );
890 template<
typename T,
int NDIM,
typename PERM = defaultLayout< NDIM > >
891 ParticleViewAccessor< ArrayView< T const, NDIM, getUSD< PERM > > >
894 string const & materialKeyName,
895 bool const allowMissingViews =
false )
const;
905 template<
typename MATERIALTYPE,
typename VIEWTYPE,
typename LHS=VIEWTYPE >
906 ParticleViewAccessor< LHS >
919 template<
typename MATERIALTYPE,
typename T,
int NDIM,
typename PERM = defaultLayout< NDIM > >
920 ParticleViewAccessor< ArrayView< T const, NDIM, getUSD< PERM > > >
929 template<
typename CONSTITUTIVE_TYPE >
930 ConstitutiveRelationAccessor< CONSTITUTIVE_TYPE >
940 template<
typename CONSTITUTIVE_TYPE >
941 ConstitutiveRelationAccessor< CONSTITUTIVE_TYPE >
1031 template<
bool DOPACK >
1042 template<
bool DOPACK >
1052 template<
typename T >
1070 template<
typename VIEWTYPE,
typename LHS >
1079 viewAccessor[kReg].resize( particleRegion.
numSubRegions() );
1085 if( !neighborName.empty() )
1093 viewAccessor[kReg][kSubReg] = wrapper->
reference();
1097 return viewAccessor;
1101 template<
typename VIEWTYPE,
typename LHS >
1110 viewAccessor[kReg].resize( particleRegion.
numSubRegions() );
1116 if( !neighborName.empty() )
1124 viewAccessor[kReg][kSubReg] = wrapper->
reference();
1128 return viewAccessor;
1131 template<
typename FIELD_TRAIT >
1136 traits::ViewTypeConst< typename FIELD_TRAIT::type > >( FIELD_TRAIT::key(), neighborName );
1139 template<
typename T,
int NDIM,
typename PERM >
1143 return constructViewAccessor< Array< T, NDIM, PERM >,
1145 >( name, neighborName );
1148 template<
typename VIEWTYPE >
1157 viewAccessor[kReg].resize( particleRegion.
numSubRegions() );
1163 if( !neighborName.empty() )
1170 viewAccessor[kReg][kSubReg].set( group->
getReference< VIEWTYPE >( viewName ) );
1174 return viewAccessor;
1177 template<
typename VIEWTYPE >
1186 viewAccessor[kReg].resize( particleRegion.
numSubRegions() );
1192 if( !neighborName.empty() )
1199 viewAccessor[kReg][kSubReg].set( group->
getReference< VIEWTYPE >( viewName ) );
1203 return viewAccessor;
1206 template<
typename VIEWTYPE,
typename LHS >
1209 constitutive::ConstitutiveManager
const & cm )
const
1223 accessor[kReg][kSubReg].
resize( cm.numSubGroups() );
1225 for(
localIndex matIndex=0; matIndex<cm.numSubGroups(); ++matIndex )
1227 string const & constitutiveName = cm.getGroup( matIndex ).getName();
1229 if( constitutiveRelation !=
nullptr )
1234 accessor[kReg][kSubReg][matIndex] = wrapper->
reference();
1243 template<
typename VIEWTYPE,
typename LHS >
1246 constitutive::ConstitutiveManager
const & cm )
1260 accessor[kReg][kSubReg].
resize( cm.numSubGroups() );
1262 for(
localIndex matIndex=0; matIndex<cm.numSubGroups(); ++matIndex )
1264 string const & constitutiveName = cm.getGroup( matIndex ).getName();
1266 if( constitutiveRelation !=
nullptr )
1271 accessor[kReg][kSubReg][matIndex] = wrapper->
reference();
1280 template<
typename VIEWTYPE,
typename LHS >
1284 string const & materialKeyName,
1285 bool const allowMissingViews )
const
1293 accessor[kReg].resize(
getRegion( kReg ).numSubRegions() );
1299 for(
localIndex k = 0; k < regionNames.size(); ++k )
1310 string const & materialName = subRegion.
getReference<
string >( materialKeyName );
1316 accessor[er][esr] = wrapper->
reference();
1320 GEOS_ERROR_IF( !allowMissingViews,
"Material " << materialKeyName[k] <<
" does not contain " << viewName );
1328 template<
typename VIEWTYPE,
typename LHS >
1332 string const & materialKeyName,
1333 bool const allowMissingViews )
1341 accessor[kReg].resize(
getRegion( kReg ).numSubRegions() );
1347 for(
localIndex k = 0; k < regionNames.size(); ++k )
1357 string const & materialName = subRegion.
getReference<
string >( materialKeyName );
1363 accessor[er][esr] = wrapper->
reference();
1367 GEOS_ERROR_IF( !allowMissingViews,
"Material " << materialName <<
" does not contain " << viewName );
1375 template<
typename FIELD_TRAIT >
1379 bool const allowMissingViews )
const
1382 traits::ViewTypeConst< typename FIELD_TRAIT::type > >( FIELD_TRAIT::key(),
1385 allowMissingViews );
1388 template<
typename MATERIAL_TYPE,
typename FIELD_TRAIT >
1394 traits::ViewTypeConst< typename FIELD_TRAIT::type > >( FIELD_TRAIT::key() );
1397 template<
typename T,
int NDIM,
typename PERM >
1401 string const & materialKeyName,
1402 bool const allowMissingViews )
const
1407 allowMissingViews );
1410 template<
typename MATERIALTYPE,
typename VIEWTYPE,
typename LHS >
1419 accessor[er].resize(
getRegion( er ).numSubRegions() );
1432 string materialName;
1433 constitutiveGroup.
forSubGroups< MATERIALTYPE >( [&]( MATERIALTYPE
const & constitutiveRelation )
1435 materialName = constitutiveRelation.getName();
1436 if( constitutiveRelation.template
hasWrapper( viewName ) )
1439 accessor[er][esr] = constitutiveRelation.template getReference< VIEWTYPE >( viewName );
1447 template<
typename MATERIALTYPE,
typename T,
int NDIM,
typename PERM >
1454 template<
typename CONSTITUTIVE_TYPE >
1469 accessor[kReg][kSubReg].
resize( cm.numSubGroups() );
1471 for(
localIndex matIndex=0; matIndex<cm.numSubGroups(); ++matIndex )
1473 string const & constitutiveName = cm.getGroup( matIndex ).getName();
1475 CONSTITUTIVE_TYPE *
const
1476 constitutiveRelation = constitutiveGroup.
getGroupPointer< CONSTITUTIVE_TYPE >( constitutiveName );
1477 if( constitutiveRelation !=
nullptr )
1479 accessor[kReg][kSubReg][matIndex] = constitutiveRelation;
1487 template<
typename CONSTITUTIVE_TYPE >
1502 accessor[kReg][kSubReg].
resize( cm.numSubGroups() );
1504 for(
localIndex matIndex=0; matIndex<cm.numSubGroups(); ++matIndex )
1506 string const & constitutiveName = cm.getGroup( matIndex ).getName();
1508 CONSTITUTIVE_TYPE *
const
1509 constitutiveRelation = constitutiveGroup.
getGroupPointer< CONSTITUTIVE_TYPE >( constitutiveName );
1510 if( constitutiveRelation !=
nullptr )
1512 accessor[kReg][kSubReg][matIndex] = constitutiveRelation;
#define GEOS_UNUSED_VAR(...)
Mark an unused variable and silence compiler warnings.
#define GEOS_ERROR_IF_EQ_MSG(lhs, rhs, msg)
Raise a hard error if two values are equal.
#define GEOS_ERROR_IF(EXP, msg)
Conditionally raise a hard error and terminate the program.
constexpr static INDEX_TYPE invalid_index
the value of an invalid index
INDEX_TYPE size() const
function to return the number of entries stored
INDEX_TYPE getIndex(KEY_TYPE const &key) const
The ObjectManagerBase is the base object of all object managers in the mesh data hierachy.
virtual localIndex packGlobalMapsSize(arrayView1d< localIndex const > const &packList, integer const recursive) const
Computes the pack size of the global maps elements in the @ packList.
virtual localIndex unpack(buffer_unit_type const *&buffer, arrayView1d< localIndex > &packList, integer const recursive, bool onDevice, parallelDeviceEvents &events, MPI_Op op=MPI_REPLACE) override
Unpack a buffer.
virtual localIndex packGlobalMaps(buffer_unit_type *&buffer, arrayView1d< localIndex const > const &packList, integer const recursive) const
Packs the global maps elements in the @ packList.
virtual localIndex unpackGlobalMaps(buffer_unit_type const *&buffer, localIndex_array &packList, integer const recursive)
Unpacks the global maps from buffer.
Abstract base class for ParticleBlockManager.
The ParticleManager class provides an interface to ObjectManagerBase in order to manage ParticleRegio...
void forParticleSubRegionsComplete(LAMBDA &&lambda) const
This const function is used to launch kernel function over the particle subregions of all subregion t...
ConstitutiveRelationAccessor< CONSTITUTIVE_TYPE > constructFullConstitutiveAccessor(constitutive::ConstitutiveManager const &cm) const
Construct a ConstitutiveRelationAccessor.
void resize(integer_array const &numParticles, string_array const ®ionNames, string_array const &particleTypes)
Set the number of particles for a set of particle regions.
virtual void setSchemaDeviations(xmlWrapper::xmlNode schemaRoot, xmlWrapper::xmlNode schemaParent, integer documentationType) override
Inform the schema generator of any deviations between the xml and GEOS data structures.
virtual void expandObjectCatalogs() override
Expand any catalogs in the data structure.
void forParticleRegions(LOOKUP_CONTAINER const &targetRegions, LAMBDA &&lambda) const
This const function is used to launch kernel function over the target particle regions with region ty...
void forParticleSubRegions(LAMBDA &&lambda) const
This const function is used to launch kernel function over the particle subregions of all the subregi...
void updateMaps()
Updates the globalToLocal and localToGlobal maps.
MaterialViewAccessor< LHS > constructFullMaterialViewAccessor(string const &viewName, constitutive::ConstitutiveManager const &cm) const
This is a const function to construct a MaterialViewAccessor to access the material data.
void forParticleSubRegions(LOOKUP_CONTAINER const &targetRegions, LAMBDA &&lambda)
This function is used to launch kernel function over the specified target particle subregions.
array1d< array1d< array1d< VIEWTYPE > > > MaterialViewAccessor
The MaterialViewAccessor at the ParticleManager level is a 3D array of VIEWTYPE.
bool hasRegion(string const &name) const
Determines if a ParticleRegion with the input name exists.
void forParticleSubRegions(LAMBDA &&lambda)
This function is used to launch kernel function over the particle subregions of all the subregion typ...
virtual void setMaxGlobalIndex() override final
Set the maximum local and global index.
ParticleViewAccessor< traits::ViewTypeConst< typename FIELD_TRAIT::type > > constructFieldAccessor(string const &neighborName=string()) const
This is a const function to construct a ParticleViewAccessor to access the data registered on the mes...
void forParticleSubRegions(LOOKUP_CONTAINER const &targetRegions, LAMBDA &&lambda) const
This const function is used to launch kernel function over the specified target particle subregions w...
void forParticleRegionsComplete(LAMBDA lambda)
This function is used to launch kernel function over all the particle regions that can be casted to o...
int PackGlobalMaps(buffer_unit_type *&buffer, ParticleViewAccessor< arrayView1d< localIndex > > const &packList) const
Pack a buffer.
int Unpack(buffer_unit_type const *&buffer, ParticleViewAccessor< arrayView1d< localIndex > > &packList)
Unpack a buffer.
void forParticleSubRegionsComplete(LAMBDA &&lambda)
This function is used to launch kernel function over all the particle subregions that can be casted t...
void generateMesh(ParticleBlockManagerABC &particleBlockManager)
Generate the mesh.
array1d< array1d< VIEWTYPE > > ParticleViewAccessor
The ParticleViewAccessor at the ParticleManager level is an array of array of VIEWTYPE.
void forParticleRegions(LAMBDA &&lambda) const
This const function is used to launch kernel function over all the particle regions with region type ...
static string catalogName()
The function is to return the name of the ParticleManager in the object catalog.
subGroupMap const & getRegions() const
Get a collection of particle regions.
void forParticleRegionsComplete(LOOKUP_CONTAINER const &targetRegions, LAMBDA lambda) const
This const function is used to launch kernel function over the specified target particle regions.
localIndex numParticleBlocks() const
Get the number of particle blocks.
void forParticleSubRegions(LAMBDA &&lambda) const
This const function is used to launch kernel function over the particle subregions of the specified s...
void forParticleSubRegionsComplete(LOOKUP_CONTAINER const &targetRegions, LAMBDA &&lambda)
This function is used to launch kernel function over the specified target particle subregions that ca...
void forParticleSubRegions(LAMBDA &&lambda)
This function is used to launch kernel function over the particle subregions of the specified subregi...
void forParticleRegionsComplete(LOOKUP_CONTAINER const &targetRegions, LAMBDA lambda)
This function is used to launch kernel function over the specified target particle regions.
localIndex numRegions() const
Get the number of regions.
ParticleViewAccessor< ArrayView< T const, NDIM, getUSD< PERM > > > constructArrayViewAccessor(string const &name, string const &neighborName=string()) const
This is a function to construct a ParticleViewAccessor to access array data registered on the mesh.
T & getRegion(KEY_TYPE const &key)
Get a particle region.
void forParticleSubRegionsComplete(LAMBDA &&lambda)
This function is used to launch kernel function over the particle subregions of all subregion types.
ParticleViewAccessor< traits::ViewTypeConst< typename FIELD_TRAIT::type > > constructMaterialFieldAccessor(arrayView1d< string const > const ®ionNames, arrayView1d< string const > const &materialNames, bool const allowMissingViews=false) const
This is a const function to construct a MaterialViewAccessor to access the material data for specifie...
ParticleViewAccessor< ArrayView< T const, NDIM, getUSD< PERM > > > constructMaterialArrayViewAccessor(string const &viewName, arrayView1d< string const > const ®ionNames, string const &materialKeyName, bool const allowMissingViews=false) const
Construct a view accessor for material data, assuming array as storage type.
T const & getRegion(KEY_TYPE const &key) const
Get a particle region.
void forParticleSubRegionsComplete(LAMBDA &&lambda) const
This const function is used to launch kernel function over all the particle subregions that can be ca...
int UnpackGlobalMaps(buffer_unit_type const *&buffer, ParticleViewAccessor< ReferenceWrapper< localIndex_array > > &packList)
Unpack a buffer.
virtual string getCatalogName() const override final
Virtual access to catalogName()
void forParticleSubRegionsComplete(LOOKUP_CONTAINER const &targetRegions, LAMBDA &&lambda) const
This const function is used to launch kernel function over the specified target particle subregions.
ParticleViewAccessor< LHS > constructViewAccessor(string const &name, string const &neighborName=string()) const
This is a const function to construct a ParticleViewAccessor to access the data registered on the mes...
virtual Group * createChild(string const &childKey, string const &childName) override
Create a new ParticleRegion object as a child of this group.
void forParticleRegionsComplete(LAMBDA lambda)
This function is used to launch kernel function over all the types of particle regions.
int PackSize(string_array const &wrapperNames, ParticleViewAccessor< arrayView1d< localIndex > > const &packList) const
Get the buffer size needed to pack a list of wrappers.
void forParticleRegionsComplete(LAMBDA lambda) const
This const function is used to launch kernel function over all the particle regions that can be caste...
void forParticleSubRegions(LOOKUP_CONTAINER const &targetRegions, LAMBDA &&lambda)
This function is used to launch kernel function over the specified target particle subregions with th...
ParticleManager(string const &name, Group *const parent)
Constructor.
subGroupMap & getRegions()
Get a collection of particle regions.
void forParticleRegionsComplete(LAMBDA lambda) const
This const function is used to launch kernel function over all the types of particle regions.
void forParticleSubRegionsComplete(LOOKUP_CONTAINER const &targetRegions, LAMBDA &&lambda) const
This const function is used to launch kernel function over the specified target particle subregions t...
void forParticleSubRegionsComplete(LOOKUP_CONTAINER const &targetRegions, LAMBDA &&lambda)
This function is used to launch kernel function over the specified target particle subregions.
int Unpack(buffer_unit_type const *&buffer, ParticleReferenceAccessor< array1d< localIndex > > &packList)
Unpack a buffer.
typename ParticleViewAccessor< VIEWTYPE >::NestedViewTypeConst ParticleViewConst
The ParticleViewAccessor at the ParticleManager level is the type resulting from ParticleViewAccessor...
void forParticleRegions(LOOKUP_CONTAINER const &targetRegions, LAMBDA &&lambda)
This function is used to launch kernel function over the target particle regions with region type = P...
void forParticleRegionsComplete(LOOKUP_CONTAINER const &targetRegions, LAMBDA lambda) const
This const function is used to launch kernel function over the specified target particle regions with...
ParticleViewAccessor< ReferenceWrapper< VIEWTYPE > > constructReferenceAccessor(string const &viewName, string const &neighborName=string()) const
This is a const function to construct a ParticleViewAccessor to access the data registered on the mes...
void forParticleRegions(LAMBDA &&lambda)
This function is used to launch kernel function over all the particle regions with region type = Part...
int Pack(buffer_unit_type *&buffer, string_array const &wrapperNames, ParticleViewAccessor< arrayView1d< localIndex > > const &packList) const
Pack a list of wrappers to a buffer.
ParticleViewAccessor< LHS > constructMaterialViewAccessor(string const &viewName, arrayView1d< string const > const ®ionNames, string const &materialKeyName, bool const allowMissingViews=false) const
This is a const function to construct a MaterialViewAccessor to access the material data for specifie...
array1d< array1d< ReferenceWrapper< VIEWTYPE > > > ParticleReferenceAccessor
The ParticleViewAccessor at the ParticleManager level is a 2D array of ReferenceWrapper around VIEWTY...
typename ParticleViewAccessor< VIEWTYPE >::NestedViewType ParticleView
The ParticleViewAccessor at the ParticleManager level is the type resulting from ParticleViewAccessor...
void forParticleSubRegions(LOOKUP_CONTAINER const &targetRegions, LAMBDA &&lambda) const
This const function is used to launch kernel function over the specified target particle subregions.
void forParticleRegionsComplete(LOOKUP_CONTAINER const &targetRegions, LAMBDA lambda)
This function is used to launch kernel function over the specified target particle regions with regio...
localIndex getNumberOfParticles() const
Get the number of particles in all ParticleSubRegions of type T.
int PackGlobalMapsSize(ParticleViewAccessor< arrayView1d< localIndex > > const &packList) const
Get the size of the buffer to be packed.
virtual ~ParticleManager() override
Destructor.
array1d< array1d< array1d< CONSTITUTIVE_TYPE * > > > ConstitutiveRelationAccessor
The ConstitutiveRelationAccessor at the ParticleManager level is a 3D array of CONSTITUTIVE_TYPE.
The ParticleRegionBase is the base class to manage the data stored at the particle level.
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 forParticleSubRegionsIndex(LAMBDA &&lambda) const
Apply LAMBDA to the subregions, loop using subregion indices.
T const & getConstitutiveModel(string const &name) const
Get a pointer to the constitutive model.
dataRepository::Group const & getConstitutiveModels() const
Get the group in which the constitutive models of this subregion are registered.
T * getGroupPointer(KEY const &key)
Return a pointer to a sub-group of the current Group.
bool hasWrapper(LOOKUP_TYPE const &lookup) const
Check if a wrapper exists.
localIndex getIndexInParent() const
Get the group's index within its parent group.
GEOS_DECLTYPE_AUTO_RETURN getReference(LOOKUP_TYPE const &lookup) const
Look up a wrapper and get reference to wrapped object.
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.
localIndex size() const
Get the "size" of the group, which determines the number of elements in resizable wrappers.
virtual localIndex packSize(string_array const &wrapperNames, integer const recursive, bool onDevice, parallelDeviceEvents &events) const
Get the size required to pack a list of wrappers.
void forSubGroups(LAMBDA &&lambda)
Apply the given functor to subgroups that can be casted to one of specified types.
virtual localIndex pack(buffer_unit_type *&buffer, string_array const &wrapperNames, integer const recursive, bool onDevice, parallelDeviceEvents &events) const
Pack a list of wrappers to a buffer.
Wrapper< T > const * getWrapperPointer(LOOKUP_TYPE const &index) const
Retrieve a Wrapper stored in this group.
virtual void resize(localIndex const newSize)
Resize the group and all contained wrappers that resize with parent.
T & reference()
Accessor for m_data.
localIndex indexType
The default index type for entries the hierarchy.
ArrayView< T, 1 > arrayView1d
Alias for 1D array view.
array1d< string > string_array
A 1-dimensional array of geos::string types.
array1d< integer > integer_array
A 1-dimensional array of geos::integer types.
std::int32_t integer
Signed integer type.
signed char buffer_unit_type
Type stored in communication buffers.
GEOSX_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
Array< T, 1 > array1d
Alias for 1D array.
LvArray::ArrayView< T, NDIM, USD, localIndex, LvArray::ChaiBuffer > ArrayView
Multidimensional array view type. See LvArray:ArrayView for details.
struct to serve as a container for group strings and keys
static constexpr char const * neighborDataString()
Group key associated with particleRegionsGroup.
static constexpr auto particleRegionsGroup()