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 
)
73 {
74  unsigned n = 2;
76  problem.solve();
77 
78  Mercury3D cg;
80  //c0->setX(-0.5,n+0.5);
81  c0->setNX(250);
82  c0->setNY(1);
83  c0->setNZ(1);
84  c0->setWidth(0.3);
85  //c0->selectSpecies(0);
86 
87  //cg.cgHandler.copyAndAddObject(CG<CGCoordinates::O>());
88  cg.cgHandler.restartAndEvaluateDataFiles("MercuryCGSelfTest");
89 
91 
92  logger(INFO,"Run 'sp 'MercuryCGSelfTest.0.stat' u ($4==0.5?$2:NaN):3:16' in gnuplot to view the output");
93 
94  helpers::writeToFile("MercuryCGSelfTest.gnu","set multiplot layout 1,2\n"
95  "set xlabel 'x'\n"
96  //"set ylabel 'y'\n"
97  "set ylabel rotate\n"
98  "unset key\n"
99  "set ylabel 'Density at z=0.5'\n"
100  //"sp 'MercuryCGSelfTest.0.stat' u ($4==0.5?$2:NaN):3:6\n"
101  "p 'MercuryCGSelfTest.0.stat' u ($4==0.5&&$3==0.5?$2:NaN):6 w lp\n"
102  "unset key\n"
103  "set ylabel 'Normal Contact Stress in x at z=0.5'\n"
104  //"sp 'MercuryCGSelfTest.0.stat' u ($4==0.5?$2:NaN):3:16\n"
105  "p 'MercuryCGSelfTest.0.stat' u ($4==0.5&&$3==0.5?$2:NaN):16 w lp\n"
106  "unset multiplot\n");
107 }
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
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:363
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:360
T * getLastObject()
Gets a pointer to the last Object in this BaseHandler.
Definition: BaseHandler.h:642
void restartAndEvaluateDataFiles(const std::string &name, bool evaluateFStatFiles=true)
Definition: CGHandler.cc:173
CGHandler cgHandler
Object of the class cgHandler.
Definition: DPMBase.h:1479
const std::string & getName() const
Allows to access the file name, e.g., "problem.data".
Definition: File.cc:143
This adds on the hierarchical grid code for 3D problems.
Definition: Mercury3D.h:16
Evaluates time-averaged continuum fields and writes the data into a stat file.
Definition: TimeAveragedCG.h:39
#define INFO(i)
Definition: mumps_solver.h:54
void more(const std::string &filename, unsigned nLines=constants::unsignedMax)
Definition: FileIOHelpers.cc:151
bool writeToFile(const std::string &filename, const std::string &filecontent)
Writes a string to a file.
Definition: FileIOHelpers.cc:29
Constructor for SteadyAxisymAdvectionDiffusion problem
Definition: steady_axisym_advection_diffusion.cc:213
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:23

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