MercuryDPM  0.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CTangentialSpring Class Reference

Stores the tangential spring $\vec{\delta}_{ij}^t$ needed to compute a tangential elastic force between particles PI, PJ. More...

#include <CTangentialSpring.h>

Public Member Functions

 CTangentialSpring ()
 constructors More...
 
 CTangentialSpring (int pParticle_, int pWall_, Mdouble time_)
 
 CTangentialSpring (const CTangentialSpring &ts)
 copy constructor More...
 
void print (std::ostream &os)
 outputs tangential spring More...
 
void reverse ()
 

Public Attributes

Vec3D delta
 stores the spring More...
 
Vec3D RollingSpring
 
Vec3D TorsionSpring
 
Vec3D SlidingForce
 Stores the force (for some non-linear, hysteretic spring models) More...
 
int pParticle
 A pointer to the particle in contact; NULL if the contact is with a wall (The other particle is the particle in which CDeltaMax is located) More...
 
int pWall
 A pointer to the wall in contact; NULL if the contact is with a particle (The other particle is the particle in which CDeltaMax is located) More...
 
Mdouble time
 stores the last time the tangential spring was read (if it was not read during the last timestep, the contact is old and will be deleted) More...
 
bool sliding
 
bool slidingRolling
 
bool slidingTorsion
 

Friends

std::ostream & operator<< (std::ostream &os, const CTangentialSpring &p)
 writes spring More...
 
std::istream & operator>> (std::istream &is, CTangentialSpring &p)
 reads spring More...
 

Detailed Description

Stores the tangential spring $\vec{\delta}_{ij}^t$ needed to compute a tangential elastic force between particles PI, PJ.

Definition at line 38 of file CTangentialSpring.h.

Constructor & Destructor Documentation

CTangentialSpring::CTangentialSpring ( )
inline

constructors

Definition at line 41 of file CTangentialSpring.h.

References delta, pParticle, pWall, RollingSpring, Vec3D::set_zero(), sliding, SlidingForce, slidingRolling, slidingTorsion, time, and TorsionSpring.

