GEOSX
ProjectionEDFMHelper.hpp
1 #ifndef GEOS_FINITEVOLUME_PROJECTIONEDFMHELPER_HPP_
2 #define GEOS_FINITEVOLUME_PROJECTIONEDFMHELPER_HPP_
3 
4 #include "common/DataTypes.hpp"
6 
7 namespace geos
8 {
9 
10 class MeshLevel;
11 class CellElementStencilTPFA;
12 class EmbeddedSurfaceToCellStencil;
13 
19 {
26 
34  : region( r ), subRegion( sr ), index( i )
35  {}
36 
42  bool operator==( CellDescriptor const & other ) const
43  {
44  return( region==other.region && subRegion==other.subRegion && index==other.index );
45  }
46 };
47 
53 {
54 public:
55 
64  CellElementStencilTPFA & stencil,
65  EmbeddedSurfaceToCellStencil & edfmStencil,
66  string const & embeddedSurfaceRegionName );
67 
73 
74 private:
75 
84  std::vector< localIndex > selectFaces( FixedOneToManyRelation const & subRegionFaces,
85  CellDescriptor const & hostCellID,
86  localIndex const fracElement,
87  EmbeddedSurfaceSubRegion const & fractureSubRegion ) const;
88 
96  bool intersection( real64 const ( &fracCenter )[3],
97  arraySlice1d< real64 const > const & fracNormal,
98  localIndex const edgeIdx ) const;
99 
105  bool isBoundaryFace( localIndex const faceIdx ) const;
106 
115  bool onLargerSide( localIndex const faceIdx,
116  real64 const signedDistanceCellCenterToFrac,
117  real64 const ( &fracCenter )[3],
118  arraySlice1d< real64 const > const & fracNormal ) const;
119 
120  /*
121  * @brief compute the signed distance between the fracture and as cell center
122  * @param[in] hostCellID id of the host cell
123  * @param[in] fracNormal the normal vector of the fracture element
124  * @param[in] fracCenter the coordinates of the center of the fracture cell
125  * @param[out] cellCenterToFracCenter distance vector between the cell and the fracture.
126  * return The signed distance between the fracture and the cell (based on the frac normal direction)
127  */
128  real64 getSignedDistanceCellCenterToFracPlane( CellDescriptor const & hostCellID,
129  arraySlice1d< real64 const > const & fracNormal,
130  real64 const (&fracCenter)[3],
131  real64 ( &cellCenterToFracCenter )[3] ) const;
132 
133  /*
134  * @brief returns true if the signed distance from the neighbor center to the frac is of the same sign as signedDistanceCellCenterToFrac
135  *(computed in the host cell)
136  * @@param[in] faceIdx the face index
137  * @param[in] signedDistanceCellCenterToFrac signed distance between the fracture and the cell (based on the frac normal direction)
138  * @param[in] hostCellID id of the host cell (region, subregion and element index)
139  * @param[in] fractureSubRegion the embeddedSurfaceSubRegion
140  * return whether the neighboring cell has the fracture on the same side of the face or not.
141  */
142  bool neighborOnSameSide( localIndex const faceIdx,
143  real64 const signedDistanceCellCenterToFrac,
144  CellDescriptor const & hostCellID,
145  EmbeddedSurfaceSubRegion const & fractureSubRegion ) const;
146 
153  CellDescriptor otherCell( localIndex const faceIdx, CellDescriptor const & hostCellID ) const;
154 
163  void computeFractureMatrixWeights( CellDescriptor const & neighborCell,
164  localIndex const fracElement,
165  EmbeddedSurfaceSubRegion const & fractureSubRegion,
166  localIndex const faceIdx,
167  real64 ( &weights )[2] ) const;
168 
176  void addNonNeighboringConnection( localIndex const fracElement,
177  CellDescriptor const & cell,
178  real64 const (&weights)[2],
179  EmbeddedSurfaceSubRegion const & fractureSubRegion ) const;
180 
181  // Private variables
182 
184  ElementRegionManager const & m_elementManager;
188  arrayView2d< localIndex const > const m_edgeToNodes;
190  arrayView2d< localIndex const > const m_faceToRegions;
192  arrayView2d< localIndex const > const m_faceToSubRegions;
194  arrayView2d< localIndex const > const m_faceToCells;
198  ArrayOfArraysView< localIndex const > const m_faceToNodes;
202  CellElementStencilTPFA & m_cellStencil;
204  EmbeddedSurfaceToCellStencil & m_edfmStencil;
206  string const m_embeddedSurfaceRegionName;
207 
208 };
209 
210 } // end namespace geos
211 
212 
213 #endif // __PROJECTIONEDFMHELPER_H_
The ElementRegionManager class provides an interface to ObjectManagerBase in order to manage ElementR...
array1d< array1d< VIEWTYPE > > ElementViewAccessor
The ElementViewAccessor at the ElementRegionManager level is an array of array of VIEWTYPE.
Provides management of the interior stencil points for a face elements when using Two-Point flux appr...
Class facilitating the representation of a multi-level discretization of a MeshBody.
Definition: MeshLevel.hpp:41
A class that contains methods to modify cell and edfm stencils based on projection edfm.
ProjectionEDFMHelper(MeshLevel const &mesh, CellElementStencilTPFA &stencil, EmbeddedSurfaceToCellStencil &edfmStencil, string const &embeddedSurfaceRegionName)
Constructor.
void addNonNeighboringConnections() const
add Fracture-matrix connections to the edfmStencil and remove the appropriate connections from the ce...
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
ArraySlice< T, 1, USD > arraySlice1d
Alias for 1D array slice.
Definition: DataTypes.hpp:224
ArrayView< T, 2, USD > arrayView2d
Alias for 2D array view.
Definition: DataTypes.hpp:236
GEOSX_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
Definition: DataTypes.hpp:125
A structure containing a single cell (element) identifier triplet.
localIndex region
region index
localIndex subRegion
subregion index
bool operator==(CellDescriptor const &other) const
Comparison operator between two CellDescriptors.
CellDescriptor(localIndex r, localIndex sr, localIndex i)
Constructor for the CellDescriptor struct.
localIndex index
cell index