GEOSX
FaceElementSubRegion.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 
19 #ifndef GEOS_MESH_FACEELEMENTSUBREGION_HPP_
20 #define GEOS_MESH_FACEELEMENTSUBREGION_HPP_
21 
23 #include "mesh/generators/FaceBlockABC.hpp"
24 
25 namespace geos
26 {
27 
37 {
38 public:
39 
42 
47 
52  static string catalogName()
53  { return "FaceElementSubRegion"; }
54 
59  virtual string getCatalogName() const override
60  {
61  return catalogName();
62  }
63 
65 
70 
76  FaceElementSubRegion( string const & name,
77  dataRepository::Group * const parent );
78 
80 
85  void copyFromCellBlock( FaceBlockABC const & faceBlock );
86 
91 
92  virtual void calculateElementGeometricQuantities( NodeManager const & nodeManager,
93  FaceManager const & faceManager ) override;
100  arrayView1d< real64 const > const & faceArea );
101 
102  virtual localIndex packUpDownMapsSize( arrayView1d< localIndex const > const & packList ) const override;
103 
105  arrayView1d< localIndex const > const & packList ) const override;
106 
107  virtual localIndex unpackUpDownMaps( buffer_unit_type const * & buffer,
108  array1d< localIndex > & packList,
109  bool const overwriteUpMaps,
110  bool const overwriteDownMaps ) override;
111 
112  virtual void fixUpDownMaps( bool const clearIfUnmapped ) override;
113 
121  void fixSecondaryMappings( NodeManager const & nodeManager,
122  EdgeManager const & edgeManager,
123  FaceManager const & faceManager,
124  ElementRegionManager const & elemManager );
125 
127 
133  void inheritGhostRankFromParentFace( FaceManager const & faceManager,
134  std::set< localIndex > const & indices );
135 
147  ElementRegionManager const & elemManager );
148 
157  void flipFaceMap( FaceManager & faceManager,
158  ElementRegionManager const & elemManager );
159 
165  {
167  static constexpr char const * dNdXString() { return "dNdX"; }
169  static constexpr char const * detJString() { return "detJ"; }
171  static constexpr char const * edgesTofractureConnectorsEdgesString() { return "edgesToFractureConnectors"; }
173  static constexpr char const * fractureConnectorEdgesToEdgesString() { return "fractureConnectorsToEdges"; }
175  static constexpr char const * fractureConnectorsEdgesToFaceElementsIndexString() { return "fractureConnectorsToElementIndex"; }
177  static constexpr char const * elem2dToCollocatedNodesBucketsString() { return "elem2dToCollocatedNodesBuckets"; }
178 
179 #if GEOSX_USE_SEPARATION_COEFFICIENT
181  constexpr static char const * separationCoeffString() { return "separationCoeff"; }
183  constexpr static char const * dSeparationCoeffdAperString() { return "dSeparationCoeffdAper"; }
184 #endif
185  };
186 
187  virtual void setupRelatedObjectsInRelations( MeshLevel const & mesh ) override;
188 
189 
195 
200  FaceMapType const & faceList() const
201  {
202  return m_toFacesRelation;
203  }
204 
209  {
210  return m_toFacesRelation;
211  }
213 
214 
220 
225  //virtual localIndex numNodesPerElement( localIndex const k ) const override { return m_toNodesRelation[k].size(); }
226 
227 #ifdef GEOSX_USE_SEPARATION_COEFFICIENT
232  arrayView1d< real64 > getSeparationCoefficient() { return m_separationCoefficient; }
236  arrayView1d< real64 const > getSeparationCoefficient() const { return m_separationCoefficient; }
237 #endif
238 
240 
243 
246 
249 
252 
255 
258 
261 
266  std::set< std::set< globalIndex > > getCollocatedNodes() const;
267 
272  { return m_dNdX; }
273 
278  { return m_dNdX.toViewConst(); }
279 
284  { return m_detJ; }
285 
290  { return m_detJ; }
291 
293 
301 
309  {
310  return m_2dElemToCollocatedNodesBuckets.toViewConst();
311  }
312 
313 private:
314 
322  template< bool DO_PACKING >
323  localIndex packUpDownMapsImpl( buffer_unit_type * & buffer,
324  arrayView1d< localIndex const > const & packList ) const;
325 
327  array4d< real64 > m_dNdX;
328 
330  array2d< real64 > m_detJ;
331 
333  FaceMapType m_toFacesRelation;
334 
339  ArrayOfArrays< array1d< globalIndex > > m_2dElemToCollocatedNodesBuckets;
340 
341 #ifdef GEOSX_USE_SEPARATION_COEFFICIENT
343  array1d< real64 > m_separationCoefficient;
344 #endif
345 
346 };
347 
348 } /* namespace geos */
349 
350 #endif /* GEOS_MESH_FACEELEMENTSUBREGION_HPP_ */
This class provides an interface to ObjectManagerBase in order to manage edge data.
Definition: EdgeManager.hpp:42
The ElementRegionManager class provides an interface to ObjectManagerBase in order to manage ElementR...
ElementType getElementType() const
Get the type of element in this subregion.
Block of 2d elements (geometrical surfaces in 3d).
void inheritGhostRankFromParentFace(FaceManager const &faceManager, std::set< localIndex > const &indices)
Function to set the ghostRank for a list of FaceElements and set them to the value of their bounding ...
ArrayOfArraysView< array1d< globalIndex > const > get2dElemToCollocatedNodesBuckets() const
Returns the 2d element to node to collocated nodes bucket mapping.
virtual string getCatalogName() const override
Get catalog name.
virtual void setupRelatedObjectsInRelations(MeshLevel const &mesh) override
Link the connectivity maps of the subregion to the managers storing the mesh information.
InterObjectRelation< ArrayOfArrays< localIndex > > FaceMapType
Face element to faces map type.
arrayView2d< real64 const > detJ() const
FaceMapType & faceList()
Get the face element to faces map.
FaceMapType const & faceList() const
Get the face element to faces map.
SortedArray< localIndex > m_recalculateConnectionsFor2dFaces
map from the edges to the fracture connectors index (edges that are fracture connectors)
virtual localIndex packUpDownMapsSize(arrayView1d< localIndex const > const &packList) const override
Computes the pack size of the specific elements in the @ packList.
void calculateSingleElementGeometricQuantities(localIndex const k, arrayView1d< real64 const > const &faceArea)
Function to compute the geometric quantities of a specific face element.
virtual localIndex unpackUpDownMaps(buffer_unit_type const *&buffer, array1d< localIndex > &packList, bool const overwriteUpMaps, bool const overwriteDownMaps) override
Unpacks the specific elements in the @ packList.
ElementType getElementType(localIndex ei) const
Returns the type of element ei.
map< localIndex, array1d< globalIndex > > m_unmappedGlobalIndicesInToEdges
Get the number of nodes per face element.
void fixNeighboringFacesNormals(FaceManager &faceManager, ElementRegionManager const &elemManager)
Function to flip the face normals of faces adjacent to the faceElements if they are not pointing in t...
arrayView4d< real64 const > dNdX() const
map< localIndex, array1d< globalIndex > > m_unmappedGlobalIndicesInToFaces
Unmapped face elements to faces map.
static string catalogName()
Get catalog name.
FaceElementSubRegion(string const &name, dataRepository::Group *const parent)
Constructor.
void fixSecondaryMappings(NodeManager const &nodeManager, EdgeManager const &edgeManager, FaceManager const &faceManager, ElementRegionManager const &elemManager)
Fixes the mappings between the FaceElementSubRegion and regions next to it (e.g., matrix regions).
void copyFromCellBlock(FaceBlockABC const &faceBlock)
Fill the FaceElementSubRegion by copying those of the source face block.
SortedArray< localIndex > m_newFaceElements
List of the new face elements that have been generated.
void flipFaceMap(FaceManager &faceManager, ElementRegionManager const &elemManager)
Function to flip the face map based on the gloal index of the nighboring elements.
ArrayOfArrays< localIndex > m_2dFaceTo2dElems
A map of fracture connector local indices face element local indices.
virtual localIndex packUpDownMaps(buffer_unit_type *&buffer, arrayView1d< localIndex const > const &packList) const override
Packs the specific elements in the @ packList.
virtual void fixUpDownMaps(bool const clearIfUnmapped) override
Call ObjectManagerBase::fixUpDownMaps for the connectivity maps needed by the derived class (i....
std::set< std::set< globalIndex > > getCollocatedNodes() const
Computes and returns all the buckets of collocated nodes.
map< localIndex, localIndex > m_edgesTo2dFaces
A map of edge local indices to the fracture connector local indices.
virtual void calculateElementGeometricQuantities(NodeManager const &nodeManager, FaceManager const &faceManager) override
Calculate the geometric quantities for each element in the subregion.
array1d< localIndex > m_2dFaceToEdge
A map of fracture connector local indices to edge local indices.
The FaceManager class provides an interface to ObjectManagerBase in order to manage face data.
Definition: FaceManager.hpp:43
Class facilitating the representation of a multi-level discretization of a MeshBody.
Definition: MeshLevel.hpp:41
The NodeManager class provides an interface to ObjectManagerBase in order to manage node data.
Definition: NodeManager.hpp:45
Base template for ordered and unordered maps.
Definition: DataTypes.hpp:369
ArrayView< T, 1 > arrayView1d
Alias for 1D array view.
Definition: DataTypes.hpp:220
Array< T, 2, PERMUTATION > array2d
Alias for 2D array.
Definition: DataTypes.hpp:232
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
LvArray::SortedArray< T, localIndex, LvArray::ChaiBuffer > SortedArray
A sorted array of local indices.
Definition: DataTypes.hpp:307
Array< T, 4, PERMUTATION > array4d
Alias for 4D array.
Definition: DataTypes.hpp:264
ElementType
Denotes type of cell/element shape.
Definition: ElementType.hpp:31
ArrayView< T, 4, USD > arrayView4d
Alias for 4D array view.
Definition: DataTypes.hpp:268
signed char buffer_unit_type
Type stored in communication buffers.
Definition: DataTypes.hpp:149
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
Array< T, 1 > array1d
Alias for 1D array.
Definition: DataTypes.hpp:216
LvArray::ArrayOfArrays< T, INDEX_TYPE, LvArray::ChaiBuffer > ArrayOfArrays
Array of variable-sized arrays. See LvArray::ArrayOfArrays for details.
Definition: DataTypes.hpp:322
Struct containing the keys to all face element views.
static constexpr char const * dNdXString()
static constexpr char const * detJString()
static constexpr char const * elem2dToCollocatedNodesBucketsString()
static constexpr char const * edgesTofractureConnectorsEdgesString()
static constexpr char const * fractureConnectorsEdgesToFaceElementsIndexString()
static constexpr char const * fractureConnectorEdgesToEdgesString()
Struct containing the keys to all surface element views.