45 double tc = 1e-2, r = 0.4, m = 1;
49 species0->setCollisionTimeAndRestitutionCoefficient(tc, r, m);
105 species1->setCollisionTimeAndRestitutionCoefficient(tc, r, 8.0, 8.0);
112 for (
unsigned int i = 0; i < 5; i += 2)
115 std::cout <<
"Cofficient of resutions for collision " << round(i / 2.0) + 1 <<
" is : " << r << std::endl;
116 if (std::abs(r-0.4)>1e-2)
118 std::cerr <<
"Wrong restitution" << std::endl;
128 std::cout <<
"Species test problem " << std::endl;
129 std::cout <<
"---------------------" << std::endl;
130 std::cout << std::endl;
131 std::cout <<
"This problem set k and gamma for different for different size particles such that the coefficent of restitution is the same" << std::endl;
132 std::cout <<
"Note for each collision this value should be 0.4" << std::endl;
133 std::cout <<
"Also this code demostrates how to use different species in the code" << std::endl;
135 problem.
setName(
"SpeciesUnitTest");
void setXMax(Mdouble newXMax)
If the length of the problem domain in x-direction is XMax - XMin, this method sets XMax...
void solve()
The work horse of the code.
Mdouble X
the vector components
void setVelocity(const Vec3D &velocity)
set the velocity of the BaseInteractable.
void setTimeMax(Mdouble newTMax)
Allows the upper time limit to be changed.
void actionsAfterSolve()
A virtual function which allows to define operations to be executed after the solve().
void setZMax(Mdouble newZMax)
If the length of the problem domain in z-direction is XMax - XMin, this method sets ZMax...
void setGravity(Vec3D newGravity)
Allows to modify the gravity vector.
void setRadius(const Mdouble radius)
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species) ...
void setYMax(Mdouble newYMax)
If the length of the problem domain in y-direction is YMax - YMin, this method sets YMax...
void setupInitialConditions()
This function allows to set the initial conditions for our problem to be solved, by default particle ...
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
U * copyAndAddObject(const U &O)
Creates a copy of a Object and adds it to the BaseHandler.
virtual void addObject(ParticleSpecies *const S)
Adds a new ParticleSpecies to the SpeciesHandler.
This adds on the hierarchical grid code for 3D problems.
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created...
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
MERCURY_DEPRECATED void setIndSpecies(unsigned int indSpecies)
void setZMin(Mdouble newZMin)
If the length of the problem domain in z-direction is ZMax - ZMin, this method sets ZMin...
Species< LinearViscoelasticNormalSpecies > LinearViscoelasticSpecies
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. elastic, linear visco-elastic... et cetera...
U::MixedSpeciesType * getMixedObject(const U *S, const U *T)
void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
void setTimeStep(Mdouble newDt)
Allows the time step dt to be changed.
virtual void printTime() const
Displays the current simulation time onto your screen for example.
virtual const Vec3D & getVelocity() const
Returns the velocity of this interactable.
Implementation of a 3D vector (by Vitaliy).
int main(int argc UNUSED, char *argv[] UNUSED)