38 #ifdef DEBUG_CONSTRUCTOR
39 std::cout<<
"LinearViscoelasticNormalSpecies::LinearViscoelasticNormalSpecies() finished"<<std::endl;
50 #ifdef DEBUG_CONSTRUCTOR
51 std::cout<<
"LinearViscoelasticNormalSpecies::LinearViscoelasticNormalSpecies(const LinearViscoelasticNormalSpecies &p) finished"<<std::endl;
57 #ifdef DEBUG_DESTRUCTOR
58 std::cout<<
"LinearViscoelasticNormalSpecies::~LinearViscoelasticNormalSpecies() finished"<<std::endl;
86 return "LinearViscoelastic";
96 std::cerr <<
"Error in set_k" << std::endl;
117 if (dissipation >= 0)
123 std::cerr <<
"Error in setDissipation(" << dissipation <<
")" << std::endl;
139 std::cerr <<
"Error in getCollisionTime(" << mass <<
") mass is not set or has an unexpected value, (getCollisionTime(" << mass <<
"))" << std::endl;
144 std::cerr <<
"Error in getCollisionTime(" << mass <<
") stiffness=" <<
stiffness_ <<
" is not set or has an unexpected value, (getCollisionTime(" << mass <<
"), with stiffness=" <<
stiffness_ <<
")" << std::endl;
149 std::cerr <<
"Error in getCollisionTime(" << mass <<
") dissipation=" <<
dissipation_ <<
" is not set or has an unexpected value, (getCollisionTime(" << mass <<
"), with dissipation=" <<
dissipation_ <<
")" << std::endl;
155 std::cerr <<
"Error 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;
170 return radius * std::sqrt(
stiffness_ / (.5 * mass));
205 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
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.
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.
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.
T square(T val)
squares a number
Mdouble getRestitutionCoefficient(Mdouble mass)
Calculates restitution coefficient for two copies of given disp, k, mass.
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.
void read(std::istream &is)
Reads the species properties from an input stream.
Mdouble getMaximumVelocity(Mdouble radius, Mdouble mass)
Calculates the maximum velocity allowed for a collision of two copies of P (for higher velocities par...
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
Mdouble getCollisionTime(Mdouble mass)
Calculates collision time for two copies of a particle of given disp, k, mass.