GEOS
FaceBlock.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 TotalEnergies
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_FACEBLOCK_HPP
17 #define GEOS_FACEBLOCK_HPP
18 
19 #include "FaceBlockABC.hpp"
20 
21 namespace geos
22 {
23 
29 class FaceBlock : public FaceBlockABC
30 {
31 public:
37  FaceBlock( string const & name,
38  Group * const parent )
39  :
40  FaceBlockABC( name, parent )
41  { }
42 
43  localIndex num2dElements() const override;
44 
45  localIndex num2dFaces() const override;
46 
48 
50 
52 
54 
56 
58 
60 
62 
67  void setNum2dElements( localIndex num2DElements );
68 
73  void setNum2dFaces( localIndex num2DFaces );
74 
79  void set2dElemToNodes( ArrayOfArrays< localIndex > && _2dElemToNodes );
80 
85  void set2dElemToEdges( ArrayOfArrays< localIndex > && _2dElemToEdges );
86 
91  void set2dElemToFaces( ArrayOfArrays< localIndex > && _2dElemToFaces );
92 
97  void set2dFaceTo2dElems( ArrayOfArrays< localIndex > && _2dFaceTo2dElems );
98 
103  void set2dFaceToEdge( array1d< localIndex > && _2dFaceToEdge );
104 
110 
116 
122 
123 private:
124 
125  localIndex m_num2dElements;
126  localIndex m_num2dFaces;
127 
128  ArrayOfArrays< localIndex > m_2dElemToNodes;
129  ArrayOfArrays< localIndex > m_2dElemToEdges;
130  ArrayOfArrays< localIndex > m_2dElemToFaces;
132  ArrayOfArrays< array1d< globalIndex > > m_2dElemsToCollocatedNodesBuckets;
133 
134  ArrayOfArrays< localIndex > m_2dFaceTo2dElems;
135  array1d< localIndex > m_2dFaceToEdge;
136 
137  array1d< globalIndex > m_localToGlobalMap;
138 };
139 
140 
141 }
142 
143 #endif // include guard
Block of 2d elements (geometrical surfaces in 3d).
Simple implementation of the FaceBlockABC contract.
Definition: FaceBlock.hpp:30
void set2dFaceTo2dElems(ArrayOfArrays< localIndex > &&_2dFaceTo2dElems)
Defines the 2d faces to elements mapping.
FaceBlock(string const &name, Group *const parent)
Constructor.
Definition: FaceBlock.hpp:37
array1d< localIndex > get2dFaceToEdge() const override
Get one 3d edge equivalent for each 2d faces (geometrical edges in 3d).
ArrayOfArrays< array1d< globalIndex > > get2dElemsToCollocatedNodesBuckets() const override
Returns the collocated nodes for each node of each 2d element of the FaceBlockABC.
array1d< globalIndex > localToGlobalMap() const override
Get local to global map for the 2d elements.
void set2dElemToNodes(ArrayOfArrays< localIndex > &&_2dElemToNodes)
Defines the 2d elements to nodes mapping.
void set2dElemToElems(ToCellRelation< ArrayOfArrays< localIndex > > &&_2dElemToElems)
Defines the 2d elements to 3d elements mapping.
void setNum2dFaces(localIndex num2DFaces)
Defines the number of 2d faces.
localIndex num2dFaces() const override
Get the number of 2d faces (geometrical segments in 3d).
ArrayOfArrays< localIndex > get2dElemToEdges() const override
Get the 3d edges of each 2d element (geometrical surfaces in 3d).
void setNum2dElements(localIndex num2DElements)
Defines the number of 2d elements.
void set2dFaceToEdge(array1d< localIndex > &&_2dFaceToEdge)
Defines the 2d faces to edges mapping.
void set2dElemToFaces(ArrayOfArrays< localIndex > &&_2dElemToFaces)
Defines the 2d elements to faces mapping.
ArrayOfArrays< localIndex > get2dElemToNodes() const override
Get the nodes of each 2d element (geometrical surfaces in 3d).
void set2dElemsToCollocatedNodesBuckets(ArrayOfArrays< array1d< globalIndex > > &&collocatedNodesBuckets)
Defines the collocated nodes bucket.
ArrayOfArrays< localIndex > get2dFaceTo2dElems() const override
Get the 2d element(s) (geometrical surfaces in 3d) connected to each 2d face (geometrical 3d segment)...
ArrayOfArrays< localIndex > get2dElemToFaces() const override
Get the 3d faces (of the volumic mesh) that are aside each 2d element (geometrical surfaces in 3d) of...
ToCellRelation< ArrayOfArrays< localIndex > > get2dElemToElems() const override
Get the 3d elements that are aside each 2d element (geometrical surfaces in 3d) of the FaceBlockABC.
void setLocalToGlobalMap(array1d< globalIndex > &&l2g)
void set2dElemToEdges(ArrayOfArrays< localIndex > &&_2dElemToEdges)
Defines the 2d elements to edges mapping.
localIndex num2dElements() const override
Get the number of 2d elements (geometrical surfaces in 3d).
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.