GEOSX
SurfaceElementSubRegion.hpp
Go to the documentation of this file.
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) 2019- GEOSX Contributors
9  * All rights reserved
10  *
11  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
12  * ------------------------------------------------------------------------------------------------------------
13  */
14 
19 #ifndef GEOS_MESH_SURFACEELEMENTSUBREGION_HPP_
20 #define GEOS_MESH_SURFACEELEMENTSUBREGION_HPP_
21 
22 #include "ElementSubRegionBase.hpp"
23 #include "InterObjectRelation.hpp"
24 #include "ToElementRelation.hpp"
25 #include "EdgeManager.hpp"
26 #include "CellElementSubRegion.hpp"
27 
28 namespace geos
29 {
30 
38 {
39 public:
40 
43 
46 
51 
56  static string catalogName()
57  { return "SurfaceElementSubRegion"; }
58 
63  virtual string getCatalogName() const override
64  {
65  return catalogName();
66  }
67 
69 
74 
80  SurfaceElementSubRegion( string const & name,
81  dataRepository::Group * const parent );
82 
83 
85  virtual ~SurfaceElementSubRegion() override;
86 
92  {
94  }
95 
97 
103 
108  NodeMapType const & nodeList() const
109  {
110  return m_toNodesRelation;
111  }
112 
117  {
118  return m_toNodesRelation;
119  }
120 
127  localIndex & nodeList( localIndex const k, localIndex a ) { return m_toNodesRelation( k, a ); }
128 
132  localIndex const & nodeList( localIndex const k, localIndex a ) const { return m_toNodesRelation( k, a ); }
133 
138  EdgeMapType const & edgeList() const
139  {
140  return m_toEdgesRelation;
141  }
142 
147  {
148  return m_toEdgesRelation;
149  }
150 
152 
153  localIndex numNodesPerElement( localIndex const k ) const final
154  { return m_toNodesRelation[k].size(); }
155 
161  {
162  return m_2dElemToElems;
163  }
164 
169  {
170  return m_2dElemToElems;
171  }
172 
174 
175 
181 
187 
192 
198 
203 
209 
215 
222 
228 
234 
241 
247 
253 
260 
261 
263 
269  {
271  static constexpr char const * surfaceElementsToCellRegionsString() { return "fractureElementsToCellRegions"; }
272 
274  static constexpr char const * surfaceElementsToCellSubRegionsString() { return "fractureElementsToCellSubRegions"; }
275 
277  static constexpr char const * surfaceElementsToCellIndexString() { return "fractureElementsToCellIndices"; }
278 
280  constexpr static char const * creationMassString() { return "creationMass"; }
281 
283  constexpr static char const * surfaceElementToParentPlaneString() { return "surfaceElementToParentPlane"; }
284  };
285 
286 protected:
287 
290 
293 
296 
299 
302 
305 
308 
311 
314 
315 };
316 
317 } /* namespace geos */
318 
319 #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.
OrderedVariableToManyElementRelation m_2dElemToElems
Map between the surface elements and the cells.
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.
OrderedVariableToManyElementRelation & getToCellRelation()
Get the surface element to cells map.
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.
OrderedVariableToManyElementRelation const & getToCellRelation() const
Get the surface element to cells map.
Base template for ordered and unordered maps.
Definition: DataTypes.hpp:369
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
ArraySlice< T, 1, USD > arraySlice1d
Alias for 1D array slice.
Definition: DataTypes.hpp:224
ArrayView< T, 2, USD > arrayView2d
Alias for 2D array view.
Definition: DataTypes.hpp:236
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
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()