GEOSX
CellBlockManagerABC.hpp
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2018-2020 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University
7  * Copyright (c) 2018-2020 TotalEnergies
8  * Copyright (c) 2020- GEOSX Contributors
9  * All rights reserved
10  *
11  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
12  * ------------------------------------------------------------------------------------------------------------
13  */
14 
15 #ifndef GEOS_CELLBLOCKMANAGERABC_HPP
16 #define GEOS_CELLBLOCKMANAGERABC_HPP
17 
18 #include "CellBlockUtilities.hpp"
19 #include "dataRepository/Group.hpp"
20 #include "LineBlockABC.hpp"
21 
22 #include <map>
23 
24 namespace geos
25 {
26 
31 {
32 public:
33 
39  CellBlockManagerABC( string const & name, Group * const parent ):
40  Group( name, parent )
41  {
42  // Left blank
43  }
44 
50  { return 8; }
51 
57  { return 8; }
58 
64  { return 8; }
65 
71  { return 4; }
72 
78  { return 4; }
79 
85  { return 4; }
86 
93  virtual Group & getCellBlocks() = 0;
94 
101  virtual Group & getFaceBlocks() = 0;
102 
109  virtual LineBlockABC const & getLineBlock( string name ) const = 0;
110 
115  virtual const Group & getCellBlocks() const = 0;
116 
121  virtual const Group & getFaceBlocks() const = 0;
122 
129  virtual localIndex numNodes() const = 0;
130 
135  virtual localIndex numEdges() const = 0;
136 
141  virtual localIndex numFaces() const = 0;
142 
148 
154 
160 
171 
177 
183 
189 
197 
203 
208  virtual std::map< string, SortedArray< localIndex > > const & getNodeSets() const = 0;
209 
214  virtual real64 getGlobalLength() const = 0;
215 
225  virtual void generateHighOrderMaps( localIndex const order,
226  globalIndex const maxVertexGlobalID,
227  globalIndex const maxEdgeGlobalID, globalIndex const maxFaceGlobalID,
228  arrayView1d< globalIndex const > const edgeLocalToGlobal,
229  arrayView1d< globalIndex const > const faceLocalToGlobal ) = 0;
230 
231 };
232 
233 }
234 #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 const Group & getFaceBlocks() const =0
Returns a group containing the face blocks as FaceBlockABC instances.
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 const Group & 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 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 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:220
Array< T, 2, PERMUTATION > array2d
Alias for 2D array.
Definition: DataTypes.hpp:232
double real64
64-bit floating point type.
Definition: DataTypes.hpp:139
GEOSX_GLOBALINDEX_TYPE globalIndex
Global index type (for indexing objects across MPI partitions).
Definition: DataTypes.hpp:128
GEOSX_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
Definition: DataTypes.hpp:125
Array< T, 1 > array1d
Alias for 1D array.
Definition: DataTypes.hpp:216
LvArray::ArrayOfArrays< T, INDEX_TYPE, LvArray::ChaiBuffer > ArrayOfArrays
Array of variable-sized arrays. See LvArray::ArrayOfArrays for details.
Definition: DataTypes.hpp:322
Container for maps from a mesh object (node, edge or face) to cells.