MercuryCGSelfTest.cpp File Reference
#include "Mercury3D.h"
#include "StatisticsVector.h"
#include "Walls/InfiniteWall.h"
#include <cmath>
#include <iostream>
#include <iomanip>
#include <Species/LinearViscoelasticSpecies.h>
#include <CG/Functions/Heaviside.h>
#include <Species/LinearViscoelasticReversibleAdhesiveSpecies.h>
#include <CG/TimeAveragedCG.h>
#include "MercuryTime.h"
#include "CG/CG.h"


struct  MercuryCGSelfTest
 In this file a cubic packing of 5^3 particles in a tri-axial box is created and allowed to settle under small gravity. After that Z statistics are calculated. More...


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

Function Documentation

◆ main()

int main ( int argc  UNUSED,
char *argv[]  UNUSED 
94 {
95  unsigned n = 2;
96  MercuryCGSelfTest problem(n);
97  problem.solve();
99  Mercury3D cg;
101  //c0->setX(-0.5,n+0.5);
102  c0->setNX(250);
103  c0->setNY(1);
104  c0->setNZ(1);
105  c0->setWidth(0.3);
106  //c0->selectSpecies(0);
108  //cg.cgHandler.copyAndAddObject(CG<CGCoordinates::O>());
109  cg.cgHandler.restartAndEvaluateDataFiles("MercuryCGSelfTest");
113  logger(INFO,"Run 'sp 'MercuryCGSelfTest.0.stat' u ($4==0.5?$2:NaN):3:16' in gnuplot to view the output");
115  helpers::writeToFile("MercuryCGSelfTest.gnu","set multiplot layout 1,2\n"
116  "set xlabel 'x'\n"
117  //"set ylabel 'y'\n"
118  "set ylabel rotate\n"
119  "unset key\n"
120  "set ylabel 'Density at z=0.5'\n"
121  //"sp 'MercuryCGSelfTest.0.stat' u ($4==0.5?$2:NaN):3:6\n"
122  "p 'MercuryCGSelfTest.0.stat' u ($4==0.5&&$3==0.5?$2:NaN):6 w lp\n"
123  "unset key\n"
124  "set ylabel 'Normal Contact Stress in x at z=0.5'\n"
125  //"sp 'MercuryCGSelfTest.0.stat' u ($4==0.5?$2:NaN):3:16\n"
126  "p 'MercuryCGSelfTest.0.stat' u ($4==0.5&&$3==0.5?$2:NaN):16 w lp\n"
127  "unset multiplot\n");
128 }
const unsigned n
Definition: CG3DPackingUnitTest.cpp:32
Info log level.
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
File statFile
File class to handle the output into a .stat file.
Definition: BaseCG.h:376
std::enable_if<!std::is_pointer< U >::value, U * >::type copyAndAddObject(const U &object)
Creates a copy of a Object and adds it to the BaseHandler.
Definition: BaseHandler.h:379
T * getLastObject()
Gets a pointer to the last Object in this BaseHandler.
Definition: BaseHandler.h:634
void restartAndEvaluateDataFiles(const std::string &name, bool evaluateFStatFiles=true)
CGHandler cgHandler
Object of the class cgHandler.
Definition: DPMBase.h:1473
const std::string & getName() const
Allows to access the file name, e.g., "".
This adds on the hierarchical grid code for 3D problems.
Definition: Mercury3D.h:37
Evaluates time-averaged continuum fields and writes the data into a stat file.
Definition: TimeAveragedCG.h:59
void more(std::string filename, unsigned nLines=constants::unsignedMax)
bool writeToFile(std::string filename, std::string filecontent)
Writes a string to a file.
In this file a cubic packing of 5^3 particles in a tri-axial box is created and allowed to settle und...
Definition: MercuryCGSelfTest.cpp:44

References DPMBase::cgHandler, BaseHandler< T >::copyAndAddObject(), BaseHandler< T >::getLastObject(), File::getName(), INFO, logger, helpers::more(), n, CGHandler::restartAndEvaluateDataFiles(), DPMBase::solve(), BaseCG::statFile, and helpers::writeToFile().