20 #ifndef GEOS_MESH_UTILITIES_AVERAGEOVERQUADRATUREPOINTSKERNEL_HPP_
21 #define GEOS_MESH_UTILITIES_AVERAGEOVERQUADRATUREPOINTSKERNEL_HPP_
24 #include "common/GEOS_RAJA_Interface.hpp"
25 #include "finiteElement/FiniteElementDispatch.hpp"
26 #include "mesh/CellElementSubRegion.hpp"
36 template<
typename SUBREGION_TYPE,
53 SUBREGION_TYPE
const & elementSubRegion,
54 FE_TYPE
const & finiteElementSpace ):
57 m_X( nodeManager.referencePosition() ),
60 finiteElement::FiniteElementBase::
61 initialize< FE_TYPE >( nodeManager,
103 for(
localIndex a = 0; a < FE_TYPE::maxSupportPoints; ++a )
107 for(
integer i = 0; i < 3; ++i )
109 stack.
xLocal[a][i] =
m_X[localNodeIndex][i];
121 traits::ViewTypeConst< typename SUBREGION_TYPE::NodeMapType::base_type >
const m_elemsToNodes;
130 typename FE_TYPE::template MeshData< SUBREGION_TYPE >
m_meshData;
138 template<
typename SUBREGION_TYPE,
165 SUBREGION_TYPE
const & elementSubRegion,
166 FE_TYPE
const & finiteElementSpace,
173 finiteElementSpace ),
219 template<
typename POLICY,
220 typename KERNEL_TYPE >
223 KERNEL_TYPE
const & kernelComponent )
225 forAll< POLICY >( numElems,
228 typename KERNEL_TYPE::StackVariables stack;
230 kernelComponent.setup( k, stack );
231 for(
integer q = 0; q < FE_TYPE::numQuadraturePoints; ++q )
233 kernelComponent.quadraturePointKernel( k, q, stack );
270 template<
typename SUBREGION_TYPE,
277 SUBREGION_TYPE
const & elementSubRegion,
278 FE_TYPE
const & finiteElementSpace,
283 kernel( nodeManager, edgeManager, faceManager, elementSubRegion, finiteElementSpace,
284 property, averageProperty );
287 kernelLaunch< POLICY >( elementSubRegion.size(), kernel );
#define GEOS_HOST_DEVICE
Marks a host-device function.
arrayView2d< real64 const > const m_property
The property living on quadrature points.
AverageOverQuadraturePoints1D(NodeManager &nodeManager, EdgeManager const &edgeManager, FaceManager const &faceManager, SUBREGION_TYPE const &elementSubRegion, FE_TYPE const &finiteElementSpace, arrayView2d< real64 const > const property, arrayView1d< real64 > const averageProperty)
Constructor for the class.
GEOS_HOST_DEVICE void quadraturePointKernel(localIndex const k, localIndex const q, StackVariables &stack) const
Increment the average property with the contribution of the property at this quadrature point.
arrayView1d< real64 > const m_averageProperty
The average property.
static void kernelLaunch(localIndex const numElems, KERNEL_TYPE const &kernelComponent)
Launch the kernel over the elements in the subRegion.
arrayView1d< real64 const > const m_elementVolume
The volume of the elements.
GEOS_HOST_DEVICE void setup(localIndex const k, StackVariables &stack) const
Performs the setup phase for the kernel.
Class to create and launch the kernel.
static void createAndLaunch(NodeManager &nodeManager, EdgeManager const &edgeManager, FaceManager const &faceManager, SUBREGION_TYPE const &elementSubRegion, FE_TYPE const &finiteElementSpace, arrayView2d< real64 const > const property, arrayView1d< real64 > const averageProperty)
Create a new kernel and launch.
GEOS_HOST_DEVICE void setup(localIndex const k, StackVariables &stack) const
Performs the setup phase for the kernel.
arrayView2d< real64 const, nodes::REFERENCE_POSITION_USD > const m_X
The reference position of the nodes.
FE_TYPE const & m_finiteElementSpace
arrayView1d< real64 const > const m_elementVolume
The volume of the elements.
FE_TYPE::template MeshData< SUBREGION_TYPE > m_meshData
Data structure containing mesh data used to setup the finite element.
traits::ViewTypeConst< typename SUBREGION_TYPE::NodeMapType::base_type > const m_elemsToNodes
The element to nodes map.
AverageOverQuadraturePointsBase(NodeManager &nodeManager, EdgeManager const &edgeManager, FaceManager const &faceManager, SUBREGION_TYPE const &elementSubRegion, FE_TYPE const &finiteElementSpace)
Constructor for the class.
This class provides an interface to ObjectManagerBase in order to manage edge data.
The FaceManager class provides an interface to ObjectManagerBase in order to manage face data.
The NodeManager class provides an interface to ObjectManagerBase in order to manage node data.
ArrayView< T, 1 > arrayView1d
Alias for 1D array view.
double real64
64-bit floating point type.
GEOS_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
std::int32_t integer
Signed integer type.
ArrayView< T, 2, USD > arrayView2d
Alias for 2D array view.
Kernel variables allocated on the stack.
Kernel variables allocated on the stack.
FE_TYPE::StackVariables feStack
Stack variables needed for the underlying FEM type.
real64 xLocal[FE_TYPE::maxSupportPoints][3]
C-array stack storage for element local the nodal positions.
GEOS_HOST_DEVICE StackVariables()