SquarePackingSelfTest.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  SquarePacking
 

Functions

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

Function Documentation

◆ main()

int main ( int argc  UNUSED,
char *argv[]  UNUSED 
)
80 {
81  SquarePacking problem;
82  problem.setName("SquarePackingSelfTest");
84  //set the number of particles
85  problem.N = 5;
86  problem.setSystemDimensions(2);
87  problem.setParticleDimensions(2);
88  species->setDensity(6.0 / constants::pi * 2. / 3.);
89  //species->setDensity(1.9098593*2/3);
90  problem.setGravity(Vec3D(0., -1, 0.));
91  species->setCollisionTimeAndRestitutionCoefficient(.01, .1, 1.);
92  problem.setTimeStep(.0002);
93  problem.setTimeMax(1.0);
94  problem.setSaveCount(1000);
95 
96  problem.setCGTimeMin(problem.getTimeMax() * .98);
97  problem.setTimeMaxStat(1e20);
98 
99  logger(INFO, "Relax the packing");
100  problem.solve();
101 
102  logger(INFO, "Get statistics");
103  StatisticsVector<Y> stats("SquarePackingSelfTest");
104  stats.statFile.setName("SquarePackingSelfTest.Y.stat");
105  double n = 500;
106  stats.setN(n);
107  stats.setCGWidth(.1);
108  stats.setCGTimeMin(problem.getTimeMax() * .98);
109  stats.setTimeMaxStat(1e20);
110  //stats.verbose();
111  //stats.set_boundedDomain(true);
112  stats.statistics_from_fstat_and_data();
113 
114  logger(INFO, "Get fully averaged statistics");
115  StatisticsVector<O> statsO("SquarePackingSelfTest");
116  statsO.statFile.setName("SquarePackingSelfTest.O.stat");
117  statsO.setCGTimeMin(problem.getTimeMax() * .98);
118  statsO.setTimeMaxStat(1e20);
119  statsO.statistics_from_fstat_and_data();
120  // should give you Density 1
121 }
const unsigned n
Definition: CG3DPackingUnitTest.cpp:32
Species< LinearViscoelasticNormalSpecies > LinearViscoelasticSpecies
Definition: LinearViscoelasticSpecies.h:33
LL< Log::INFO > INFO
Info log level.
Definition: Logger.cc:55
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
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
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 setParticleDimensions(unsigned int particleDimensions)
Sets the particle dimensionality.
Definition: DPMBase.cc:1448
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
Definition: SquarePackingSelfTest.cpp:35
int N
Definition: SquarePackingSelfTest.cpp:75
This class is used to extract statistical data from MD simulations.
Definition: StatisticsVector.h:62
void setCGTimeMin(Mdouble t)
Definition: StatisticsVector.h:223
void setTimeMaxStat(Mdouble t)
Definition: StatisticsVector.h:231
Definition: Vector.h:51
const Mdouble pi
Definition: ExtendedMath.h:45

References BaseHandler< T >::copyAndAddObject(), DPMBase::getTimeMax(), INFO, logger, SquarePacking::N, n, constants::pi, StatisticsVector< T >::setCGTimeMin(), StatisticsVector< T >::setCGWidth(), DPMBase::setGravity(), StatisticsVector< T >::setN(), DPMBase::setName(), File::setName(), DPMBase::setParticleDimensions(), DPMBase::setSaveCount(), DPMBase::setSystemDimensions(), DPMBase::setTimeMax(), StatisticsVector< T >::setTimeMaxStat(), DPMBase::setTimeStep(), DPMBase::solve(), DPMBase::speciesHandler, DPMBase::statFile, and StatisticsVector< T >::statistics_from_fstat_and_data().