39 #ifdef DEBUG_CONSTRUCTOR
40 std::cout<<
"LinearViscoelasticNormalSpecies::LinearViscoelasticNormalSpecies() finished"<<std::endl;
51 #ifdef DEBUG_CONSTRUCTOR
52 std::cout<<
"LinearViscoelasticNormalSpecies::LinearViscoelasticNormalSpecies(const LinearViscoelasticNormalSpecies &p) finished"<<std::endl;
58 #ifdef DEBUG_DESTRUCTOR
59 std::cout<<
"LinearViscoelasticNormalSpecies::~LinearViscoelasticNormalSpecies() finished"<<std::endl;
87 return "LinearViscoelastic";
97 std::cerr <<
"Error in set_k" << std::endl;
118 if (dissipation >= 0)
124 std::cerr <<
"Error in setDissipation(" << dissipation <<
")" << std::endl;
140 std::cerr <<
"Warning in getCollisionTime(" << mass <<
") mass is not set or has an unexpected value, (getCollisionTime(" << mass <<
"))" << std::endl;
144 std::cerr <<
"Warning in getCollisionTime(" << mass <<
") stiffness=" <<
stiffness_ <<
" is not set or has an unexpected value, (getCollisionTime(" << mass <<
"), with stiffness=" <<
stiffness_ <<
")" << std::endl;
148 std::cerr <<
"Warning in getCollisionTime(" << mass <<
") dissipation=" <<
dissipation_ <<
" is not set or has an unexpected value, (getCollisionTime(" << mass <<
"), with dissipation=" <<
dissipation_ <<
")" << std::endl;
153 std::cerr <<
"Warning in getCollisionTime(" << mass <<
") values for mass, stiffness and dissipation would lead to an overdamped system, (getCollisionTime(" << mass <<
"), with stiffness=" <<
stiffness_ <<
" and dissipation=" <<
dissipation_ <<
")" << std::endl;
167 return radius * std::sqrt(
stiffness_ / (.5 * mass));
202 logger(
INFO,
"setCollisionTimeAndRestitutionCoefficient: set stiffness to % and dissipation to % to obtain a collision time of % and a restitution coefficient of % for two particles of mass %",
214 Mdouble reduced_mass = mass1 * mass2 / (mass1 + mass2);
void setCollisionTimeAndRestitutionCoefficient(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 mix(LinearViscoelasticNormalSpecies *const SBase, LinearViscoelasticNormalSpecies *const TBase)
creates default values for mixed species
Mdouble stiffness_
(normal) spring constant
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
Mdouble getStiffness() const
Allows the spring constant to be accessed.
return type specifically for fuctions returning k and disp at once
void setDissipation(Mdouble dissipation)
Allows the normal dissipation to be changed.
Mdouble exp(Mdouble Exponent)
std::string getBaseName() const
Used in Species::getName to obtain a unique name for each Species.
Mdouble getDissipation() const
Allows the normal dissipation to be accessed.
Mdouble getRestitutionCoefficient(Mdouble mass) const
Calculates restitution coefficient for two copies of given disp, k, mass.
void setStiffnessAndRestitutionCoefficient(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...
virtual ~LinearViscoelasticNormalSpecies()
The default destructor.
Mdouble log(Mdouble Power)
T square(T val)
squares a number
LinearViscoelasticNormalSpecies contains the parameters used to describe a linear elastic-dissipative...
void setStiffness(Mdouble new_k)
Allows the spring constant to be changed.
Mdouble average(Mdouble a, Mdouble b)
defines the average of two variables by the harmonic mean.
Mdouble getCollisionTime(Mdouble mass) const
Calculates collision time for two copies of a particle of given disp, k, mass.
Mdouble getMaximumVelocity(Mdouble radius, Mdouble mass) const
Calculates the maximum velocity allowed for a collision of two copies of P (for higher velocities par...
void read(std::istream &is)
Reads the species properties from an input stream.
LinearViscoelasticNormalSpecies()
The default constructor.
Defines the basic properties that a interactable object can have.
MERCURY_DEPRECATED void setStiffnessAndDissipation(helpers::KAndDisp new_)
Allows the spring and dissipation constants to be changed simultaneously.
void write(std::ostream &os) const
Writes the species properties to an output stream.
Mdouble dissipation_
(normal) viscosity