Go to the documentation of this file.
21 #ifndef __grainInteractionKernels_hpp__
22 #define __grainInteractionKernels_hpp__
31 typename ContactForceModel,
32 typename ContactListType>
36 using PairType =
typename ContactListType::PairType;
37 using ValueType =
typename ContactListType::ValueType;
56 ContactForceModel forceModel,
57 ContactListType tobeFilled,
97 real ovrlp = (Ri+Rj) - dist;
106 auto Nij = (xj-xi)/dist;
107 auto Vr = Vi - Vj +
cross((Ri*wi+Rj*wj), Nij);
114 realx3 FCn, FCt, Mri, Mrj, Mij, Mji;
120 Ri, Rj, cGFi , cGFj ,
130 Ri, Rj, cGFi , cGFj ,
137 auto M =
cross(Nij,FCt);
143 Kokkos::atomic_add(&
cForce_[i].x_,FC.x_);
144 Kokkos::atomic_add(&
cForce_[i].y_,FC.y_);
145 Kokkos::atomic_add(&
cForce_[i].z_,FC.z_);
147 Kokkos::atomic_add(&
cForce_[j].x_,-FC.x_);
148 Kokkos::atomic_add(&
cForce_[j].y_,-FC.y_);
149 Kokkos::atomic_add(&
cForce_[j].z_,-FC.z_);
173 typename ContactForceModel,
174 typename ContactListType,
175 typename TraingleAccessor,
179 using PairType =
typename ContactListType::PairType;
205 ContactForceModel forceModel,
206 ContactListType tobeFilled,
207 TraingleAccessor triangles,
258 tri, xi, Ri, ovrlp, Nij, cp) )
269 auto Vr = Vi - Vw +
cross(Ri*wi, Nij);
276 realx3 FCn, FCt, Mri, Mrj, Mij;
282 Ri, Rj, cGFi , cGFj ,
294 Ri, Rj, cGFi , cGFj ,
301 auto M =
cross(Nij,FCt);
310 Kokkos::atomic_add(&
cForce_[i].x_,FC.x_);
311 Kokkos::atomic_add(&
cForce_[i].y_,FC.y_);
312 Kokkos::atomic_add(&
cForce_[i].z_,FC.z_);
314 Kokkos::atomic_add(&
wCForce_[tj].x_,-FC.x_);
315 Kokkos::atomic_add(&
wCForce_[tj].y_,-FC.y_);
316 Kokkos::atomic_add(&
wCForce_[tj].z_,-FC.z_);
337 #endif //__grainInteractionKernels_hpp__
deviceViewType1D< realx3 > rVel_
deviceViewType1D< realx3 > cTorque_
deviceViewType1D< realx3 > cTorque_
ContactListType tobeFilled_
deviceViewType1D< real > diam_
deviceViewType1D< real > coarseGrainFactor_
typename ContactListType::ValueType ValueType
typename ContactListType::PairType PairType
deviceViewType1D< realx3 > lVel_
deviceViewType1D< realx3 > rVel_
Kokkos::View< T * > deviceViewType1D
1D array (vector) with default device (memory space and execution space)
ContactForceModel forceModel_
deviceViewType1D< uint32 > propId_
deviceViewType1D< uint32 > wPropId_
deviceViewType1D< realx3 > pos_
INLINE_FUNCTION_HD triple< T > cross(const triple< T > &v1, const triple< T > &v2)
INLINE_FUNCTION_HD T length(const triple< T > &v1)
TraingleAccessor triangles_
deviceViewType1D< uint32 > wTriMotionIndex_
ContactListType tobeFilled_
deviceViewType1D< real > coarseGrainFactor_
INLINE_FUNCTION_HD bool isGrainInContactBothSides(const realx3x3 &tri, const realx3 &cntr, real Rad, real &ovrlp, realx3 &norm, realx3 &cp)
deviceViewType1D< uint32 > propId_
deviceViewType1D< realx3 > lVel_
deviceViewType1D< realx3 > wCForce_
pwInteractionFunctor(real dt, ContactForceModel forceModel, ContactListType tobeFilled, TraingleAccessor triangles, MotionModel motionModel, deviceViewType1D< real > diam, deviceViewType1D< real > coarseGrainFactor, deviceViewType1D< uint32 > propId, deviceViewType1D< realx3 > pos, deviceViewType1D< realx3 > lVel, deviceViewType1D< realx3 > rVel, deviceViewType1D< realx3 > cForce, deviceViewType1D< realx3 > cTorque, deviceViewType1D< uint32 > wTriMotionIndex, deviceViewType1D< uint32 > wPropId, deviceViewType1D< realx3 > wCForce)
deviceViewType1D< realx3 > cForce_
typename ContactListType::ValueType ValueType
ContactForceModel forceModel_
INLINE_FUNCTION_HD void operator()(const uint32 n) const
deviceViewType1D< realx3 > cForce_
INLINE_FUNCTION_HD void operator()(const int32 n) const
deviceViewType1D< real > diam_
typename ContactListType::PairType PairType
Motion model abstract class (CRTP) for all the motion models.
ppInteractionFunctor(real dt, ContactForceModel forceModel, ContactListType tobeFilled, deviceViewType1D< real > diam, deviceViewType1D< real > coarseGrainFactor, deviceViewType1D< uint32 > propId, deviceViewType1D< realx3 > pos, deviceViewType1D< realx3 > lVel, deviceViewType1D< realx3 > rVel, deviceViewType1D< realx3 > cForce, deviceViewType1D< realx3 > cTorque)
#define INLINE_FUNCTION_HD
deviceViewType1D< realx3 > pos_