52 double deltamax = (
species->getUnloadingStiffnessMax()/(
species->getUnloadingStiffnessMax()-
species->getLoadingStiffness()))*depth*((2*0.5*0.5)/(0.5+0.5));
53 double relVelocity=sqrt(
species->getLoadingStiffness()*(
chi*deltamax)*(
chi*deltamax)*2);
86 PlasticForceUnitTestProblem.
species->setPlasticParameters(k1, 5.0*k1, k1, 0.05);
87 PlasticForceUnitTestProblem.
species->setDissipation(0);
91 logger(
INFO,
"Testing particle particles collision for elastic plastic forces. \n"
92 "This will be done for serveral values of scaled relative velocity chi");
97 const std::vector<double> chi = {0.34, 0.69, 1.1, 1.37};
98 const std::vector<Vec3D> leftFinalVecloity = {
99 Vec3D(-0.032721738352012,0.0,0.0),
100 Vec3D(-0.0138683231953154,0.0,0.0),
101 Vec3D(-0.0204655358555405,0.0,0.0),
102 Vec3D(-0.163049415300304,0.0,0.0)};
103 const std::vector<Vec3D> leftFinalPosition = {
104 Vec3D(0.995546292935715,1.0,1.0),
105 Vec3D(1.00695193269955,1.0,1.0),
106 Vec3D(1.00840467123501,1.0,1.0),
107 Vec3D(0.969386085767181,1.0,1.0)};
110 for (
int i=0; i<4; i++)
113 PlasticForceUnitTestProblem.
set_chi(chi[i]);
114 std::stringstream ss(
"");
115 ss <<
"PlasticForceUnitTest" << PlasticForceUnitTestProblem.
get_chi();
116 PlasticForceUnitTestProblem.
setName(ss.str().c_str());
117 PlasticForceUnitTestProblem.
solve();
122 if (!(*pIt)->getPosition().isEqualTo(leftFinalPosition[i], 1e-10))
123 logger(
FATAL,
"Left particle is in the wrong position. It is at % and should be %",(*pIt)->getPosition(),leftFinalPosition[i]);
124 if (!(*pIt)->getVelocity().isEqualTo(leftFinalVecloity[i] , 1e-10))
125 logger(
FATAL,
"Left particle has the wrong velocity. It is at % and should be %",(*pIt)->getVelocity(),leftFinalVecloity[i]);
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 set_chi(double new_)
LL< Log::INFO > INFO
Info log level.
void setParticleDimensions(unsigned int particleDimensions)
Allows the dimension of the particle (f.e. for mass) to be changed. e.g. discs or spheres...
void setZMax(Mdouble newZMax)
If the length of the problem domain in z-direction is XMax - XMin, this method sets ZMax...
void setSystemDimensions(unsigned int newDim)
Allows for the dimension of the simulation to be changed.
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.
void setRadius(const Mdouble radius)
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species) ...
const std::vector< T * >::const_iterator begin() const
Gets the begin of the const_iterator over all Object in this BaseHandler.
void clear()
Empties the whole ParticleHandler by removing all BaseParticle.
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.
Species< LinearPlasticViscoelasticNormalSpecies > LinearPlasticViscoelasticSpecies
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_
void setDensity(Mdouble density)
Allows the density to be changed.
LL< Log::FATAL > FATAL
Fatal log level.
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. elastic, linear visco-elastic... et cetera...
This code tests our plastic force model, as published in Luding 2008.
void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
void setTimeStep(Mdouble newDt)
Allows the time step dt to be changed.
int main(int argc UNUSED, char *argv[] UNUSED)
virtual void writeRestartFile()
Stores all the particle data for current save time step. Calls the write function.
Contains material and contact force properties.
Implementation of a 3D vector (by Vitaliy).
Mdouble getTimeStep() const
Allows the time step dt to be accessed.
LinearPlasticViscoelasticSpecies * species
void setupInitialConditions()
This function allows to set the initial conditions for our problem to be solved, by default particle ...