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"
43 template<
typename FE_TYPE,
77 FE_TYPE
const & finiteElementSpace,
78 SOLID_TYPE
const & solidModel,
79 fields::solidMechanics::arrayViewConst2dLayoutTotalDisplacement
const displacement,
80 fields::solidMechanics::arrayViewConst2dLayoutIncrDisplacement
const displacementInc,
81 fields::solidMechanics::arrayView2dLayoutStrain
const avgStrain,
82 fields::solidMechanics::arrayView2dLayoutStrain
const avgPlasticStrain,
84 fields::solidMechanics::arrayView2dLayoutAvgStress
const avgStress,
107 {
real64 uLocal[FE_TYPE::maxSupportPoints][3];
108 real64 uHatLocal[FE_TYPE::maxSupportPoints][3]; };
121 for(
localIndex a = 0; a < FE_TYPE::maxSupportPoints; ++a )
124 for(
int i = 0; i < 3; ++i )
131 for(
int icomp = 0; icomp < 6; ++icomp )
151 real64 dNdX[ FE_TYPE::maxSupportPoints ][3];
152 real64 const detJxW = FE_TYPE::calcGradN( q, stack.xLocal, stack.feStack, dNdX );
154 real64 strainInc[6] = {0.0};
155 finiteElement::feOps::symmetricGradient( dNdX, stack.uLocal, strain );
156 finiteElement::feOps::symmetricGradient( dNdX, stack.uHatLocal, strainInc );
158 real64 elasticStrainInc[6] = {0.0};
161 real64 const thermalExpansionCoefficient =
m_solidUpdate.getThermalExpansionCoefficient( k );
166 real64 conversionFactor[6] = {1.0, 1.0, 1.0, 0.5, 0.5, 0.5};
168 for(
int icomp = 0; icomp < 6; ++icomp )
175 real64 const thermalStrainInc = ( icomp < 3 ) ? thermalExpansionCoefficient * deltaTemperature : 0.0;
176 real64 const mechanicalStrainInc = strainInc[icomp] - thermalStrainInc;
181 if( std::abs( mechanicalStrainInc ) > 1.0e-8 )
195 template<
typename POLICY,
196 typename KERNEL_TYPE >
199 KERNEL_TYPE
const & kernelComponent )
201 forAll< POLICY >( numElems,
204 typename KERNEL_TYPE::StackVariables stack;
206 kernelComponent.setup( k, stack );
207 for(
integer q = 0; q < FE_TYPE::numQuadraturePoints; ++q )
209 kernelComponent.quadraturePointKernel( k, q, stack );
220 fields::solidMechanics::arrayViewConst2dLayoutTotalDisplacement
const m_displacement;
226 fields::solidMechanics::arrayView2dLayoutStrain
const m_avgStrain;
235 fields::solidMechanics::arrayView2dLayoutAvgStress
const m_avgStress;
269 template<
typename FE_TYPE,
277 FE_TYPE
const & finiteElementSpace,
278 SOLID_TYPE
const & solidModel,
279 fields::solidMechanics::arrayViewConst2dLayoutTotalDisplacement
const displacement,
280 fields::solidMechanics::arrayViewConst2dLayoutIncrDisplacement
const displacementInc,
281 fields::solidMechanics::arrayView2dLayoutStrain
const avgStrain,
282 fields::solidMechanics::arrayView2dLayoutStrain
const avgPlasticStrain,
284 fields::solidMechanics::arrayView2dLayoutAvgStress
const avgStress,
288 AverageStressStrainOverQuadraturePoints< FE_TYPE, SOLID_TYPE >
289 kernel( nodeManager, edgeManager, faceManager, elementSubRegion, finiteElementSpace,
290 solidModel, displacement, displacementInc, avgStrain, avgPlasticStrain, stress, avgStress,
291 temperature, temperature_n );
293 AverageStressStrainOverQuadraturePoints< FE_TYPE, SOLID_TYPE >::template
294 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.
arrayView1d< real64 const > const m_temperature
The temperature at the current time step (empty for non-thermal simulations)
static void kernelLaunch(localIndex const numElems, KERNEL_TYPE const &kernelComponent)
Launch the kernel over the elements in the subRegion.
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, arrayView1d< real64 const > const temperature, arrayView1d< real64 const > const temperature_n)
Constructor for the class.
fields::solidMechanics::arrayViewConst2dLayoutIncrDisplacement const m_displacementInc
The displacement increment.
fields::solidMechanics::arrayView2dLayoutStrain const m_avgPlasticStrain
The average plastic strain.
arrayView1d< real64 const > const m_temperature_n
The temperature at the previous time step (empty for non-thermal simulations)
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, arrayView1d< real64 const > const temperature={}, arrayView1d< real64 const > const temperature_n={})
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.
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).
int integer
Signed integer type.
ArrayView< T, 3, USD > arrayView3d
Alias for 3D array view.
Kernel variables allocated on the stack.