CGBasicSelfTest.cpp File Reference

Classes

class  CGBasicSelfTest
 Tests if the different CG templates work correctly. More...
 

Functions

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

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)
99 {
100  //declare the DPM problem and set the name
102  problem.setTimeMax(0.21); //a total of 5000 time steps
103 
104  //int n1 = 1000, n2 = 100, n3=20;
105  size_t n1 = 1000, n2 = 33, n3=10;
106  //define different coarse-graining objects (which should all result in the same mean values)
107  auto cg0 = problem.cgHandler.copyAndAddObject(CG<CGCoordinates::O>());
108  cg0->setTimeMin(0.21);
109  auto cg1 = problem.cgHandler.copyAndAddObject(CG<CGCoordinates::Z,CGFunctions::Gauss>());
110  cg1->setN(n1);
111  cg1->setWidth(0.5/3.01);
112  cg1->setTimeMin(0.21);
113  auto cg2 = problem.cgHandler.copyAndAddObject(CG<CGCoordinates::YZ,CGFunctions::Gauss>());
114  cg2->setN(n2);
115  cg2->setWidth(0.5/3.01);
116  cg2->setTimeMin(0.21);
117  auto cg3 = problem.cgHandler.copyAndAddObject(CG<CGCoordinates::XYZ,CGFunctions::Gauss>());
118  cg3->setN(n3);
119  cg3->setWidth(0.5/3.01);
120  cg3->setTimeMin(0.21);
121  auto cg4 = problem.cgHandler.copyAndAddObject(CG<CGCoordinates::Z,CGFunctions::Heaviside>());
122  cg4->setNZ(n1);
123  cg4->setWidth(0.5/2.01);
124  cg4->setTimeMin(0.21);
125  auto cg5 = problem.cgHandler.copyAndAddObject(CG<CGCoordinates::YZ,CGFunctions::Heaviside>());
126  cg5->setN(n2);
127  cg5->setWidth(0.5/2.01);
128  cg5->setTimeMin(0.21);
129  auto cg6 = problem.cgHandler.copyAndAddObject(CG<CGCoordinates::XYZ,CGFunctions::Heaviside>());
130  cg6->setN(n3);
131  cg6->setWidth(0.5/2.01);
132  cg6->setTimeMin(0.21);
133  auto cg7 = problem.cgHandler.copyAndAddObject(CG<CGCoordinates::Z,CGFunctions::Lucy>());
134  cg7->setNZ(n1);
135  cg7->setWidth(0.5/2.01);
136  cg7->setTimeMin(0.21);
137  auto cg8 = problem.cgHandler.copyAndAddObject(CG<CGCoordinates::YZ,CGFunctions::Lucy>());
138  cg8->setN(n2);
139  cg8->setWidth(0.5/2.01);
140  cg8->setTimeMin(0.21);
141  auto cg9 = problem.cgHandler.copyAndAddObject(CG<CGCoordinates::XYZ,CGFunctions::Lucy>());
142  cg9->setN(n3);
143  cg9->setWidth(0.5/2.01);
144  cg9->setTimeMin(0.21);
145  auto cg10 = problem.cgHandler.copyAndAddObject(CG<CGCoordinates::X,CGFunctions::Lucy>());
146  cg10->setN(n1);
147  cg10->setWidth(0.5/2.01);
148  cg10->setTimeMin(0.21);
149  auto cg11 = problem.cgHandler.copyAndAddObject(CG<CGCoordinates::X,CGFunctions::Gauss>());
150  cg11->setN(n1);
151  cg11->setWidth(0.5/3.01);
152  cg11->setTimeMin(0.21);
153  auto cg12 = problem.cgHandler.copyAndAddObject(CG<CGCoordinates::Y,CGFunctions::Lucy>());
154  cg12->setN(n1);
155  cg12->setWidth(0.5/2.01);
156  cg12->setTimeMin(0.21);
157  auto cg13 = problem.cgHandler.copyAndAddObject(CG<CGCoordinates::Y,CGFunctions::Gauss>());
158  cg13->setN(n1);
159  cg13->setWidth(0.5/3.01);
160  cg13->setTimeMin(0.21);
161 
162  //run the simulation
163  problem.solve(argc, argv);
164 
165  helpers::writeToFile("CGBasicSelfTest.1D.gnu","p 'CGBasicSelfTest.1.stat' u 2:22 w d, 'CGBasicSelfTest.4.stat' u 2:22 w d, 'CGBasicSelfTest.7.stat' u 2:22 w d");
166  helpers::writeToFile("CGBasicSelfTest.2D.gnu","sp 'CGBasicSelfTest.8.stat' u 2:3:23 w d");
167 }
Tests if the different CG templates work correctly.
Definition: CGBasicSelfTest.cpp:55
Evaluates time-resolved continuum fields and writes the data into a stat file.
Definition: CG.h:55
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

References problem, and helpers::writeToFile().