PeriDEM 0.3.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
Loading...
Searching...
No Matches
contact Namespace Reference

Data Structures

class  AnalyticalPlaneWallContact
 
class  Contact
 Contact neighbor search and force assembly. Pair law and damping are separate types on this object. More...
 
class  Damping
 
class  MeshedWallContact
 
struct  Pair
 One node-node contact pair. Assembly fills this; the law uses it. More...
 
class  PairForce
 
class  StickSlipPairForce
 
class  WallContact
 Optional analytical wall-contact path (Model.Wall_Contact). More...
 

Functions

double correctedContactVolume (double volj, double Rji, double Rc, double h)
 
std::unique_ptr< PairForcemakePairForce (const std::string &friction_law)
 Build pair-force object from friction-law name.
 
std::unique_ptr< DampingmakeDamping (const std::string &name)
 Build COM damping object, or nullptr when the law has no COM term.
 
bool usesComDamping (const std::string &damping_law)
 True for com / com_and_node.
 
bool usesNodeDamping (const std::string &damping_law)
 True for node / com_and_node.
 
std::unique_ptr< WallContactmakeWallContact (const std::string &name)
 

Function Documentation

◆ correctedContactVolume()

double contact::correctedContactVolume ( double  volj,
double  Rji,
double  Rc,
double  h 
)

Partial volume of neighbor j near the contact radius (same idea as the horizon correction in the PD force loop). Full volume when R is well inside Rc - h/2; linearly tapers to zero by Rc + h/2.

Definition at line 19 of file pairForce.cpp.

20 {
21 if (!(volj > 0.) || !(Rc > 0.) || !(h > 0.) || !(Rji > 0.))
22 return volj;
23
24 const double check_up = Rc + 0.5 * h;
25 const double check_low = Rc - 0.5 * h;
26 if (util::isGreater(Rji, check_low)) {
27 volj *= (check_up - Rji) / h;
28 if (volj < 0.)
29 volj = 0.;
30 }
31 return volj;
32}
bool isGreater(const double &a, const double &b)
Returns true if a > b.
Definition function.cpp:15

References util::isGreater().

Referenced by contact::Contact::computeForces(), and main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ makeDamping()

std::unique_ptr< Damping > contact::makeDamping ( const std::string &  name)

Build COM damping object, or nullptr when the law has no COM term.

Definition at line 29 of file policy.cpp.

29 {
30 if (name == "com_and_node" || name == "com")
31 return std::make_unique<Damping>();
32 if (name == "node" || name == "off")
33 return nullptr;
34 throw std::runtime_error(
35 "Unknown Contact.Damping_Law '" + name +
36 "'. Supported: com_and_node, com, node, off.");
37}

Referenced by main(), and contact::Contact::setup().

Here is the caller graph for this function:

◆ makePairForce()

std::unique_ptr< PairForce > contact::makePairForce ( const std::string &  friction_law)

Build pair-force object from friction-law name.

Definition at line 17 of file policy.cpp.

17 {
18 if (friction_law != "coulomb_simple" && friction_law != "stick_slip") {
19 throw std::runtime_error(
20 "Unknown Contact.Friction_Law '" + friction_law +
21 "'. Supported: coulomb_simple, stick_slip.");
22 }
23
24 if (friction_law == "stick_slip")
25 return std::make_unique<StickSlipPairForce>();
26 return std::make_unique<PairForce>();
27}

Referenced by main(), and contact::Contact::setup().

Here is the caller graph for this function:

◆ makeWallContact()

std::unique_ptr< WallContact > contact::makeWallContact ( const std::string &  name)

Definition at line 113 of file wallContact.cpp.

113 {
114 if (name == "meshed")
115 return std::make_unique<MeshedWallContact>();
116 if (name == "analytical_plane")
117 return std::make_unique<AnalyticalPlaneWallContact>();
118 throw std::runtime_error(
119 "Unknown Model.Wall_Contact '" + name +
120 "'. Supported: meshed, analytical_plane.");
121}

References makeWallContact().

Referenced by main(), makeWallContact(), and contact::Contact::setup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ usesComDamping()

bool contact::usesComDamping ( const std::string &  damping_law)

True for com / com_and_node.

Definition at line 39 of file policy.cpp.

39 {
40 return damping_law == "com" || damping_law == "com_and_node";
41}

Referenced by main().

Here is the caller graph for this function:

◆ usesNodeDamping()

bool contact::usesNodeDamping ( const std::string &  damping_law)

True for node / com_and_node.

Definition at line 43 of file policy.cpp.

43 {
44 return damping_law == "node" || damping_law == "com_and_node";
45}

Referenced by main(), and contact::Contact::setup().

Here is the caller graph for this function: