GEOSX
EmbeddedSurfaceNodeManager.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_EMBEDDEDSURFACENODEMANAGER_HPP_
20 #define GEOS_MESH_EMBEDDEDSURFACENODEMANAGER_HPP_
21 
22 #include "mesh/generators/CellBlockManagerABC.hpp"
24 #include "ToElementRelation.hpp"
25 
26 namespace geos
27 {
28 
29 class EdgeManager;
30 class ElementRegionManager;
31 
42 {
43 public:
46 
49 
56  static constexpr localIndex edgeMapOverallocation()
58 
63  static constexpr localIndex elemMapOverallocation()
64  { return 8; }
65 
66 
71 
77  EmbeddedSurfaceNodeManager( string const & name,
78  dataRepository::Group * const parent );
79 
81 
87  virtual void resize( localIndex const newsize ) override;
88 
93 
98  static string catalogName()
99  { return "EmbeddedSurfaceNodeManager"; }
100 
105  string getCatalogName() const override final
106  { return catalogName(); }
107 
109 
114  void setEdgeMaps( EdgeManager const & edgeManager );
115 
116 
122  void setElementMaps( ElementRegionManager const & elementRegionManager );
123 
130 
136  void appendNode( arraySlice1d< real64 const > const & pointCoord,
137  integer const & pointGhostRank );
138 
143 
150 
158  arrayView1d< localIndex const > const & packList ) const;
159 
160  virtual localIndex packUpDownMapsSize( arrayView1d< localIndex const > const & packList ) const override;
161 
162 
164  arrayView1d< localIndex const > const & packList ) const override;
165 
173  localIndex_array & packList );
174 
175  virtual localIndex unpackUpDownMaps( buffer_unit_type const * & buffer,
176  array1d< localIndex > & packList,
177  bool const overwriteUpMaps,
178  bool const overwriteDownMaps ) override;
179 
181 
186 
192  {
194  static constexpr char const * referencePositionString() { return "referencePosition"; }
195 
197  static constexpr char const * edgeListString() { return "edgeList"; }
198 
200  static constexpr char const * elementRegionListString() { return "elemRegionList"; }
201 
203  static constexpr char const * elementSubRegionListString() { return "elemSubRegionList"; }
204 
206  static constexpr char const * elementListString() { return "elemList"; }
207 
209  static constexpr char const * parentEdgeGlobalIndexString() { return "parentEdgeGlobalIndex"; }
210 
213 
216 
219 
222 
225 
228  }
231 
233 
238 
243  EdgeMapType const & edgeList() const { return m_toEdgesRelation; }
244 
249  EdgeMapType & edgeList() { return m_toEdgesRelation; }
250 
255  ElemMapType & toElementRelation() {return m_toElements;}
256 
264  ElemMapType const & toElementRelation() const {return m_toElements;}
265 
271 
276  ArrayOfArraysView< localIndex const > elementRegionList() const { return m_toElements.m_toElementRegion.toViewConst(); }
277 
283 
289 
295 
302  { return m_toElements.m_toElementIndex.toViewConst(); }
303 
309 
315  { return m_referencePosition; }
316 
322  {
323  return m_parentEdgeGlobalIndex;
324  }
325 
331  {
332  return m_parentEdgeGlobalIndex;
333  }
334 
336 
337 private:
338 
347  template< bool DO_PACKING >
348  localIndex packUpDownMapsImpl( buffer_unit_type * & buffer,
349  arrayView1d< localIndex const > const & packList ) const;
350 
358  template< bool DO_PACKING >
359  localIndex packNewNodesGlobalMapsImpl( buffer_unit_type * & buffer,
360  arrayView1d< localIndex const > const & packList ) const;
361 
367  void nodeExistsOnThisRank( real64 const (&nodeCoord)[3],
368  localIndex & nodeIndexOnThisRank ) const;
369 
372 
374  EdgeMapType m_toEdgesRelation;
375 
377  ElemMapType m_toElements;
378 
380  array1d< globalIndex > m_parentEdgeGlobalIndex;
381 
382 };
383 }
384 
385 #endif // MESH_EMBEDDEDSURFACENODEMANAGER_HPP_
static constexpr localIndex edgeMapExtraSpacePerNode()
Extra space for node to edges mapping.
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...
The EmbeddedSurfaceNodeManager class provides an interface to ObjectManagerBase in order to manage no...
ArrayOfArraysView< localIndex const > elementSubRegionList() const
Provide an immutable arrayView to the nodes-to-elements-subregions relation.
virtual localIndex packUpDownMaps(buffer_unit_type *&buffer, arrayView1d< localIndex const > const &packList) const override
Packs the specific elements in the @ packList.
localIndex unpackNewNodesGlobalMaps(buffer_unit_type const *&buffer, localIndex_array &packList)
Unpacks the global maps from buffer and cleans them up from duplicated nodes.
string getCatalogName() const override final
Provide a virtual access to catalogName().
ArrayOfArrays< localIndex > & elementList()
Get the mutable nodes-to-elements indices.
ArrayOfArrays< localIndex > & elementSubRegionList()
Get the mutable nodes-to-elements-subregions relation.
EdgeMapType const & edgeList() const
Provide an immutable accessor to the nodes-to-edges relation.
static constexpr localIndex edgeMapOverallocation()
return default size of the value array in the node-to-edge mapping
void appendNode(arraySlice1d< real64 const > const &pointCoord, integer const &pointGhostRank)
appends a node to the embeSurfaceNodeManager.
EmbeddedSurfaceNodeManager(string const &name, dataRepository::Group *const parent)
Main constructor for EmbeddedSurfaceNodeManager Objects.
ArrayOfArrays< localIndex > & elementRegionList()
Get the mutable nodes-to-elements-regions relation.
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.
EdgeMapType & edgeList()
Get a mutable accessor to the node-to-edges relation.
arrayView1d< globalIndex const > getParentEdgeGlobalIndex() const
Provide an immutable arrayView of the parent Edge global index position.
localIndex packNewNodesGlobalMapsSize(arrayView1d< localIndex const > const &packList) const
Computes the pack size of the global maps elements in the @ packList.
virtual localIndex packUpDownMapsSize(arrayView1d< localIndex const > const &packList) const override
Computes the pack size of the specific elements in the @ packList.
virtual void resize(localIndex const newsize) override
Resize the EmbeddedSurfaceNodeManager, and all its member vectors that relate nodes to faces,...
array1d< globalIndex > & getParentEdgeGlobalIndex()
Provide an immutable arrayView of the parent Edge global index position.
static string catalogName()
Return the name of the node manager in the object catalog.
localIndex packNewNodesGlobalMaps(buffer_unit_type *&buffer, arrayView1d< localIndex const > const &packList) const
Packs the global maps for the nodes in the @ packList.
arrayView2d< real64 const, nodes::REFERENCE_POSITION_USD > referencePosition() const
Provide an immutable arrayView of the reference position. This table will contain all the node coordi...
array2d< real64, nodes::REFERENCE_POSITION_PERM > & referencePosition()
Get the mutable reference position array. This table will contain all the node coordinates.
InterObjectRelation< ArrayOfSets< localIndex > > EdgeMapType
nodeToEdge map type
ElemMapType & toElementRelation()
Get the nodes-to-elements relation.
void compressRelationMaps()
Compress all EmbeddedSurfaceNodeManager member arrays so that the values of each array are contiguous...
ArrayOfArraysView< localIndex const > elementList() const
Provide an immutable arrayView to the nodes-to-elements indices.
ElemMapType const & toElementRelation() const
Provide a const accessor to the nodes-to-elements relation.
static constexpr localIndex elemMapOverallocation()
return default size of the value array in the node-to-element mapping
void setEdgeMaps(EdgeManager const &edgeManager)
Link the EdgeManager edgeManager to the EmbeddedSurfaceNodeManager, and performs the node-to-edge map...
void setElementMaps(ElementRegionManager const &elementRegionManager)
Assign the ElementRegionManager elementRegionManager to the EmbeddedSurfaceNodeManager,...
OrderedVariableToManyElementRelation ElemMapType
nodeToElement map type
ArrayOfArraysView< localIndex const > elementRegionList() const
Provide an immutable arrayView to the nodes-to-elements-regions relation.
geos::EmbeddedSurfaceNodeManager::viewKeyStruct viewKeys
viewKeys
The ObjectManagerBase is the base object of all object managers in the mesh data hierachy.
BASETYPE m_toElementIndex
The relationship between object indices and element indices.
BASETYPE m_toElementSubRegion
The relationship between object indices and element subregions.
BASETYPE m_toElementRegion
The relationship between object indices and element regions.
Group::wrapperMap::KeyIndex ViewKey
Type alias for KeyIndexT type used for wrapper lookups.
Definition: Group.hpp:1625
ArrayView< T, 1 > arrayView1d
Alias for 1D array view.
Definition: DataTypes.hpp:220
array1d< localIndex > localIndex_array
A 1-dimensional array of geos::localIndex types.
Definition: DataTypes.hpp:438
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
ToElementRelation< ArrayOfArrays< localIndex > > OrderedVariableToManyElementRelation
A ToElementRelation where each object is related to an arbitrary number of elements.
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
std::int32_t integer
Signed integer type.
Definition: DataTypes.hpp:122
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
contains the added view access keys to be bound with class data member.
dataRepository::ViewKey referencePosition
Accessor to reference position.
dataRepository::ViewKey elementSubRegionList
Accessor to element subregion map.
dataRepository::ViewKey parentEdgeGlobalIndex
Accessor to element map.
dataRepository::ViewKey edgeList
Accessor to edge map.
dataRepository::ViewKey elementRegionList
Accessor to element region map.
dataRepository::ViewKey elementList
Accessor to element map.
struct to serve as a container for variable strings and keys