Go to the documentation of this file.
21 #ifndef __sphereInteractionKernels_hpp__
22 #define __sphereInteractionKernels_hpp__
31 typename ContactForceModel,
32 typename ContactListType>
36 using PairType =
typename ContactListType::PairType;
37 using ValueType =
typename ContactListType::ValueType;
55 ContactForceModel forceModel,
56 ContactListType tobeFilled,
90 real ovrlp = (Ri+Rj) - dist;
99 auto Nij = (xj-xi)/dist;
100 auto Vr = Vi - Vj +
cross((Ri*wi+Rj*wj), Nij);
107 realx3 FCn, FCt, Mri, Mrj, Mij, Mji;
130 auto M =
cross(Nij,FCt);
136 Kokkos::atomic_add(&
cForce_[i].x_,FC.x_);
137 Kokkos::atomic_add(&
cForce_[i].y_,FC.y_);
138 Kokkos::atomic_add(&
cForce_[i].z_,FC.z_);
140 Kokkos::atomic_add(&
cForce_[j].x_,-FC.x_);
141 Kokkos::atomic_add(&
cForce_[j].y_,-FC.y_);
142 Kokkos::atomic_add(&
cForce_[j].z_,-FC.z_);
166 typename ContactForceModel,
167 typename ContactListType,
168 typename TraingleAccessor,
172 using PairType =
typename ContactListType::PairType;
197 ContactForceModel forceModel,
198 ContactListType tobeFilled,
199 TraingleAccessor triangles,
246 tri, xi, Ri, ovrlp, Nij, cp) )
257 auto Vr = Vi - Vw +
cross(Ri*wi, Nij);
264 realx3 FCn, FCt, Mri, Mrj, Mij;
289 auto M =
cross(Nij,FCt);
298 Kokkos::atomic_add(&
cForce_[i].x_,FC.x_);
299 Kokkos::atomic_add(&
cForce_[i].y_,FC.y_);
300 Kokkos::atomic_add(&
cForce_[i].z_,FC.z_);
302 Kokkos::atomic_add(&
wCForce_[tj].x_,-FC.x_);
303 Kokkos::atomic_add(&
wCForce_[tj].y_,-FC.y_);
304 Kokkos::atomic_add(&
wCForce_[tj].z_,-FC.z_);
325 #endif //__sphereInteractionKernels_hpp__
deviceViewType1D< realx3 > lVel_
typename ContactListType::ValueType ValueType
deviceViewType1D< real > diam_
pwInteractionFunctor(real dt, ContactForceModel forceModel, ContactListType tobeFilled, TraingleAccessor triangles, MotionModel motionModel, deviceViewType1D< real > diam, 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)
INLINE_FUNCTION_HD void operator()(const uint32 n) const
deviceViewType1D< realx3 > wCForce_
typename ContactListType::PairType PairType
ContactForceModel forceModel_
deviceViewType1D< realx3 > cTorque_
ppInteractionFunctor(real dt, ContactForceModel forceModel, ContactListType tobeFilled, deviceViewType1D< real > diam, deviceViewType1D< uint32 > propId, deviceViewType1D< realx3 > pos, deviceViewType1D< realx3 > lVel, deviceViewType1D< realx3 > rVel, deviceViewType1D< realx3 > cForce, deviceViewType1D< realx3 > cTorque)
Kokkos::View< T * > deviceViewType1D
1D array (vector) with default device (memory space and execution space)
typename ContactListType::ValueType ValueType
deviceViewType1D< realx3 > rVel_
deviceViewType1D< realx3 > cTorque_
INLINE_FUNCTION_HD triple< T > cross(const triple< T > &v1, const triple< T > &v2)
deviceViewType1D< uint32 > wPropId_
TraingleAccessor triangles_
INLINE_FUNCTION_HD T length(const triple< T > &v1)
deviceViewType1D< realx3 > pos_
deviceViewType1D< realx3 > lVel_
deviceViewType1D< real > diam_
ContactListType tobeFilled_
deviceViewType1D< uint32 > wTriMotionIndex_
deviceViewType1D< uint32 > propId_
deviceViewType1D< realx3 > cForce_
ContactForceModel forceModel_
deviceViewType1D< uint32 > propId_
INLINE_FUNCTION_HD bool isSphereInContactBothSides(const realx3x3 &tri, const realx3 &cntr, real Rad, real &ovrlp, realx3 &norm, realx3 &cp)
Motion model abstract class (CRTP) for all the motion models.
deviceViewType1D< realx3 > pos_
typename ContactListType::PairType PairType
#define INLINE_FUNCTION_HD
deviceViewType1D< realx3 > cForce_
deviceViewType1D< realx3 > rVel_
INLINE_FUNCTION_HD void operator()(const int32 n) const
ContactListType tobeFilled_