60 species->setCollisionTimeAndRestitutionCoefficient(0.01, 1.0, 1.0);
72 std::vector<Vec3D> points={
Vec3D(0.5,-std::sqrt(3)/6.0,0.0),
Vec3D(0.0,std::sqrt(3)/3.0,0.0),
Vec3D(-0.5,-std::sqrt(3)/6.0,0.0),
Vec3D(0.5,-std::sqrt(3)/6.0,0.0)};
147 basic.
setName(
"MovingIntersectionOfWallsUnitTest_Basic");
148 movingReferenceFrame.
setName(
"MovingIntersectionOfWallsUnitTest_MovingReferenceFrame");
150 movingReferenceFrame.
solve();
151 compareParticles(movingReferenceFrame.
p1f,basic.
p1f, 1e-10, movingReferenceFrame.
velocity*movingReferenceFrame.
getTime(), movingReferenceFrame.
velocity,
Vec3D(0.0,0.0,0.0),
Vec3D(0.0,0.0,0.0));
152 compareParticles(movingReferenceFrame.
p2f,basic.
p2f, 1e-10, movingReferenceFrame.
velocity*movingReferenceFrame.
getTime(), movingReferenceFrame.
velocity,
Vec3D(0.0,0.0,0.0),
Vec3D(0.0,0.0,0.0));
153 compareParticles(movingReferenceFrame.
p3f,basic.
p3f, 1e-10, movingReferenceFrame.
velocity*movingReferenceFrame.
getTime(), movingReferenceFrame.
velocity,
Vec3D(0.0,0.0,0.0),
Vec3D(0.0,0.0,0.0));
154 compareParticles(movingReferenceFrame.
p1e,basic.
p1e, 1e-10, movingReferenceFrame.
velocity*movingReferenceFrame.
getTime(), movingReferenceFrame.
velocity,
Vec3D(0.0,0.0,0.0),
Vec3D(0.0,0.0,0.0));
155 compareParticles(movingReferenceFrame.
p2e,basic.
p2e, 1e-10, movingReferenceFrame.
velocity*movingReferenceFrame.
getTime(), movingReferenceFrame.
velocity,
Vec3D(0.0,0.0,0.0),
Vec3D(0.0,0.0,0.0));
156 compareParticles(movingReferenceFrame.
p3e,basic.
p3e, 1e-10, movingReferenceFrame.
velocity*movingReferenceFrame.
getTime(), movingReferenceFrame.
velocity,
Vec3D(0.0,0.0,0.0),
Vec3D(0.0,0.0,0.0));
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.
The DPMBase header includes quite a few header files, defining all the handlers, which are essential...
void setVelocity(const Vec3D &velocity)
set the velocity of the BaseInteractable.
A IntersectionOfWalls is convex polygon defined as an intersection of InfiniteWall's.
void setTimeMax(Mdouble newTMax)
Allows the upper time limit to be changed.
void setupInitialConditions()
This function allows to set the initial conditions for our problem to be solved, by default particle ...
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...
int main(int argc UNUSED, char *argv[] UNUSED)
void setParticleDimensions(unsigned int particleDimensions)
Allows the dimension of the particle (f.e. for mass) to be changed. e.g. discs or spheres...
virtual const Vec3D & getAngularVelocity() const
Returns the angular velocity of this interactable.
void setSystemDimensions(unsigned int newDim)
Allows for the dimension of the simulation to be changed.
void accelerate(const Vec3D &vel)
Increases the particle's velocity_ by the given vector.
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) ...
const Vec3D & getPosition() const
Returns the position of this BaseInteractable.
const Vec3D & getOrientation() const
Returns the orientation of this BaseInteractable.
void createOpenPrism(std::vector< Vec3D > points, Vec3D prismAxis)
Creates an open prism which is a polygon between the points, except the first and last point...
void setYMax(Mdouble newYMax)
If the length of the problem domain in y-direction is YMax - YMin, this method sets YMax...
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.
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...
void setDensity(Mdouble density)
Allows the density to be changed.
LL< Log::FATAL > FATAL
Fatal log level.
MovingIntersectionOfWallsUnitTest_Basic()
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
Species< LinearViscoelasticNormalSpecies > LinearViscoelasticSpecies
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. elastic, linear visco-elastic... et cetera...
bool isEqual(Mdouble v1, Mdouble v2, double absError)
Compares the difference of two Mdouble with an absolute error, useful in UnitTests.
WallHandler wallHandler
An object of the class WallHandler. Contains pointers to all the walls created.
void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
void setupInitialConditions()
This function allows to set the initial conditions for our problem to be solved, by default particle ...
This tests if moving walls also works with IntersectionOfWalls.
void setTimeStep(Mdouble newDt)
Allows the time step dt to be changed.
LinearViscoelasticSpecies * species
Contains material and contact force properties.
virtual const Vec3D & getVelocity() const
Returns the velocity of this interactable.
Implementation of a 3D vector (by Vitaliy).
Mdouble getTimeStep() const
Allows the time step dt to be accessed.
IntersectionOfWalls * triangle
unsigned int getSaveCountFromNumberOfSavesAndTimeMaxAndTimestep(unsigned int numberOfSaves, Mdouble timeMax, Mdouble timestep)
Returns the correct saveCount if the total number of saves, the final time and the time step is known...
Mdouble getTime() const
Access function for the time.
Mdouble getTimeMax() const
Allows the user to access the total simulation time during the simulation. Cannot change it though...
void compareParticles(BaseParticle *Ptest, BaseParticle *Pref, double absError, Vec3D positionDifference, Vec3D velocityDifference, Vec3D orientationDifference, Vec3D AngularVelocityDifference)