GEOS
CellBlockManagerABC.hpp
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2024 Total, S.A
7  * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University
8  * Copyright (c) 2023-2024 Chevron
9  * Copyright (c) 2019- GEOS/GEOSX Contributors
10  * All rights reserved
11  *
12  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
13  * ------------------------------------------------------------------------------------------------------------
14  */
15 
16 #ifndef GEOS_CELLBLOCKMANAGERABC_HPP
17 #define GEOS_CELLBLOCKMANAGERABC_HPP
18 
19 #include "CellBlockUtilities.hpp"
20 #include "dataRepository/Group.hpp"
21 #include "LineBlockABC.hpp"
22 
23 #include <map>
24 
25 namespace geos
26 {
27 
32 {
33 public:
34 
40  CellBlockManagerABC( string const & name, Group * const parent ):
41  Group( name, parent )
42  {
43  // Left blank
44  }
45 
51  { return 8; }
52 
58  { return 8; }
59 
65  { return 8; }
66 
72  { return 4; }
73 
79  { return 4; }
80 
86  { return 4; }
87 
94  virtual Group & getCellBlocks() = 0;
95 
102  virtual Group & getFaceBlocks() = 0;
103 
110  virtual LineBlockABC const & getLineBlock( string name ) const = 0;
111 
116  virtual Group const & getCellBlocks() const = 0;
117 
122  virtual Group const & getFaceBlocks() const = 0;
123 
127  virtual std::map< integer, std::set< string > > const & getRegionAttributesCellBlocks() const = 0;
128 
135  virtual localIndex numNodes() const = 0;
136 
141  virtual localIndex numEdges() const = 0;
142 
147  virtual localIndex numFaces() const = 0;
148 
154 
160 
166 
177 
183 
189 
195 
203 
209 
214  virtual std::map< string, SortedArray< localIndex > > const & getNodeSets() const = 0;
215 
220  virtual real64 getGlobalLength() const = 0;
221 
231  virtual void generateHighOrderMaps( localIndex const order,
232  globalIndex const maxVertexGlobalID,
233  globalIndex const maxEdgeGlobalID, globalIndex const maxFaceGlobalID,
234  arrayView1d< globalIndex const > const edgeLocalToGlobal,
235  arrayView1d< globalIndex const > const faceLocalToGlobal ) = 0;
236 
237 };
238 
239 }
240 #endif // include guard
Abstract base class for CellBlockManager.
virtual ArrayOfArrays< localIndex > getNodeToEdges() const =0
Returns the node to edges mapping.
virtual LineBlockABC const & getLineBlock(string name) const =0
Returns LineBlockABC corresponding to the given identifier.
virtual localIndex numNodes() const =0
Total number of nodes across all the cell blocks.
virtual Group & getFaceBlocks()=0
Returns a group containing the face blocks as FaceBlockABC instances.
virtual array2d< localIndex > getEdgeToNodes() const =0
Returns the edge to nodes mapping.
static constexpr localIndex elemMapExtraSpacePerNode()
Extra space for node to elements mapping.
virtual ArrayOfArrays< localIndex > getFaceToNodes() const =0
Returns the face to nodes mapping.
virtual real64 getGlobalLength() const =0
Getter for the global length.
CellBlockManagerABC(string const &name, Group *const parent)
Constructor.
virtual ToCellRelation< ArrayOfArrays< localIndex > > getNodeToElements() const =0
Returns the node to elements mapping.
static constexpr localIndex edgeMapExtraSpacePerNode()
Extra space for node to edges mapping.
virtual ToCellRelation< array2d< localIndex > > getFaceToElements() const =0
Returns the face to elements mapping.
virtual Group const & getCellBlocks() const =0
Returns a group containing the cell blocks as CellBlockABC instances.
static constexpr localIndex edgeMapExtraSpacePerFace()
Extra space for extra faces.
virtual array1d< globalIndex > getNodeLocalToGlobal() const =0
The node to global mapping for nodes.
virtual ArrayOfArrays< localIndex > getFaceToEdges() const =0
Returns the face to edges mapping.
static constexpr localIndex nodeMapExtraSpacePerFace()
Extra space for extra nodes.
virtual Group & getCellBlocks()=0
Returns a group containing the cell blocks as CellBlockABC instances.
static constexpr localIndex faceMapExtraSpacePerNode()
Extra space for node to faces mapping.
virtual Group const & getFaceBlocks() const =0
Returns a group containing the face blocks as FaceBlockABC instances.
virtual ArrayOfArrays< localIndex > getNodeToFaces() const =0
Returns the face to nodes mappings.
virtual ArrayOfArrays< localIndex > getEdgeToFaces() const =0
Returns the edge to faces mapping.
virtual array2d< real64, nodes::REFERENCE_POSITION_PERM > getNodePositions() const =0
Returns the node coordinates in a (numNodes, 3) 2d array.
virtual std::map< integer, std::set< string > > const & getRegionAttributesCellBlocks() const =0
virtual localIndex numFaces() const =0
Total number of faces across all the cell blocks.
virtual localIndex numEdges() const =0
Total number of edges across all the cell blocks.
virtual std::map< string, SortedArray< localIndex > > const & getNodeSets() const =0
Returns the node sets. Key of the map is the name of the set.
static constexpr localIndex faceMapExtraSpacePerEdge()
Extra space for extra edges.
virtual void generateHighOrderMaps(localIndex const order, globalIndex const maxVertexGlobalID, globalIndex const maxEdgeGlobalID, globalIndex const maxFaceGlobalID, arrayView1d< globalIndex const > const edgeLocalToGlobal, arrayView1d< globalIndex const > const faceLocalToGlobal)=0
Generates in place the high-order maps for this cell block manager.
ArrayView< T, 1 > arrayView1d
Alias for 1D array view.
Definition: DataTypes.hpp:180
Array< T, 2, PERMUTATION > array2d
Alias for 2D array.
Definition: DataTypes.hpp:192
GEOS_GLOBALINDEX_TYPE globalIndex
Global index type (for indexing objects across MPI partitions).
Definition: DataTypes.hpp:88
double real64
64-bit floating point type.
Definition: DataTypes.hpp:99
GEOS_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
Definition: DataTypes.hpp:85
Array< T, 1 > array1d
Alias for 1D array.
Definition: DataTypes.hpp:176
LvArray::ArrayOfArrays< T, INDEX_TYPE, LvArray::ChaiBuffer > ArrayOfArrays
Array of variable-sized arrays. See LvArray::ArrayOfArrays for details.
Definition: DataTypes.hpp:282
Container for maps from a mesh object (node, edge or face) to cells.