SinterBed1SelfTest.cpp File Reference
#include "Mercury3D.h"
#include <Species/SinterFrictionSpecies.h>
#include <Walls/InfiniteWall.h>
#include <Walls/AxisymmetricIntersectionOfWalls.h>
#include <iomanip>
#include <cassert>

Classes

class  Sintering
 

Functions

int main (int argc UNUSED, char *argv[] UNUSED)
 

Function Documentation

◆ main()

int main ( int argc  UNUSED,
char *argv[]  UNUSED 
)
110 {
111  Sintering s;
112  s.setSaveCount(100);
113  s.fStatFile.setSaveCount(300);
114 
115  Mdouble sinterRate = readFromFile("in","sinterRate",0.25*0.25*mathsFunc::square(0.3));
116  s.species->setSinterRate(sinterRate);
117 
118  Mdouble sinterTime = readFromFile("in","sinterTime",24);
119  s.setTimeMax(sinterTime);
120  s.restartFile.setSaveCount(s.getTimeMax()/s.getTimeStep()/5.0+1.0);
122  s.restartFile.setFileType(FileType::MULTIPLE_FILES); // so we can restart from different times
123 
124  writeToFile("SinterBed1.gnu",
125  "set xlabel 't'\n"
126  "set ylabel 'x/d'\n"
127  "p '"+s.getName()+".ene' u 1:2 w lp, 0.075*x**0.5\n"
128  );
129  writeToFile("SinterBed1b.gnu",
130  "set xlabel 't'\n"
131  "set ylabel 'x/d'\n"
132  "p '" + s.getName() + ".fstat' u 1:(sqrt($7/" +
133  toString(2.0 * s.particleHandler.getMeanRadius()) + ")), 0.3*x**0.5\n"
134  );
135 
136  s.species->setSinterType(SINTERTYPE::CONSTANT_RATE);
137  s.solve();
138 
139  logger(INFO, "Run with ./SinterBed1 >out; the execute 'gnuplot SinterBed1.gnu' to view output");
140 
141  //if I add friction (10,1), it creates ruptures
142  return 0;
143 }
@ MULTIPLE_FILES
each time-step will be written into/read from separate files numbered consecutively: name_....
@ ONE_FILE
all data will be written into/ read from a single file called name_
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.
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:408
File fStatFile
An instance of class File to handle in- and output into a .fstat file.
Definition: DPMBase.h:1483
Mdouble getTimeStep() const
Returns the simulation time step.
Definition: DPMBase.cc:1250
const std::string & getName() const
Returns the name of the file. Does not allow to change it though.
Definition: DPMBase.cc:399
File restartFile
An instance of class File to handle in- and output into a .restart file.
Definition: DPMBase.h:1493
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
void solve()
The work horse of the code.
Definition: DPMBase.cc:4270
Mdouble getTimeMax() const
Returns the maximum simulation duration.
Definition: DPMBase.cc:888
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_.
Definition: File.cc:273
void setFileType(FileType fileType)
Sets the type of file needed to write into or read from. File::fileType_.
Definition: File.cc:215
Mdouble getMeanRadius() const
Definition: ParticleHandler.cc:804
Definition: SinterBed1SelfTest.cpp:40
SinterFrictionSpecies * species
Definition: SinterBed1SelfTest.cpp:106
T readFromFile(const std::string fileName, const std::string varName, const T defaultValue)
Definition: FileIOHelpers.h:121
std::string toString(Mdouble value, unsigned precision)
converts a floating point number into a string with a given precision
Definition: StringHelpers.cc:38
bool writeToFile(std::string filename, std::string filecontent)
Writes a string to a file.
Definition: FileIOHelpers.cc:58
T square(const T val)
squares a number
Definition: ExtendedMath.h:106

References CONSTANT_RATE, DPMBase::fStatFile, ParticleHandler::getMeanRadius(), DPMBase::getName(), DPMBase::getTimeMax(), DPMBase::getTimeStep(), INFO, logger, MULTIPLE_FILES, ONE_FILE, DPMBase::particleHandler, helpers::readFromFile(), DPMBase::restartFile, File::setFileType(), DPMBase::setSaveCount(), File::setSaveCount(), DPMBase::setTimeMax(), DPMBase::solve(), Sintering::species, mathsFunc::square(), helpers::toString(), and helpers::writeToFile().