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 
127 
128 
133 
138  real64 getDefaultAperture() const { return m_defaultAperture; }
139 
144  SurfaceSubRegionType subRegionType() const { return m_subRegionType; }
145 
152  template< typename SUBREGION_TYPE >
153  SUBREGION_TYPE & getUniqueSubRegion()
154  {
155  return getSubRegion< SUBREGION_TYPE >( getUniqueSubRegionName< SUBREGION_TYPE >() );
156  }
157 
164  template< typename SUBREGION_TYPE >
165  SUBREGION_TYPE const & getUniqueSubRegion() const
166  {
167  return getSubRegion< SUBREGION_TYPE >( getUniqueSubRegionName< SUBREGION_TYPE >() );
168  }
169 
171 
177  {
179  static constexpr char const * subRegionTypeString() { return "subRegionType"; }
180 
182  static constexpr char const * fractureSetString() { return "fractureSet"; }
183 
185  static constexpr char const * defaultApertureString() { return "defaultAperture"; }
186 
188  static constexpr char const * ruptureTimeString() { return "ruptureTime"; }
189 
191  static constexpr char const * faceBlockString() { return "faceBlock"; }
192  };
193 
194 protected:
195  virtual void initializePreSubGroups() override;
196 
197 private:
198 
205  template< typename SUBREGION_TYPE >
206  string getUniqueSubRegionName() const
207  {
208  stdVector< string > subRegionNames;
209  forElementSubRegions< SUBREGION_TYPE >( [&]( SUBREGION_TYPE const & sr )
210  {
211  subRegionNames.push_back( sr.getName() );
212  } );
213  GEOS_ERROR_IF( subRegionNames.size() != 1,
214  "Surface region \"" << getDataContext() <<
215  "\" should have one unique sub region (" << subRegionNames.size() << " found)." );
216  return subRegionNames.front();
217  }
218 
219  SurfaceSubRegionType m_subRegionType;
220 
221  real64 m_defaultAperture;
222 
228  string m_faceBlockName;
229 };
230 
233  "faceElement",
234  "embeddedElement" );
235 
236 } /* namespace geos */
237 
238 #endif /* CORECOMPONENTS_MESH_SurfaceElementRegion_HPP_ */
#define GEOS_ERROR_IF(EXP, msg)
Conditionally raise a hard error and terminate the program.
Definition: Logger.hpp:142
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.
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:1345
ENUM_STRINGS(LinearSolverParameters::SolverType, "direct", "cg", "gmres", "fgmres", "bicgstab", "preconditioner")
Declare strings associated with enumeration values.
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:294
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
std::int32_t integer
Signed integer type.
Definition: DataTypes.hpp:81
std::vector< T, Allocator > 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()