97 int main(
int argc,
char *argv[])
106 species->setDensity(2000);
107 species->setStiffness(1e1);
108 species->setDissipation(0.0);
109 species->setSlidingFrictionCoefficient(1.0);
110 species->setSlidingStiffness(2.0/7.0*species->getStiffness());
111 species->setSlidingDissipation(2.0/7.0*species->getDissipation());
113 OverlapProblem.
setName(
"ExtremeOverlapUnitTest");
120 OverlapProblem.
solve(argc,argv);
123 Vec3D positionToCompare =
Vec3D(-1.031389999146e-06, 0.009506389407855, 0);
124 if (!position.
isEqualTo(positionToCompare, 1e-10))
125 logger(
FATAL,
"Large particle is in the wrong position. It is at % and should be %",position,positionToCompare);
127 std::cout <<
"Test passed" << std::endl;
129 positionToCompare =
Vec3D(0.01010314899993, 0.01487096023445, 0);
130 if (!position.
isEqualTo(positionToCompare, 1e-10))
131 logger(
FATAL,
"Large particle is in the wrong position. It is at % and should be %",position,positionToCompare);
133 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.
void setupInitialConditions() final
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...
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.
Species< LinearViscoelasticNormalSpecies, SlidingFrictionSpecies > LinearViscoelasticSlidingFrictionSpecies
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.
Makes sure that the behavior is still sensible if the overlap of two particles grows extremely large...
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...
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_.
void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
void setTimeStep(Mdouble newDt)
Allows the time step dt to be changed.
Implementation of a 3D vector (by Vitaliy).
int main(int argc, char *argv[])