19 #ifndef GEOS_MESH_ELEMENTREGIONMANAGER_HPP
20 #define GEOS_MESH_ELEMENTREGIONMANAGER_HPP
22 #include "constitutive/ConstitutiveManager.hpp"
24 #include "CellElementSubRegion.hpp"
25 #include "mesh/generators/CellBlockManagerABC.hpp"
63 template<
typename VIEWTYPE >
71 template<
typename VIEWTYPE >
79 template<
typename VIEWTYPE >
86 template<
typename VIEWTYPE >
94 template<
typename VIEWTYPE >
101 template<
typename CONSTITUTIVE_TYPE >
109 {
return "ZoneManager"; }
134 template<
typename T = ElementSubRegionBase >
140 numElem += elementSubRegion.
size();
187 integer documentationType )
override;
230 template<
typename T=ElementRegionBase,
typename KEY_TYPE=
void >
242 template<
typename T=ElementRegionBase,
typename KEY_TYPE=
void >
254 template<
typename T=ElementRegionBase >
283 template<
typename REGIONTYPE =
ElementRegionBase,
typename ... REGIONTYPES,
typename LAMBDA >
295 template<
typename REGIONTYPE =
ElementRegionBase,
typename ... REGIONTYPES,
typename LAMBDA >
309 template<
typename REGIONTYPE =
ElementRegionBase,
typename ... REGIONTYPES,
typename LOOKUP_CONTAINER,
typename LAMBDA >
323 template<
typename REGIONTYPE =
ElementRegionBase,
typename ... REGIONTYPES,
typename LOOKUP_CONTAINER,
typename LAMBDA >
334 template<
typename LAMBDA >
346 template<
typename LAMBDA >
359 template<
typename REGIONTYPE,
typename ... REGIONTYPES,
typename LAMBDA >
368 lambda( er, castedRegion );
379 template<
typename REGIONTYPE,
typename ... REGIONTYPES,
typename LAMBDA >
388 lambda( er, castedRegion );
400 template<
typename LOOKUP_CONTAINER,
typename LAMBDA >
414 template<
typename LOOKUP_CONTAINER,
typename LAMBDA >
429 template<
typename REGIONTYPE,
typename ... REGIONTYPES,
typename LOOKUP_CONTAINER,
typename LAMBDA >
433 auto & elementRegion )
435 lambda( targetIndex, elementRegion.getIndexInParent(), elementRegion );
447 template<
typename REGIONTYPE,
typename ... REGIONTYPES,
typename LOOKUP_CONTAINER,
typename LAMBDA >
451 auto const & elementRegion )
453 lambda( targetIndex, elementRegion.getIndexInParent(), elementRegion );
462 template<
typename LAMBDA >
475 template<
typename LAMBDA >
489 template<
typename LOOKUP_CONTAINER,
typename LAMBDA >
503 template<
typename LOOKUP_CONTAINER,
typename LAMBDA >
516 template<
typename SUBREGIONTYPE,
typename ... SUBREGIONTYPES,
typename LAMBDA >
520 [lambda = std::forward< LAMBDA >( lambda )](
localIndex const,
536 template<
typename SUBREGIONTYPE,
typename ... SUBREGIONTYPES,
typename LAMBDA >
540 [lambda = std::forward< LAMBDA >( lambda )](
localIndex const,
543 auto const & subRegion )
557 template<
typename SUBREGIONTYPE,
typename ... SUBREGIONTYPES,
typename LOOKUP_CONTAINER,
typename LAMBDA >
561 [lambda = std::forward< LAMBDA >( lambda )](
localIndex const targetIndex,
567 lambda( targetIndex, subRegion );
579 template<
typename SUBREGIONTYPE,
typename ... SUBREGIONTYPES,
typename LOOKUP_CONTAINER,
typename LAMBDA >
583 [lambda = std::forward< LAMBDA >( lambda )](
localIndex const targetIndex,
587 auto const & subRegion )
589 lambda( targetIndex, subRegion );
598 template<
typename LAMBDA >
610 template<
typename LAMBDA >
624 template<
typename LOOKUP_CONTAINER,
typename LAMBDA >
627 forElementSubRegionsComplete< CellElementSubRegion, FaceElementSubRegion, EmbeddedSurfaceSubRegion, WellElementSubRegion >( targetRegions,
628 std::forward< LAMBDA >( lambda ) );
638 template<
typename LOOKUP_CONTAINER,
typename LAMBDA >
641 forElementSubRegionsComplete< CellElementSubRegion, FaceElementSubRegion, EmbeddedSurfaceSubRegion, WellElementSubRegion >( targetRegions,
642 std::forward< LAMBDA >( lambda ) );
651 template<
typename SUBREGIONTYPE,
typename ... SUBREGIONTYPES,
typename LAMBDA >
664 lambda( er, esr, elementRegion, castedSubRegion );
676 template<
typename SUBREGIONTYPE,
typename ... SUBREGIONTYPES,
typename LAMBDA >
689 lambda( er, esr, elementRegion, castedSubRegion );
703 template<
typename SUBREGIONTYPE,
typename ... SUBREGIONTYPES,
typename LOOKUP_CONTAINER,
typename LAMBDA >
718 lambda( targetIndex, er, esr, elementRegion, castedSubRegion );
733 template<
typename SUBREGIONTYPE,
typename ... SUBREGIONTYPES,
typename LOOKUP_CONTAINER,
typename LAMBDA >
748 lambda( targetIndex, er, esr, elementRegion, castedSubRegion );
762 template<
typename FIELD_TRAIT >
763 ElementViewAccessor< traits::ViewTypeConst< typename FIELD_TRAIT::type > >
773 template<
typename VIEWTYPE,
typename LHS=VIEWTYPE >
774 ElementViewAccessor< LHS >
784 template<
typename VIEWTYPE,
typename LHS=VIEWTYPE >
785 ElementViewAccessor< LHS >
797 template<
typename T,
int NDIM,
typename PERM = defaultLayout< NDIM > >
798 ElementViewAccessor< ArrayView< T const, NDIM, getUSD< PERM > > >
808 template<
typename VIEWTYPE >
809 ElementViewAccessor< ReferenceWrapper< VIEWTYPE > >
819 template<
typename VIEWTYPE >
820 ElementViewAccessor< ReferenceWrapper< VIEWTYPE > >
830 template<
typename VIEWTYPE,
typename LHS=VIEWTYPE >
831 MaterialViewAccessor< LHS >
833 constitutive::ConstitutiveManager
const & cm )
const;
842 template<
typename VIEWTYPE,
typename LHS=VIEWTYPE >
843 MaterialViewAccessor< LHS >
845 constitutive::ConstitutiveManager
const & cm );
857 template<
typename FIELD_TRAIT >
858 ElementViewAccessor< traits::ViewTypeConst< typename FIELD_TRAIT::type > >
861 bool const allowMissingViews =
false )
const;
872 template<
typename MATERIAL_TYPE,
typename FIELD_TRAIT >
873 ElementViewAccessor< traits::ViewTypeConst< typename FIELD_TRAIT::type > >
888 template<
typename VIEWTYPE,
typename LHS=VIEWTYPE >
889 ElementViewAccessor< LHS >
892 string const & materialKeyName,
893 bool const allowMissingViews =
false )
const;
906 template<
typename VIEWTYPE,
typename LHS=VIEWTYPE >
907 ElementViewAccessor< LHS >
910 string const & materialKeyName,
911 bool const allowMissingViews =
false );
924 template<
typename T,
int NDIM,
typename PERM = defaultLayout< NDIM > >
925 ElementViewAccessor< ArrayView< T const, NDIM, getUSD< PERM > > >
928 string const & materialKeyName,
929 bool const allowMissingViews =
false )
const;
939 template<
typename MATERIALTYPE,
typename VIEWTYPE,
typename LHS=VIEWTYPE >
940 ElementViewAccessor< LHS >
953 template<
typename MATERIALTYPE,
typename T,
int NDIM,
typename PERM = defaultLayout< NDIM > >
954 ElementViewAccessor< ArrayView< T const, NDIM, getUSD< PERM > > >
963 template<
typename CONSTITUTIVE_TYPE >
964 ConstitutiveRelationAccessor< CONSTITUTIVE_TYPE >
974 template<
typename CONSTITUTIVE_TYPE >
975 ConstitutiveRelationAccessor< CONSTITUTIVE_TYPE >
1090 bool const overwriteMap );
1099 string const fractureRegionName )
const;
1110 string const fractureRegionName )
const;
1121 string const fractureRegionName );
1132 template<
bool DO_PACKING >
1142 template<
bool DO_PACKING >
1152 template<
bool DO_PACKING,
typename T >
1155 T
const & packList )
const;
1162 template<
typename T >
1173 template<
bool DO_PACKING >
1176 string const fractureRegionName )
const;
1193 template<
typename VIEWTYPE,
typename LHS >
1208 if( !neighborName.empty() )
1216 viewAccessor[kReg][kSubReg] = wrapper->
reference();
1220 return viewAccessor;
1224 template<
typename VIEWTYPE,
typename LHS >
1240 if( !neighborName.empty() )
1248 viewAccessor[kReg][kSubReg] = wrapper->
reference();
1252 return viewAccessor;
1255 template<
typename FIELD_TRAIT >
1260 traits::ViewTypeConst< typename FIELD_TRAIT::type > >( FIELD_TRAIT::key(), neighborName );
1264 template<
typename T,
int NDIM,
typename PERM >
1269 return constructViewAccessor< Array< T, NDIM, PERM >,
1271 >( name, neighborName );
1274 template<
typename VIEWTYPE >
1290 if( !neighborName.empty() )
1297 viewAccessor[kReg][kSubReg].set( group->
getReference< VIEWTYPE >( viewName ) );
1301 return viewAccessor;
1304 template<
typename VIEWTYPE >
1307 string const & neighborName )
1320 if( !neighborName.empty() )
1327 viewAccessor[kReg][kSubReg].set( group->
getReference< VIEWTYPE >( viewName ) );
1331 return viewAccessor;
1334 template<
typename VIEWTYPE,
typename LHS >
1338 constitutive::ConstitutiveManager
const & cm )
const
1352 accessor[kReg][kSubReg].
resize( cm.numSubGroups() );
1354 for(
localIndex matIndex=0; matIndex<cm.numSubGroups(); ++matIndex )
1356 string const & constitutiveName = cm.getGroup( matIndex ).getName();
1358 if( constitutiveRelation !=
nullptr )
1363 accessor[kReg][kSubReg][matIndex] = wrapper->
reference();
1372 template<
typename VIEWTYPE,
typename LHS >
1376 constitutive::ConstitutiveManager
const & cm )
1390 accessor[kReg][kSubReg].
resize( cm.numSubGroups() );
1392 for(
localIndex matIndex=0; matIndex<cm.numSubGroups(); ++matIndex )
1394 string const & constitutiveName = cm.getGroup( matIndex ).getName();
1396 if( constitutiveRelation !=
nullptr )
1401 accessor[kReg][kSubReg][matIndex] = wrapper->
reference();
1410 template<
typename VIEWTYPE,
typename LHS >
1414 string const & materialKeyName,
1415 bool const allowMissingViews )
const
1423 accessor[kReg].resize(
getRegion( kReg ).numSubRegions() );
1429 for(
localIndex k = 0; k < regionNames.size(); ++k )
1440 string const & materialName = subRegion.
getReference<
string >( materialKeyName );
1446 accessor[er][esr] = wrapper->
reference();
1452 ": Material " << constitutiveRelation.getDataContext() <<
1453 " does not contain " << viewName );
1461 template<
typename VIEWTYPE,
typename LHS >
1465 string const & materialKeyName,
1466 bool const allowMissingViews )
1474 accessor[kReg].resize(
getRegion( kReg ).numSubRegions() );
1480 for(
localIndex k = 0; k < regionNames.size(); ++k )
1490 string const & materialName = subRegion.
getReference<
string >( materialKeyName );
1496 accessor[er][esr] = wrapper->
reference();
1501 <<
" does not contain " << viewName );
1509 template<
typename FIELD_TRAIT >
1513 bool const allowMissingViews )
const
1516 traits::ViewTypeConst< typename FIELD_TRAIT::type > >( FIELD_TRAIT::key(),
1519 allowMissingViews );
1522 template<
typename MATERIAL_TYPE,
typename FIELD_TRAIT >
1528 traits::ViewTypeConst< typename FIELD_TRAIT::type > >( FIELD_TRAIT::key() );
1532 template<
typename T,
int NDIM,
typename PERM >
1537 string const & materialKeyName,
1538 bool const allowMissingViews )
const
1543 allowMissingViews );
1546 template<
typename MATERIALTYPE,
typename VIEWTYPE,
typename LHS >
1555 accessor[er].resize(
getRegion( er ).numSubRegions() );
1568 string materialName;
1569 constitutiveGroup.
forSubGroups< MATERIALTYPE >( [&]( MATERIALTYPE
const & constitutiveRelation )
1571 materialName = constitutiveRelation.getName();
1572 if( constitutiveRelation.template
hasWrapper( viewName ) )
1575 accessor[er][esr] = constitutiveRelation.template getReference< VIEWTYPE >( viewName );
1583 template<
typename MATERIALTYPE,
typename T,
int NDIM,
typename PERM >
1590 template<
typename CONSTITUTIVE_TYPE >
1605 accessor[kReg][kSubReg].
resize( cm.numSubGroups() );
1607 for(
localIndex matIndex=0; matIndex<cm.numSubGroups(); ++matIndex )
1609 string const & constitutiveName = cm.getGroup( matIndex ).getName();
1611 CONSTITUTIVE_TYPE *
const
1612 constitutiveRelation = constitutiveGroup.
getGroupPointer< CONSTITUTIVE_TYPE >( constitutiveName );
1613 if( constitutiveRelation !=
nullptr )
1615 accessor[kReg][kSubReg][matIndex] = constitutiveRelation;
1623 template<
typename CONSTITUTIVE_TYPE >
1638 accessor[kReg][kSubReg].
resize( cm.numSubGroups() );
1640 for(
localIndex matIndex=0; matIndex<cm.numSubGroups(); ++matIndex )
1642 string const & constitutiveName = cm.getGroup( matIndex ).getName();
1644 CONSTITUTIVE_TYPE *
const
1645 constitutiveRelation = constitutiveGroup.
getGroupPointer< CONSTITUTIVE_TYPE >( constitutiveName );
1646 if( constitutiveRelation !=
nullptr )
1648 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
Abstract base class for CellBlockManager.
The ElementRegionBase is the base class to manage the data stored at the element level.
void forElementSubRegionsIndex(LAMBDA &&lambda) const
Apply LAMBDA to the subregions, loop using subregion indices.
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.
The ElementRegionManager class provides an interface to ObjectManagerBase in order to manage ElementR...
array1d< array1d< ReferenceWrapper< VIEWTYPE > > > ElementReferenceAccessor
The ElementViewAccessor at the ElementRegionManager level is a 2D array of ReferenceWrapper around VI...
void forElementSubRegionsComplete(LOOKUP_CONTAINER const &targetRegions, LAMBDA &&lambda)
This function is used to launch kernel function over the specified target element subregions that can...
void forElementSubRegionsComplete(LOOKUP_CONTAINER const &targetRegions, LAMBDA &&lambda)
This function is used to launch kernel function over the specified target element subregions.
void forElementRegionsComplete(LAMBDA lambda)
This function is used to launch kernel function over all the types of element regions.
void forElementSubRegionsComplete(LOOKUP_CONTAINER const &targetRegions, LAMBDA &&lambda) const
This const function is used to launch kernel function over the specified target element subregions.
int unpackUpDownMaps(buffer_unit_type const *&buffer, ElementReferenceAccessor< localIndex_array > &packList, bool const overwriteMap)
Unpack element-to-node and element-to-face maps.
T & getRegion(KEY_TYPE const &key)
Get a element region.
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.
int packGlobalMaps(buffer_unit_type *&buffer, ElementViewAccessor< arrayView1d< localIndex > > const &packList) const
Pack a buffer.
int unpack(buffer_unit_type const *&buffer, ElementReferenceAccessor< array1d< localIndex > > &packList)
Unpack a buffer.
int packFracturedElementsSize(ElementViewAccessor< arrayView1d< localIndex > > const &packList, string const fractureRegionName) const
Get the buffer size needed to pack the set of fractured elements and the map toEmbSurfaces.
ElementViewAccessor< 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.
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.
ElementRegionManager(string const &name, Group *const parent)
Constructor.
virtual ~ElementRegionManager() override
Destructor.
virtual void setMaxGlobalIndex() override final
Set the maximum local and global index.
int unpack(buffer_unit_type const *&buffer, ElementViewAccessor< arrayView1d< localIndex > > &packList)
Unpack a buffer.
void forElementSubRegions(LAMBDA &&lambda) const
This const function is used to launch kernel function over the element subregions of the specified su...
int packUpDownMaps(buffer_unit_type *&buffer, ElementReferenceAccessor< array1d< localIndex > > const &packList) const
Pack element-to-node and element-to-face maps.
void forElementRegions(LAMBDA &&lambda)
This function is used to launch kernel function over all the element regions with region type = Eleme...
int pack(buffer_unit_type *&buffer, ElementViewAccessor< arrayView1d< localIndex > > const &packList) const
Pack all the wrappers of all the sub regions of all the regions.
array2d< localIndex > getCellBlockToSubRegionMap(CellBlockManagerABC const &cellBlockManager) const
Produce a map from cell block indices to element region and subregion indices.
void forElementRegionsComplete(LAMBDA lambda)
This function is used to launch kernel function over all the element regions that can be casted to on...
subGroupMap const & getRegions() const
Get a collection of element regions.
ConstitutiveRelationAccessor< CONSTITUTIVE_TYPE > constructFullConstitutiveAccessor(constitutive::ConstitutiveManager const &cm) const
Construct a ConstitutiveRelationAccessor.
void forElementSubRegionsComplete(LOOKUP_CONTAINER const &targetRegions, LAMBDA &&lambda) const
This const function is used to launch kernel function over the specified target element subregions th...
ElementViewAccessor< 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...
void forElementRegionsComplete(LOOKUP_CONTAINER const &targetRegions, LAMBDA lambda)
This function is used to launch kernel function over the specified target element regions.
localIndex numRegions() const
Get number of the regions.
void forElementSubRegions(LOOKUP_CONTAINER const &targetRegions, LAMBDA &&lambda) const
This const function is used to launch kernel function over the specified target element subregions.
ElementViewAccessor< traits::ViewTypeConst< typename FIELD_TRAIT::type > > constructFieldAccessor(string const &neighborName=string()) const
This is a const function to construct a ElementViewAccessor to access the data registered on the mesh...
virtual Group * createChild(string const &childKey, string const &childName) override
Create a new ElementRegion object as a child of this group.
void forElementSubRegionsComplete(LAMBDA &&lambda) const
This const function is used to launch kernel function over all the element subregions that can be cas...
void forElementRegions(LAMBDA &&lambda) const
This const function is used to launch kernel function over all the element regions with region type =...
subGroupMap & getRegions()
Get a collection of element regions.
int unpackFracturedElements(buffer_unit_type const *&buffer, ElementReferenceAccessor< localIndex_array > &packList, string const fractureRegionName)
Unpack set of fractured elements and map toEmbSurfaces to a buffer or get the buffer size.
array1d< array1d< array1d< CONSTITUTIVE_TYPE * > > > ConstitutiveRelationAccessor
The ConstitutiveRelationAccessor at the ElementRegionManager level is a 3D array of CONSTITUTIVE_TYPE...
void forElementRegions(LOOKUP_CONTAINER const &targetRegions, LAMBDA &&lambda) const
This const function is used to launch kernel function over the target element regions with region typ...
int packFracturedElements(buffer_unit_type *&buffer, ElementViewAccessor< arrayView1d< localIndex > > const &packList, string const fractureRegionName) const
Pack set of fractured elements and map toEmbSurfaces to a buffer or get the buffer size.
int unpackGlobalMaps(buffer_unit_type const *&buffer, ElementViewAccessor< ReferenceWrapper< localIndex_array > > &packList)
Unpack a buffer.
void forElementRegions(LOOKUP_CONTAINER const &targetRegions, LAMBDA &&lambda)
This function is used to launch kernel function over the target element regions with region type = El...
void forElementRegionsComplete(LOOKUP_CONTAINER const &targetRegions, LAMBDA lambda)
This function is used to launch kernel function over the specified target element regions with region...
typename ElementViewAccessor< VIEWTYPE >::NestedViewType ElementView
The ElementViewAccessor at the ElementRegionManager level is the type resulting from ElementViewAcces...
int packUpDownMaps(buffer_unit_type *&buffer, ElementViewAccessor< arrayView1d< localIndex > > const &packList) const
Pack element-to-node and element-to-face maps.
virtual void expandObjectCatalogs() override
Expand any catalogs in the data structure.
void forElementRegionsComplete(LAMBDA lambda) const
This const function is used to launch kernel function over all the types of element regions.
localIndex getNumberOfElements() const
Get the number of elements in all ElementSubRegions of type T.
ElementViewAccessor< ArrayView< T const, NDIM, getUSD< PERM > > > constructArrayViewAccessor(string const &name, string const &neighborName=string()) const
This is a function to construct a ElementViewAccessor to access array data registered on the mesh.
int packUpDownMapsSize(ElementReferenceAccessor< array1d< localIndex > > const &packList) const
Get the buffer size needed to pack element-to-node and element-to-face maps.
void forElementSubRegionsComplete(LAMBDA &&lambda) const
This const function is used to launch kernel function over the element subregions of all subregion ty...
void forElementSubRegionsComplete(LAMBDA &&lambda)
This function is used to launch kernel function over the element subregions of all subregion types.
void forElementSubRegions(LAMBDA &&lambda) const
This const function is used to launch kernel function over the element subregions of all the subregio...
void forElementSubRegionsComplete(LAMBDA &&lambda)
This function is used to launch kernel function over all the element subregions that can be casted to...
void forElementSubRegions(LAMBDA &&lambda)
This function is used to launch kernel function over the element subregions of all the subregion type...
virtual string getCatalogName() const override final
Virtual access to catalogName()
void forElementSubRegions(LAMBDA &&lambda)
This function is used to launch kernel function over the element subregions of the specified subregio...
void generateMesh(CellBlockManagerABC const &cellBlockManager)
Generate the mesh.
void forElementRegionsComplete(LAMBDA lambda) const
This const function is used to launch kernel function over all the element regions that can be casted...
void forElementSubRegions(LOOKUP_CONTAINER const &targetRegions, LAMBDA &&lambda) const
This const function is used to launch kernel function over the specified target element subregions wi...
void forElementSubRegions(LOOKUP_CONTAINER const &targetRegions, LAMBDA &&lambda)
This function is used to launch kernel function over the specified target element subregions.
array1d< array1d< array1d< VIEWTYPE > > > MaterialViewAccessor
The MaterialViewAccessor at the ElementRegionManager level is a 3D array of VIEWTYPE.
int packGlobalMapsSize(ElementViewAccessor< arrayView1d< localIndex > > const &packList) const
Get the size of the buffer to be packed.
ElementViewAccessor< 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...
int packSize(ElementViewAccessor< arrayView1d< localIndex > > const &packList) const
Get the buffer size needed to pack all the wrappers of all the sub regions of all the regions.
void buildSets(NodeManager const &nodeManager)
Build sets from the node sets.
array1d< array1d< VIEWTYPE > > ElementViewAccessor
The ElementViewAccessor at the ElementRegionManager level is an array of array of VIEWTYPE.
bool hasRegion(string const &name) const
Determines if an ElementRegion with the input name exists.
void forElementRegionsComplete(LOOKUP_CONTAINER const &targetRegions, LAMBDA lambda) const
This const function is used to launch kernel function over the specified target element regions.
void resize(integer_array const &numElements, string_array const ®ionNames, string_array const &elementTypes)
Set the number of elements for a set of element regions.
constexpr static int maxNumNodesPerElem
int packUpDownMapsSize(ElementViewAccessor< arrayView1d< localIndex > > const &packList) const
Get the buffer size needed to pack element-to-node and element-to-face maps.
static string catalogName()
The function is to return the name of the ElementRegionManager in the object catalog.
ElementViewAccessor< ReferenceWrapper< VIEWTYPE > > constructReferenceAccessor(string const &viewName, string const &neighborName=string()) const
This is a const function to construct a ElementViewAccessor to access the data registered on the mesh...
typename ElementViewAccessor< VIEWTYPE >::NestedViewTypeConst ElementViewConst
The ElementViewAccessor at the ElementRegionManager level is the type resulting from ElementViewAcces...
void generateWells(CellBlockManagerABC const &cellBlockManager, MeshLevel &meshLevel)
Generate the wells.
T const & getRegion(KEY_TYPE const &key) const
Get a element region.
ElementViewAccessor< LHS > constructViewAccessor(string const &name, string const &neighborName=string()) const
This is a const function to construct a ElementViewAccessor to access the data registered on the mesh...
void forElementRegionsComplete(LOOKUP_CONTAINER const &targetRegions, LAMBDA lambda) const
This const function is used to launch kernel function over the specified target element regions with ...
void forElementSubRegions(LOOKUP_CONTAINER const &targetRegions, LAMBDA &&lambda)
This function is used to launch kernel function over the specified target element subregions with the...
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.
INDEX_TYPE size() const
function to return the number of entries stored
INDEX_TYPE getIndex(KEY_TYPE const &key) const
Class facilitating the representation of a multi-level discretization of a MeshBody.
The NodeManager class provides an interface to ObjectManagerBase in order to manage node data.
The ObjectManagerBase is the base object of all object managers in the mesh data hierachy.
virtual localIndex packUpDownMaps(buffer_unit_type *&buffer, arrayView1d< localIndex const > const &packList) const
Packs the specific elements in the @ packList.
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.
virtual localIndex packUpDownMapsSize(arrayView1d< localIndex const > const &packList) const
Computes the pack size of the specific elements in the @ packList.
virtual localIndex unpackUpDownMaps(buffer_unit_type const *&buffer, array1d< localIndex > &packList, bool const overwriteUpMaps, bool const overwriteDownMaps)
Unpacks the specific elements in the @ packList.
This class specializes the element region for the case of a well. This class is also in charge of sta...
This class describes a collection of local well elements and perforations.
T * getGroupPointer(KEY const &key)
Return a pointer to a sub-group of the current Group.
DataContext const & getDataContext() const
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.
Array< T, 2, PERMUTATION > array2d
Alias for 2D array.
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.
Group key associated with elementRegionsGroup.
static constexpr auto elementRegionsGroup()
struct to serve as a container for group strings and keys
static constexpr char const * neighborDataString()