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 "finiteElement/elementFormulations/FiniteElementOperators.hpp"
27 #include "constitutive/ConstitutivePassThru.hpp"
28 #include "mesh/CellElementSubRegion.hpp"
42 template<
typename FE_TYPE,
74 FE_TYPE
const & finiteElementSpace,
75 SOLID_TYPE
const & solidModel,
76 fields::solidMechanics::arrayViewConst2dLayoutTotalDisplacement
const displacement,
77 fields::solidMechanics::arrayViewConst2dLayoutIncrDisplacement
const displacementInc,
78 fields::solidMechanics::arrayView2dLayoutStrain
const avgStrain,
79 fields::solidMechanics::arrayView2dLayoutStrain
const avgPlasticStrain,
81 fields::solidMechanics::arrayView2dLayoutAvgStress
const avgStress ):
100 {
real64 uLocal[FE_TYPE::maxSupportPoints][3];
101 real64 uHatLocal[FE_TYPE::maxSupportPoints][3]; };
114 for(
localIndex a = 0; a < FE_TYPE::maxSupportPoints; ++a )
117 for(
int i = 0; i < 3; ++i )
124 for(
int icomp = 0; icomp < 6; ++icomp )
144 real64 dNdX[ FE_TYPE::maxSupportPoints ][3];
145 real64 const detJxW = FE_TYPE::calcGradN( q, stack.xLocal, stack.feStack, dNdX );
147 real64 strainInc[6] = {0.0};
148 finiteElement::feOps::symmetricGradient( dNdX, stack.uLocal, strain );
149 finiteElement::feOps::symmetricGradient( dNdX, stack.uHatLocal, strainInc );
151 real64 elasticStrainInc[6] = {0.0};
154 real64 conversionFactor[6] = {1.0, 1.0, 1.0, 0.5, 0.5, 0.5};
156 for(
int icomp = 0; icomp < 6; ++icomp )
164 if( std::abs( strainInc[icomp] ) > 1.0e-8 )
178 template<
typename POLICY,
179 typename KERNEL_TYPE >
182 KERNEL_TYPE
const & kernelComponent )
184 forAll< POLICY >( numElems,
187 typename KERNEL_TYPE::StackVariables stack;
189 kernelComponent.setup( k, stack );
190 for(
integer q = 0; q < FE_TYPE::numQuadraturePoints; ++q )
192 kernelComponent.quadraturePointKernel( k, q, stack );
203 fields::solidMechanics::arrayViewConst2dLayoutTotalDisplacement
const m_displacement;
209 fields::solidMechanics::arrayView2dLayoutStrain
const m_avgStrain;
218 fields::solidMechanics::arrayView2dLayoutAvgStress
const m_avgStress;
246 template<
typename FE_TYPE,
254 FE_TYPE
const & finiteElementSpace,
255 SOLID_TYPE
const & solidModel,
256 fields::solidMechanics::arrayViewConst2dLayoutTotalDisplacement
const displacement,
257 fields::solidMechanics::arrayViewConst2dLayoutIncrDisplacement
const displacementInc,
258 fields::solidMechanics::arrayView2dLayoutStrain
const avgStrain,
259 fields::solidMechanics::arrayView2dLayoutStrain
const avgPlasticStrain,
261 fields::solidMechanics::arrayView2dLayoutAvgStress
const avgStress )
264 kernel( nodeManager, edgeManager, faceManager, elementSubRegion, finiteElementSpace,
265 solidModel, displacement, displacementInc, avgStrain, avgPlasticStrain, stress, avgStress );
268 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.