PeriDEM 0.3.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
Loading...
Searching...
No Matches
anonymous_namespace{selfContact.cpp} Namespace Reference

Functions

util::Point cappedRepulsive (const util::Point &yji, double volj, double Kn, double natural_R)
 

Function Documentation

◆ cappedRepulsive()

util::Point anonymous_namespace{selfContact.cpp}::cappedRepulsive ( const util::Point yji,
double  volj,
double  Kn,
double  natural_R 
)

Definition at line 17 of file selfContact.cpp.

18 {
19 const double Rji = yji.length();
20 if (!(Rji > 0.) || !(natural_R > 0.))
21 return util::Point();
22
23 double gap = Rji - natural_R;
24 if (gap > 0.)
25 gap = 0.;
26 else {
27 // Cap penetration so a bond that breaks while already deep inside
28 // natural_R cannot inject a discontinuous Kn*(R-natural_R) kick.
29 const double gap_cap = -0.25 * natural_R;
30 if (gap < gap_cap)
31 gap = gap_cap;
32 }
33
34 const double scalar_f = Kn * volj * gap / Rji;
35 return scalar_f * yji;
36}
A structure to represent 3d vectors.
Definition point.h:30
double length() const
Computes the Euclidean length of the vector.
Definition point.h:124

References util::Point::length().

Here is the call graph for this function: