20 #ifndef GEOS_MESH_CELLBLOCKMANAGER_H_
21 #define GEOS_MESH_CELLBLOCKMANAGER_H_
23 #include "mesh/generators/CellBlock.hpp"
24 #include "mesh/generators/FaceBlock.hpp"
25 #include "mesh/generators/InternalWellGenerator.hpp"
26 #include "mesh/generators/LineBlock.hpp"
27 #include "mesh/generators/LineBlockABC.hpp"
28 #include "mesh/generators/CellBlockManagerABC.hpp"
49 virtual Group *
createChild(
string const & childKey,
string const & childName )
override;
94 std::map< string, SortedArray< localIndex > >
const &
getNodeSets()
const override;
154 return this->
getGroup( viewKeyStruct::cellBlocks() ).getGroup<
CellBlock >( name );
162 {
return m_regionAttributesCellBlocks; }
203 template<
typename LAMBDA >
206 this->
getGroup( viewKeyStruct::cellBlocks() ).forSubGroups<
CellBlock >( lambda );
230 static constexpr
char const * cellBlocks()
231 {
return "cellBlocks"; }
234 static constexpr
char const * faceBlocks()
235 {
return "faceBlocks"; }
238 static constexpr
char const * lineBlocks()
239 {
return "lineBlocks"; }
248 Group & getLineBlocks();
268 void buildNodeToEdges();
273 void buildFaceMaps();
275 template<
typename BASEMAP,
typename FUNC >
276 void buildToCellMap(
localIndex const cellIndex,
277 ToCellRelation< BASEMAP > & toCells,
278 FUNC cellToObjectGetter,
281 array2d< real64, nodes::REFERENCE_POSITION_PERM > m_nodesPositions;
283 ArrayOfArrays< localIndex > m_nodeToEdges;
284 ArrayOfArrays< localIndex > m_edgeToFaces;
285 array2d< localIndex > m_edgeToNodes;
286 ArrayOfArrays< localIndex > m_faceToNodes;
287 ArrayOfArrays< localIndex > m_faceToEdges;
288 ToCellRelation< array2d< localIndex > > m_faceToCells;
290 array1d< globalIndex > m_nodeLocalToGlobal;
292 std::map< string, SortedArray< localIndex > > m_nodeSets;
294 std::map< integer, std::set< string > > m_regionAttributesCellBlocks;
Abstract base class for CellBlockManager.
The CellBlockManager class provides an interface to ObjectManagerBase in order to manage CellBlock da...
localIndex numFaces() const override
Total number of faces across all the cell blocks.
array2d< localIndex > getEdgeToNodes() const override
Returns the edge to nodes mapping.
void setGlobalOffset(real64 globalOffset)
Setter for the global offset.
CellBlock & registerCellBlock(string const &name)
Registers and returns a cell block of name name.
ArrayOfArrays< localIndex > getNodeToEdges() const override
Returns the node to edges mapping.
const Group & getCellBlocks() const override
Returns a group containing the cell blocks as CellBlockABC instances.
void setNumNodes(localIndex numNodes)
Defines the number of nodes and resizes some underlying arrays appropriately.
Group const & getFaceBlocks() const override
Returns a group containing the face blocks as FaceBlockABC instances.
ArrayOfArrays< localIndex > getEdgeToFaces() const override
Returns the edge to faces mapping.
real64 getGlobalOffset() const override
Getter for the global offset.
ArrayOfArrays< localIndex > getFaceToEdges() const override
Returns the face to edges mapping.
void setGlobalLength(real64 globalLength)
Setter for the global length.
array2d< real64, nodes::REFERENCE_POSITION_PERM > getNodePositions() const override
Returns the node coordinates in a (numNodes, 3) 2d array.
std::map< integer, std::set< string > > const & getRegionAttributesCellBlocks() const override
FaceBlock & registerFaceBlock(string const &name)
Registers and returns a face block of name name.
void forElementSubRegions(LAMBDA lambda)
Launch kernel function over all the sub-regions.
arrayView2d< real64, nodes::REFERENCE_POSITION_USD > getNodePositions()
Returns a view to the vector holding the nodes coordinates.
localIndex numEdges() const override
Total number of edges across all the cell blocks.
LineBlock & registerLineBlock(string const &name)
Registers and returns a line block of name name.
real64 getGlobalLength() const override
Getter for the global length.
ToCellRelation< array2d< localIndex > > getFaceToElements() const override
Returns the face to elements mapping.
std::map< string, SortedArray< localIndex > > & getNodeSets()
Returns a mutable reference to the node sets.
localIndex numNodes() const override
Total number of nodes across all the cell blocks.
ArrayOfArrays< localIndex > getNodeToFaces() const override
Returns the face to nodes mappings.
virtual Group * createChild(string const &childKey, string const &childName) override
Creates a new sub-Group using the ObjectCatalog functionality.
CellBlock & getCellBlock(string const &name)
Get cell block by name.
LineBlockABC const & getLineBlock(string name) const override
Returns LineBlockABC corresponding to the given identifier.
void resize(integer_array const &numElements, string_array const ®ionNames)
Set the number of elements for a set of element regions.
CellBlock & registerCellBlock(string const &cellBlockName, integer regionAttribute)
Registers and returns a cell block of name name.
Group & getCellBlocks() override
Returns a group containing the cell blocks as CellBlockABC instances.
ToCellRelation< ArrayOfArrays< localIndex > > getNodeToElements() const override
Returns the node to elements mapping.
static constexpr int maxNodesPerFace()
Maximum number of nodes allowed (in memory) per each face.
ArrayOfArrays< localIndex > getFaceToNodes() const override
Returns the face to nodes mapping.
void generateHighOrderMaps(localIndex const order, globalIndex const maxVertexGlobalID, globalIndex const maxEdgeGlobalID, globalIndex const maxFaceGlobalID, arrayView1d< globalIndex const > const edgeLocalToGlobal, arrayView1d< globalIndex const > const faceLocalToGlobal) override
Generates in place the high-order maps for this cell block manager.
array1d< globalIndex > getNodeLocalToGlobal() const override
The node to global mapping for nodes.
arrayView1d< globalIndex > getNodeLocalToGlobal()
Returns a view to the vector holding the node to global mapping.
std::map< string, SortedArray< localIndex > > const & getNodeSets() const override
Returns the node sets. Key of the map is the name of the set.
CellBlockManager(string const &name, Group *const parent)
Constructor for CellBlockManager object.
Group & getFaceBlocks() override
Returns a group containing the face blocks as FaceBlockABC instances.
void buildMaps()
Trigger the computation of all the mappings.
Simple implementation of the FaceBlockABC contract.
T & getGroup(KEY const &key)
Return a reference to a sub-group of the current Group.
Group()=delete
Deleted default constructor.
virtual void resize(localIndex const newSize)
Resize the group and all contained wrappers that resize with parent.
ArrayView< T, 1 > arrayView1d
Alias for 1D array view.
stdVector< string > string_array
A 1-dimensional array of geos::string types.
Array< T, 2, PERMUTATION > array2d
Alias for 2D array.
GEOS_GLOBALINDEX_TYPE globalIndex
Global index type (for indexing objects across MPI partitions).
array1d< integer > integer_array
A 1-dimensional array of geos::integer types.
double real64
64-bit floating point type.
GEOS_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
ArrayView< T, 2, USD > arrayView2d
Alias for 2D array view.
int integer
Signed integer type.
Array< T, 1 > array1d
Alias for 1D array.
LvArray::ArrayOfArrays< T, INDEX_TYPE, LvArray::ChaiBuffer > ArrayOfArrays
Array of variable-sized arrays. See LvArray::ArrayOfArrays for details.
Container for maps from a mesh object (node, edge or face) to cells.