19 #ifndef GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_KERNELS_IMPLCITSMALLSTRAINNEWMARK_IMPL_HPP_
20 #define GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_KERNELS_IMPLCITSMALLSTRAINNEWMARK_IMPL_HPP_
28 namespace solidMechanicsLagrangianFEMKernels
31 template<
typename SUBREGION_TYPE,
32 typename CONSTITUTIVE_TYPE,
39 SUBREGION_TYPE
const & elementSubRegion,
40 FE_TYPE
const & finiteElementSpace,
41 CONSTITUTIVE_TYPE & inputConstitutiveType,
47 real64 const (&inputGravityVector)[3],
48 real64 const inputNewmarkGamma,
49 real64 const inputNewmarkBeta,
50 real64 const inputMassDamping,
51 real64 const inputStiffnessDamping ):
59 inputConstitutiveType,
66 m_vtilde( nodeManager.getField< fields::solidMechanics::totalDisplacement >() ),
67 m_uhattilde( nodeManager.getField< fields::solidMechanics::totalDisplacement >() ),
68 m_newmarkGamma( inputNewmarkGamma ),
69 m_newmarkBeta( inputNewmarkBeta ),
70 m_massDamping( inputMassDamping ),
71 m_stiffnessDamping( inputStiffnessDamping )
76 template<
typename SUBREGION_TYPE,
77 typename CONSTITUTIVE_TYPE,
87 localIndex const localNodeIndex = m_elemsToNodes( k, a );
88 for(
localIndex i=0; i<numDofPerTrialSupportPoint; ++i )
90 stack.
vtilde_local[ a ][ i ] = m_vtilde[ localNodeIndex ][ i ];
94 Base::setup( k, stack );
97 template<
typename SUBREGION_TYPE,
98 typename CONSTITUTIVE_TYPE,
108 Base::quadraturePointKernel( k, q, stack );
111 real64 N[numNodesPerElem];
112 FE_TYPE::calcN( q, N );
114 for(
int a=0; a<numNodesPerElem; ++a )
116 for(
int b=a; b<numNodesPerElem; ++b )
118 real64 const integrationFactor = m_density( k, q ) * N[a] * N[b] * detJ;
119 real64 const temp1 = ( m_massDamping * m_newmarkGamma/( m_newmarkBeta * m_dt )
120 + 1.0 / ( m_newmarkBeta * m_dt * m_dt ) )* integrationFactor;
122 constexpr
int nsdof = numDofPerTestSupportPoint;
123 for(
int i=0; i<nsdof; ++i )
127 m_newmarkGamma/( m_newmarkBeta * m_dt ) *( stack.
uhat_local[b][i]
131 stack.localResidual[ a*nsdof+i ] -= ( m_massDamping * vel + acc ) * integrationFactor;
137 template<
typename SUBREGION_TYPE,
138 typename CONSTITUTIVE_TYPE,
147 for(
int a=0; a<numNodesPerElem; ++a )
149 for(
int b=0; b<numNodesPerElem; ++b )
151 for(
int i=0; i<numDofPerTestSupportPoint; ++i )
153 for(
int j=0; j<numDofPerTrialSupportPoint; ++j )
155 stack.localResidual[ a*numDofPerTestSupportPoint+i ] =
156 stack.localResidual[ a*numDofPerTestSupportPoint+i ] +
157 m_stiffnessDamping * stack.localJacobian[ a*numDofPerTestSupportPoint+i][ b*numDofPerTrialSupportPoint+j ] *
160 stack.localJacobian[a*numDofPerTestSupportPoint+i][b*numDofPerTrialSupportPoint+j] =
161 stack.localJacobian[a*numDofPerTestSupportPoint+i][b*numDofPerTrialSupportPoint+j] +
162 stack.localJacobian[a][b] * (1.0 + m_stiffnessDamping * m_newmarkGamma / ( m_newmarkBeta * m_dt ) ) +
169 for(
int a=0; a<stack.maxNumRows; ++a )
171 for(
int b=0; b<stack.maxNumCols; ++b )
173 stack.localJacobian[a][b] += stack.localJacobian[a][b] * (1.0 + m_stiffnessDamping * m_newmarkGamma / ( m_newmarkBeta * m_dt ) )
178 return Base::complete( k, stack );
181 template<
typename SUBREGION_TYPE,
182 typename CONSTITUTIVE_TYPE,
184 template<
typename POLICY,
185 typename KERNEL_TYPE >
188 KERNEL_TYPE
const & kernelComponent )
190 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.
double real64
64-bit floating point type.
GEOSX_GLOBALINDEX_TYPE globalIndex
Global index type (for indexing objects across MPI partitions).
GEOSX_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.