CubicPackingSelfTest.cpp File Reference
#include "Mercury3D.h"
#include "StatisticsVector.h"
#include "Walls/InfiniteWall.h"
#include <cmath>
#include <iostream>
#include <iomanip>
#include <Species/LinearViscoelasticSpecies.h>

Classes

class  NewtonsCradleSelftest
 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 
)

should give you Density 1

85 {
86  NewtonsCradleSelftest problem;
87  problem.setName("CubicPackingSelfTest");
89 
90  //set the number of particles
91  problem.N = 5;
92  problem.setSystemDimensions(3);
93  problem.speciesHandler.getObject(0)->setDensity(1.9098593);
94  problem.setGravity(Vec3D(0., 0., -1.));
95  species->setCollisionTimeAndRestitutionCoefficient(.01, .1, 1.);
96  problem.setTimeStep(.0002);
97  problem.setTimeMax(0.2);
98  problem.setSaveCount(1000);
99  problem.solve();
100 
101  StatisticsVector<Z> stats("CubicPackingSelfTest");
102  int n = 500;
103  stats.setN(n);
104  stats.setCGWidth(.1);
105  stats.setSuperExact(false);
106  stats.setCGShape("Gaussian");
107  stats.setCGTimeMin(problem.getTimeMax() * .999999);
108  stats.setTimeMaxStat(1e20);
109  stats.setVerbosityLevel(0);
110  stats.statistics_from_fstat_and_data();
112 
113 }
const unsigned n
Definition: CG3DPackingUnitTest.cpp:32
Species< LinearViscoelasticNormalSpecies > LinearViscoelasticSpecies
Definition: LinearViscoelasticSpecies.h:33
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
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:613
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:408
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1427
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:422
void setTimeStep(Mdouble newDt)
Sets a new value for the simulation time step.
Definition: DPMBase.cc:1234
void setTimeMax(Mdouble newTMax)
Sets a new value for the maximum simulation duration.
Definition: DPMBase.cc:873
void setSystemDimensions(unsigned int newDim)
Sets the system dimensionality.
Definition: DPMBase.cc:1417
void solve()
The work horse of the code.
Definition: DPMBase.cc:4270
Mdouble getTimeMax() const
Returns the maximum simulation duration.
Definition: DPMBase.cc:888
void setGravity(Vec3D newGravity)
Sets a new value for the gravitational acceleration.
Definition: DPMBase.cc:1383
In this file a cubic packing of 5^3 particles in a tri-axial box is created and allowed to settle und...
Definition: CubicPackingSelfTest.cpp:37
int N
Definition: CubicPackingSelfTest.cpp:80
void setDensity(Mdouble density)
Definition: ParticleSpecies.cc:108
This class is used to extract statistical data from MD simulations.
Definition: StatisticsVector.h:62
Definition: Vector.h:51

References BaseHandler< T >::copyAndAddObject(), BaseHandler< T >::getObject(), DPMBase::getTimeMax(), NewtonsCradleSelftest::N, n, StatisticsVector< T >::setCGShape(), StatisticsVector< T >::setCGTimeMin(), StatisticsVector< T >::setCGWidth(), ParticleSpecies::setDensity(), DPMBase::setGravity(), StatisticsVector< T >::setN(), DPMBase::setName(), DPMBase::setSaveCount(), StatisticsVector< T >::setSuperExact(), DPMBase::setSystemDimensions(), DPMBase::setTimeMax(), StatisticsVector< T >::setTimeMaxStat(), DPMBase::setTimeStep(), StatisticsVector< T >::setVerbosityLevel(), DPMBase::solve(), DPMBase::speciesHandler, and StatisticsVector< T >::statistics_from_fstat_and_data().