GEOS
MeshLevel.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_MESHLEVEL_HPP_
21 #define GEOS_MESH_MESHLEVEL_HPP_
22 
23 #include "NodeManager.hpp"
24 #include "ParticleManager.hpp"
26 #include "EdgeManager.hpp"
27 #include "ElementRegionManager.hpp"
28 #include "FaceManager.hpp"
29 
30 namespace geos
31 {
32 class ElementRegionManager;
33 
42 {
43 public:
44 
50  MeshLevel( string const & name,
51  Group * const parent );
52 
53 
60  MeshLevel( string const & name,
61  Group * const parent,
62  MeshLevel & source );
63 
64 
72  MeshLevel( string const & name,
73  Group * const parent,
74  MeshLevel const & source,
75  int const order );
76 
77  virtual ~MeshLevel() override;
78 
82  void generateSets();
83 
84 
100  localIndex_array & nodeAdjacencyList,
101  localIndex_array & edgeAdjacencyList,
102  localIndex_array & faceAdjacencyList,
104  integer const depth );
105 
106 
108 
109 
111 
112  struct viewStructKeys
113  {
114  dataRepository::ViewKey meshLevel = { "meshLevel" };
115 // static constexpr char const * baseDiscretizationString() { return "baseDiscretization"; }
116 
117  } viewKeys;
118 
119  struct groupStructKeys
120  {
121  dataRepository::GroupKey vertexManager = { "vertexManager" };
122  dataRepository::GroupKey cellManager = { "cellManager" };
123 
124  static constexpr char const * nodeManagerString() { return "nodeManager"; }
125  static constexpr char const * edgeManagerString() { return "edgeManager"; }
126  static constexpr char const * faceManagerString() { return "faceManager"; }
127 
128  // This key is defined in problem manager:
129  static constexpr char const * elemManagerString() { return "ElementRegions"; }
130  static constexpr char const * particleManagerString() { return "ParticleRegions"; }
131 
132  static constexpr auto embSurfNodeManagerString = "embeddedSurfacesNodeManager";
133  static constexpr auto embSurfEdgeManagerString = "embeddedSurfacesEdgeManager";
134 
135  dataRepository::GroupKey nodeManager = {nodeManagerString()};
136  dataRepository::GroupKey particleManager = {particleManagerString()};
137  dataRepository::GroupKey edgeManager = {edgeManagerString()};
138  dataRepository::GroupKey faceManager = {faceManagerString()};
139  dataRepository::GroupKey elemManager = {elemManagerString()};
140  dataRepository::GroupKey embSurfNodeManager = {embSurfNodeManagerString};
141  dataRepository::GroupKey embSurfEdgeManager = {embSurfEdgeManagerString};
142  } groupKeys;
143 
145 
150 
155  NodeManager const & getNodeManager() const
156  { return *m_nodeManager; }
157 
162  { return *m_nodeManager; }
163 
169  { return *m_particleManager; }
170 
175  { return *m_particleManager; }
176 
181  EdgeManager const & getEdgeManager() const
182  { return *m_edgeManager; }
183 
188  { return *m_edgeManager; }
189 
194  FaceManager const & getFaceManager() const
195  { return *m_faceManager; }
196 
201  { return *m_faceManager; }
202 
208  { return *m_elementManager; }
209 
214  { return *m_elementManager; }
215 
221  { return *m_embSurfNodeManager; }
222 
227  { return *m_embSurfNodeManager; }
228 
234  { return *m_embSurfEdgeManager; }
235 
240  { return *m_embSurfEdgeManager; }
241 
247  { return m_modificationTimestamp; }
248 
252  void modified()
253  { m_modificationTimestamp++; }
254 
258  bool isShallowCopy() const
259  { return m_isShallowCopy; }
260 
266  bool isShallowCopyOf( MeshLevel const & comparisonLevel ) const;
267 
268 
274  MeshLevel const & getShallowParent() const;
275 
282 
284 
285 private:
286 
288  NodeManager * const m_nodeManager;
290  ParticleManager * const m_particleManager;
292  EdgeManager * const m_edgeManager;
294  FaceManager * const m_faceManager;
296  ElementRegionManager * const m_elementManager;
297 
299  EmbeddedSurfaceNodeManager * const m_embSurfNodeManager;
301  EdgeManager * const m_embSurfEdgeManager;
302 
304  Timestamp m_modificationTimestamp;
305 
306  bool const m_isShallowCopy = false;
307 
308  MeshLevel * const m_shallowParent;
309 
310 };
311 
312 } /* namespace geos */
313 
314 #endif /* GEOS_MESH_MESHLEVEL_HPP_ */
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...
array1d< array1d< VIEWTYPE > > ElementViewAccessor
The ElementViewAccessor at the ElementRegionManager level is an array of array of VIEWTYPE.
The EmbeddedSurfaceNodeManager class provides an interface to ObjectManagerBase in order to manage no...
The FaceManager class provides an interface to ObjectManagerBase in order to manage face data.
Definition: FaceManager.hpp:44
Class facilitating the representation of a multi-level discretization of a MeshBody.
Definition: MeshLevel.hpp:42
EdgeManager const & getEmbSurfEdgeManager() const
Get the edge Manager related to the embedded surfaces grid.
Definition: MeshLevel.hpp:233
virtual void initializePostInitialConditionsPostSubGroups() override
Called by InitializePostInitialConditions() after to initializing sub-Groups.
EdgeManager & getEdgeManager()
Get the edge manager.
Definition: MeshLevel.hpp:187
EmbeddedSurfaceNodeManager & getEmbSurfNodeManager()
Get the node Manager of the embedded surfaces grid.
Definition: MeshLevel.hpp:226
NodeManager const & getNodeManager() const
Get the node manager.
Definition: MeshLevel.hpp:155
NodeManager & getNodeManager()
Get the node manager.
Definition: MeshLevel.hpp:161
FaceManager const & getFaceManager() const
Get the face manager.
Definition: MeshLevel.hpp:194
ParticleManager const & getParticleManager() const
Get the particle manager.
Definition: MeshLevel.hpp:168
bool isShallowCopyOf(MeshLevel const &comparisonLevel) const
Determines if this->MeshLevel is a shallow copy of the input.
ElementRegionManager const & getElemManager() const
Get the element region manager.
Definition: MeshLevel.hpp:207
EmbeddedSurfaceNodeManager const & getEmbSurfNodeManager() const
Get the node Manager of the embedded surfaces grid.
Definition: MeshLevel.hpp:220
EdgeManager & getEmbSurfEdgeManager()
Get the edge Manager related to the embedded surfaces grid.
Definition: MeshLevel.hpp:239
FaceManager & getFaceManager()
Get the face manager.
Definition: MeshLevel.hpp:200
void generateAdjacencyLists(arrayView1d< localIndex const > const &seedNodeList, localIndex_array &nodeAdjacencyList, localIndex_array &edgeAdjacencyList, localIndex_array &faceAdjacencyList, ElementRegionManager::ElementViewAccessor< ReferenceWrapper< localIndex_array > > &elementAdjacencyList, integer const depth)
Collects the nodes, edges, faces, and elements that are adjacent to a given list of nodes.
void modified()
Increment the modification timestamp if the mesh has been modified.
Definition: MeshLevel.hpp:252
ParticleManager & getParticleManager()
Get the particle manager.
Definition: MeshLevel.hpp:174
MeshLevel & getShallowParent()
If this is a shallow clone of another MeshLevel, then return the source MeshLevel.
MeshLevel(string const &name, Group *const parent, MeshLevel const &source, int const order)
Constructor for the MeshLevel object.
Timestamp getModificationTimestamp() const
Getter for the modification timestamp.
Definition: MeshLevel.hpp:246
ElementRegionManager & getElemManager()
Get the element region manager.
Definition: MeshLevel.hpp:213
EdgeManager const & getEdgeManager() const
Get the edge manager.
Definition: MeshLevel.hpp:181
MeshLevel(string const &name, Group *const parent)
Constructor for the MeshLevel object.
MeshLevel(string const &name, Group *const parent, MeshLevel &source)
Constructor to create a shallow MeshLevel.
MeshLevel const & getShallowParent() const
If this is a shallow clone of another MeshLevel, then return the source MeshLevel.
bool isShallowCopy() const
Definition: MeshLevel.hpp:258
void generateSets()
Generate the sets for the objects within a MeshLevel.
The NodeManager class provides an interface to ObjectManagerBase in order to manage node data.
Definition: NodeManager.hpp:46
The ParticleManager class provides an interface to ObjectManagerBase in order to manage ParticleRegio...
Group::wrapperMap::KeyIndex ViewKey
Type alias for KeyIndexT type used for wrapper lookups.
Definition: Group.hpp:1662
Group::subGroupMap::KeyIndex GroupKey
Type alias for KeyIndexT type used for sub-group lookups.
Definition: Group.hpp:1657
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
unsigned long long int Timestamp
Timestamp type (used to perform actions such a sparsity pattern computation after mesh modifications)
Definition: DataTypes.hpp:127
std::int32_t integer
Signed integer type.
Definition: DataTypes.hpp:82