44 double stiffness = 1e5;
46 species->setDensity(2500);
47 species->setStiffness(stiffness);
48 species->setSlidingStiffness(2.0 / 7.0 * stiffness);
49 species->setSlidingFrictionCoefficient(0.5);
50 species->setRollingStiffness(2.0 / 5.0 * stiffness);
51 species->setRollingFrictionCoefficient(0.5);
52 species->setTorsionStiffness(2.0 / 5.0 * stiffness);
53 species->setTorsionFrictionCoefficient(0.5);
121 static bool FirstParticleRemoved =
false;
122 static bool SecondParticlRemoved =
false;
123 if (
getTime() > 3.5e-2 && FirstParticleRemoved ==
false)
128 logger(
VERBOSE,
"Interaction between particle (id=% index=%) and particle (id=% index=%) delta=%)", (*it)->getP()->getId(), (*it)->getP()->getIndex(), (*it)->getI()->getId(), (*it)->getI()->getIndex(), (*it)->getTimeStamp());
131 FirstParticleRemoved =
true;
137 logger(
VERBOSE,
"Interaction between particle (id=% index=%) and particle (id=% index=%) delta=%)", (*it)->getP()->getId(), (*it)->getP()->getIndex(), (*it)->getI()->getId(), (*it)->getI()->getIndex(), (*it)->getTimeStamp());
140 logger(
VERBOSE,
"First the particle (id=1,index=1) is removed");
141 logger(
VERBOSE,
"This causes the particle (id=7,index=7) to move to (id=7,index=1)");
142 logger(
VERBOSE,
"So the tangential spring witch was between particle (id=7,index=1) and (id=6,index=6) should be move to the last particle and reversed");
145 if (
getTime() > 4.5e-2 && SecondParticlRemoved ==
false)
150 logger(
VERBOSE,
"Interaction between particle (id=% index=%) and particle (id=% index=%) delta=%)", (*it)->getP()->getId(), (*it)->getP()->getIndex(), (*it)->getI()->getId(), (*it)->getI()->getIndex(), (*it)->getTimeStamp());
153 SecondParticlRemoved =
true;
160 logger(
VERBOSE,
"Interaction between particle (id=% index=%) and particle (id=% index=%) delta=%)", (*it)->getP()->getId(), (*it)->getP()->getIndex(), (*it)->getI()->getId(), (*it)->getI()->getIndex(), (*it)->getTimeStamp());
163 logger(
VERBOSE,
"First the particle (id=0,index=0) is removed");
164 logger(
VERBOSE,
"This causes the particle (id=6,index=6) to move to (id=0,index=0)");
165 logger(
VERBOSE,
"So the tangential spring between particle (id=6,index=6) and (id=7,index=1) should be move to the last particle and reversed");
178 periodicWallsWithSlidingFrictionUnitTest.
solve();
180 periodicWallsWithSlidingFrictionUnitTest.
setName(
"PeriodicWallsWithSlidingFrictionUnitTest");
190 shift =
Vec3D(-0.58, -0.4, 0.0);
200 shift =
Vec3D(0.0, -0.779, 0.0);
214 shift =
Vec3D(1.0 - 0.58, -0.4, 0.0);
225 shift =
Vec3D(0.0, 1.0 - 0.779, 0.0);
void set(Vec3D normal, Mdouble distanceLeft, Mdouble distanceRight)
Defines a periodic wall.
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.
void actionsBeforeTimeStep()
A virtual function which allows to define operations to be executed before the new time step...
void setVelocity(const Vec3D &velocity)
set the velocity of the BaseInteractable.
void setTimeMax(Mdouble newTMax)
Allows the upper time limit to be changed.
void printTime() const
Displays the current simulation time onto your screen for example.
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
void setYMin(Mdouble newYMin)
If the length of the problem domain in y-direction is YMax - YMin, this method sets YMin...
Mdouble getXMin() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMin() returns XMin...
int main(int argc UNUSED, char *argv[] UNUSED)
Mdouble getYMin() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMin() returns YMin...
const std::vector< T * >::const_iterator end() const
Gets the end of the const_iterator over all BaseBoundary in this BaseHandler.
void setParticleDimensions(unsigned int particleDimensions)
Allows the dimension of the particle (f.e. for mass) to be changed. e.g. discs or spheres...
Species< LinearViscoelasticNormalSpecies, FrictionSpecies > LinearViscoelasticFrictionSpecies
void setFileType(FileType fileType)
Sets File::fileType_ for all files (ene, data, fstat, restart, stat)
void setGravity(Vec3D newGravity)
Allows to modify the gravity vector.
bool isEqualTo(const Vec3D &other, const double tol) const
Checks if the length this Vec3D is equal the length of other with a certain tolerance.
void setRadius(const Mdouble radius)
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species) ...
const Vec3D & getPosition() const
Returns the position of this BaseInteractable.
const std::vector< T * >::const_iterator begin() const
Gets the begin of the const_iterator over all Object in this BaseHandler.
Defines a pair of periodic walls. Inherits from BaseBoundary.
Mdouble getXMax() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMax() returns XMax...
void setYMax(Mdouble newYMax)
If the length of the problem domain in y-direction is YMax - YMin, this method sets YMax...
file will not be created/read
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.
BoundaryHandler boundaryHandler
An object of the class BoundaryHandler which concerns insertion and deletion of particles into or fro...
This adds on the hierarchical grid code for 3D problems.
void setXMin(Mdouble newXMin)
If the length of the problem domain in x-direction is XMax - XMin, this method sets XMin...
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.
LL< Log::FATAL > FATAL
Fatal log level.
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. elastic, linear visco-elastic... et cetera...
InteractionHandler interactionHandler
An object of the class InteractionHandler.
Mdouble getYMax() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMax() returns XMax...
void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
void setTimeStep(Mdouble newDt)
Allows the time step dt to be changed.
void setupInitialConditions()
This function allows to set the initial conditions for our problem to be solved, by default particle ...
virtual const Vec3D & getVelocity() const
Returns the velocity of this interactable.
Implementation of a 3D vector (by Vitaliy).
void setAngularVelocity(const Vec3D &angularVelocity)
set the angular velocity of the BaseInteractble.
Mdouble getTime() const
Access function for the time.
virtual void removeObject(unsigned const int id)
Removes a BaseParticle from the ParticleHandler.
This test is a UnitTest for: Periodic Particles in combination with HGrid Tangential Springs over per...