20 #ifndef GEOS_PHYSICSSOLVERS_CONTACT_KERNELS_SOLIDMECHANICSLAGRANGECONTACTKERNELS_HPP_
21 #define GEOS_PHYSICSSOLVERS_CONTACT_KERNELS_SOLIDMECHANICSLAGRANGECONTACTKERNELS_HPP_
24 #include "SolidMechanicsConformingContactKernelsBase.hpp"
29 namespace solidMechanicsLagrangeContactKernels
35 template<
typename CONSTITUTIVE_TYPE,
80 FE_TYPE
const & finiteElementSpace,
81 CONSTITUTIVE_TYPE & inputConstitutiveType,
89 string const tractionDofKey ):
96 inputConstitutiveType,
104 m_traction( elementSubRegion.getField< fields::contact::traction >().toViewConst() ),
105 m_tDofNumber( elementSubRegion.getReference<
globalIndex_array >( tractionDofKey ).toViewConst() ),
106 m_incrDisp( nodeManager.getField< fields::solidMechanics::incrementalDisplacement >() ),
107 m_incrBubbleDisp( faceManager.getField< fields::solidMechanics::incrementalBubbleDisplacement >() ),
108 m_targetIncrementalJump( elementSubRegion.getField< fields::contact::targetIncrementalJump >().toViewConst() )
120 Base::StackVariables(),
182 template<
typename POLICY,
183 typename KERNEL_TYPE >
187 KERNEL_TYPE
const & kernelComponent )
189 return Base::template kernelLaunch< POLICY, KERNEL_TYPE >( numElems, kernelComponent );
214 for(
int i=0; i<3; ++i )
222 stack.
duLocal[a*3+i] = m_incrDisp[kn0][i];
223 stack.
duLocal[shift + a*3+i] = m_incrDisp[kn1][i];
227 for(
int j=0; j<3; ++j )
229 for(
int i=0; i<3; ++i )
241 for(
int i=0; i<3; ++i )
249 stack.
dbLocal[ i ] = m_incrBubbleDisp[ kf0 ][i];
250 stack.
dbLocal[ 3 + i ] = m_incrBubbleDisp[ kf1 ][i];
253 for(
int i=0; i<3; ++i )
262 void quadraturePointKernel(
localIndex const k,
264 StackVariables & stack )
const
266 Base::quadraturePointKernel( k, q, stack, [ =, &stack ] (
real64 const detJ )
268 stack.localRt[0] -= detJ * (
m_dispJump[k][0] - m_targetIncrementalJump[k][0] );
278 StackVariables & stack )
const
287 LvArray::tensorOps::Rij_eq_AkiBkj< 3, numUdofs, 3 >( matRRtAtu, stack.localRotationMatrix, stack.localAtu );
289 LvArray::tensorOps::Rij_eq_AkiBkj< 3, numBdofs, 3 >( matRRtAtb, stack.localRotationMatrix, stack.localAtb );
291 LvArray::tensorOps::copy< numTdofs, numUdofs >( stack.localAtu, matRRtAtu );
292 LvArray::tensorOps::copy< numTdofs, numBdofs >( stack.localAtb, matRRtAtb );
294 LvArray::tensorOps::scale< numTdofs, numUdofs >( stack.localAtu, -1.0 );
295 LvArray::tensorOps::scale< numTdofs, numBdofs >( stack.localAtb, -1.0 );
297 LvArray::tensorOps::transpose< numUdofs, numTdofs >( stack.localAut, stack.localAtu );
298 LvArray::tensorOps::transpose< numBdofs, numTdofs >( stack.localAbt, stack.localAtb );
301 LvArray::tensorOps::Ri_eq_AijBj< numUdofs, numTdofs >( tractionR, stack.localAut, m_traction[k] );
302 LvArray::tensorOps::Ri_eq_AijBj< numBdofs, numTdofs >( tractionRb, stack.localAbt, m_traction[k] );
306 LvArray::tensorOps::scaledAdd< numUdofs >( stack.localRu, tractionR, 1.0 );
308 LvArray::tensorOps::scaledAdd< numBdofs >( stack.localRb, tractionRb, 1.0 );
317 arrayView2d< real64 const >
const m_traction;
319 arrayView1d< globalIndex const >
const m_tDofNumber;
321 arrayView2d< real64 const, nodes::INCR_DISPLACEMENT_USD >
const m_incrDisp;
323 arrayView2d< real64 const >
const m_incrBubbleDisp;
325 arrayView2d< real64 const >
const m_targetIncrementalJump;
362 if( dof < 0 || dof >=
m_matrix.numRows() )
continue;
365 RAJA::atomicAdd< parallelDeviceAtomic >( &
m_rhs[dof], stack.
localRt[i] );
368 m_matrix.template addToRowBinarySearchUnsorted< parallelDeviceAtomic >( dof,
374 m_matrix.template addToRowBinarySearchUnsorted< parallelDeviceAtomic >( dof,
380 m_matrix.template addToRowBinarySearchUnsorted< parallelDeviceAtomic >( dof,
390 if( dof < 0 || dof >=
m_matrix.numRows() )
continue;
393 RAJA::atomicAdd< parallelDeviceAtomic >( &
m_rhs[dof], stack.
localRu[i] );
396 m_matrix.template addToRowBinarySearchUnsorted< parallelDeviceAtomic >( dof,
407 if( dof < 0 || dof >=
m_matrix.numRows() )
continue;
410 RAJA::atomicAdd< parallelDeviceAtomic >( &
m_rhs[dof], stack.
localRb[i] );
413 m_matrix.template addToRowBinarySearchUnsorted< parallelDeviceAtomic >( dof,
#define GEOS_HOST_DEVICE
Marks a host-device function.
#define GEOS_UNUSED_VAR(...)
Mark an unused variable and silence compiler warnings.
Partition of the decomposed physical domain. It also manages the connexion information to its neighbo...
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.
globalIndex const m_dofRankOffset
The global rank offset.
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.
static constexpr int maxNumTestSupportPointsPerElem
arrayView1d< real64 > const m_rhs
The global residaul vector.
Used to forward arguments to a class that implements the InterfaceKernelBase interface.
CONSTITUTIVE_TYPE::KernelWrapper const m_constitutiveUpdate
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).
array1d< globalIndex > globalIndex_array
A 1-dimensional array of geos::globalIndex types.
double real64
64-bit floating point type.
GEOS_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).