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 Total, S.A
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 
113  FaceManager const * const faceManager,
114  ArrayOfArraysView< localIndex const > const & originalFaceToEdges,
115  localIndex const faceIndices[2] );
116 
118 
119 
124 
129  real64 getDefaultAperture() const { return m_defaultAperture; }
130 
135  SurfaceSubRegionType subRegionType() const { return m_subRegionType; }
136 
143  template< typename SUBREGION_TYPE >
144  SUBREGION_TYPE & getUniqueSubRegion()
145  {
146  return getSubRegion< SUBREGION_TYPE >( getUniqueSubRegionName< SUBREGION_TYPE >() );
147  }
148 
155  template< typename SUBREGION_TYPE >
156  SUBREGION_TYPE const & getUniqueSubRegion() const
157  {
158  return getSubRegion< SUBREGION_TYPE >( getUniqueSubRegionName< SUBREGION_TYPE >() );
159  }
160 
162 
168  {
170  static constexpr char const * subRegionTypeString() { return "subRegionType"; }
171 
173  static constexpr char const * fractureSetString() { return "fractureSet"; }
174 
176  static constexpr char const * defaultApertureString() { return "defaultAperture"; }
177 
179  static constexpr char const * ruptureTimeString() { return "ruptureTime"; }
180 
182  static constexpr char const * faceBlockString() { return "faceBlock"; }
183  };
184 
185 protected:
186  virtual void initializePreSubGroups() override;
187 
188 private:
189 
196  template< typename SUBREGION_TYPE >
197  string getUniqueSubRegionName() const
198  {
199  std::vector< string > subRegionNames;
200  forElementSubRegions< SUBREGION_TYPE >( [&]( SUBREGION_TYPE const & sr )
201  {
202  subRegionNames.push_back( sr.getName() );
203  } );
204  GEOS_ERROR_IF( subRegionNames.size() != 1,
205  "Surface region \"" << getDataContext() <<
206  "\" should have one unique sub region (" << subRegionNames.size() << " found)." );
207  return subRegionNames.front();
208  }
209 
210  SurfaceSubRegionType m_subRegionType;
211 
212  real64 m_defaultAperture;
213 
219  string m_faceBlockName;
220 };
221 
224  "faceElement",
225  "embeddedElement" );
226 
227 } /* namespace geos */
228 
229 #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.
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:1343
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:286
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
std::int32_t integer
Signed integer type.
Definition: DataTypes.hpp:82
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()