20 #ifndef GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_KERNELS_IMPLCITSMALLSTRAINNEWMARK_IMPL_HPP_
21 #define GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_KERNELS_IMPLCITSMALLSTRAINNEWMARK_IMPL_HPP_
29 namespace solidMechanicsLagrangianFEMKernels
32 template<
typename SUBREGION_TYPE,
33 typename CONSTITUTIVE_TYPE,
40 SUBREGION_TYPE
const & elementSubRegion,
41 FE_TYPE
const & finiteElementSpace,
42 CONSTITUTIVE_TYPE & inputConstitutiveType,
48 real64 const (&inputGravityVector)[3],
49 real64 const inputNewmarkGamma,
50 real64 const inputNewmarkBeta,
51 real64 const inputMassDamping,
52 real64 const inputStiffnessDamping ):
60 inputConstitutiveType,
67 m_vtilde( nodeManager.getField< fields::solidMechanics::totalDisplacement >() ),
68 m_uhattilde( nodeManager.getField< fields::solidMechanics::totalDisplacement >() ),
69 m_newmarkGamma( inputNewmarkGamma ),
70 m_newmarkBeta( inputNewmarkBeta ),
71 m_massDamping( inputMassDamping ),
72 m_stiffnessDamping( inputStiffnessDamping )
77 template<
typename SUBREGION_TYPE,
78 typename CONSTITUTIVE_TYPE,
88 localIndex const localNodeIndex = m_elemsToNodes( k, a );
89 for(
localIndex i=0; i<numDofPerTrialSupportPoint; ++i )
91 stack.
vtilde_local[ a ][ i ] = m_vtilde[ localNodeIndex ][ i ];
95 Base::setup( k, stack );
98 template<
typename SUBREGION_TYPE,
99 typename CONSTITUTIVE_TYPE,
109 Base::quadraturePointKernel( k, q, stack );
112 real64 N[numNodesPerElem];
113 FE_TYPE::calcN( q, N );
115 for(
int a=0; a<numNodesPerElem; ++a )
117 for(
int b=a; b<numNodesPerElem; ++b )
119 real64 const integrationFactor = m_density( k, q ) * N[a] * N[b] * detJ;
120 real64 const temp1 = ( m_massDamping * m_newmarkGamma/( m_newmarkBeta * m_dt )
121 + 1.0 / ( m_newmarkBeta * m_dt * m_dt ) )* integrationFactor;
123 constexpr
int nsdof = numDofPerTestSupportPoint;
124 for(
int i=0; i<nsdof; ++i )
128 m_newmarkGamma/( m_newmarkBeta * m_dt ) *( stack.
uhat_local[b][i]
132 stack.localResidual[ a*nsdof+i ] -= ( m_massDamping * vel + acc ) * integrationFactor;
138 template<
typename SUBREGION_TYPE,
139 typename CONSTITUTIVE_TYPE,
148 for(
int a=0; a<numNodesPerElem; ++a )
150 for(
int b=0; b<numNodesPerElem; ++b )
152 for(
int i=0; i<numDofPerTestSupportPoint; ++i )
154 for(
int j=0; j<numDofPerTrialSupportPoint; ++j )
156 stack.localResidual[ a*numDofPerTestSupportPoint+i ] =
157 stack.localResidual[ a*numDofPerTestSupportPoint+i ] +
158 m_stiffnessDamping * stack.localJacobian[ a*numDofPerTestSupportPoint+i][ b*numDofPerTrialSupportPoint+j ] *
161 stack.localJacobian[a*numDofPerTestSupportPoint+i][b*numDofPerTrialSupportPoint+j] =
162 stack.localJacobian[a*numDofPerTestSupportPoint+i][b*numDofPerTrialSupportPoint+j] +
163 stack.localJacobian[a][b] * (1.0 + m_stiffnessDamping * m_newmarkGamma / ( m_newmarkBeta * m_dt ) ) +
170 for(
int a=0; a<stack.maxNumRows; ++a )
172 for(
int b=0; b<stack.maxNumCols; ++b )
174 stack.localJacobian[a][b] += stack.localJacobian[a][b] * (1.0 + m_stiffnessDamping * m_newmarkGamma / ( m_newmarkBeta * m_dt ) )
179 return Base::complete( k, stack );
182 template<
typename SUBREGION_TYPE,
183 typename CONSTITUTIVE_TYPE,
185 template<
typename POLICY,
186 typename KERNEL_TYPE >
189 KERNEL_TYPE
const & kernelComponent )
191 return Base::template kernelLaunch< POLICY, KERNEL_TYPE >( numElems, kernelComponent );
#define GEOS_HOST_DEVICE
Marks a host-device function.
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.
GEOS_HOST_DEVICE void quadraturePointKernel(localIndex const k, localIndex const q, StackVariables &stack) const
Performs a state update at a quadrature point.
ImplicitSmallStrainNewmark(NodeManager const &nodeManager, EdgeManager const &edgeManager, FaceManager const &faceManager, localIndex const targetRegionIndex, SUBREGION_TYPE const &elementSubRegion, FE_TYPE const &finiteElementSpace, CONSTITUTIVE_TYPE &inputConstitutiveType, arrayView1d< globalIndex const > const &inputDofNumber, globalIndex const rankOffset, CRSMatrixView< real64, globalIndex const > const inputMatrix, arrayView1d< real64 > const inputRhs, real64 const inputDt, real64 const (&inputGravityVector)[3], real64 const inputNewmarkGamma, real64 const inputNewmarkBeta, real64 const inputMassDamping, real64 const inputStiffnessDamping)
Constructor.
static real64 kernelLaunch(localIndex const numElems, KERNEL_TYPE const &kernelComponent)
Kernel Launcher.
GEOS_HOST_DEVICE void setup(localIndex const k, StackVariables &stack) const
Copy global values from primary field to a local stack array.
GEOS_HOST_DEVICE real64 complete(localIndex const k, StackVariables &stack) const
Implements kernels for solving quasi-static equilibrium.
ArrayView< T, 1 > arrayView1d
Alias for 1D array view.
LvArray::CRSMatrixView< T, COL_INDEX, localIndex const, LvArray::ChaiBuffer > CRSMatrixView
Alias for CRS Matrix View.
GEOS_GLOBALINDEX_TYPE globalIndex
Global index type (for indexing objects across MPI partitions).
double real64
64-bit floating point type.
GEOS_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
real64 uhattilde_local[numNodesPerElem][numDofPerTrialSupportPoint]
Stack storage for the incremental displacement predictor.
real64 vtilde_local[numNodesPerElem][numDofPerTrialSupportPoint]
Stack storage for the velocity predictor.
real64 dRdU_InertiaMassDamping[maxNumRows][maxNumCols]
Stack storage for the Inertial damping contributions to the Jacobian.
real64 uhat_local[numNodesPerElem][numDofPerTrialSupportPoint]
Stack storage for the element local nodal incremental displacement.