46 vector <double> loc (
d, 0) ;
49 for (
int n=0 ; gh>0 ; gh>>=1, ghd>>=1, n++)
52 loc[n] +=
P->Boundaries[n].delta * ((ghd&1)?-1:1) ;
54 return (
particle_particle (Xi, Vi, Omegai, ri, mi, loc, Vj, Omegaj, rj, mj,
Contact, isdumptime) ) ;
62 vector <double> loc (
d, 0) ;
69 particle_particle (Xi, Vi, Omegai, ri, mi, loc, Vj, Omegaj, rj, mj,
Contact, isdumptime) ;
76 vector <double>
vel (
d, 0) ;
vel=Vj ;
78 loc[0] +=
P->Boundaries[0].delta * ((ghd&1)?-1:1) ;
79 loc[1] += (ghd&1?-1:1)*
P->Boundaries[0].displacement ;
80 double additionaldelta = 0 ;
81 if (loc[1] >
P->Boundaries[1].xmax) {additionaldelta = -
P->Boundaries[1].delta ;}
82 if (loc[1] <
P->Boundaries[1].xmin) {additionaldelta =
P->Boundaries[1].delta ;}
83 loc[1] += additionaldelta ;
84 vel[1] += (ghd&1?-1:1) *
P->Boundaries[0].vel *
P->Boundaries[0].delta ;
89 particle_particle (Xi, Vi, Omegai, ri, mi, loc,
vel, Omegaj, rj, mj,
Contact, isdumptime) ;
96 vector <double> loc (
d, 0) ;
103 particle_particle (Xi, Vi, Omegai, ri, mi, loc, Vj, Omegaj, rj, mj,
Contact, isdumptime) ;
108 vector <double>
vel (
d, 0) ;
vel=Vj ;
110 loc[0] +=
P->Boundaries[0].delta * ((ghd&1)?-1:1) ;
111 loc[1] += (ghd&1?-1:1)*
P->Boundaries[0].displacement ;
112 vel[1] += (ghd&1?-1:1) *
P->Boundaries[0].vel *
P->Boundaries[0].delta ;
116 particle_particle (Xi, Vi, Omegai, ri, mi, loc,
vel, Omegaj, rj, mj,
Contact, isdumptime) ;
122 for (
int n=startn ; gh>0 ; gh>>=1, ghd>>=1, n++)
125 loc[n] +=
P->Boundaries[n].delta * ((ghd&1)?-1:1) ;
134 vector <double>
cn,
rri,
rrj,
vn,
vt,
Fn,
Ft,
tvec,
Ftc,
tspr,
tsprc ;
157 rri.resize(
d,0) ;
rrj.resize(
d,0) ;
vn.resize(
d,0) ;
vt.resize(
d,0) ;
174 double kn, kt, gamman, gammat ;
175 contactlength=
Contact.contactlength ;
177 ovlp=ri+rj-contactlength ;
181 cn /= contactlength ;
192 if (P->ContactModel ==
HERTZ)
194 double Rstar = (ri*rj)/(ri+rj) ;
195 double Mstar = (mi*mj)/(mi+mj) ;
196 double sqrtovlpR = sqrt(ovlp*Rstar) ;
197 kn = P->Kn * sqrtovlpR;
198 kt = P->Kt * sqrtovlpR;
199 gamman = P->Gamman * sqrt(Mstar * kn);
200 gammat = P->Gammat * sqrt(Mstar * kt);
216 Act.Fn_el = cn*(ovlp*kn) ;
217 Act.Fn_visc = - vn*gamman ;
223 if (tspr.size()==0) tspr.resize(
d,0) ;
242 if (isdumptime) {Act.Ft_fric = Ft ; Act.Ft_isfric=true ; }
246 if (isdumptime) {Act.Ft_el = Ft ; Act.Ft_visc=-vt*gammat ; Act.Ft_isfric=false ; }
255 Act.set(Fn, Ft, Torquei, Torquej) ;
265 contactlength=
Contact.contactlength ;
266 ovlp=ri-contactlength ;
270 rri = -cn * (ri-ovlp/2.) ;
276 double kn, kt, gamman, gammat ;
277 if (P->ContactModel ==
HERTZ)
279 double sqrtovlpR = sqrt(ovlp*ri) ;
280 kn = P->Kn * sqrtovlpR;
281 kt = P->Kt * sqrtovlpR;
282 gamman = P->Gamman * mi * sqrtovlpR;
283 gammat = P->Gammat * mi * sqrtovlpR;
300 if (tspr.size()==0) tspr.resize(
d,0) ;
312 Ftc = tvec * Coulomb ;
325 Act.set(Fn, Ft, Torquei, Torquej) ;
334 contactlength=
Contact.contactlength ;
336 ovlp=ri-contactlength ;
337 if (ovlp<=0) {Act.setzero() ; return ;}
346 double kn, kt, gamman, gammat ;
347 if (P->ContactModel ==
HERTZ)
349 double sqrtovlpR = sqrt(ovlp*ri) ;
350 kn = P->Kn * sqrtovlpR;
351 kt = P->Kt * sqrtovlpR;
352 gamman = P->Gamman * mi * sqrtovlpR;
353 gammat = P->Gammat * mi * sqrtovlpR;
370 if (tspr.size()==0) tspr.resize(
d,0) ;
395 Act.set(Fn, Ft, Torquei, Torquej) ;
403 contactlength=
Contact.contactlength ;
405 ovlp=ri-contactlength ;
406 if (ovlp<=0) {Act.setzero() ; return ;}
408 cn /= contactlength ;
417 double kn, kt, gamman, gammat ;
418 if (P->ContactModel ==
HERTZ)
420 double sqrtovlpR = sqrt(ovlp*ri) ;
421 kn = P->Kn * sqrtovlpR;
422 kt = P->Kt * sqrtovlpR;
423 gamman = P->Gamman * mi * sqrtovlpR;
424 gammat = P->Gammat * mi * sqrtovlpR;
442 if (tspr.size()==0) tspr.resize(
d,0) ;
454 Ftc = tvec * Coulomb ;
467 Act.set(Fn, Ft, Torquei, Torquej) ;
Handle force and torque contact information.
Definition: ContactList.h:19
Generic class to handle the simulation set up.
Definition: Parameters.h:128
ContactStrategies contact_strategy
Strategy for the contact detection.
Definition: Parameters.h:188
Contact properties class.
Definition: ContactList.h:69
Contact properties for mesh contacts (mainly), including contact point location, specialising cp.
Definition: ContactList.h:177
@ Contact
Definition: Coarsing.h:59
static void setzero(v2d &a)
Set a matrix to zero in-place.
Definition: Tools.h:117
static v1d wedgeproduct(cv1d &a, cv1d &b)
Wedge product of vectors.
Definition: Tools.h:710
static double dot(cv1d &a, cv1d &b)
Dot product.
Definition: Tools.h:127
void particle_particle(cv1d &Xi, cv1d &Vi, cv1d &Omegai, double ri, double mi, cv1d &Xj, cv1d &Vj, cv1d &Omegaj, double rj, double mj, cp< d > &Contact, bool isdumptime)
Force & torque between 2 particles.
Definition: Contacts.h:171
@ vel
Definition: Typedefs.h:19
void particle_mesh(cv1d &Xi, cv1d &Vi, cv1d &Omegai, double ri, double mi, cpm< d > &Contact)
Force & torque between particle and mesh.
Definition: Contacts.h:401
void particle_movingwall(cv1d &Vi, cv1d &Omegai, double ri, double mi, cv1d &cn, cv1d &Vj, cp< d > &Contact)
Force & torque between a particle and a moving wall. Vj is the velocity of the wall at the contact po...
Definition: Contacts.h:331
Contacts(Parameters< d > &PP)
Definition: Contacts.h:150
static v1d skewmatvecmult(cv1d &M, cv1d &v)
Multiply the skew symetric matrix M with vector v.
Definition: Tools.h:569
const vector< double > cv1d
Definition: Typedefs.h:13
void particle_wall(cv1d &Vi, cv1d &Omegai, double ri, double mi, cv1d &cn, cp< d > &Contact)
Force & torque between a particle and a wall.
Definition: Contacts.h:261
vector< double > v1d
Definition: Typedefs.h:9
static double norm(const vector< double > &a)
Norm of a vector.
Definition: Tools.h:119
@ CELLS
Definition: Typedefs.h:22
@ HERTZ
Definition: Typedefs.h:21
unsigned int uint32_t
Definition: stdint.h:126