19 #ifndef GEOS_MESH_CELLBLOCKMANAGER_H_
20 #define GEOS_MESH_CELLBLOCKMANAGER_H_
22 #include "mesh/generators/CellBlock.hpp"
23 #include "mesh/generators/FaceBlock.hpp"
24 #include "mesh/generators/InternalWellGenerator.hpp"
25 #include "mesh/generators/LineBlock.hpp"
26 #include "mesh/generators/LineBlockABC.hpp"
27 #include "mesh/generators/CellBlockManagerABC.hpp"
48 virtual Group *
createChild(
string const & childKey,
string const & childName )
override;
93 std::map< string, SortedArray< localIndex > >
const &
getNodeSets()
const override;
153 return this->
getGroup( viewKeyStruct::cellBlocks() ).getGroup<
CellBlock >( name );
191 template<
typename LAMBDA >
194 this->
getGroup( viewKeyStruct::cellBlocks() ).forSubGroups<
CellBlock >( lambda );
210 static constexpr
char const * cellBlocks()
211 {
return "cellBlocks"; }
214 static constexpr
char const * faceBlocks()
215 {
return "faceBlocks"; }
218 static constexpr
char const * lineBlocks()
219 {
return "lineBlocks"; }
228 Group & getLineBlocks();
248 void buildNodeToEdges();
253 void buildFaceMaps();
255 template<
typename BASEMAP,
typename FUNC >
256 void buildToCellMap(
localIndex const cellIndex,
257 ToCellRelation< BASEMAP > & toCells,
258 FUNC cellToObjectGetter,
261 array2d< real64, nodes::REFERENCE_POSITION_PERM > m_nodesPositions;
263 ArrayOfArrays< localIndex > m_nodeToEdges;
264 ArrayOfArrays< localIndex > m_edgeToFaces;
265 array2d< localIndex > m_edgeToNodes;
266 ArrayOfArrays< localIndex > m_faceToNodes;
267 ArrayOfArrays< localIndex > m_faceToEdges;
268 ToCellRelation< array2d< localIndex > > m_faceToCells;
270 array1d< globalIndex > m_nodeLocalToGlobal;
272 std::map< string, SortedArray< localIndex > > m_nodeSets;
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.
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.
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.
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.
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.
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.
double real64
64-bit floating point type.
GEOSX_GLOBALINDEX_TYPE globalIndex
Global index type (for indexing objects across MPI partitions).
ArrayView< T, 2, USD > arrayView2d
Alias for 2D array view.
GEOSX_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
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.