19 #ifndef GEOSX_MESH_CELLBLOCK_HPP_ 20 #define GEOSX_MESH_CELLBLOCK_HPP_ 25 #include "rajaInterface/GEOS_RAJA_Interface.hpp" 61 {
return "CellBlock"; }
122 LvArray::tensorOps::copy< 3 >( elementCenters[ k ], X[
m_toNodesRelation( k, 0 ) ] );
125 LvArray::tensorOps::add< 3 >( elementCenters[ k ], X[
m_toNodesRelation( k, a ) ] );
128 LvArray::tensorOps::scale< 3 >( elementCenters[ k ], 1.0 / nNodes );
147 LvArray::tensorOps::add< 3 >( m_elementCenter[ k ], X[
m_toNodesRelation( k, a ) ] );
151 if( m_numNodesPerElement == 8 )
155 else if( m_numNodesPerElement == 4 )
159 else if( m_numNodesPerElement == 6 )
163 else if( m_numNodesPerElement == 5 )
169 GEOSX_ERROR(
"GEOX does not support cells with " << m_numNodesPerElement <<
" nodes" );
180 virtual void SetElementType(
string const & elementType )
override;
273 template<
typename T >
277 return this->registerWrapper< T >( propertyName )->reference();
285 template<
typename LAMBDA >
288 for(
auto & externalPropertyName : m_externalPropertyNames )
FaceMapType m_toFacesRelation
Element-to-face relation.
FixedOneToManyRelation & edgeList()
Get the element-to-edge map.
localIndex GetFaceNodes(localIndex const elementIndex, localIndex const localFaceIndex, localIndex *const nodeIndices) const
Get the local indices of the nodes in a face of the element.
CellBlock()=delete
Deleted default constructor.
localIndex m_numNodesPerElement
Number of nodes per element in this subregion.
InterObjectRelation< array2d< localIndex > > FixedOneToManyRelation
A relationship from single objects to many other objects, where each object is related to the same nu...
T & AddProperty(string const &propertyName)
Add a property to the CellBlock.
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...
localIndex GetNumFaceNodes(localIndex const elementIndex, localIndex const localFaceIndex) const
Get the number of the nodes in a face of the element.
void calculateElementCenters(arrayView2d< real64 const, nodes::REFERENCE_POSITION_USD > const &X) const
Compute the center of each element in the subregion.
This class serves to provide a "view" of a multidimensional array.
void forExternalProperties(LAMBDA &&lambda)
Helper function to apply a lambda function over all the external properties of the subregion...
std::enable_if_t< _NDIM==1 > emplace_back(ARGS &&... args)
Construct a value in place at the end of the array.
double real64
64-bit floating point type.
virtual void SetElementType(string const &elementType) override
Set the type of element in this subregion.
virtual void CalculateElementGeometricQuantities(NodeManager const &nodeManager, FaceManager const &facemanager) override
Calculate the geometric quantities for each element in the subregion.
EdgeMapType m_toEdgesRelation
Element-to-edge relation.
NodeMapType m_toNodesRelation
Element-to-node relation.
virtual ~CellBlock() override
Destructor.
Base class for all wrappers containing common operations.
localIndex & nodeList(localIndex const k, localIndex a)
Get the local index of the a-th node of the k-th element.
NodeMapType & nodeList()
Get the element-to-node map.
array2d< real64 > m_elementCenter
Member level field for the element center.
localIndex const & numNodesPerElement() const
Get the number of nodes per element.
FixedOneToManyRelation const & faceList() const
Get the element-to-face map.
void CalculateCellVolumesKernel(localIndex const k, arrayView2d< real64 const, nodes::REFERENCE_POSITION_USD > const &X) const
Compute the volume of the k-th element in the subregion.
#define GEOSX_ERROR(msg)
Raise a hard error and terminate the program.
virtual void setupRelatedObjectsInRelations(MeshLevel const *const mesh) override
Link the connectivity maps of the subregion to the managers storing the mesh information.
localIndex const & nodeList(localIndex const k, localIndex a) const
Get the local index of the a-th node of the k-th element.
localIndex size() const
Get the "size" of the group, which determines the number of elements in resizable wrappers...
static const string CatalogName()
Const getter for the catalog name.
std::ptrdiff_t localIndex
Local index type (for indexing objects within an MPI partition).
array1d< real64 > m_elementVolume
Member level field for the element volume.
FixedOneToManyRelation const & edgeList() const
Get the element-to-edge map.
The FaceManager class provides an interface to ObjectManagerBase in order to manage face data...
NodeMapType const & nodeList() const
Get the element-to-node map.
WrapperBase const * getWrapperBase(indexType const index) const
Retrieve a WrapperBase stored in this group.
This class provides a fixed dimensional resizeable array interface in addition to an interface simila...
FixedOneToManyRelation & faceList()
Get the element-to-face map.
virtual const string getCatalogName() const override final
Const getter for the catalog name.