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 "constitutive/ConstitutivePassThru.hpp"
27 #include "mesh/CellElementSubRegion.hpp"
39 template<
typename FE_TYPE,
69 FE_TYPE
const & finiteElementSpace,
70 SOLID_TYPE
const & solidModel,
71 fields::solidMechanics::arrayViewConst2dLayoutTotalDisplacement
const displacement,
72 fields::solidMechanics::arrayViewConst2dLayoutIncrDisplacement
const displacementInc,
73 fields::solidMechanics::arrayView2dLayoutStrain
const avgStrain,
74 fields::solidMechanics::arrayView2dLayoutStrain
const avgPlasticStrain ):
91 {
real64 uLocal[FE_TYPE::maxSupportPoints][3];
92 real64 uHatLocal[FE_TYPE::maxSupportPoints][3]; };
105 for(
localIndex a = 0; a < FE_TYPE::maxSupportPoints; ++a )
108 for(
int i = 0; i < 3; ++i )
115 for(
int icomp = 0; icomp < 6; ++icomp )
135 real64 dNdX[ FE_TYPE::maxSupportPoints ][3];
138 real64 strainInc[6] = {0.0};
139 FE_TYPE::symmetricGradient( dNdX, stack.uLocal, strain );
140 FE_TYPE::symmetricGradient( dNdX, stack.uHatLocal, strainInc );
142 real64 elasticStrainInc[6] = {0.0};
145 real64 conversionFactor[6] = {1.0, 1.0, 1.0, 0.5, 0.5, 0.5};
147 for(
int icomp = 0; icomp < 6; ++icomp )
154 if( std::abs( strainInc[icomp] ) > 1.0e-8 )
168 template<
typename POLICY,
169 typename KERNEL_TYPE >
172 KERNEL_TYPE
const & kernelComponent )
174 forAll< POLICY >( numElems,
177 typename KERNEL_TYPE::StackVariables stack;
179 kernelComponent.setup( k, stack );
180 for(
integer q = 0; q < FE_TYPE::numQuadraturePoints; ++q )
182 kernelComponent.quadraturePointKernel( k, q, stack );
193 fields::solidMechanics::arrayViewConst2dLayoutTotalDisplacement
const m_displacement;
199 fields::solidMechanics::arrayView2dLayoutStrain
const m_avgStrain;
230 template<
typename FE_TYPE,
238 FE_TYPE
const & finiteElementSpace,
239 SOLID_TYPE
const & solidModel,
240 fields::solidMechanics::arrayViewConst2dLayoutTotalDisplacement
const displacement,
241 fields::solidMechanics::arrayViewConst2dLayoutIncrDisplacement
const displacementInc,
242 fields::solidMechanics::arrayView2dLayoutStrain
const avgStrain,
243 fields::solidMechanics::arrayView2dLayoutStrain
const avgPlasticStrain )
246 kernel( nodeManager, edgeManager, faceManager, elementSubRegion, finiteElementSpace,
247 solidModel, displacement, displacementInc, avgStrain, avgPlasticStrain );
250 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::arrayViewConst2dLayoutTotalDisplacement const m_displacement
The displacement solution.
fields::solidMechanics::arrayView2dLayoutStrain const m_avgStrain
The average strain.
SOLID_TYPE::KernelWrapper const m_solidUpdate
The material.
GEOS_HOST_DEVICE void setup(localIndex const k, StackVariables &stack) const
Performs the setup phase for the kernel.
static void kernelLaunch(localIndex const numElems, KERNEL_TYPE const &kernelComponent)
Launch the kernel over the elements in the subRegion.
AverageStrainOverQuadraturePoints(NodeManager &nodeManager, EdgeManager const &edgeManager, FaceManager const &faceManager, CellElementSubRegion const &elementSubRegion, FE_TYPE const &finiteElementSpace, SOLID_TYPE const &solidModel, fields::solidMechanics::arrayViewConst2dLayoutTotalDisplacement const displacement, fields::solidMechanics::arrayViewConst2dLayoutIncrDisplacement const displacementInc, fields::solidMechanics::arrayView2dLayoutStrain const avgStrain, fields::solidMechanics::arrayView2dLayoutStrain const avgPlasticStrain)
Constructor for the class.
fields::solidMechanics::arrayView2dLayoutStrain const m_avgPlasticStrain
The average plastic strain.
fields::solidMechanics::arrayViewConst2dLayoutIncrDisplacement const m_displacementInc
The displacement increment.
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.
Class to create and launch the kernel.
static void createAndLaunch(NodeManager &nodeManager, EdgeManager const &edgeManager, FaceManager const &faceManager, CellElementSubRegion const &elementSubRegion, FE_TYPE const &finiteElementSpace, SOLID_TYPE const &solidModel, fields::solidMechanics::arrayViewConst2dLayoutTotalDisplacement const displacement, fields::solidMechanics::arrayViewConst2dLayoutIncrDisplacement const displacementInc, fields::solidMechanics::arrayView2dLayoutStrain const avgStrain, fields::solidMechanics::arrayView2dLayoutStrain const avgPlasticStrain)
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.
localIndex size() const
Get the "size" of the group, which determines the number of elements in resizable wrappers.
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.