GEOSX
ElementSubRegionBase.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 Total, S.A
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 GEOSX_MESH_ELEMENTSUBREGIONBASE_HPP_
20 #define GEOSX_MESH_ELEMENTSUBREGIONBASE_HPP_
21 
23 namespace geosx
24 {
25 
26 class NodeManager;
27 class FaceManager;
28 class MeshLevel;
29 class DomainPartition;
30 namespace constitutive
31 {
32 class ConstitutiveBase;
33 }
34 
43 {
44 public:
45 
49 
56  ElementSubRegionBase( string const & name, dataRepository::Group * const parent );
57 
62 
64 
68 
76  virtual void CalculateElementGeometricQuantities( NodeManager const & nodeManager,
77  FaceManager const & faceManager ) = 0;
78 
87  virtual void setupRelatedObjectsInRelations( MeshLevel const * const mesh ) = 0;
88 
94  virtual void FixUpDownMaps( bool const clearIfUnmapped ) { GEOSX_UNUSED_VAR( clearIfUnmapped ); }
95 
97 
101 
107  localIndex const & numNodesPerElement() const { return m_numNodesPerElement; }
108 
114  virtual localIndex numNodesPerElement( localIndex const k ) const { GEOSX_UNUSED_VAR( k ); return m_numNodesPerElement; }
115 
121  {
122  m_numNodesPerElement = numNodes;
123  }
124 
133  localIndex const & numIndependentNodesPerElement() const { return m_numIndependentNodesPerElement; }
134 
140  {
141  m_numIndependentNodesPerElement = numNodes;
142  }
143 
148  localIndex const & numEdgesPerElement() const { return m_numEdgesPerElement; }
149 
154  void setNumEdgesPerElement( localIndex const numEdges )
155  {
156  m_numEdgesPerElement = numEdges;
157  }
158 
163  localIndex const & numFacesPerElement() const { return m_numFacesPerElement; }
164 
169  void setNumFacesPerElement( localIndex const numFaces )
170  { m_numFacesPerElement = numFaces; }
171 
177  { return m_elementCenter; }
178 
183  { return m_elementCenter; }
184 
190  { return m_elementVolume; }
191 
197  { return &m_constitutiveModels; }
198 
203  { return &m_constitutiveModels; }
204 
211  template< typename T = constitutive::ConstitutiveBase >
212  T const * getConstitutiveModel( string const & name ) const
213  {
214  return m_constitutiveModels.GetGroup< T >( name );
215  }
216 
220  template< typename T = constitutive::ConstitutiveBase >
221  T * getConstitutiveModel( string const & name )
222  {
223  return m_constitutiveModels.GetGroup< T >( name );
224  }
225 
226 
233  virtual string GetElementTypeString() const { return m_elementTypeString; }
234 
239  virtual void SetElementType( string const & elementType );
240 
245  std::vector< int > getVTKNodeOrdering() const;
246 
248 
254  {
255 
257  static constexpr auto numNodesPerElementString = "numNodesPerElement";
259  static constexpr auto nodeListString = "nodeList";
261  static constexpr auto numEdgesPerElementString = "numEdgesPerElement";
263  static constexpr auto edgeListString = "edgeList";
265  static constexpr auto numFacesPerElementString = "numFacesPerElement";
267  static constexpr auto faceListString = "faceList";
269  static constexpr auto elementCenterString = "elementCenter";
271  static constexpr auto elementVolumeString = "elementVolume";
272  };
273 
279  {
281  static constexpr auto constitutiveModelsString = "ConstitutiveModels";
282  };
283 
284 private:
286  dataRepository::Group m_constitutiveModels;
287 
288 protected:
291 
294 
297 
300 
303 
306 
309 
311 };
312 
313 
314 } /* namespace geosx */
315 
316 #endif /* GEOSX_MESH_ELEMENTSUBREGIONBASE_HPP_ */
arrayView1d< real64 const > getElementVolume() const
Get the volume of each element in this subregion.
virtual void FixUpDownMaps(bool const clearIfUnmapped)
Call ObjectManagerBase::FixUpDownMaps for the connectivity maps needed by the derived class (i...
struct to serve as a container for group strings and keys
localIndex m_numNodesPerElement
Number of nodes per element in this subregion.
Class facilitating the representation of a multi-level discretization of a MeshBody.
Definition: MeshLevel.hpp:38
void setNumNodesPerElement(localIndex numNodes)
Set the number of nodes per element.
virtual localIndex numNodesPerElement(localIndex const k) const
Get the number of nodes per element.
The NodeManager class provides an interface to ObjectManagerBase in order to manage node data...
Definition: NodeManager.hpp:47
localIndex const & numEdgesPerElement() const
Get the number of edges per element.
This class serves to provide a "view" of a multidimensional array.
Definition: ArrayView.hpp:67
void setNumIndependentNodesPerElement(localIndex const numNodes)
Set the number of independent nodes per element.
A struct to serve as a container for variable strings and keys.
localIndex const & numFacesPerElement() const
Get the number of faces per element.
The ObjectManagerBase is the base object of all object managers in the mesh data hierachy.
localIndex m_numIndependentNodesPerElement
Number of independent nodes per element in this subregion.
localIndex const & numIndependentNodesPerElement() const
Get the number of independent nodes per element.
T * getConstitutiveModel(string const &name)
Get a pointer to the constitutive model.
array2d< real64 > m_elementCenter
Member level field for the element center.
void setNumEdgesPerElement(localIndex const numEdges)
Set the number of edges per element.
localIndex const & numNodesPerElement() const
Get the number of nodes per element.
struct to serve as a container for group strings and keys
#define GEOSX_UNUSED_VAR(...)
Mark an unused variable and silence compiler warnings.
Definition: GeosxMacros.hpp:78
localIndex m_numEdgesPerElement
Number of edges per element in this subregion.
void setNumFacesPerElement(localIndex const numFaces)
Set the number of faces per element.
std::ptrdiff_t localIndex
Local index type (for indexing objects within an MPI partition).
Definition: DataTypes.hpp:125
array1d< real64 > m_elementVolume
Member level field for the element volume.
arrayView2d< real64 const > getElementCenter() const
Get the center of each element in this subregion.
string m_elementTypeString
Type of element in this subregion.
dataRepository::Group const * GetConstitutiveModels() const
Get the group in which the constitutive models of this subregion are registered.
arrayView2d< real64 > getElementCenter()
Get the center of each element in this subregion.
The FaceManager class provides an interface to ObjectManagerBase in order to manage face data...
Definition: FaceManager.hpp:40
T const * getConstitutiveModel(string const &name) const
Get a pointer to the constitutive model.
localIndex m_numFacesPerElement
Number of faces per element in this subregion.
dataRepository::Group * GetConstitutiveModels()
Get the group in which the constitutive models of this subregion are registered.
This class provides a fixed dimensional resizeable array interface in addition to an interface simila...
Definition: Array.hpp:55
virtual string GetElementTypeString() const
Get the type of element in this subregion.
struct to serve as a container for variable strings and keys