GEOSX
SurfaceElementRegion.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 
20 #ifndef GEOS_MESH_SURFACEELEMENTREGION_HPP_
21 #define GEOS_MESH_SURFACEELEMENTREGION_HPP_
22 
23 #include "ElementRegionBase.hpp"
24 #include "codingUtilities/EnumStrings.hpp"
25 
26 namespace geos
27 {
28 
29 
30 class EdgeManager;
31 
40 {
41 public:
42 
49  {
50  faceElement,
51  embeddedElement
52  };
53 
58 
64  SurfaceElementRegion( string const & name, Group * const parent );
65 
70 
74  virtual ~SurfaceElementRegion() override;
75 
77 
82 
87  static string catalogName()
88  { return "SurfaceElementRegion"; }
89 
90  virtual string getCatalogName() const override final
91  { return catalogName(); }
92 
94 
95 
100 
101  virtual void generateMesh( Group const & faceBlocks ) override;
102 
112  FaceManager const * const faceManager,
113  ArrayOfArraysView< localIndex const > const & originalFaceToEdges,
114  localIndex const faceIndices[2] );
115 
117 
118 
123 
128  real64 getDefaultAperture() const { return m_defaultAperture; }
129 
134  SurfaceSubRegionType subRegionType() const { return m_subRegionType; }
135 
142  template< typename SUBREGION_TYPE >
143  SUBREGION_TYPE & getUniqueSubRegion()
144  {
145  return getSubRegion< SUBREGION_TYPE >( getUniqueSubRegionName< SUBREGION_TYPE >() );
146  }
147 
154  template< typename SUBREGION_TYPE >
155  SUBREGION_TYPE const & getUniqueSubRegion() const
156  {
157  return getSubRegion< SUBREGION_TYPE >( getUniqueSubRegionName< SUBREGION_TYPE >() );
158  }
159 
161 
167  {
169  static constexpr char const * subRegionTypeString() { return "subRegionType"; }
170 
172  static constexpr char const * fractureSetString() { return "fractureSet"; }
173 
175  static constexpr char const * defaultApertureString() { return "defaultAperture"; }
176 
178  static constexpr char const * ruptureTimeString() { return "ruptureTime"; }
179 
181  static constexpr char const * faceBlockString() { return "faceBlock"; }
182  };
183 
184 protected:
185  virtual void initializePreSubGroups() override;
186 
187 private:
188 
195  template< typename SUBREGION_TYPE >
196  string getUniqueSubRegionName() const
197  {
198  std::vector< string > subRegionNames;
199  forElementSubRegions< SUBREGION_TYPE >( [&]( SUBREGION_TYPE const & sr )
200  {
201  subRegionNames.push_back( sr.getName() );
202  } );
203  GEOS_ERROR_IF( subRegionNames.size() != 1,
204  "Surface region \"" << getDataContext() <<
205  "\" should have one unique sub region (" << subRegionNames.size() << " found)." );
206  return subRegionNames.front();
207  }
208 
209  SurfaceSubRegionType m_subRegionType;
210 
211  real64 m_defaultAperture;
212 
218  string m_faceBlockName;
219 };
220 
223  "faceElement",
224  "embeddedElement" );
225 
226 } /* namespace geos */
227 
228 #endif /* CORECOMPONENTS_MESH_SurfaceElementRegion_HPP_ */
#define GEOS_ERROR_IF(EXP, msg)
Conditionally raise a hard error and terminate the program.
Definition: Logger.hpp:107
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:43
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:1322
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:326
double real64
64-bit floating point type.
Definition: DataTypes.hpp:139
std::int32_t integer
Signed integer type.
Definition: DataTypes.hpp:122
GEOSX_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
Definition: DataTypes.hpp:125
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()