GEOS
SurfaceElementSubRegion.hpp
Go to the documentation of this file.
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 
20 #ifndef GEOS_MESH_SURFACEELEMENTSUBREGION_HPP_
21 #define GEOS_MESH_SURFACEELEMENTSUBREGION_HPP_
22 
23 #include "ElementSubRegionBase.hpp"
24 #include "InterObjectRelation.hpp"
25 #include "ToElementRelation.hpp"
26 #include "EdgeManager.hpp"
27 #include "CellElementSubRegion.hpp"
28 
29 namespace geos
30 {
31 
39 {
40 public:
41 
44 
47 
52 
57  static string catalogName()
58  { return "SurfaceElementSubRegion"; }
59 
64  virtual string getCatalogName() const override
65  {
66  return catalogName();
67  }
68 
70 
75 
81  SurfaceElementSubRegion( string const & name,
82  dataRepository::Group * const parent );
83 
84 
86  virtual ~SurfaceElementSubRegion() override;
87 
93  {
95  }
96 
98 
104 
109  NodeMapType const & nodeList() const
110  {
111  return m_toNodesRelation;
112  }
113 
118  {
119  return m_toNodesRelation;
120  }
121 
128  localIndex & nodeList( localIndex const k, localIndex a ) { return m_toNodesRelation( k, a ); }
129 
133  localIndex const & nodeList( localIndex const k, localIndex a ) const { return m_toNodesRelation( k, a ); }
134 
139  EdgeMapType const & edgeList() const
140  {
141  return m_toEdgesRelation;
142  }
143 
148  {
149  return m_toEdgesRelation;
150  }
151 
153 
154  localIndex numNodesPerElement( localIndex const k ) const final
155  { return m_toNodesRelation[k].size(); }
156 
158 
159 
165 
171 
176 
182 
187 
193 
199 
206 
212 
218 
225 
231 
237 
244 
245 
247 
253  {
255  static constexpr char const * surfaceElementsToCellRegionsString() { return "fractureElementsToCellRegions"; }
256 
258  static constexpr char const * surfaceElementsToCellSubRegionsString() { return "fractureElementsToCellSubRegions"; }
259 
261  static constexpr char const * surfaceElementsToCellIndexString() { return "fractureElementsToCellIndices"; }
262 
264  constexpr static char const * surfaceElementToParentPlaneString() { return "surfaceElementToParentPlane"; }
265  };
266 
267 protected:
268 
271 
274 
277 
280 
283 
286 
289 
292 
293 };
294 
295 } /* namespace geos */
296 
297 #endif /* SRC_CORECOMPONENTS_MESH_SURFACEELEMENTSUBREGION_HPP_ */
localIndex const & numNodesPerElement() const
Get the number of nodes per element.
void calculateElementCenters(NODE_MAP const &toNodesRelation, arrayView2d< real64 const, nodes::REFERENCE_POSITION_USD > const &X) const
Compute the center of each element in the subregion.
void calculateElementCenters(arrayView2d< real64 const, nodes::REFERENCE_POSITION_USD > const &X) const
Compute the center of each element in the subregion.
arrayView2d< real64 const > getNormalVector() const
Const accessor to the normal vectors.
arrayView1d< real64 > getElementArea()
Get face element surface area.
EdgeMapType const & edgeList() const
Get the surface element to edges map.
array1d< real64 > m_elementAperture
Member level field for the element center.
NodeMapType m_toNodesRelation
list of nodes
map< localIndex, array1d< globalIndex > > m_unmappedGlobalIndicesInToNodes
Unmapped surface elements to nodes map.
arrayView1d< real64 const > getElementAperture() const
Get face element aperture.
arrayView2d< real64 const > getTangentVector2() const
Get an array of the second tangent vector of the surface elements.
SurfaceElementSubRegion(string const &name, dataRepository::Group *const parent)
Constructor.
static string catalogName()
Get catalog name.
localIndex numNodesPerElement(localIndex const k) const final
Get the number of nodes per element.
arrayView2d< real64 const > getTangentVector1() const
Get an array of the first tangent vector of the surface elements.
virtual ~SurfaceElementSubRegion() override
Destructor.
localIndex const & nodeList(localIndex const k, localIndex a) const
Get the local index of the a-th node of the k-th element.
array1d< real64 > m_elementArea
Member level field for the element center.
arrayView2d< real64 > getNormalVector()
Non const accessor to the normal vectors.
arrayView1d< real64 > getElementAperture()
Get face element aperture.
arrayView1d< real64 const > getElementArea() const
Get face element surface area.
arrayView2d< real64 > getTangentVector1()
Get an array of the first tangent vector of the surface elements.
localIndex & nodeList(localIndex const k, localIndex a)
Get the local index of the a-th node of the k-th element.
array2d< real64 > m_tangentVector1
Unit vector indicating the first tangential direction.
array2d< real64 > m_tangentVector2
Unit vector indicating the second tangential direction.
EdgeMapType & edgeList()
Get the surface element to edges map.
arraySlice1d< real64 const > getNormalVector(localIndex k) const
Get normal vector of a specific surface element.
EdgeMapType m_toEdgesRelation
list of edges
NodeMapType & nodeList()
Get the face element to nodes map.
arraySlice1d< real64 const > getTangentVector1(localIndex const k) const
Get the first tangent vector of a specific surface element.
virtual string getCatalogName() const override
Get catalog name.
NodeMapType const & nodeList() const
Get the face element to nodes map.
arrayView2d< real64 > getTangentVector2()
Get an array of the first tangent vector of the surface elements.
array2d< real64 > m_normalVector
Normal vector to the surface element.
arraySlice1d< real64 const > getTangentVector2(localIndex const k) const
Get the second tangent vector of a specific surface element.
Base template for ordered and unordered maps.
Definition: DataTypes.hpp:329
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_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
Definition: DataTypes.hpp:85
ArraySlice< T, 1, USD > arraySlice1d
Alias for 1D array slice.
Definition: DataTypes.hpp:184
ArrayView< T, 2, USD > arrayView2d
Alias for 2D array view.
Definition: DataTypes.hpp:196
Array< T, 1 > array1d
Alias for 1D array.
Definition: DataTypes.hpp:176
A struct to serve as a container for variable strings and keys.
Struct containing the keys to all surface element views.
static constexpr char const * surfaceElementsToCellSubRegionsString()
static constexpr char const * surfaceElementsToCellIndexString()
static constexpr char const * surfaceElementsToCellRegionsString()
constexpr static char const * surfaceElementToParentPlaneString()