MercuryDPM  0.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CSpecies.h
Go to the documentation of this file.
1 //Copyright (c) 2013-2014, The MercuryDPM Developers Team. All rights reserved.
2 //For the list of developers, see <http://www.MercuryDPM.org/Team>.
3 //
4 //Redistribution and use in source and binary forms, with or without
5 //modification, are permitted provided that the following conditions are met:
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above copyright
9 // notice, this list of conditions and the following disclaimer in the
10 // documentation and/or other materials provided with the distribution.
11 // * Neither the name MercuryDPM nor the
12 // names of its contributors may be used to endorse or promote products
13 // derived from this software without specific prior written permission.
14 //
15 //THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16 //ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 //WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 //DISCLAIMED. IN NO EVENT SHALL THE MERCURYDPM DEVELOPERS TEAM BE LIABLE FOR ANY
19 //DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 //(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 //LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 //ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 //(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 //SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 
26 #ifndef CSPECIES_H
27 #define CSPECIES_H
28 
31 
32 //This is a header with some extra standard maths function and constants that are required by the code
33 #include "ExtendedMath.h"
34 
35 #include "Vector.h"
36 #include <vector>
37 #include <iostream>
38 #include <iomanip>
39 #include <stdio.h>
40 #include <stdlib.h>
41 #include <string.h>
42 
56 class CSpecies {
57 public:
59  k = 0;
60  kt = 0;
61  krolling = 0;
62  ktorsion = 0;
63  disp = 0;
64  dispt = 0;
65  disprolling = 0;
66  disptorsion = 0;
67  mu = 0;
68  mus = 0;
69  mu = 0;
70  murolling = 0;
71  musrolling = 0;
72  mutorsion = 0;
73  mustorsion = 0;
74  k2max = 0;
75  kc = 0;
76  depth = 0;
77  rho = 0;
78  dim_particle = 0;
79  logRestitution = 0;
80  useRestitution=false;
81  ForceType = Linear;
83  k0 = 0;
84  f0 = 0;
85  }
86 
88  void set_k0(Mdouble new_k0){if(new_k0>=0) k0=new_k0; else { std::cerr << "Error in set_k0" << std::endl; exit(-1); }}
90  Mdouble get_k0() const {return k;}
91 
93  void set_f0(Mdouble new_f0){if(new_f0>=0) f0=new_f0; else { std::cerr << "Error in set_f0" << std::endl; exit(-1); }}
95  Mdouble get_f0() const {return f0;}
96 
98  if (AdhesionForceType==None)
99  return 0.0;
100  else
101  return f0/k0;
102  }
103 
105  void set_k(Mdouble new_k){if(new_k>=0) k=new_k; else { std::cerr << "Error in set_k" << std::endl; exit(-1); }}
107  Mdouble get_k() const {return k;}
108 
113 
115  void set_kt(Mdouble new_kt){if(new_kt>=0) {kt=new_kt;} else { std::cerr << "Error in set_kt" << std::endl; exit(-1); }}
117  Mdouble get_kt() const {return kt;}
119  void set_krolling(Mdouble new_k){if(new_k>=0) {krolling=new_k;} else { std::cerr << "Error in set_krolling" << std::endl; exit(-1); }}
121  Mdouble get_krolling() const {return krolling;}
123  void set_ktorsion(Mdouble new_k){if(new_k>=0) {ktorsion=new_k;} else { std::cerr << "Error in set_ktorsion" << std::endl; exit(-1); }}
125  Mdouble get_ktorsion() const {return ktorsion;}
126 
129  void set_rho(Mdouble new_rho){if(new_rho>=0) rho=new_rho; else { std::cerr << "Error in set_rho" << std::endl; exit(-1); }}
131  Mdouble get_rho() const {return rho;}
132 
134  void set_dispt(Mdouble new_dispt){if (new_dispt>=0) dispt = new_dispt; else { std::cerr << "Error in set_dispt" << std::endl; exit(-1); }}
136  Mdouble get_dispt() const {return dispt;}
138  void set_disprolling(Mdouble new_disprolling){if (new_disprolling>=0) disprolling = new_disprolling; else { std::cerr << "Error in set_disprolling" << std::endl; exit(-1); }}
142  void set_disptorsion(Mdouble new_disptorsion){if (new_disptorsion>=0) disptorsion = new_disptorsion; else { std::cerr << "Error in set_disptorsion" << std::endl; exit(-1); }}
145 
147  void set_dissipation(Mdouble new_disp){if(new_disp>=0) {useRestitution=false; disp=new_disp;} else { std::cerr << "Error in set_dissipation(" << new_disp << ")" << std::endl; exit(-1); }}
149  Mdouble get_dissipation() const {return disp;}
151  void set_disp(Mdouble new_disp){set_dissipation(new_disp);}
153  Mdouble get_disp() const {return get_dissipation();}
154 
155 
157  void set_restitution(Mdouble new_){if(new_>=0) {useRestitution=true; logRestitution=log(new_);} else { std::cerr << "Error in set_dissipation(" << new_ << ")" << std::endl; exit(-1); }
158  //std::cout << "restitution " << exp(logRestitution) << std::endl;
159 }
164 
165  void update_disp(Mdouble mass1, Mdouble mass2) {
166  Mdouble reducedMass = mass1*mass2/(mass1+mass2);
168  disp = - sqrt( 4.0*reducedMass*k/(sqr(constants::pi)+sqr(logRestitution)) ) * logRestitution;
169  //std::cout << "disp " << disp << " reducedMass " << mass1 << " " << mass2 << std::endl;
170  }
171 
173  //mu has to be set to allow tangential forces (sets dispt=disp as default)
174  void set_mu(Mdouble new_mu){if (new_mu>=0) {mu = new_mu; mus = mu;} else { std::cerr << "Error in set_mu" << std::endl; exit(-1); }}
176  Mdouble get_mu() const {return mu;}
178  void set_mus(Mdouble new_mu){if (new_mu>=0) {mus = new_mu;} else { std::cerr << "Error in set_mus" << std::endl; exit(-1); }}
180  Mdouble get_mus() const {return mus;}
181 
183  //murolling has to be set to allow tangential forces (sets dispt=disp as default)
184  void set_murolling(Mdouble new_murolling){if (new_murolling>=0) {murolling = new_murolling; musrolling = murolling;} else { std::cerr << "Error in set_murolling" << std::endl; exit(-1); }}
186  Mdouble get_murolling() const {return murolling;}
188  void set_musrolling(Mdouble new_mu){if (new_mu>=0) {musrolling = new_mu;} else { std::cerr << "Error in set_musrolling" << std::endl; exit(-1); }}
191 
193  //mu has to be set to allow tangential forces (sets dispt=disp as default)
194  void set_mutorsion(Mdouble new_mu){if (new_mu>=0) {mutorsion = new_mu; mustorsion = mutorsion;} else { std::cerr << "Error in set_mutorsion" << std::endl; exit(-1); }}
196  Mdouble get_mutorsion() const {return mutorsion;}
198  void set_mustorsion(Mdouble new_mu){if (new_mu>=0) {mustorsion = new_mu;} else { std::cerr << "Error in set_mustorsion" << std::endl; exit(-1); }}
201 
203  void set_dim_particle(int new_dim){if (new_dim>=1 && new_dim<=3) dim_particle = new_dim; else { std::cerr << "Error in set_dim_particle" << std::endl; exit(-1); }}
205  int get_dim_particle() const {return dim_particle;}
206 
208  friend inline std::ostream& operator<<(std::ostream& os, const CSpecies &s) {
209  os << "k " << s.k
210  << " disp " << s.disp
211  << " kt " << s.kt;
212  if (s.krolling) os << " krolling " << s.krolling;
213  if (s.ktorsion) os << " ktorsion " << s.ktorsion;
214  os << " dispt " << s.dispt;
215  if (s.disprolling) os << " disprolling " << s.disprolling;
216  if (s.disptorsion) os << " disptorsion " << s.disptorsion;
217  os << " mu " << s.mu;
218  //optional output
219  if (s.mu!=s.mus) os << " mus " << s.mus;
220  if (s.murolling) os << " murolling " << s.murolling;
221  if (s.murolling!=s.musrolling) os << " musrolling " << s.musrolling;
222  if (s.mutorsion) os << " mutorsion " << s.mutorsion;
223  if (s.mutorsion!=s.mustorsion) os << " mustorsion " << s.mustorsion;
224  if (s.depth) {
225  os << " k2max " << s.k2max
226  << " kc " << s.kc
227  << " depth " << s.depth;
228  }
229  if (s.AdhesionForceType!=None) {
230  os << " AdhesionForceType " << (unsigned int)s.AdhesionForceType
231  << " k0 " << s.k0
232  << " f0 " << s.f0;
233  }
234  os << " rho " << s.rho
235  << " dim_particle " << s.dim_particle;
236  return os;
237  }
238 
240  friend inline std::istream& operator>>(std::istream& is, CSpecies &s) {
241  is >> s.k >> s.disp >> s.kt >> s.krolling >> s.ktorsion >> s.dispt >> s.disprolling >> s.disptorsion >> s.mu >> s.mus >> s.murolling >> s.musrolling >> s.mutorsion >> s.mustorsion >> s.k2max >> s.kc >> s.depth >> s.rho >> s.dim_particle;
242  //s.mus=s.mu;
243  return is;
244  }
245 
246  void read(std::istream& is) {
247  std::string dummy;
248  is >> dummy >> k
249  >> dummy >> disp
250  >> dummy >> kt >> dummy;
251  if (!strcmp(dummy.c_str(),"krolling")) is >> krolling >> dummy; else krolling = 0;
252  if (!strcmp(dummy.c_str(),"ktorsion")) is >> ktorsion >> dummy; else ktorsion = 0;
253  is >> dispt >> dummy;
254  if (!strcmp(dummy.c_str(),"disprolling")) is >> disprolling >> dummy; else disprolling = 0;
255  if (!strcmp(dummy.c_str(),"disptorsion")) is >> disptorsion >> dummy; else disptorsion = 0;
256  is >> mu >> dummy;
257  if (!strcmp(dummy.c_str(),"mus")) is >> mus >> dummy; else mus=mu;
258  if (!strcmp(dummy.c_str(),"murolling")) is >> murolling >> dummy; else murolling = 0;
259  if (!strcmp(dummy.c_str(),"musrolling")) is >> musrolling >> dummy; else musrolling = murolling;
260  if (!strcmp(dummy.c_str(),"mutorsion")) is >> mutorsion >> dummy; else mutorsion = 0;
261  if (!strcmp(dummy.c_str(),"mustorsion")) is >> mustorsion >> dummy; else mustorsion = mutorsion;
262 
263  // checks if plastic model parameters are included (for backward compability)
264  if (!strcmp(dummy.c_str(),"k2max")) {
265  is >> k2max
266  >> dummy >> kc
267  >> dummy >> depth
268  >> dummy;
269  }
270  if (!strcmp(dummy.c_str(),"AdhesionForceType")) {
271  unsigned int AFT;
272  is >> AFT;
274  is >> dummy >> k0
275  >> dummy >> f0
276  >> dummy;
277  }
278  is >> rho
279  >> dummy >> dim_particle;
280  //read rest of line
281  getline(is,dummy);
282  }
283 
285  void print(std::ostream& os) {
286  os << "k:" << k
287  << ", disp:" << disp
288  << ", kt:" << kt;
289  if (krolling) os << ", krolling: " << krolling;
290  if (ktorsion) os << ", ktorsion: " << ktorsion;
291  os << ", dispt: " << dispt;
292  if (disprolling) os << ", disprolling: " << disprolling;
293  if (disptorsion) os << ", disptorsion: " << disptorsion;
294  os << ", mu: " << mu;
295  if (mu!=mus) os << ", mus: " << mus;
296  if (murolling) os << ", murolling: " << murolling;
297  if (murolling!=musrolling) os << ", musrolling: " << musrolling;
298  if (mutorsion) os << ", mutorsion: " << mutorsion;
299  if (mutorsion!=mustorsion) os << ", mustorsion: " << mustorsion;
300  os << ", k2max:" << k2max
301  << ", kc:" << kc
302  << ", depth:" << depth;
303  if (dim_particle) {
304  os << ", rho:" << rho
305  << ", dim_particle:" << dim_particle;
306  } else {
307  os << " (mixed)";
308  }
309  }
310 
313  if(mass<=0) {std::cerr << "Error in get_collision_time(Mdouble mass) mass is not set or has an unexpected value, (get_collision_time("<<mass<<"))"<< std::endl; exit(-1);}
314  if(k<=0) {std::cerr << "Error in get_collision_time(Mdouble mass) stiffness is not set or has an unexpected value, (get_collision_time("<<mass<<"), with stiffness="<<k<<")"<< std::endl; exit(-1);}
315  if(disp<0) {std::cerr << "Error in get_collision_time(Mdouble mass) dissipation is not set or has an unexpected value, (get_collision_time("<<mass<<"), with dissipation="<<disp<<")"<< std::endl; exit(-1);}
316  Mdouble tosqrt=k/(.5*mass) - sqr(disp/mass);
317  //~ std::cout<<"tosqrt "<<tosqrt<<" 1e "<<k/(.5*mass)<<" 2e "<<sqr(disp/mass)<<std::endl;
318  if (tosqrt<=0) {std::cerr << "Error in get_collision_time(Mdouble mass) values for mass, stiffness and dissipation would leads to an over damped system, (get_collision_time("<<mass<<"), with stiffness="<<k<<" and dissipation="<<disp<<")"<< std::endl; exit(-1);}
319  return constants::pi / sqrt( tosqrt );
320  }
321 
324 
326  Mdouble get_maximum_velocity(Mdouble radius, Mdouble mass){return radius * sqrt(k/(.5*mass));}
327 
330  k = k_;
332  disp = - sqrt(2.0*mass*k/(constants::sqr_pi+sqr(log(eps)))) * log(eps);
333  }
334 
337  disp = - mass / tc * log(eps);
338  k = .5 * mass * (sqr(constants::pi/tc) + sqr(disp/mass));
339  }
340 
345  {
346  Mdouble reduced_mass = mass1*mass2/(mass1+mass2);
347  set_collision_time_and_restitution_coefficient(tc,eps,2.0*reduced_mass);
348  }
349 
353  //from Deen...Kuipers2006, eq. 43 and 30
354  set_kt(2.0/7.0*get_k()*(sqr(constants::pi)+sqr(log(beta)))/(sqr(constants::pi)+sqr(log(eps))));
355  if (beta) set_dispt(-2*log(beta)*sqrt(1.0/7.0*mass*get_kt()/(sqr(constants::pi)+sqr(log(beta)))));
356  else set_dispt(2.*sqrt(1.0/7.0*mass*get_kt()));
357  }
358 
362  //from BeckerSchwagerPoeschel2008, eq. 56
363  set_kt(2.0/7.0*get_k()*sqr(acos(-beta)/constants::pi));
364  set_dispt(0);
365  }
366 
369  {
370  Mdouble reduced_mass = mass1*mass2/(mass1+mass2);
372  }
373 
376  {
377  Mdouble reduced_mass = mass1*mass2/(mass1+mass2);
379  }
380 
382  return (a+b) ? (2.*(a*b)/(a+b)) : 0;
383  }
384 
386  void mix(CSpecies& S0, CSpecies& S1){
387  k = get_average(S0.get_k(),S1.get_k());
388  kt = get_average(S0.get_kt(),S1.get_kt());
392  dispt = get_average(S0.get_dispt(),S1.get_dispt());
395  mu = get_average(S0.get_mu(),S1.get_mu());
396  mus = get_average(S0.get_mus(),S1.get_mus());
401  k2max = get_average(S0.get_k2max(),S1.get_k2max());
402  kc = get_average(S0.get_kc(),S1.get_kc());
403  depth = get_average(S0.get_depth(),S1.get_depth());
404  rho = 0;
405  dim_particle = 0; //this will be used to distinguish a mixed species
406  }
407 
408 
409  Mdouble k; //(normal) spring constant
412  Mdouble ktorsion; //tangential spring constant
413  Mdouble disp; //(normal) viscosity
414  Mdouble dispt; //tangential viscosity: should satisfy 4*dispt*dt<mass, dispt \approx disp
415  Mdouble disprolling; //tangential viscosity: should satisfy 4*dispt*dt<mass, dispt \approx disp
416  Mdouble disptorsion; //tangential viscosity: should satisfy 4*dispt*dt<mass, dispt \approx disp
417  Mdouble mu;//< (dynamic) Coulomb friction coefficient
418  Mdouble mus; //static Coulomb friction coefficient (by default set equal to mu)
419  Mdouble murolling;//< (dynamic) Coulomb friction coefficient
420  Mdouble musrolling; //static Coulomb friction coefficient
421  Mdouble mutorsion;//< (dynamic) Coulomb friction coefficient
422  Mdouble mustorsion; //static Coulomb friction coefficient
423  Mdouble rho; //density
424  int dim_particle; //determines if 2D or 3D volume is used for mass calculations
425  std::vector<CSpecies> MixedSpecies;
426 
427 public:
428 
429  //access function to MD::Hertzian
432  if (ForceType==Hertzian) std::cout << "Hertzian law activated" << std::endl;
433  else if (ForceType==HMD) std::cout << "Hertz-Mindlin-Deresiewicz law activated" << std::endl;
434  else if (ForceType==HM) std::cout << "Hertz-Mindlin law activated" << std::endl;
435  else if (ForceType==Linear) std::cout << "Linear law activated" << std::endl;
436  }
437 
439  {
440  return AdhesionForceType;
441  }
442 
444  {
445  AdhesionForceType=new_;
446  if (AdhesionForceType==None)
447  std::cout << "No adhesion activated" << std::endl;
449  std::cout << "Linear reversible adhesion activated" << std::endl;
451  std::cout << "Linear irreversible adhesion activated" << std::endl;
452  else
453  {
454  std::cerr << "Error: AdhesionForceType unknown" << std::endl;
455  exit (-1);
456  }
457  }
458 
459  void set_AdhesionForceType(char new_[])
460  {
461  if (!strcmp(new_,"None"))
463  else if (!strcmp(new_,"LinearReversible"))
465  else if (!strcmp(new_,"LinearIrreversible"))
467  else
468  {
469  std::cerr << "Error: AdhesionForceType unknown" << std::endl;
470  exit (-1);
471  }
472  }
473 
474 
477  if (k1_<=0 || k2max_<k1_ || kc_<0 || depth_<0 || depth_>1) {
478  std::cerr << "Error: arguments of set_plastic_k1_k2max_kc_depth do not make sense" << std::endl;
479  exit(-1);
480  }
481  set_k1(k1_);
482  set_k2max(k2max_);
483  set_kc(kc_);
484  set_depth(depth_);
485  }
486 
487  Mdouble get_k1() const {return k;}
488  Mdouble get_k2max() const {return k2max;}
489  Mdouble get_kc() const {return kc;}
490  Mdouble get_depth() const {return depth;}
491  void set_k1(Mdouble new_) {k = new_;}
492  void set_k2max(Mdouble new_) {k2max = new_;}
493  void set_kc(Mdouble new_) {kc = new_;}
494  void set_depth(Mdouble new_) {depth = new_;}
497  return 0.02 * constants::pi / sqrt( k2max/(.5*mass) - sqr(disp/mass) );
498  }
499 
500  Mdouble k2max; //<for plastic deformations; the maximum elastic constant
501  Mdouble kc; //<for plastic deformations; the adhesive spring constant
502  Mdouble depth; //<for plastic deformations; the depth (relative to the normalized radius) at which kpmax is used
503  Mdouble logRestitution; //restitution coefficient (only used if useRestitution=true
504  bool useRestitution; //false if dissipation is set instead of the restitution coefficient
505  //the constant restitution coefficient was first implemented in: http://www.astro.umd.edu/~dcr/reprints/schwartz_gm14,363.pdf
506  ForceTypes ForceType; //<make force law Hertzian
507  AdhesionForceTypes AdhesionForceType; //<determines which adhesion force model is used
508  Mdouble k0; //<stiffness of linear adhesion force
509  Mdouble f0; //<adhesion force at zero overlap
510 };
511 
512 #endif
void set_ForceType(ForceTypes new_)
Definition: CSpecies.h:431
Definition: CSpecies.h:29
Mdouble k0
Definition: CSpecies.h:508
Mdouble k2max
Definition: CSpecies.h:500
Mdouble get_logRestitution() const
Allows the normal dissipation to be accessed.
Definition: CSpecies.h:161
Mdouble get_kc() const
Definition: CSpecies.h:489
void set_mus(Mdouble new_mu)
Allows the static Coulomb friction coefficient to be changed.
Definition: CSpecies.h:178
friend std::istream & operator>>(std::istream &is, CSpecies &s)
Reads all species data.
Definition: CSpecies.h:240
int get_dim_particle() const
Allows the dimension of the particle (f.e. for mass) to be accessed.
Definition: CSpecies.h:205
ForceTypes
Definition: CSpecies.h:29
Mdouble get_dissipation() const
Allows the normal dissipation to be accessed.
Definition: CSpecies.h:149
Mdouble depth
Definition: CSpecies.h:502
void set_AdhesionForceType(AdhesionForceTypes new_)
Definition: CSpecies.h:443
Mdouble disptorsion
Definition: CSpecies.h:416
return type specifically for fuctions returning k and disp at once
Definition: ExtendedMath.h:98
Mdouble get_mutorsion() const
Allows the (dynamic) Coulomb friction coefficient to be accessed.
Definition: CSpecies.h:196
void set_k0(Mdouble new_k0)
Allows the spring constant to be changed.
Definition: CSpecies.h:88
Mdouble get_disptorsion() const
Allows the tangential viscosity to be accessed.
Definition: CSpecies.h:144
void set_collision_time_and_normal_and_tangential_restitution_coefficient_nodispt(Mdouble tc, Mdouble eps, Mdouble beta, Mdouble mass)
Sets k, disp, kt, dispt such that it matches a given tc and eps for a collision of two particles of m...
Definition: CSpecies.h:360
Mdouble get_kt() const
Allows the spring constant to be accessed.
Definition: CSpecies.h:117
std::vector< CSpecies > MixedSpecies
Definition: CSpecies.h:425
Mdouble mus
Definition: CSpecies.h:418
Mdouble get_k2max() const
Definition: CSpecies.h:488
Mdouble disp
Definition: CSpecies.h:413
void set_mustorsion(Mdouble new_mu)
Allows the static Coulomb friction coefficient to be changed.
Definition: CSpecies.h:198
void set_ktorsion(Mdouble new_k)
Allows the spring constant to be changed.
Definition: CSpecies.h:123
#define sqr(a)
Definition: ExtendedMath.h:36
bool useRestitution
Definition: CSpecies.h:504
void set_musrolling(Mdouble new_mu)
Allows the static Coulomb friction coefficient to be changed.
Definition: CSpecies.h:188
Mdouble get_musrolling() const
Allows the static Coulomb friction coefficient to be accessed.
Definition: CSpecies.h:190
void set_mutorsion(Mdouble new_mu)
Allows the (dynamic) Coulomb friction coefficient to be changed; also sets mu_s by default...
Definition: CSpecies.h:194
void set_k(Mdouble new_k)
Allows the spring constant to be changed.
Definition: CSpecies.h:105
void set_k1(Mdouble new_)
Definition: CSpecies.h:491
CSpecies()
Definition: CSpecies.h:58
void set_disptorsion(Mdouble new_disptorsion)
Allows the tangential viscosity to be changed.
Definition: CSpecies.h:142
AdhesionForceTypes AdhesionForceType
Definition: CSpecies.h:507
void set_collision_time_and_normal_and_tangential_restitution_coefficient(Mdouble tc, Mdouble eps, Mdouble beta, Mdouble mass)
Sets k, disp, kt, dispt such that it matches a given tc and eps for a collision of two particles of m...
Definition: CSpecies.h:351
void set_dispt(Mdouble new_dispt)
Allows the tangential viscosity to be changed.
Definition: CSpecies.h:134
void set_kc(Mdouble new_)
Definition: CSpecies.h:493
AdhesionForceTypes get_AdhesionForceType() const
Definition: CSpecies.h:438
void print(std::ostream &os)
Outputs species.
Definition: CSpecies.h:285
Mdouble get_collision_time(Mdouble mass)
Calculates collision time for two copies of a particle of given disp, k, mass.
Definition: CSpecies.h:312
Mdouble kt
Definition: CSpecies.h:410
Mdouble mu
Definition: CSpecies.h:417
Mdouble get_maximum_velocity(Mdouble radius, Mdouble mass)
Calculates the maximum velocity allowed for a collision of two copies of P (for higher velocities par...
Definition: CSpecies.h:326
void set_kt(Mdouble new_kt)
Allows the spring constant to be changed.
Definition: CSpecies.h:115
Definition: CSpecies.h:30
Mdouble get_disp() const
Allows the normal dissipation to be accessed.
Definition: CSpecies.h:153
void set_f0(Mdouble new_f0)
Allows the spring constant to be changed.
Definition: CSpecies.h:93
void set_k_and_restitution_coefficient(Mdouble k_, Mdouble eps, Mdouble mass)
Sets k, disp such that it matches a given tc and eps for a collision of two copies of P...
Definition: CSpecies.h:329
int dim_particle
Definition: CSpecies.h:424
Mdouble get_ktorsion() const
Allows the spring constant to be accessed.
Definition: CSpecies.h:125
AdhesionForceTypes
Definition: CSpecies.h:30
Mdouble get_k() const
Allows the spring constant to be accessed.
Definition: CSpecies.h:107
Mdouble get_disprolling() const
Allows the tangential viscosity to be accessed.
Definition: CSpecies.h:140
void set_collision_time_and_restitution_coefficient(Mdouble tc, Mdouble eps, Mdouble mass)
Sets k, disp such that it matches a given tc and eps for a collision of two copies of equal mass m...
Definition: CSpecies.h:336
void set_k2max(Mdouble new_)
Definition: CSpecies.h:492
ForceTypes ForceType
Definition: CSpecies.h:506
Mdouble get_k0() const
Allows the spring constant to be accessed.
Definition: CSpecies.h:90
Mdouble get_f0() const
Allows the spring constant to be accessed.
Definition: CSpecies.h:95
void read(std::istream &is)
Definition: CSpecies.h:246
const Mdouble pi
Definition: ExtendedMath.h:54
double Mdouble
Definition: ExtendedMath.h:33
Mdouble mustorsion
Definition: CSpecies.h:422
void set_dissipation(Mdouble new_disp)
Allows the normal dissipation to be changed.
Definition: CSpecies.h:147
Mdouble get_rho() const
Allows the density to be accessed.
Definition: CSpecies.h:131
return type specifically for fuctions returning k, disp, kt, dispt at once
Definition: ExtendedMath.h:110
void set_collision_time_and_restitution_coefficient(Mdouble tc, Mdouble eps, Mdouble mass1, Mdouble mass2)
Set k, disp such that is matches a given tc and eps for a collision of two different masses...
Definition: CSpecies.h:344
Mdouble k
Definition: CSpecies.h:409
Mdouble get_k1() const
Definition: CSpecies.h:487
Mdouble get_mu() const
Allows the (dynamic) Coulomb friction coefficient to be accessed.
Definition: CSpecies.h:176
Mdouble f0
Definition: CSpecies.h:509
Definition: CSpecies.h:29
Mdouble get_dispt() const
Allows the tangential viscosity to be accessed.
Definition: CSpecies.h:136
Mdouble get_useRestitution() const
Allows the normal dissipation to be accessed.
Definition: CSpecies.h:163
void set_plastic_k1_k2max_kc_depth(Mdouble k1_, Mdouble k2max_, Mdouble kc_, Mdouble depth_)
Acccess functions for the plastic model.
Definition: CSpecies.h:476
void set_collision_time_and_normal_and_tangential_restitution_coefficient_nodispt(Mdouble tc, Mdouble eps, Mdouble beta, Mdouble mass1, Mdouble mass2)
Sets k, disp, kt, dispt such that it matches a given tc and eps for a collision of two particles of e...
Definition: CSpecies.h:375
Mdouble mutorsion
Definition: CSpecies.h:421
Mdouble murolling
Definition: CSpecies.h:419
void set_depth(Mdouble new_)
Definition: CSpecies.h:494
Mdouble kc
Definition: CSpecies.h:501
Mdouble krolling
Definition: CSpecies.h:411
Mdouble get_depth() const
Definition: CSpecies.h:490
Mdouble get_average(Mdouble a, Mdouble b)
Definition: CSpecies.h:381
void set_k_and_disp_and_kt_and_dispt(helperFunc::KAndDispAndKtAndDispt new_)
Allows the normal and tangential spring and dissipation constants to be changed simultaneously.
Definition: CSpecies.h:112
void set_disprolling(Mdouble new_disprolling)
Allows the tangential viscosity to be changed.
Definition: CSpecies.h:138
void set_mu(Mdouble new_mu)
Allows the (dynamic) Coulomb friction coefficient to be changed; also sets mu_s by default...
Definition: CSpecies.h:174
friend std::ostream & operator<<(std::ostream &os, const CSpecies &s)
Writes all species data.
Definition: CSpecies.h:208
Mdouble logRestitution
Definition: CSpecies.h:503
Mdouble get_mustorsion() const
Allows the static Coulomb friction coefficient to be accessed.
Definition: CSpecies.h:200
Mdouble musrolling
Definition: CSpecies.h:420
void set_krolling(Mdouble new_k)
Allows the spring constant to be changed.
Definition: CSpecies.h:119
Mdouble get_restitution_coefficient(Mdouble mass)
Calculates restitution coefficient for two copies of given disp, k, mass.
Definition: CSpecies.h:323
Mdouble get_krolling() const
Allows the spring constant to be accessed.
Definition: CSpecies.h:121
Mdouble disprolling
Definition: CSpecies.h:415
ForceTypes get_ForceType() const
Definition: CSpecies.h:430
void set_disp(Mdouble new_disp)
Allows the normal dissipation to be changed.
Definition: CSpecies.h:151
void set_rho(Mdouble new_rho)
Definition: CSpecies.h:129
void set_murolling(Mdouble new_murolling)
Allows the (dynamic) Coulomb friction coefficient to be changed; also sets murolling_s by default...
Definition: CSpecies.h:184
Stores properties of the particles and the contact models such as the elastic modulus.
Definition: CSpecies.h:56
void set_collision_time_and_normal_and_tangential_restitution_coefficient(Mdouble tc, Mdouble eps, Mdouble beta, Mdouble mass1, Mdouble mass2)
Sets k, disp, kt, dispt such that it matches a given tc and eps for a collision of two particles of e...
Definition: CSpecies.h:368
Mdouble rho
Definition: CSpecies.h:423
Mdouble get_mus() const
Allows the static Coulomb friction coefficient to be accessed.
Definition: CSpecies.h:180
void update_disp(Mdouble mass1, Mdouble mass2)
Definition: CSpecies.h:165
const Mdouble sqr_pi
Definition: ExtendedMath.h:56
Mdouble get_plastic_dt(Mdouble mass)
Calculates collision time for stiffest spring constant, divides by 50.
Definition: CSpecies.h:496
void set_restitution(Mdouble new_)
Allows the normal dissipation to be changed.
Definition: CSpecies.h:157
void set_dim_particle(int new_dim)
Allows the dimension of the particle (f.e. for mass) to be changed.
Definition: CSpecies.h:203
Mdouble ktorsion
Definition: CSpecies.h:412
void mix(CSpecies &S0, CSpecies &S1)
create values for mixed species
Definition: CSpecies.h:386
void set_k_and_disp(helperFunc::KAndDisp new_)
Allows the spring and dissipation constants to be changed simultaneously.
Definition: CSpecies.h:110
Mdouble get_InteractionDistance()
Definition: CSpecies.h:97
Mdouble get_murolling() const
Allows the (dynamic) Coulomb friction coefficient to be accessed.
Definition: CSpecies.h:186
void set_AdhesionForceType(char new_[])
Definition: CSpecies.h:459
Mdouble dispt
Definition: CSpecies.h:414