Go to the documentation of this file.
21 #ifndef __linearCF_hpp__
22 #define __linearCF_hpp__
30 template<
bool limited=true>
86 auto nElem = kn.
size();
89 if(nElem != kt.
size())
92 "sizes of kn("<<nElem<<
") and kt("<<kt.
size()<<
") do not match.\n";
96 if(nElem != en.
size())
99 "sizes of kn("<<nElem<<
") and en("<<en.
size()<<
") do not match.\n";
103 if(nElem != et.
size())
106 "sizes of kn("<<nElem<<
") and et("<<et.
size()<<
") do not match.\n";
110 if(nElem != mu.
size())
113 "sizes of kn("<<nElem<<
") and mu("<<mu.
size()<<
") do not match.\n";
123 "sizes of properties do not match a symetric array with size ("<<
130 "size mismatch for porperties. \n"<<
131 "you supplied "<<
numMaterial_<<
" items in materials list and "<<
132 nMat <<
" for other properties.\n";
141 etha_n[i] = -2.0*
log(en[i])*
sqrt(kn[i])/
144 etha_t[i] = -2.0*
log( et[i]*
sqrt(kt[i]) )/
151 prop[i] = {kn[i], kt[i], etha_n[i], etha_t[i], mu[i]};
162 if constexpr (limited)
164 return "linearLimited";
168 return "linearNonLimited";
184 rho_(
"rho",nMaterial),
188 Kokkos::deep_copy(
rho_,rho);
249 real sqrt_meff =
sqrt((mi*mj)/(mi+mj));
251 FCn = (-prop.kn_ * ovrlp_n - sqrt_meff * prop.ethan_ * vrn)*Nij;
252 FCt = -prop.kt_ * history.
overlap_t_ - sqrt_meff * prop.ethat_*Vt;
261 if constexpr (limited)
268 FCt = (FCt/ft)*ft_fric;
INLINE_FUNCTION_HD int32 numMaterial() const
#define fatalExit
Fatal exit.
Vector< T, Allocator > pow(const Vector< T, Allocator > &v1, const Vector< T, Allocator > &v2)
Vector< T, Allocator > sqrt(const Vector< T, Allocator > &v)
LinearArrayType linearProperties_
INLINE_FUNCTION_HD void contactForce(const real dt, const uint32 i, const uint32 j, const uint32 propId_i, const uint32 propId_j, const real Ri, const real Rj, const real ovrlp_n, const realx3 &Vr, const realx3 &Nij, contactForceStorage &history, realx3 &FCn, realx3 &FCt) const
bool readLinearDictionary(const dictionary &dict)
INLINE_FUNCTION_HD ~linear()=default
auto size() const
Size of the vector.
static bool getN(uint32 nElem, uint32 &n)
INLINE_FUNCTION_HD T dot(const quadruple< T > &oprnd1, const quadruple< T > &oprnd2)
bool assign(const Vector< T > src)
#define fatalErrorInFunction
Report a fatal error and function name and exit the application.
INLINE_FUNCTION_HD T length(const triple< T > &v1)
Vector< T, Allocator > log(const Vector< T, Allocator > &v)
linear(int32 nMaterial, const ViewType1D< real > &rho, const dictionary &dict)
INLINE_FUNCTION_HD linearProperties()
INLINE_FUNCTION_HD linear()
#define ForAll(i, container)
Kokkos::View< T *, properties... > ViewType1D
1D veiw as a vector
T getVal(const word &keyword) const
get the value of data entry
INLINE_FUNCTION_HD ~linearProperties()=default
INLINE_FUNCTION_HD linearProperties & operator=(const linearProperties &)=default
static const char * modelName()
INLINE_FUNCTION_HD linearProperties(real kn, real kt, real etha_n, real etha_t, real mu)
INLINE_FUNCTION_HD linear & operator=(const linear &)=default
#define INLINE_FUNCTION_HD
Dictionary holds a set of data entries or sub-dictionaries that are enclosed in a curely braces or ar...