NDDEM
Public Member Functions | Public Attributes | List of all members
cp< d > Class Template Reference

Contact properties class. More...

#include <ContactList.h>

+ Inheritance diagram for cp< d >:

Public Member Functions

 cp ()
 Only for use when restarting. More...
 
 cp (int ii, int jj, double ctlength, Action< d > *default_action)
 New contact creation. More...
 
 cp (const cp &v)
 
 ~cp ()
 Remove & clean contact. More...
 
cpoperator= (const cp &c)
 Affect contact. More...
 
Action< d > & getinfo ()
 Returning stored information. More...
 
void setinfo (Action< d > *a)
 Set information for contact force. More...
 
void saveinfo (Action< d > &a)
 Save information regarding the contact forces for later write down. More...
 
template<class Archive >
void save (Archive &ar) const
 
template<class Archive >
void load (Archive &ar)
 
std::pair< vector< double >, vector< double > > compute_branchvector (cv2d &X, Parameters< d > &P)
 Compute the location & branch vector of the contact. More...
 

Public Attributes

int i
 Index of contacting particle. More...
 
int j
 Index of second contacting particle or wall. If this is a wall contact, j=2*walldimension + (0 or 1 if it is the low wall or high wall) More...
 
double contactlength
 Length of the contact. More...
 
uint32_t ghost
 Contain ghost information about ghost contact, cf detailed description. More...
 
uint32_t ghostdir
 Contain ghost information about ghost direction, cf detailed description. More...
 
std::vector< double > tspr
 Vector of tangential contact history. More...
 
Action< d > * infos
 stores contact information if contact storing is requires More...
 
bool owninfos
 True if the contact contains stored information for dump retrieval. More...
 
bool persisting
 True if the contact is still maintained for the current ts. More...
 

Detailed Description

template<int d>
class cp< d >

Contact properties class.

How ghost work
Image particles though periodic boundary conditions (PBC) are called ghost. A ghost can be an image through multiple PBC. ghost indicate if particle j is making contact through 1 or more PBC (of ghost>0), and if so through which PBC. A bit set to 1 at position n in ghost indicates an image through the PBC in the n-th dimension. Least significant bit (LSB) correspond to dimension 0. Walls are counted identically as PBC for dimension counting. ghostdir follows the same logic as ghost but a bit set to 1 (resp. 0) at position n indicates an image through the high (resp. low) n-th dimension, which should be a PBC.
Warning
A ghost bit of 1 should never happen on a non PBC dimension. A ghostdir bit of 1 should never happen on a non PBC dimension, or without a 1 bit at the same location in ghost.
The number of dimensions is limited to sizeof(uint32_t) because of these ghost, as they are using 32 bit datatype. There is a risk of overflowing the datatype if using PBC at higher than 32 dimensions, or if using a PBC in dimension 32 (since the last bit could be interpreted as a sign bit). Walls in dimensions higher than 32 may be ok, but without guarantee.
Todo:
Ghosts should be improved in order to use either a bitset datatype, or a custom datatype, to avoid the limitation to sizeof(uint32_t) in the number of dimension.

Constructor & Destructor Documentation

◆ cp() [1/3]

template<int d>
cp< d >::cp ( )
inline

Only for use when restarting.

◆ cp() [2/3]

template<int d>
cp< d >::cp ( int  ii,
int  jj,
double  ctlength,
Action< d > *  default_action 
)
inline

New contact creation.

◆ cp() [3/3]

template<int d>
cp< d >::cp ( const cp< d > &  v)
inline

◆ ~cp()

template<int d>
cp< d >::~cp ( )
inline

Remove & clean contact.

Member Function Documentation

◆ compute_branchvector()

template<int d>
std::pair<vector<double>,vector<double> > cp< d >::compute_branchvector ( cv2d X,
Parameters< d > &  P 
)
inline

Compute the location & branch vector of the contact.

◆ getinfo()

template<int d>
Action<d>& cp< d >::getinfo ( )
inline

Returning stored information.

Warning
Poorly tested

◆ load()

template<int d>
template<class Archive >
void cp< d >::load ( Archive &  ar)
inline

◆ operator=()

template<int d>
cp& cp< d >::operator= ( const cp< d > &  c)
inline

Affect contact.

◆ save()

template<int d>
template<class Archive >
void cp< d >::save ( Archive &  ar) const
inline

◆ saveinfo()

template<int d>
void cp< d >::saveinfo ( Action< d > &  a)
inline

Save information regarding the contact forces for later write down.

◆ setinfo()

template<int d>
void cp< d >::setinfo ( Action< d > *  a)
inline

Set information for contact force.

Member Data Documentation

◆ contactlength

template<int d>
double cp< d >::contactlength

Length of the contact.

◆ ghost

template<int d>
uint32_t cp< d >::ghost

Contain ghost information about ghost contact, cf detailed description.

◆ ghostdir

template<int d>
uint32_t cp< d >::ghostdir

Contain ghost information about ghost direction, cf detailed description.

◆ i

template<int d>
int cp< d >::i

Index of contacting particle.

◆ infos

template<int d>
Action<d>* cp< d >::infos

stores contact information if contact storing is requires

Warning
Poorly tested.

◆ j

template<int d>
int cp< d >::j

Index of second contacting particle or wall. If this is a wall contact, j=2*walldimension + (0 or 1 if it is the low wall or high wall)

◆ owninfos

template<int d>
bool cp< d >::owninfos

True if the contact contains stored information for dump retrieval.

◆ persisting

template<int d>
bool cp< d >::persisting

True if the contact is still maintained for the current ts.

◆ tspr

template<int d>
std::vector<double> cp< d >::tspr

Vector of tangential contact history.


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