GEOS
EmbeddedSurfaceSubRegion.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_EMBEDDEDSURFACESUBREGION_HPP_
21 #define GEOS_MESH_EMBEDDEDSURFACESUBREGION_HPP_
22 
24 #include "InterObjectRelation.hpp"
25 #include "ToElementRelation.hpp"
26 #include "EdgeManager.hpp"
28 #include "CellElementSubRegion.hpp"
29 //Do we really need this include Rectangle?
31 
32 namespace geos
33 {
34 
40 {
44  std::vector< globalIndex > parentEdgeIndex;
47 
52  surfaceIndex(),
54  numOfNodes( 0 ){}
59  void insert ( globalIndex const & edgeIndex );
60 };
61 
69 {
70 public:
71 
74 
79 
84  static string catalogName()
85  { return "EmbeddedSurfaceSubRegion"; }
86 
91  virtual string getCatalogName() const override
92  {
93  return catalogName();
94  }
95 
97 
102 
108  EmbeddedSurfaceSubRegion( string const & name,
109  dataRepository::Group * const parent );
110 
112 
117 
118  virtual void calculateElementGeometricQuantities( NodeManager const & nodeManager,
119  FaceManager const & facemanager ) override final;
120 
127  localIndex k );
140  bool addNewEmbeddedSurface( localIndex const cellIndex,
141  localIndex const regionIndex,
142  localIndex const subRegionIndex,
143  NodeManager const & nodeManager,
144  EmbeddedSurfaceNodeManager & embSurfNodeManager,
145  EdgeManager const & edgeManager,
146  FixedOneToManyRelation const & cellToEdges,
147  PlanarGeometricObject const * fracture );
148 
153  void inheritGhostRank( array1d< array1d< arrayView1d< integer const > > > const & cellGhostRank );
154 
162  localIndex const k ) const;
163 
164  virtual localIndex packUpDownMapsSize( arrayView1d< localIndex const > const & packList ) const override;
165 
167  arrayView1d< localIndex const > const & packList ) const override;
168 
169  virtual localIndex unpackUpDownMaps( buffer_unit_type const * & buffer,
170  array1d< localIndex > & packList,
171  bool const overwriteUpMaps,
172  bool const overwriteDownMaps ) override;
173 
175 
181  {
183  static constexpr char const * connectivityIndexString() { return "connectivityIndex"; }
184 
186  static constexpr char const * surfaceWithGhostNodesString() { return "surfaceWithGhostNodes"; }
187  }
190 
191  virtual void setupRelatedObjectsInRelations( MeshLevel const & mesh ) override;
192 
198 
203  localIndex & numOfJumpEnrichments() {return m_numOfJumpEnrichments;}
204 
209  localIndex const & numOfJumpEnrichments() const {return m_numOfJumpEnrichments;}
210 
216  string const & getFractureName( localIndex k ) const { return m_parentPlaneName[k]; }
217 
222  arrayView1d< real64 > getConnectivityIndex() { return m_connectivityIndex.toView();}
223 
227  arrayView1d< real64 const > getConnectivityIndex() const { return m_connectivityIndex;}
228 
233  std::vector< struct surfaceWithGhostNodes > surfaceWithGhostNodes() { return m_surfaceWithGhostNodes; }
234 
240  {
241  return m_2dElemToElems;
242  }
243 
248  {
249  return m_2dElemToElems;
250  }
251 
253 
254 private:
255 
263  template< bool DO_PACKING >
264  localIndex packUpDownMapsImpl( buffer_unit_type * & buffer,
265  arrayView1d< localIndex const > const & packList ) const;
266 
268  localIndex m_numOfJumpEnrichments;
269 
271  array1d< real64 > m_connectivityIndex;
272 
273  // Indices of geometric objects the element belongs to
274  array1d< string > m_parentPlaneName;
275 
277  std::vector< struct surfaceWithGhostNodes > m_surfaceWithGhostNodes;
278 
280  OrderedVariableToManyElementRelation m_2dElemToElems;
281 
282 };
283 
284 
285 } /* namespace geos */
286 
287 #endif /* GEOS_MESH_EMBEDDEDSURFACESUBREGION_HPP_ */
This class provides an interface to ObjectManagerBase in order to manage edge data.
Definition: EdgeManager.hpp:43
The EmbeddedSurfaceNodeManager class provides an interface to ObjectManagerBase in order to manage no...
OrderedVariableToManyElementRelation const & getToCellRelation() const
Get the surface element to cells map.
virtual localIndex packUpDownMaps(buffer_unit_type *&buffer, arrayView1d< localIndex const > const &packList) const override
Packs the specific elements in the @ packList.
OrderedVariableToManyElementRelation & getToCellRelation()
Get the surface element to cells map.
virtual void setupRelatedObjectsInRelations(MeshLevel const &mesh) override
Link the connectivity maps of the subregion to the managers storing the mesh information.
virtual void calculateElementGeometricQuantities(NodeManager const &nodeManager, FaceManager const &facemanager) override final
Calculate the geometric quantities for each element in the subregion.
virtual localIndex packUpDownMapsSize(arrayView1d< localIndex const > const &packList) const override
Computes the pack size of the specific elements in the @ packList.
real64 computeHeavisideFunction(ArraySlice< real64 const, 1, nodes::REFERENCE_POSITION_USD - 1 > const nodeCoord, localIndex const k) const
Given the coordinates of a node, it computes the Heaviside function iside a cut element with respect ...
std::vector< struct surfaceWithGhostNodes > surfaceWithGhostNodes()
accessor to the m_surfaceWithGhostNodes list
void inheritGhostRank(array1d< array1d< arrayView1d< integer const > > > const &cellGhostRank)
inherit ghost rank from cell elements.
arrayView1d< real64 > getConnectivityIndex()
Get the connectivity index of the embedded surface element.
virtual string getCatalogName() const override
Get catalog name.
arrayView1d< real64 const > getConnectivityIndex() const
Get the connectivity index of the embedded surface element.
localIndex & numOfJumpEnrichments()
Get number of jump enrichments.
geos::EmbeddedSurfaceSubRegion::viewKeyStruct viewKeys
viewKey struct for the EmbeddedSurfaceSubRegion class
virtual localIndex unpackUpDownMaps(buffer_unit_type const *&buffer, array1d< localIndex > &packList, bool const overwriteUpMaps, bool const overwriteDownMaps) override
Unpacks the specific elements in the @ packList.
void calculateElementGeometricQuantities(arrayView2d< real64 const > const intersectionPoints, localIndex k)
Function to compute the geometric quantities of a specific embedded surface element.
string const & getFractureName(localIndex k) const
Get the name of the bounding plate that was used to generate fracture element k.
localIndex const & numOfJumpEnrichments() const
Get number of jump enrichments.
EmbeddedSurfaceSubRegion(string const &name, dataRepository::Group *const parent)
Constructor.
bool addNewEmbeddedSurface(localIndex const cellIndex, localIndex const regionIndex, localIndex const subRegionIndex, NodeManager const &nodeManager, EmbeddedSurfaceNodeManager &embSurfNodeManager, EdgeManager const &edgeManager, FixedOneToManyRelation const &cellToEdges, PlanarGeometricObject const *fracture)
Function to add a new embedded surface element.
static string catalogName()
Get catalog name.
The FaceManager class provides an interface to ObjectManagerBase in order to manage face data.
Definition: FaceManager.hpp:44
Class facilitating the representation of a multi-level discretization of a MeshBody.
Definition: MeshLevel.hpp:42
The NodeManager class provides an interface to ObjectManagerBase in order to manage node data.
Definition: NodeManager.hpp:46
Abstract class to implement functions used by all bounded geometric objects in GEOSX,...
ArrayView< T, 1 > arrayView1d
Alias for 1D array view.
Definition: DataTypes.hpp:180
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
InterObjectRelation< array2d< localIndex > > FixedOneToManyRelation
A relationship from single objects to many other objects, where each object is related to the same nu...
LvArray::ArraySlice< T, NDIM, USD, localIndex > ArraySlice
Multidimensional array slice type. See LvArray:ArraySlice for details.
Definition: DataTypes.hpp:152
signed char buffer_unit_type
Type stored in communication buffers.
Definition: DataTypes.hpp:109
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
Struct containing the keys to all embedded surface element views.
static constexpr char const * surfaceWithGhostNodesString()
Struct containing the keys to all surface element views.
Struct defining an embedded element which has at least on node which is a ghost on this rank.
localIndex numOfNodes
number of nodes of the element
std::vector< globalIndex > parentEdgeIndex
index of the parent edge of each node
void insert(globalIndex const &edgeIndex)
insert a new node
localIndex surfaceIndex
local index of the surface element