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); }}
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); }}
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); }}
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); }}
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); }}
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); }}
166 Mdouble reducedMass = mass1*mass2/(mass1+mass2);
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); }}
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); }}
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); }}
210 <<
" disp " << s.
disp
214 os <<
" dispt " << s.
dispt;
217 os <<
" mu " << s.
mu;
219 if (s.
mu!=s.
mus) os <<
" mus " << s.
mus;
225 os <<
" k2max " << s.
k2max
227 <<
" depth " << s.
depth;
234 os <<
" rho " << s.
rho
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;
257 if (!strcmp(dummy.c_str(),
"mus")) is >>
mus >> dummy;
else mus=
mu;
264 if (!strcmp(dummy.c_str(),
"k2max")) {
270 if (!strcmp(dummy.c_str(),
"AdhesionForceType")) {
291 os <<
", dispt: " <<
dispt;
294 os <<
", mu: " <<
mu;
295 if (mu!=
mus) os <<
", mus: " <<
mus;
300 os <<
", k2max:" <<
k2max
302 <<
", depth:" <<
depth;
304 os <<
", rho:" <<
rho
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);}
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);}
337 disp = - mass / tc * log(eps);
346 Mdouble reduced_mass = mass1*mass2/(mass1+mass2);
370 Mdouble reduced_mass = mass1*mass2/(mass1+mass2);
377 Mdouble reduced_mass = mass1*mass2/(mass1+mass2);
382 return (a+b) ? (2.*(a*b)/(a+b)) : 0;
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;
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;
454 std::cerr <<
"Error: AdhesionForceType unknown" << std::endl;
461 if (!strcmp(new_,
"None"))
463 else if (!strcmp(new_,
"LinearReversible"))
465 else if (!strcmp(new_,
"LinearIrreversible"))
469 std::cerr <<
"Error: AdhesionForceType unknown" << std::endl;
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;
void set_ForceType(ForceTypes new_)
Mdouble get_logRestitution() const
Allows the normal dissipation to be accessed.
void set_mus(Mdouble new_mu)
Allows the static Coulomb friction coefficient to be changed.
friend std::istream & operator>>(std::istream &is, CSpecies &s)
Reads all species data.
int get_dim_particle() const
Allows the dimension of the particle (f.e. for mass) to be accessed.
Mdouble get_dissipation() const
Allows the normal dissipation to be accessed.
void set_AdhesionForceType(AdhesionForceTypes new_)
return type specifically for fuctions returning k and disp at once
Mdouble get_mutorsion() const
Allows the (dynamic) Coulomb friction coefficient to be accessed.
void set_k0(Mdouble new_k0)
Allows the spring constant to be changed.
Mdouble get_disptorsion() const
Allows the tangential viscosity to be accessed.
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...
Mdouble get_kt() const
Allows the spring constant to be accessed.
std::vector< CSpecies > MixedSpecies
Mdouble get_k2max() const
void set_mustorsion(Mdouble new_mu)
Allows the static Coulomb friction coefficient to be changed.
void set_ktorsion(Mdouble new_k)
Allows the spring constant to be changed.
void set_musrolling(Mdouble new_mu)
Allows the static Coulomb friction coefficient to be changed.
Mdouble get_musrolling() const
Allows the static Coulomb friction coefficient to be accessed.
void set_mutorsion(Mdouble new_mu)
Allows the (dynamic) Coulomb friction coefficient to be changed; also sets mu_s by default...
void set_k(Mdouble new_k)
Allows the spring constant to be changed.
void set_k1(Mdouble new_)
void set_disptorsion(Mdouble new_disptorsion)
Allows the tangential viscosity to be changed.
AdhesionForceTypes AdhesionForceType
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...
void set_dispt(Mdouble new_dispt)
Allows the tangential viscosity to be changed.
void set_kc(Mdouble new_)
AdhesionForceTypes get_AdhesionForceType() const
void print(std::ostream &os)
Outputs species.
Mdouble get_collision_time(Mdouble mass)
Calculates collision time for two copies of a particle of given disp, k, mass.
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...
void set_kt(Mdouble new_kt)
Allows the spring constant to be changed.
Mdouble get_disp() const
Allows the normal dissipation to be accessed.
void set_f0(Mdouble new_f0)
Allows the spring constant to be changed.
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...
Mdouble get_ktorsion() const
Allows the spring constant to be accessed.
Mdouble get_k() const
Allows the spring constant to be accessed.
Mdouble get_disprolling() const
Allows the tangential viscosity to be accessed.
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...
void set_k2max(Mdouble new_)
Mdouble get_k0() const
Allows the spring constant to be accessed.
Mdouble get_f0() const
Allows the spring constant to be accessed.
void read(std::istream &is)
void set_dissipation(Mdouble new_disp)
Allows the normal dissipation to be changed.
Mdouble get_rho() const
Allows the density to be accessed.
return type specifically for fuctions returning k, disp, kt, dispt at once
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...
Mdouble get_mu() const
Allows the (dynamic) Coulomb friction coefficient to be accessed.
Mdouble get_dispt() const
Allows the tangential viscosity to be accessed.
Mdouble get_useRestitution() const
Allows the normal dissipation to be accessed.
void set_plastic_k1_k2max_kc_depth(Mdouble k1_, Mdouble k2max_, Mdouble kc_, Mdouble depth_)
Acccess functions for the plastic model.
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...
void set_depth(Mdouble new_)
Mdouble get_depth() const
Mdouble get_average(Mdouble a, Mdouble b)
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.
void set_disprolling(Mdouble new_disprolling)
Allows the tangential viscosity to be changed.
void set_mu(Mdouble new_mu)
Allows the (dynamic) Coulomb friction coefficient to be changed; also sets mu_s by default...
friend std::ostream & operator<<(std::ostream &os, const CSpecies &s)
Writes all species data.
Mdouble get_mustorsion() const
Allows the static Coulomb friction coefficient to be accessed.
void set_krolling(Mdouble new_k)
Allows the spring constant to be changed.
Mdouble get_restitution_coefficient(Mdouble mass)
Calculates restitution coefficient for two copies of given disp, k, mass.
Mdouble get_krolling() const
Allows the spring constant to be accessed.
ForceTypes get_ForceType() const
void set_disp(Mdouble new_disp)
Allows the normal dissipation to be changed.
void set_rho(Mdouble new_rho)
void set_murolling(Mdouble new_murolling)
Allows the (dynamic) Coulomb friction coefficient to be changed; also sets murolling_s by default...
Stores properties of the particles and the contact models such as the elastic modulus.
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...
Mdouble get_mus() const
Allows the static Coulomb friction coefficient to be accessed.
void update_disp(Mdouble mass1, Mdouble mass2)
Mdouble get_plastic_dt(Mdouble mass)
Calculates collision time for stiffest spring constant, divides by 50.
void set_restitution(Mdouble new_)
Allows the normal dissipation to be changed.
void set_dim_particle(int new_dim)
Allows the dimension of the particle (f.e. for mass) to be changed.
void mix(CSpecies &S0, CSpecies &S1)
create values for mixed species
void set_k_and_disp(helperFunc::KAndDisp new_)
Allows the spring and dissipation constants to be changed simultaneously.
Mdouble get_InteractionDistance()
Mdouble get_murolling() const
Allows the (dynamic) Coulomb friction coefficient to be accessed.
void set_AdhesionForceType(char new_[])