20 #ifndef GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_KERNELS_STRESSSTRAINAVERAGEKERNELS_HPP_
21 #define GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_KERNELS_STRESSSTRAINAVERAGEKERNELS_HPP_
24 #include "common/GEOS_RAJA_Interface.hpp"
25 #include "finiteElement/FiniteElementDispatch.hpp"
26 #include "constitutive/ConstitutivePassThru.hpp"
27 #include "mesh/CellElementSubRegion.hpp"
41 template<
typename FE_TYPE,
73 FE_TYPE
const & finiteElementSpace,
74 SOLID_TYPE
const & solidModel,
75 fields::solidMechanics::arrayViewConst2dLayoutTotalDisplacement
const displacement,
76 fields::solidMechanics::arrayViewConst2dLayoutIncrDisplacement
const displacementInc,
77 fields::solidMechanics::arrayView2dLayoutStrain
const avgStrain,
78 fields::solidMechanics::arrayView2dLayoutStrain
const avgPlasticStrain,
80 fields::solidMechanics::arrayView2dLayoutAvgStress
const avgStress ):
99 {
real64 uLocal[FE_TYPE::maxSupportPoints][3];
100 real64 uHatLocal[FE_TYPE::maxSupportPoints][3]; };
113 for(
localIndex a = 0; a < FE_TYPE::maxSupportPoints; ++a )
116 for(
int i = 0; i < 3; ++i )
123 for(
int icomp = 0; icomp < 6; ++icomp )
143 real64 dNdX[ FE_TYPE::maxSupportPoints ][3];
146 real64 strainInc[6] = {0.0};
147 FE_TYPE::symmetricGradient( dNdX, stack.uLocal, strain );
148 FE_TYPE::symmetricGradient( dNdX, stack.uHatLocal, strainInc );
150 real64 elasticStrainInc[6] = {0.0};
153 real64 conversionFactor[6] = {1.0, 1.0, 1.0, 0.5, 0.5, 0.5};
155 for(
int icomp = 0; icomp < 6; ++icomp )
163 if( std::abs( strainInc[icomp] ) > 1.0e-8 )
177 template<
typename POLICY,
178 typename KERNEL_TYPE >
181 KERNEL_TYPE
const & kernelComponent )
183 forAll< POLICY >( numElems,
186 typename KERNEL_TYPE::StackVariables stack;
188 kernelComponent.setup( k, stack );
189 for(
integer q = 0; q < FE_TYPE::numQuadraturePoints; ++q )
191 kernelComponent.quadraturePointKernel( k, q, stack );
202 fields::solidMechanics::arrayViewConst2dLayoutTotalDisplacement
const m_displacement;
208 fields::solidMechanics::arrayView2dLayoutStrain
const m_avgStrain;
217 fields::solidMechanics::arrayView2dLayoutAvgStress
const m_avgStress;
245 template<
typename FE_TYPE,
253 FE_TYPE
const & finiteElementSpace,
254 SOLID_TYPE
const & solidModel,
255 fields::solidMechanics::arrayViewConst2dLayoutTotalDisplacement
const displacement,
256 fields::solidMechanics::arrayViewConst2dLayoutIncrDisplacement
const displacementInc,
257 fields::solidMechanics::arrayView2dLayoutStrain
const avgStrain,
258 fields::solidMechanics::arrayView2dLayoutStrain
const avgPlasticStrain,
260 fields::solidMechanics::arrayView2dLayoutAvgStress
const avgStress )
263 kernel( nodeManager, edgeManager, faceManager, elementSubRegion, finiteElementSpace,
264 solidModel, displacement, displacementInc, avgStrain, avgPlasticStrain, stress, avgStress );
267 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.
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.
fields::solidMechanics::arrayViewConst2dLayoutIncrDisplacement const m_displacementInc
The displacement increment.
fields::solidMechanics::arrayView2dLayoutStrain const m_avgPlasticStrain
The average plastic strain.
AverageStressStrainOverQuadraturePoints(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, arrayView3d< real64 const, solid::STRESS_USD > const stress, fields::solidMechanics::arrayView2dLayoutAvgStress const avgStress)
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.
fields::solidMechanics::arrayView2dLayoutStrain const m_avgStrain
The average strain.
SOLID_TYPE::KernelWrapper const m_solidUpdate
The material.
fields::solidMechanics::arrayView2dLayoutAvgStress const m_avgStress
The average stress.
fields::solidMechanics::arrayViewConst2dLayoutTotalDisplacement const m_displacement
The displacement solution.
arrayView3d< real64 const, solid::STRESS_USD > const m_stress
The stress solution.
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, arrayView3d< real64 const, solid::STRESS_USD > const stress, fields::solidMechanics::arrayView2dLayoutAvgStress const avgStress)
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).
int integer
Signed integer type.
ArrayView< T, 3, USD > arrayView3d
Alias for 3D array view.
Kernel variables allocated on the stack.