51 return(
Vec3D(cos(time),
69 if (std::abs(pos.
getLength() - 1) > 1e-6 )
70 logger(
FATAL,
"The particle is not on the unit circle anymore!");
71 if (std::abs(pos.
X) - 1 > 1e-6)
72 logger(
FATAL,
"The particle exceeded the bounds in x direction");
73 if (std::abs(pos.
Y) > 1e-6)
74 logger(
FATAL,
"The particle exceeded the bounds in y direction");
75 if (std::abs(pos.
Z) - 1 > 1e-6 )
76 logger(
FATAL,
"The particle exceeded the bounds in z direction");
78 if (pos.
X != pos.
X || pos.
Y != pos.
Y || pos.
Z != pos.
Z)
79 logger(
FATAL,
"The position of the particle contains an entry that is not a number.");
83 int main(
int argc,
char *argv[])
87 problem.
setName(
"DrivenParticleUnitTest");
void actionsAfterTimeStep()
A virtual function which allows to define operations to be executed after time step.
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...
Mdouble X
the vector components
void setTimeMax(Mdouble newTMax)
Allows the upper time limit to be changed.
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
void setPrescribedPosition(std::function< Vec3D(double)> prescribedPosition)
Allows the position of an infinite mass interactable to be prescribed.
void setZMax(Mdouble newZMax)
If the length of the problem domain in z-direction is XMax - XMin, this method sets ZMax...
void setFileType(FileType fileType)
Sets File::fileType_ for all files (ene, data, fstat, restart, stat)
const Vec3D & getPosition() const
Returns the position of this BaseInteractable.
static Mdouble getLength(const Vec3D &a)
Calculates the length of a Vec3D: .
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.
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.
Species< LinearViscoelasticNormalSpecies > LinearViscoelasticSpecies
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. elastic, linear visco-elastic... et cetera...
int main(int argc, char *argv[])
void setTimeStep(Mdouble newDt)
Allows the time step dt to be changed.
Implementation of a 3D vector (by Vitaliy).
void setupInitialConditions()
This function allows to set the initial conditions for our problem to be solved, by default particle ...
void fixParticle()
Fix Particle function. It fixes a Particle by setting its inverse mass and inertia and velocities to ...