GEOS
SurfaceElementRegion.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 
21 #ifndef GEOS_MESH_SURFACEELEMENTREGION_HPP_
22 #define GEOS_MESH_SURFACEELEMENTREGION_HPP_
23 
24 #include "ElementRegionBase.hpp"
26 
27 namespace geos
28 {
29 
30 
31 class EdgeManager;
32 
41 {
42 public:
43 
50  {
51  faceElement,
52  embeddedElement
53  };
54 
59 
65  SurfaceElementRegion( string const & name, Group * const parent );
66 
71 
75  virtual ~SurfaceElementRegion() override;
76 
78 
83 
88  static string catalogName()
89  { return "SurfaceElementRegion"; }
90 
91  virtual string getCatalogName() const override final
92  { return catalogName(); }
93 
95 
96 
101 
102  virtual void generateMesh( Group const & faceBlocks ) override;
103 
110  localIndex addToSurfaceMesh( FaceManager const * const faceManager,
111  localIndex const faceIndices[2] );
112 
122  FaceManager const * const faceManager,
123  ArrayOfArraysView< localIndex const > const & originalFaceToEdges,
124  localIndex const faceIndices[2] );
125 
130  void updateSets( FaceManager const & faceManager );
131 
133 
134 
139 
144  real64 getDefaultAperture() const { return m_defaultAperture; }
145 
150  SurfaceSubRegionType subRegionType() const { return m_subRegionType; }
151 
158  template< typename SUBREGION_TYPE >
159  SUBREGION_TYPE & getUniqueSubRegion()
160  {
161  return getSubRegion< SUBREGION_TYPE >( getUniqueSubRegionName< SUBREGION_TYPE >() );
162  }
163 
170  template< typename SUBREGION_TYPE >
171  SUBREGION_TYPE const & getUniqueSubRegion() const
172  {
173  return getSubRegion< SUBREGION_TYPE >( getUniqueSubRegionName< SUBREGION_TYPE >() );
174  }
175 
177 
183  {
185  static constexpr char const * subRegionTypeString() { return "subRegionType"; }
186 
188  static constexpr char const * fractureSetString() { return "fractureSet"; }
189 
191  static constexpr char const * defaultApertureString() { return "defaultAperture"; }
192 
194  static constexpr char const * ruptureTimeString() { return "ruptureTime"; }
195 
197  static constexpr char const * faceBlockString() { return "faceBlock"; }
198  };
199 
200 protected:
201  virtual void initializePreSubGroups() override;
202 
203 private:
204 
211  template< typename SUBREGION_TYPE >
212  string getUniqueSubRegionName() const
213  {
214  stdVector< string > subRegionNames;
215  forElementSubRegions< SUBREGION_TYPE >( [&]( SUBREGION_TYPE const & sr )
216  {
217  subRegionNames.push_back( sr.getName() );
218  } );
219  GEOS_ERROR_IF( subRegionNames.size() != 1,
220  GEOS_FMT( "Surface region should have one unique sub region ({} found).", subRegionNames.size() ),
221  getDataContext() );
222  return subRegionNames.front();
223  }
224 
225  SurfaceSubRegionType m_subRegionType;
226 
227  real64 m_defaultAperture;
228 
234  string m_faceBlockName;
235 };
236 
239  "faceElement",
240  "embeddedElement" );
241 
242 } /* namespace geos */
243 
244 #endif /* CORECOMPONENTS_MESH_SurfaceElementRegion_HPP_ */
#define GEOS_ERROR_IF(COND,...)
Conditionally raise a hard error and terminate the program.
Definition: Logger.hpp:217
The ElementRegionBase is the base class to manage the data stored at the element level.
The FaceManager class provides an interface to ObjectManagerBase in order to manage face data.
Definition: FaceManager.hpp:44
SUBREGION_TYPE const & getUniqueSubRegion() const
Returns the unique sub-region of type SUBREGION_TYPE for the current SurfaceElementRegion.
localIndex addToFractureMesh(real64 const time_np1, FaceManager const *const faceManager, ArrayOfArraysView< localIndex const > const &originalFaceToEdges, localIndex const faceIndices[2])
This function generates and adds entries to the face/fracture mesh.
virtual ~SurfaceElementRegion() override
Default destructor.
localIndex addToSurfaceMesh(FaceManager const *const faceManager, localIndex const faceIndices[2])
This function generates and adds entries to the face/surface mesh.
SurfaceElementRegion()=delete
Deleted default constructor.
SUBREGION_TYPE & getUniqueSubRegion()
Returns the unique sub-region of type SUBREGION_TYPE for the current SurfaceElementRegion.
real64 getDefaultAperture() const
Get default aperture value.
SurfaceElementRegion(string const &name, Group *const parent)
Constructor.
virtual string getCatalogName() const override final
Get the name of the catalog.
void updateSets(FaceManager const &faceManager)
This function updates the face/surface mesh entries for the faces that are part of the surface region...
SurfaceSubRegionType subRegionType() const
Get subRegion type.
static string catalogName()
Get the key name for the SurfaceElementRegion in the object catalog.
virtual void initializePreSubGroups() override
Called by Initialize() prior to initializing sub-Groups.
virtual void generateMesh(Group const &faceBlocks) override
Generate mesh.
DataContext const & getDataContext() const
Definition: Group.hpp:1343
LvArray::ArrayOfArraysView< T, INDEX_TYPE const, CONST_SIZES, LvArray::ChaiBuffer > ArrayOfArraysView
View of array of variable-sized arrays. See LvArray::ArrayOfArraysView for details.
Definition: DataTypes.hpp:285
double real64
64-bit floating point type.
Definition: DataTypes.hpp:98
GEOS_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
Definition: DataTypes.hpp:84
int integer
Signed integer type.
Definition: DataTypes.hpp:81
ENUM_STRINGS(LinearSolverParameters::SolverType, "direct", "cg", "gmres", "fgmres", "bicgstab", "richardson", "preconditioner")
Declare strings associated with enumeration values.
internal::StdVectorWrapper< T, Allocator, USE_STD_CONTAINER_BOUNDS_CHECKING > stdVector
Struct to serve as a container for variable strings and keys.
A struct to serve as a container for variable strings and keys.
static constexpr char const * defaultApertureString()
static constexpr char const * fractureSetString()
static constexpr char const * ruptureTimeString()
static constexpr char const * subRegionTypeString()
static constexpr char const * faceBlockString()