20 #ifndef GEOS_MESH_ELEMENTSUBREGIONBASE_HPP_
21 #define GEOS_MESH_ELEMENTSUBREGIONBASE_HPP_
25 #include "LvArray/src/tensorOps.hpp"
34 namespace constitutive
36 class ConstitutiveBase;
168 {
return m_constitutiveModels; }
174 {
return m_constitutiveModels; }
182 template<
typename T = constitutive::ConstitutiveBase >
184 {
return m_constitutiveModels.
getGroup< T >( name ); }
189 template<
typename T = constitutive::ConstitutiveBase >
191 {
return m_constitutiveModels.
getGroup< T >( name ); }
273 template<
class NODE_MAP >
278 auto const e2n = toNodesRelation.toViewConst();
282 LvArray::tensorOps::copy< 3 >( elementCenters[k], X[e2n( k, 0 )] );
286 LvArray::tensorOps::add< 3 >( elementCenters[k], X[e2n( k, a )] );
289 LvArray::tensorOps::scale< 3 >( elementCenters[k], 1.0 / numNodes );
#define GEOS_UNUSED_VAR(...)
Mark an unused variable and silence compiler warnings.
T const & getConstitutiveModel(string const &name) const
Get a pointer to the constitutive model.
localIndex const & numEdgesPerElement() const
Gets the number of edges per element.
void setElementType(ElementType const elemType)
Setter for m_elementType.
localIndex const & numFacesPerElement() const
Get the number of faces per element.
virtual void setupRelatedObjectsInRelations(MeshLevel const &mesh)=0
Link the connectivity maps of the subregion to the managers storing the mesh information.
virtual void fixUpDownMaps(bool const clearIfUnmapped)
Call ObjectManagerBase::fixUpDownMaps for the connectivity maps needed by the derived class (i....
ElementType m_elementType
Type of element in this subregion.
virtual void calculateElementGeometricQuantities(NodeManager const &nodeManager, FaceManager const &faceManager)=0
Calculate the geometric quantities for each element in the subregion.
arrayView2d< real64 const > getElementCenter() const
Get the center of each element in this subregion.
localIndex m_numNodesPerElement
Number of nodes per element in this subregion.
dataRepository::Group & getConstitutiveModels()
Get the group in which the constitutive models of this subregion are registered.
array2d< real64 > & getElementCenter()
Get the center of each element in this subregion.
localIndex m_numFacesPerElement
Number of faces per element in this subregion.
localIndex const & numNodesPerElement() const
Get the number of nodes per element.
virtual localIndex numNodesPerElement(localIndex const k) const
Get the number of nodes per element.
dataRepository::Group const & getConstitutiveModels() const
Get the group in which the constitutive models of this subregion are registered.
~ElementSubRegionBase()
Destructor.
ElementSubRegionBase(string const &name, dataRepository::Group *const parent)
Constructor for this class.
array1d< real64 > m_elementVolume
Member level field for the element volume.
array2d< real64 > m_elementCenter
Member level field for the element center.
T & getConstitutiveModel(string const &name)
Get a pointer to the constitutive model.
void calculateElementCenters(NODE_MAP const &toNodesRelation, arrayView2d< real64 const, nodes::REFERENCE_POSITION_USD > const &X) const
Compute the center of each element in the subregion.
localIndex m_numEdgesPerElement
Number of edges per element in this subregion.
arrayView1d< real64 const > getElementVolume() const
Get the volume of each element in this subregion.
virtual void resizePerElementValues(localIndex const numNodesPerElement, localIndex const numEdgesPerElement, localIndex const numFacesPerElement)
Set all "perElement" values for this subregion.
ElementType getElementType() const
Get the type of element in this subregion.
The FaceManager class provides an interface to ObjectManagerBase in order to manage face data.
Class facilitating the representation of a multi-level discretization of a MeshBody.
The NodeManager class provides an interface to ObjectManagerBase in order to manage node data.
The ObjectManagerBase is the base object of all object managers in the mesh data hierachy.
T & getGroup(KEY const &key)
Return a reference to a sub-group of the current Group.
localIndex size() const
Get the "size" of the group, which determines the number of elements in resizable wrappers.
ArrayView< T, 1 > arrayView1d
Alias for 1D array view.
Array< T, 2, PERMUTATION > array2d
Alias for 2D array.
GEOS_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
ElementType
Denotes type of cell/element shape.
ArrayView< T, 2, USD > arrayView2d
Alias for 2D array view.
Array< T, 1 > array1d
Alias for 1D array.
struct to serve as a container for group strings and keys
static constexpr auto constitutiveModelsString()
A struct to serve as a container for variable strings and keys.
static constexpr char const * nodeListString()
static constexpr char const * numFacesPerElementString()
static constexpr char const * numEdgesPerElementString()
static constexpr char const * edgeListString()
static constexpr char const * elementVolumeString()
static constexpr char const * numNodesPerElementString()
static constexpr char const * elementCenterString()
static constexpr char const * faceListString()
struct to serve as a container for group strings and keys
struct to serve as a container for variable strings and keys