20 #ifndef GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_KERNELS_STRAINHELPER_HPP_
21 #define GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_KERNELS_STRAINHELPER_HPP_
24 #include "common/GEOS_RAJA_Interface.hpp"
25 #include "finiteElement/FiniteElementDispatch.hpp"
26 #include "mesh/CellElementSubRegion.hpp"
37 template<
typename SUBREGION_TYPE,
66 SUBREGION_TYPE
const & elementSubRegion,
67 FE_TYPE
const & finiteElementSpace,
68 fields::solidMechanics::arrayViewConst2dLayoutTotalDisplacement
const displacement,
69 fields::solidMechanics::arrayView2dLayoutStrain
const avgStrain ):
83 {
real64 uLocal[FE_TYPE::maxSupportPoints][3]; };
96 for(
localIndex a = 0; a < FE_TYPE::maxSupportPoints; ++a )
99 for(
int i = 0; i < 3; ++i )
105 for(
int icomp = 0; icomp < 6; ++icomp )
124 real64 dNdX[ FE_TYPE::maxSupportPoints ][3];
127 FE_TYPE::symmetricGradient( dNdX, stack.uLocal, strain );
129 for(
int icomp = 0; icomp < 6; ++icomp )
142 template<
typename POLICY,
143 typename KERNEL_TYPE >
146 KERNEL_TYPE
const & kernelComponent )
148 forAll< POLICY >( numElems,
151 typename KERNEL_TYPE::StackVariables stack;
153 kernelComponent.setup( k, stack );
154 for(
integer q = 0; q < FE_TYPE::numQuadraturePoints; ++q )
156 kernelComponent.quadraturePointKernel( k, q, stack );
164 fields::solidMechanics::arrayViewConst2dLayoutTotalDisplacement
const m_displacement;
167 fields::solidMechanics::arrayView2dLayoutStrain
const m_avgStrain;
194 template<
typename SUBREGION_TYPE,
201 SUBREGION_TYPE
const & elementSubRegion,
202 FE_TYPE
const & finiteElementSpace,
203 fields::solidMechanics::arrayViewConst2dLayoutTotalDisplacement
const displacement,
204 fields::solidMechanics::arrayView2dLayoutStrain
const avgStrain )
207 kernel( nodeManager, edgeManager, faceManager, elementSubRegion, finiteElementSpace,
208 displacement, avgStrain );
211 kernelLaunch< POLICY >( elementSubRegion.size(), kernel );
#define GEOS_HOST_DEVICE
Marks a host-device function.
GEOS_HOST_DEVICE void setup(localIndex const k, StackVariables &stack) const
Performs the setup phase for the kernel.
FE_TYPE const & m_finiteElementSpace
arrayView1d< real64 const > const m_elementVolume
The volume of the elements.
traits::ViewTypeConst< typename SUBREGION_TYPE::NodeMapType::base_type > const m_elemsToNodes
The element to nodes map.
fields::solidMechanics::arrayView2dLayoutStrain const m_avgStrain
The average strain.
GEOS_HOST_DEVICE void setup(localIndex const k, StackVariables &stack) const
Performs the setup phase for the kernel.
FE_TYPE const & m_finiteElementSpace
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 > const m_elementVolume
The volume of the elements.
AverageStrainOverQuadraturePoints(NodeManager &nodeManager, EdgeManager const &edgeManager, FaceManager const &faceManager, SUBREGION_TYPE const &elementSubRegion, FE_TYPE const &finiteElementSpace, fields::solidMechanics::arrayViewConst2dLayoutTotalDisplacement const displacement, fields::solidMechanics::arrayView2dLayoutStrain const avgStrain)
Constructor for the class.
traits::ViewTypeConst< typename SUBREGION_TYPE::NodeMapType::base_type > const m_elemsToNodes
The element to nodes map.
static void kernelLaunch(localIndex const numElems, KERNEL_TYPE const &kernelComponent)
Launch the kernel over the elements in the subRegion.
fields::solidMechanics::arrayViewConst2dLayoutTotalDisplacement const m_displacement
The displacement solution.
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, fields::solidMechanics::arrayViewConst2dLayoutTotalDisplacement const displacement, fields::solidMechanics::arrayView2dLayoutStrain const avgStrain)
Create a new kernel and launch.
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.
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.
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.
Kernel variables allocated on the stack.