InclinedPlaneUnitTest.cpp File Reference

Classes

class  InclinedPlane
 

Functions

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

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)

Start off my solving the default problem

31 {
32  logger(INFO, "Single particle rolling on a bottom plate");
35 
36  auto species = problem.speciesHandler.copyAndAddObject(LinearViscoelasticSlidingFrictionSpecies());
37  problem.setName("InclinedPlane");
38  problem.setFileType(FileType::NO_FILE); //comment if you want file output
39  problem.setSaveCount(50000);
40  problem.setSystemDimensions(2);
41  problem.setParticleDimensions(3);
42  Mdouble theta = 15.0*constants::pi/180.0;
43  problem.setGravity(9.8*Vec3D(std::sin(theta),-std::cos(theta),0.0));
44  species->setDensity(2000);
45  species->setStiffness(10000);
46  species->setDissipation(0);
47  species->setSlidingStiffness(10000);
48  species->setSlidingDissipation(0);
49  species->setSlidingFrictionCoefficient(0.5);
50  //species->setRollingStiffness(10000);
51  //species->setRollingDissipation(0);
52  //species->setRollingFrictionCoefficient(0.5);
53  //tc=7e-5
54  problem.setTimeStep(0.02*species->getCollisionTime(species->getMassFromRadius(0.005)));
55  problem.setTimeMax(1.0);
56  problem.setXMax(0.1);
57  problem.setYMax(0.1);
58  problem.setZMax(0.1);
59  problem.solve(argc, argv);
60  //problem.write(std::cout, true);
61  const Vec3D v = problem.particleHandler.getObject(0)->getVelocity();
62  logger(INFO,"v_x(t_max)=% should be ~1.81",v.X);
63  logger(INFO,"v_y(t_max)=% should be ~0",v.Y);
64  helpers::check(v.X,1.81167,1e-4,"v_x");
65  helpers::check(v.Y,0.00234107,1e-4,"v_y");
66 
67 }
AnnoyingScalar cos(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:136
AnnoyingScalar sin(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:137
Array< int, Dynamic, 1 > v
Definition: Array_initializer_list_vector_cxx11.cpp:1
Array< double, 1, 3 > e(1./3., 0.5, 2.)
@ NO_FILE
file will not be created/read
Species< LinearViscoelasticNormalSpecies, SlidingFrictionSpecies > LinearViscoelasticSlidingFrictionSpecies
Definition: LinearViscoelasticSlidingFrictionSpecies.h:12
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
Definition: InclinedPlaneUnitTest.cpp:11
Definition: Kernel/Math/Vector.h:30
#define INFO(i)
Definition: mumps_solver.h:54
double theta
Definition: two_d_biharmonic.cc:236
const Mdouble pi
Definition: ExtendedMath.h:23
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(), cos(), e(), INFO, logger, NO_FILE, constants::pi, problem, sin(), BiharmonicTestFunctions2::theta, and v.