88 PlasticForceUnitTestProblem.
species->setPlasticParameters(k1, 5.0*k1, k1, 0.05);
89 PlasticForceUnitTestProblem.
species->setDissipation(0);
93 logger(
INFO,
"Testing particle particles collision for elastic plastic forces. \n"
94 "This will be done for serveral values of scaled relative velocity chi");
99 const std::vector<double> chi = {0.34, 0.69, 1.1, 1.37};
100 const std::vector<Vec3D> leftFinalVecloity = {
101 Vec3D(-0.032721738352012,0.0,0.0),
102 Vec3D(-0.0138683231953154,0.0,0.0),
103 Vec3D(-0.0204655358555405,0.0,0.0),
104 Vec3D(-0.163049415300304,0.0,0.0)};
105 const std::vector<Vec3D> leftFinalPosition = {
106 Vec3D(0.995546292935715,1.0,1.0),
107 Vec3D(1.00695193269955,1.0,1.0),
108 Vec3D(1.00840467123501,1.0,1.0),
109 Vec3D(0.969386085767181,1.0,1.0)};
112 for (
int i=0;
i<4;
i++)
115 PlasticForceUnitTestProblem.
set_chi(chi[
i]);
116 std::stringstream ss(
"");
117 ss <<
"PlasticForceUnitTest" << PlasticForceUnitTestProblem.
get_chi();
118 PlasticForceUnitTestProblem.
setName(ss.str().c_str());
119 PlasticForceUnitTestProblem.
solve();
124 if (!(*pIt)->getPosition().isEqualTo(leftFinalPosition[
i], 1e-10))
125 logger(
FATAL,
"Left particle is in the wrong position. It is at % and should be %", (*pIt)->getPosition(),
126 leftFinalPosition[
i]);
127 if (!(*pIt)->getVelocity().isEqualTo(leftFinalVecloity[
i], 1e-10))
128 logger(
FATAL,
"Left particle has the wrong velocity. It is at % and should be %", (*pIt)->getVelocity(),
129 leftFinalVecloity[
i]);
132 logger(
INFO,
"Execute 'gnuplot PlasticForceUnitTest.gnu' to view output");
134 "set xlabel 'displacement [{/Symbol d}]'\n"
135 "set ylabel 'force [f^n]'\n"
137 "plot 'PlasticForceUnitTest0.34.fstat' u 7:9 w lp\n"
LL< Log::INFO > INFO
Info log level.
Definition: Logger.cc:55
LL< Log::FATAL > FATAL
Definition of the different loglevels by its wrapper class LL. These are used as tags in template met...
Definition: Logger.cc:52
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
const std::vector< T * >::const_iterator begin() const
Gets the begin of the const_iterator over all Object in this BaseHandler.
Definition: BaseHandler.h:690
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:422
void setParticleDimensions(unsigned int particleDimensions)
Sets the particle dimensionality.
Definition: DPMBase.cc:1448
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created.
Definition: DPMBase.h:1437
void setSystemDimensions(unsigned int newDim)
Sets the system dimensionality.
Definition: DPMBase.cc:1417
void solve()
The work horse of the code.
Definition: DPMBase.cc:4270
[T11:contactModel]
Definition: PlasticForceUnitTest.cpp:36
void set_chi(double new_)
Definition: PlasticForceUnitTest.cpp:77
double get_chi()
Definition: PlasticForceUnitTest.cpp:78
LinearPlasticViscoelasticSpecies * species
Definition: PlasticForceUnitTest.cpp:81
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51
bool writeToFile(std::string filename, std::string filecontent)
Writes a string to a file.
Definition: FileIOHelpers.cc:58