41  {
42  delta.set_zero();
46  pParticle=-1;
47  pWall=-1;
48  time=-1;
49  sliding = false;
50  slidingRolling = false;
51  slidingTorsion = false;
52  }
int pParticle
A pointer to the particle in contact; NULL if the contact is with a wall (The other particle is the p...
int pWall
A pointer to the wall in contact; NULL if the contact is with a particle (The other particle is the p...
Vec3D delta
stores the spring
void set_zero()
Definition: Vector.h:55
Vec3D SlidingForce
Stores the force (for some non-linear, hysteretic spring models)
Mdouble time
stores the last time the tangential spring was read (if it was not read during the last timestep...
CTangentialSpring::CTangentialSpring ( int  pParticle_,
int  pWall_,
Mdouble  time_ 
)
inline

Definition at line 54 of file CTangentialSpring.h.

References delta, pParticle, pWall, RollingSpring, Vec3D::set_zero(), sliding, SlidingForce, slidingRolling, slidingTorsion, time, and TorsionSpring.

54  {
55  delta.set_zero();
59  pParticle = pParticle_;
60  pWall = pWall_;
61  time = time_;
62  sliding = false;
63  slidingRolling = false;
64  slidingTorsion = false;
65  }
int pParticle
A pointer to the particle in contact; NULL if the contact is with a wall (The other particle is the p...
int pWall
A pointer to the wall in contact; NULL if the contact is with a particle (The other particle is the p...
Vec3D delta
stores the spring
void set_zero()
Definition: Vector.h:55
Vec3D SlidingForce
Stores the force (for some non-linear, hysteretic spring models)
Mdouble time
stores the last time the tangential spring was read (if it was not read during the last timestep...
CTangentialSpring::CTangentialSpring ( const CTangentialSpring ts)
inline

copy constructor

Definition at line 68 of file CTangentialSpring.h.

References delta, pParticle, pWall, RollingSpring, sliding, SlidingForce, slidingRolling, slidingTorsion, time, and TorsionSpring.

68  {
69  delta = ts.delta;
73  pParticle = ts.pParticle;
74  pWall = ts.pWall;
75  time = ts.time;
76  sliding = ts.sliding;
79  }
int pParticle
A pointer to the particle in contact; NULL if the contact is with a wall (The other particle is the p...
int pWall
A pointer to the wall in contact; NULL if the contact is with a particle (The other particle is the p...
Vec3D delta
stores the spring
Vec3D SlidingForce
Stores the force (for some non-linear, hysteretic spring models)
Mdouble time
stores the last time the tangential spring was read (if it was not read during the last timestep...

Member Function Documentation

void CTangentialSpring::print ( std::ostream &  os)
inline

outputs tangential spring

Definition at line 82 of file CTangentialSpring.h.

References delta, pParticle, pWall, and time.

82  {
83  os << "delta:" << delta
84  << ", particle:" << pParticle
85  << ", wall:" << pWall
86  << ", time:" << time;
87  }
int pParticle
A pointer to the particle in contact; NULL if the contact is with a wall (The other particle is the p...
int pWall
A pointer to the wall in contact; NULL if the contact is with a particle (The other particle is the p...
Vec3D delta
stores the spring
Mdouble time
stores the last time the tangential spring was read (if it was not read during the last timestep...
void CTangentialSpring::reverse ( )
inline

Definition at line 103 of file CTangentialSpring.h.

References delta, RollingSpring, SlidingForce, and TorsionSpring.

Referenced by TangentialSpringParticle::moveInHandler().

104  {
105  delta=-delta;
109  }
Vec3D delta
stores the spring
Vec3D SlidingForce
Stores the force (for some non-linear, hysteretic spring models)

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const CTangentialSpring p 
)
friend

writes spring

Definition at line 90 of file CTangentialSpring.h.

91  {
92  os << p.delta << " " << p.RollingSpring << " " << p.TorsionSpring << " " << p.pParticle << " " << p.pWall << " " << p.time;
93  return os;
94  }
int pParticle
A pointer to the particle in contact; NULL if the contact is with a wall (The other particle is the p...
int pWall
A pointer to the wall in contact; NULL if the contact is with a particle (The other particle is the p...
Vec3D delta
stores the spring
Mdouble time
stores the last time the tangential spring was read (if it was not read during the last timestep...
std::istream& operator>> ( std::istream &  is,
CTangentialSpring p 
)
friend

reads spring

Definition at line 97 of file CTangentialSpring.h.

98  {
99  is >> p.delta >> p.RollingSpring >> p.TorsionSpring >> p.pParticle >> p.pWall >> p.time;
100  return is;
101  }
int pParticle
A pointer to the particle in contact; NULL if the contact is with a wall (The other particle is the p...
int pWall
A pointer to the wall in contact; NULL if the contact is with a particle (The other particle is the p...
Vec3D delta
stores the spring
Mdouble time
stores the last time the tangential spring was read (if it was not read during the last timestep...

Member Data Documentation

Vec3D CTangentialSpring::delta
int CTangentialSpring::pParticle

A pointer to the particle in contact; NULL if the contact is with a wall (The other particle is the particle in which CDeltaMax is located)

Definition at line 118 of file CTangentialSpring.h.

Referenced by CTangentialSpring(), TangentialSpringParticle::moveInHandler(), and print().

int CTangentialSpring::pWall

A pointer to the wall in contact; NULL if the contact is with a particle (The other particle is the particle in which CDeltaMax is located)

Definition at line 120 of file CTangentialSpring.h.

Referenced by CTangentialSpring(), and print().

Vec3D CTangentialSpring::RollingSpring
bool CTangentialSpring::sliding
Vec3D CTangentialSpring::SlidingForce

Stores the force (for some non-linear, hysteretic spring models)

Definition at line 116 of file CTangentialSpring.h.

Referenced by MD::compute_internal_forces(), MD::compute_walls(), CTangentialSpring(), and reverse().

bool CTangentialSpring::slidingRolling
bool CTangentialSpring::slidingTorsion
Mdouble CTangentialSpring::time

stores the last time the tangential spring was read (if it was not read during the last timestep, the contact is old and will be deleted)

Definition at line 122 of file CTangentialSpring.h.

Referenced by CTangentialSpring(), CTangentialSprings::check_spring_time::operator()(), and print().

Vec3D CTangentialSpring::TorsionSpring

The documentation for this class was generated from the following file: