20 #ifndef GEOS_PHYSICSSOLVERS_CONTACT_KERNELS_SOLIDMECHANICSPRESSUREFACEBUBBLEKERNELS_HPP_
21 #define GEOS_PHYSICSSOLVERS_CONTACT_KERNELS_SOLIDMECHANICSPRESSUREFACEBUBBLEKERNELS_HPP_
29 namespace solidMechanicsConformingContactKernels
38 template<
typename SUBREGION_TYPE,
39 typename CONSTITUTIVE_TYPE,
84 SUBREGION_TYPE
const & elementSubRegion,
85 FE_TYPE
const & finiteElementSpace,
86 CONSTITUTIVE_TYPE & inputConstitutiveType,
99 inputConstitutiveType,
105 m_X( nodeManager.referencePosition()),
106 m_incrementalDisp( nodeManager.getField< fields::solidMechanics::incrementalDisplacement >() ),
110 m_pressure( elementSubRegion.template getField< fields::flow::pressure >().toViewConst() ),
111 m_pressure_n( elementSubRegion.template getField< fields::flow::pressure_n >().toViewConst() ),
112 m_incrementalBubbleDisp( faceManager.getField< fields::contact::incrementalBubbleDisplacement >().toViewConst() )
176 template<
typename POLICY,
177 typename KERNEL_TYPE >
181 KERNEL_TYPE
const & kernelComponent )
188 RAJA::ReduceMax< ReducePolicy< POLICY >,
real64 > maxResidual( 0 );
190 forAll< POLICY >( kernelComponent.m_bubbleElems.size(),
193 typename KERNEL_TYPE::StackVariables stack;
195 kernelComponent.setup( i, stack );
196 for(
integer q=0; q<numQuadraturePointsPerElem; ++q )
198 kernelComponent.quadraturePointKernel( i, q, stack );
200 maxResidual.max( kernelComponent.complete( i, stack ) );
203 return maxResidual.get();
217 localIndex const localNodeIndex = m_elemsToNodes( k, a );
219 for(
int i=0; i<3; ++i )
221 stack.X[ a ][ i ] = m_X[ localNodeIndex ][ i ];
222 stack.uIncrLocal[ a*3 + i ] = m_incrementalDisp[ localNodeIndex ][i];
226 localIndex const localFaceIndex = m_elemsToFaces[kk][0];
228 for(
int i=0; i<3; ++i )
231 stack.bEqnRowIndices[i] = m_bDofNumber[localFaceIndex] + i - m_dofRankOffset;
232 stack.bIncrLocal[ i ] = m_incrementalBubbleDisp[ localFaceIndex ][i];
235 stack.pLocal[0] = m_pressure( k );
242 void quadraturePointKernel(
localIndex const kk,
249 constexpr
int nBubbleUdof = numFacesPerElem*3;
251 constexpr
int nUdof = numNodesPerElem*3;
253 real64 dBubbleNdX[ numFacesPerElem ][ 3 ];
255 LvArray::tensorOps::fill< numFacesPerElem, 3 >( dBubbleNdX, 0 );
257 real64 detJ = m_finiteElementSpace.calcGradFaceBubbleN( q, stack.X, dBubbleNdX );
259 real64 dNdX[ numNodesPerElem ][ 3 ];
260 detJ = m_finiteElementSpace.calcGradN( q, stack.X, dNdX );
263 m_constitutiveUpdate.getBiotCoefficient( k, biotCoefficient );
265 real64 strainBubbleMatrix[6][nBubbleUdof];
266 solidMechanicsConformingContactKernelsHelper::assembleStrainOperator< 6, nBubbleUdof, numFacesPerElem >( strainBubbleMatrix, dBubbleNdX );
268 real64 strainMatrix[6][nUdof];
269 solidMechanicsConformingContactKernelsHelper::assembleStrainOperator< 6, nUdof, numNodesPerElem >( strainMatrix, dNdX );
271 real64 biotPressure[6] = {0};
272 LvArray::tensorOps::symAddIdentity< 3 >( biotPressure, -biotCoefficient * stack.pLocal[0] );
275 real64 Rb_gauss[nBubbleUdof];
276 LvArray::tensorOps::Ri_eq_AjiBj< nBubbleUdof, 6 >( Rb_gauss, strainBubbleMatrix, biotPressure );
277 LvArray::tensorOps::scaledAdd< nBubbleUdof >( stack.localRb, Rb_gauss, -detJ );
279 real64 localStrainBubbleMatrix[6][3];
280 localIndex const parentFaceIndex = m_elemsToFaces[kk][1];
285 localStrainBubbleMatrix[i][j] = strainBubbleMatrix[i][parentFaceIndex*3+j];
288 real64 strainIncBubble[6] = {0};
289 real64 strainInc[6] = {0};
291 LvArray::tensorOps::Ri_eq_AijBj< 6, 3 >( strainIncBubble, localStrainBubbleMatrix, stack.bIncrLocal );
292 LvArray::tensorOps::Ri_eq_AijBj< 6, nUdof >( strainInc, strainMatrix, stack.uIncrLocal );
296 real64 totalStress[6] = {0};
297 typename CONSTITUTIVE_TYPE::KernelWrapper::DiscretizationOps stiffness;
299 m_constitutiveUpdate.smallStrainUpdatePoromechanicsFixedStress( k, q,
316 localIndex const parentFaceIndex = m_elemsToFaces[kk][1];
323 localRb[i] = stack.localRb[parentFaceIndex*3+i];
328 localIndex const dof = LvArray::integerConversion< localIndex >( stack.bEqnRowIndices[ i ] );
330 if( dof < 0 || dof >= m_matrix.numRows() )
continue;
332 RAJA::atomicAdd< parallelDeviceAtomic >( &m_rhs[dof], localRb[i] );
#define GEOS_HOST_DEVICE
Marks a host-device function.
#define GEOS_UNUSED_VAR(...)
Mark an unused variable and silence compiler warnings.
#define GEOS_MARK_FUNCTION
Mark function with both Caliper and NVTX if enabled.
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.
Define the base interface for implicit finite element kernels.
globalIndex const m_dofRankOffset
The global rank offset.
traits::ViewTypeConst< typename SUBREGION_TYPE::NodeMapType::base_type > const m_elemsToNodes
The element to nodes map.
FE_TYPE const m_finiteElementSpace
CRSMatrixView< real64, globalIndex const > const m_matrix
The global Jacobian matrix.
arrayView1d< globalIndex const > const m_dofNumber
The global degree of freedom number.
real64 const m_dt
time increment
static constexpr int maxNumTestSupportPointsPerElem
arrayView1d< real64 > const m_rhs
The global residaul vector.
CONSTITUTIVE_TYPE::KernelWrapper const m_constitutiveUpdate
Used to forward arguments to a class that implements the KernelBase interface.
ArrayView< T, 1 > arrayView1d
Alias for 1D array 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).
LvArray::CRSMatrixView< T, COL_INDEX, INDEX_TYPE const, LvArray::ChaiBuffer > CRSMatrixView
Alias for CRS Matrix View.
ArrayView< T, 2, USD > arrayView2d
Alias for 2D array view.
int integer
Signed integer type.
Kernel variables (dof numbers, jacobian and residual) located on the stack.