GEOS
EmbeddedSurfaceNodeManager.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 
20 #ifndef GEOS_MESH_EMBEDDEDSURFACENODEMANAGER_HPP_
21 #define GEOS_MESH_EMBEDDEDSURFACENODEMANAGER_HPP_
22 
23 #include "mesh/generators/CellBlockManagerABC.hpp"
25 #include "ToElementRelation.hpp"
26 
27 namespace geos
28 {
29 
30 class EdgeManager;
31 class ElementRegionManager;
32 
43 {
44 public:
47 
50 
57  static constexpr localIndex edgeMapOverallocation()
59 
64  static constexpr localIndex elemMapOverallocation()
65  { return 8; }
66 
67 
72 
78  EmbeddedSurfaceNodeManager( string const & name,
79  dataRepository::Group * const parent );
80 
82 
88  virtual void resize( localIndex const newsize ) override;
89 
94 
99  static string catalogName()
100  { return "EmbeddedSurfaceNodeManager"; }
101 
106  string getCatalogName() const override final
107  { return catalogName(); }
108 
110 
115  void setEdgeMaps( EdgeManager const & edgeManager );
116 
117 
123  void setElementMaps( ElementRegionManager const & elementRegionManager );
124 
131 
137  void appendNode( arraySlice1d< real64 const > const & pointCoord,
138  integer const & pointGhostRank );
139 
144 
151 
159  arrayView1d< localIndex const > const & packList ) const;
160 
161  virtual localIndex packUpDownMapsSize( arrayView1d< localIndex const > const & packList ) const override;
162 
163 
165  arrayView1d< localIndex const > const & packList ) const override;
166 
174  localIndex_array & packList );
175 
176  virtual localIndex unpackUpDownMaps( buffer_unit_type const * & buffer,
177  array1d< localIndex > & packList,
178  bool const overwriteUpMaps,
179  bool const overwriteDownMaps ) override;
180 
182 
187 
193  {
195  static constexpr char const * referencePositionString() { return "referencePosition"; }
196 
198  static constexpr char const * edgeListString() { return "edgeList"; }
199 
201  static constexpr char const * elementRegionListString() { return "elemRegionList"; }
202 
204  static constexpr char const * elementSubRegionListString() { return "elemSubRegionList"; }
205 
207  static constexpr char const * elementListString() { return "elemList"; }
208 
210  static constexpr char const * parentEdgeGlobalIndexString() { return "parentEdgeGlobalIndex"; }
211 
214 
217 
220 
223 
226 
229  }
232 
234 
239 
244  EdgeMapType const & edgeList() const { return m_toEdgesRelation; }
245 
250  EdgeMapType & edgeList() { return m_toEdgesRelation; }
251 
256  ElemMapType & toElementRelation() {return m_toElements;}
257 
265  ElemMapType const & toElementRelation() const {return m_toElements;}
266 
272 
277  ArrayOfArraysView< localIndex const > elementRegionList() const { return m_toElements.m_toElementRegion.toViewConst(); }
278 
284 
290 
296 
303  { return m_toElements.m_toElementIndex.toViewConst(); }
304 
310 
316  { return m_referencePosition; }
317 
323  {
324  return m_parentEdgeGlobalIndex;
325  }
326 
332  {
333  return m_parentEdgeGlobalIndex;
334  }
335 
337 
338 private:
339 
348  template< bool DO_PACKING >
349  localIndex packUpDownMapsImpl( buffer_unit_type * & buffer,
350  arrayView1d< localIndex const > const & packList ) const;
351 
359  template< bool DO_PACKING >
360  localIndex packNewNodesGlobalMapsImpl( buffer_unit_type * & buffer,
361  arrayView1d< localIndex const > const & packList ) const;
362 
368  void nodeExistsOnThisRank( real64 const (&nodeCoord)[3],
369  localIndex & nodeIndexOnThisRank ) const;
370 
373 
375  EdgeMapType m_toEdgesRelation;
376 
378  ElemMapType m_toElements;
379 
381  array1d< globalIndex > m_parentEdgeGlobalIndex;
382 
383 };
384 }
385 
386 #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:43
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:1662
ArrayView< T, 1 > arrayView1d
Alias for 1D array view.
Definition: DataTypes.hpp:180
array1d< localIndex > localIndex_array
A 1-dimensional array of geos::localIndex types.
Definition: DataTypes.hpp:398
Array< T, 2, PERMUTATION > array2d
Alias for 2D array.
Definition: DataTypes.hpp:192
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
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:99
GEOS_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
Definition: DataTypes.hpp:85
ArraySlice< T, 1, USD > arraySlice1d
Alias for 1D array slice.
Definition: DataTypes.hpp:184
std::int32_t integer
Signed integer type.
Definition: DataTypes.hpp:82
signed char buffer_unit_type
Type stored in communication buffers.
Definition: DataTypes.hpp:109
ArrayView< T, 2, USD > arrayView2d
Alias for 2D array view.
Definition: DataTypes.hpp:196
Array< T, 1 > array1d
Alias for 1D array.
Definition: DataTypes.hpp:176
LvArray::ArrayOfArrays< T, INDEX_TYPE, LvArray::ChaiBuffer > ArrayOfArrays
Array of variable-sized arrays. See LvArray::ArrayOfArrays for details.
Definition: DataTypes.hpp:282
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