revision: v0.14
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"

Classes

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...
 

Functions

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();
98 
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);
107 
108  //cg.cgHandler.copyAndAddObject(CG<CGCoordinates::O>());
109  cg.cgHandler.restartAndEvaluateDataFiles("MercuryCGSelfTest");
110 
112 
113  logger(INFO,"Run 'sp 'MercuryCGSelfTest.0.stat' u ($4==0.5?$2:NaN):3:16' in gnuplot to view the output");
114 
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 }

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().

File::getName
const std::string & getName() const
Allows to access the file name, e.g., "problem.data".
Definition: File.cc:165
MercuryCGSelfTest
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
logger
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
DPMBase::cgHandler
CGHandler cgHandler
Object of the class cgHandler.
Definition: DPMBase.h:1431
CGHandler::restartAndEvaluateDataFiles
void restartAndEvaluateDataFiles(const std::string &name, bool evaluateFStatFiles=true)
Definition: CGHandler.cc:188
Mercury3D
This adds on the hierarchical grid code for 3D problems.
Definition: Mercury3D.h:37
INFO
LL< Log::INFO > INFO
Info log level.
Definition: Logger.cc:55
BaseCG::statFile
File statFile
File class to handle the output into a .stat file.
Definition: BaseCG.h:369
TimeAveragedCG
Evaluates time-averaged continuum fields and writes the data into a stat file.
Definition: TimeAveragedCG.h:59
BaseHandler::getLastObject
T * getLastObject()
Gets a pointer to the last Object in this BaseHandler.
Definition: BaseHandler.h:634
BaseHandler::copyAndAddObject
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
n
const unsigned n
Definition: CG3DPackingUnitTest.cpp:32
helpers::more
void more(std::string filename, unsigned nLines=constants::unsignedMax)
Definition: Helpers.cc:580
helpers::writeToFile
bool writeToFile(std::string filename, std::string filecontent)
Writes a string to a file.
Definition: Helpers.cc:445