105 int main(
int argc,
char *argv[])
110 species->setDensity(2000);
111 species->setStiffness(1e5);
112 species->setDissipation(1e-2);
113 OverlapProblem.
setName(
"ExtremeOverlapWithWallsUnitTest");
121 OverlapProblem.
solve(argc,argv);
124 Vec3D positionToCompare =
Vec3D(0, -0.0004900098000491, 0.004008957617341);
125 if (!position.
isEqualTo(positionToCompare, 1e-10))
126 logger(
FATAL,
"Large particle is in the wrong position. It is at % and should be %",position,positionToCompare);
128 std::cout <<
"Test passed" << std::endl;
130 positionToCompare =
Vec3D(0, -0.0004900098000491, 0.009004578797915);
132 if (!position.
isEqualTo(positionToCompare, 1e-10))
133 logger(
FATAL,
"Large particle is in the wrong position. It is at % and should be %",position,positionToCompare);
135 std::cout <<
"Test passed" << std::endl;
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.
void setTimeMax(Mdouble newTMax)
Allows the upper time limit to be changed.
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 getZMax() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMax() returns ZMax...
void setupInitialConditions()
This function allows to set the initial conditions for our problem to be solved, by default particle ...
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 setDimension(unsigned int newDim)
Sets the system and particle dimension.
void setFileType(FileType fileType)
Sets File::fileType_ for all files (ene, data, fstat, restart, stat)
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.
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.
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...
all data will be written into/ read from a single file called name_
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.
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
File dataFile
An instance of class File to handle in- and output into a .data file.
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...
void setFileType(FileType fileType)
Sets the type of file needed to write into or read from. File::fileType_.
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.
int main(int argc, char *argv[])
void set(Vec3D normal, Vec3D point)
Defines a standard wall, given an outward normal vector s.t. normal*x=normal*point for all x of the w...
void setTimeStep(Mdouble newDt)
Allows the time step dt to be changed.
This is a class defining walls.
Implementation of a 3D vector (by Vitaliy).
Compresses 2 particles (vertically) until they have an extreme overlap.