ConsistencyInitialParticleWallOverlapUnitTest.cpp File Reference
#include <cmath>
#include "Mercury3D.h"
#include "Walls/InfiniteWall.h"
#include "Species/LinearViscoelasticFrictionSpecies.h"

Classes

class  ConsistencyInitialParticleWallOverlapUnitTest
 

Functions

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

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)
68 {
69  // Problem setup
71  problem.setXMax(0.4);
72  problem.setYMax(0.6);
73  problem.setZMax(0.1);
74  problem.setXMin(0.0);
75  problem.setYMin(0.2);
76  problem.setZMin(0.0);
77 
78  problem.setGravity(Vec3D{0.,0.,-9.81});
79 
80  problem.setRadius(1.e-2);
81  problem.setInitOverlap(1.e-3);
82  problem.setInitPos0({0., 0.4, problem.getRadius() - problem.getInitOverlap()});
83  problem.setInitPos1({0.2, 0.4, problem.getRadius() - problem.getInitOverlap()});
84 
85  problem.setTimeMax(1.e-1);
86  problem.setTimeStep(0.005/50.);
87 
88  problem.setName("ConsistencyInitialParticleWallOverlapUnitTest");
89  // Uncomment to check vtu files
90  //problem.setParticlesWriteVTK(true);
91  //problem.wallHandler.setWriteVTK(true);
92  problem.dataFile.setFileType(FileType::NO_FILE);
93  problem.restartFile.setFileType(FileType::NO_FILE);
94  problem.eneFile.setFileType(FileType::NO_FILE);
95  problem.fStatFile.setFileType(FileType::NO_FILE);
96 
97  problem.solve();
98 
99  Vec3D initDiff = problem.getInitPos1() - problem.getInitPos0();
100  Vec3D currDiff = problem.particleHandler.getObject(1)->getPosition() - problem.particleHandler.getObject(0)->getPosition();
101 
102  // Check if particle 0 and 1 only moved in z-dir
103  helpers::check(problem.getInitPos0().X, problem.particleHandler.getObject(0)->getPosition().X, 1.e-15, "Particle 0 x-movement");
104  helpers::check(problem.getInitPos0().Y, problem.particleHandler.getObject(0)->getPosition().Y, 1.e-15, "Particle 0 y-movement");
105 
106  helpers::check(problem.getInitPos1().X, problem.particleHandler.getObject(1)->getPosition().X, 1.e-15, "Particle 1 x-movement");
107  helpers::check(problem.getInitPos1().Y, problem.particleHandler.getObject(1)->getPosition().Y, 1.e-15, "Particle 1 y-movement");
108 
109  helpers::check((currDiff.X-initDiff.X),0.,1.e-15,"Difference in x-movement");
110  helpers::check((currDiff.Y-initDiff.Y),0.,1.e-15,"Difference in y-movement");
111  helpers::check((currDiff.Z-initDiff.Z),0.,1.e-15,"Difference in z-movement");
112 
113  return 0;
114 }
@ NO_FILE
file will not be created/read
Definition: ConsistencyInitialParticleWallOverlapUnitTest.cpp:18
Definition: Kernel/Math/Vector.h:30
Mdouble Y
Definition: Kernel/Math/Vector.h:45
Mdouble Z
Definition: Kernel/Math/Vector.h:45
Mdouble X
the vector components
Definition: Kernel/Math/Vector.h:45
void check(double real, double ideal, double error, std::string errorMessage)
Definition: TestHelpers.cc:16
Constructor for SteadyAxisymAdvectionDiffusion problem
Definition: steady_axisym_advection_diffusion.cc:213

References helpers::check(), NO_FILE, problem, Vec3D::X, Vec3D::Y, and Vec3D::Z.