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

52 {
53  logger(INFO, "Single particle rolling on a bottom plate");
55  InclinedPlane problem;
56 
58  problem.setName("InclinedPlane");
59  problem.setFileType(FileType::NO_FILE); //comment if you want file output
60  problem.setSaveCount(50000);
61  problem.setSystemDimensions(2);
62  problem.setParticleDimensions(3);
63  Mdouble theta = 15.0*constants::pi/180.0;
64  problem.setGravity(9.8*Vec3D(std::sin(theta),-std::cos(theta),0.0));
65  species->setDensity(2000);
66  species->setStiffness(10000);
67  species->setDissipation(0);
68  species->setSlidingStiffness(10000);
69  species->setSlidingDissipation(0);
70  species->setSlidingFrictionCoefficient(0.5);
71  //species->setRollingStiffness(10000);
72  //species->setRollingDissipation(0);
73  //species->setRollingFrictionCoefficient(0.5);
74  //tc=7e-5
75  problem.setTimeStep(0.02*species->getCollisionTime(species->getMassFromRadius(0.005)));
76  problem.setTimeMax(1.0);
77  problem.setXMax(0.1);
78  problem.setYMax(0.1);
79  problem.setZMax(0.1);
80  problem.solve(argc, argv);
81  //problem.write(std::cout, true);
82  const Vec3D v = problem.particleHandler.getObject(0)->getVelocity();
83  logger(INFO,"v_x(t_max)=% should be ~1.81",v.X);
84  logger(INFO,"v_y(t_max)=% should be ~0",v.Y);
85  helpers::check(v.X,1.81167,1e-4,"v_x");
86  helpers::check(v.Y,0.00234107,1e-4,"v_y");
87 
88 }

References helpers::check(), BaseHandler< T >::copyAndAddObject(), mathsFunc::cos(), BaseHandler< T >::getObject(), BaseInteractable::getVelocity(), INFO, logger, DPMBase::particleHandler, constants::pi, DPMBase::setFileType(), DPMBase::setGravity(), DPMBase::setName(), DPMBase::setParticleDimensions(), DPMBase::setSaveCount(), DPMBase::setSystemDimensions(), DPMBase::setTimeMax(), DPMBase::setTimeStep(), DPMBase::setXMax(), DPMBase::setYMax(), DPMBase::setZMax(), mathsFunc::sin(), DPMBase::solve(), DPMBase::speciesHandler, Vec3D::X, and Vec3D::Y.

DPMBase::setName
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:420
DPMBase::setTimeStep
void setTimeStep(Mdouble newDt)
Sets a new value for the simulation time step.
Definition: DPMBase.cc:1225
LinearViscoelasticSlidingFrictionSpecies
Species< LinearViscoelasticNormalSpecies, SlidingFrictionSpecies > LinearViscoelasticSlidingFrictionSpecies
Definition: LinearViscoelasticSlidingFrictionSpecies.h:34
constants::pi
const Mdouble pi
Definition: ExtendedMath.h:45
DPMBase::setParticleDimensions
void setParticleDimensions(unsigned int particleDimensions)
Sets the particle dimensionality.
Definition: DPMBase.cc:1439
logger
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
Vec3D::X
Mdouble X
the vector components
Definition: Vector.h:65
DPMBase::setYMax
void setYMax(Mdouble newYMax)
Sets the value of YMax, the upper bound of the problem domain in the y-direction.
Definition: DPMBase.cc:1182
INFO
LL< Log::INFO > INFO
Info log level.
Definition: Logger.cc:55
helpers::check
void check(double real, double ideal, double error, std::string errorMessage)
Definition: Helpers.cc:911
BaseInteractable::getVelocity
virtual const Vec3D & getVelocity() const
Returns the velocity of this interactable.
Definition: BaseInteractable.cc:329
Vec3D
Definition: Vector.h:50
DPMBase::solve
void solve()
The work horse of the code.
Definition: DPMBase.cc:4003
DPMBase::setZMax
void setZMax(Mdouble newZMax)
Sets the value of ZMax, the upper bound of the problem domain in the z-direction.
Definition: DPMBase.cc:1208
Mdouble
double Mdouble
Definition: GeneralDefine.h:34
InclinedPlane
Definition: InclinedPlaneUnitTest.cpp:32
mathsFunc::sin
Mdouble sin(Mdouble x)
Definition: ExtendedMath.cc:44
DPMBase::setXMax
void setXMax(Mdouble newXMax)
Sets the value of XMax, the upper bound of the problem domain in the x-direction.
Definition: DPMBase.cc:1156
DPMBase::speciesHandler
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1385
DPMBase::setTimeMax
void setTimeMax(Mdouble newTMax)
Sets a new value for the maximum simulation duration.
Definition: DPMBase.cc:870
Vec3D::Y
Mdouble Y
Definition: Vector.h:65
DPMBase::setGravity
void setGravity(Vec3D newGravity)
Sets a new value for the gravitational acceleration.
Definition: DPMBase.cc:1374
DPMBase::setFileType
void setFileType(FileType fileType)
Sets File::fileType_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:457
BaseHandler::getObject
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:613
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
DPMBase::particleHandler
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created.
Definition: DPMBase.h:1395
DPMBase::setSaveCount
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:406
mathsFunc::cos
Mdouble cos(Mdouble x)
Definition: ExtendedMath.cc:64
DPMBase::setSystemDimensions
void setSystemDimensions(unsigned int newDim)
Sets the system dimensionality.
Definition: DPMBase.cc:1408