35 logger(
ERROR,
"Please enter the name of the simulation you want to restart and, optionally, the name of the "
36 "simulation after restart");
40 logger(
INFO,
"restart data: %.restart", argv[1]);
50 logger(
INFO,
"Writing file %.tex", std::string(argv[1]));
51 ofstream os(std::string(argv[1]) +
".tex");
52 os <<
"\\documentclass[11pt]{standalone}\n"
53 "\\usepackage{tikz,graphics,multirow,multicol,tabularx, tabu,xcolor}\n"
56 "\\begin{tikzpicture}[\n"
57 "pf/.style ={fill=yellow!50,draw=none},%fill particle\n"
58 "pd/.style ={draw=black} %draw particle\n"
61 os <<
"%draw particles' inside\n";
64 const Vec3D& pos = p->getPosition()*1e6;
65 const Mdouble& r = p->getRadius()*1e6;
66 os <<
"\\draw[pf] (" + std::to_string(pos.
X)
67 +
"," + std::to_string(pos.
Z)
68 +
") circle (" + std::to_string(r) +
");\n";
71 os <<
"%draw particles' outside\n";
74 const Vec3D& pos = p->getPosition()*1e6;
75 const Mdouble& r = p->getRadius()*1e6;
76 os <<
"\\draw[pd] (" + std::to_string(pos.
X)
77 +
"," + std::to_string(pos.
Z)
78 +
") circle (" + std::to_string(r) +
");\n";
81 os <<
"%draw plastic overlap' outside\n";
85 const Vec3D& cp = c->getContactPoint()*1e6;
86 const Vec3D&
n = c->getNormal();
88 const Mdouble& po = 0.5*c->getPlasticOverlap()*1e6;
89 const Mdouble& o = 0.5*c->getOverlap()*1e6;
91 logger.assert_always(p!=
nullptr,
"not particle");
93 const Mdouble x = sqrt(2.0*po*r);
94 const Vec3D a0 = cp+x*t+(o-po)*
n, a1 = cp+x*t+0.5*r*
n, a2 = cp-x*t+0.5*r*
n, a3 = cp-x*t+(o-po)*
n;
95 os <<
"\\draw[pf] ("+ std::to_string(a0.
X) +
","+ std::to_string(a0.
Z)
96 +
") -- ("+ std::to_string(a1.X) +
","+ std::to_string(a1.Z)
97 +
") -- ("+ std::to_string(a2.X) +
","+ std::to_string(a2.Z)
98 +
") -- ("+ std::to_string(a3.X) +
","+ std::to_string(a3.Z)
100 os <<
"\\draw[pd] ("+ std::to_string(a0.
X) +
","+ std::to_string(a0.
Z)
101 +
") -- ("+ std::to_string(a3.X) +
","+ std::to_string(a3.Z) +
");\n";
102 const Vec3D b0 = cp+x*t-(o-po)*
n, b1 = cp+x*t-0.5*r*
n, b2 = cp-x*t-0.5*r*
n, b3 = cp-x*t-(o-po)*
n;
103 os <<
"\\draw[pf] ("+ std::to_string(b0.
X) +
","+ std::to_string(b0.
Z)
104 +
") -- ("+ std::to_string(b1.X) +
","+ std::to_string(b1.Z)
105 +
") -- ("+ std::to_string(b2.X) +
","+ std::to_string(b2.Z)
106 +
") -- ("+ std::to_string(b3.X) +
","+ std::to_string(b3.Z)
108 os <<
"\\draw[pd] ("+ std::to_string(b0.
X) +
","+ std::to_string(b0.
Z)
109 +
") -- ("+ std::to_string(b3.X) +
","+ std::to_string(b3.Z) +
");\n";
111 os <<
"\\end{tikzpicture}\n"
const unsigned n
Definition: CG3DPackingUnitTest.cpp:32
@ NO_FILE
file will not be created/read
LL< Log::INFO > INFO
Info log level.
Definition: Logger.cc:55
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
LL< Log::ERROR > ERROR
Error log level.
Definition: Logger.cc:53
Definition: BaseParticle.h:54
Mdouble getRadius() const
Returns the particle's radius.
Definition: BaseParticle.h:348
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:422
Mdouble getTimeStep() const
Returns the simulation time step.
Definition: DPMBase.cc:1250
void setRestarted(bool newRestartedFlag)
Allows to set the flag stating if the simulation is to be restarted or not.
Definition: DPMBase.cc:1501
File restartFile
An instance of class File to handle in- and output into a .restart file.
Definition: DPMBase.h:1493
InteractionHandler interactionHandler
An object of the class InteractionHandler.
Definition: DPMBase.h:1467
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created.
Definition: DPMBase.h:1437
void setTimeMax(Mdouble newTMax)
Sets a new value for the maximum simulation duration.
Definition: DPMBase.cc:873
bool readRestartFile(ReadOptions opt=ReadOptions::ReadAll)
Reads all the particle data corresponding to a given, existing . restart file (for more details regar...
Definition: DPMBase.cc:3006
void setFileType(FileType fileType)
Sets the type of file needed to write into or read from. File::fileType_.
Definition: File.cc:215
This adds on the hierarchical grid code for 3D problems.
Definition: Mercury3D.h:37
Computes normal forces in case of a linear plastic visco-elastic interaction.
Definition: SinterInteraction.h:40
Mdouble Z
Definition: Vector.h:66
Mdouble X
the vector components
Definition: Vector.h:66
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51