77 logger(
INFO,
"Simulating a stack of particles under gravity on a wall until it is relaxed");
79 problem.
setName(
"NewtonsCradleSelfTest");
84 species->setDensity(6./
pi);
86 species->setCollisionTimeAndRestitutionCoefficient(.01,.1,1.);
103 "p 'NewtonsCradleSelfTest.0.stat' u 2:22 w lp, 'NewtonsCradleSelfTest.stat' u 3:41 w l");
107 stats1.setCGWidth(w);
108 stats1.setSuperExact(
false);
109 stats1.setCGShape(
"Gaussian");
110 stats1.setCGTimeMin(problem.
getTimeMax()*1.00000999999);
111 stats1.setTimeMaxStat(1e20);
113 logger(
INFO,
"Creating %",stats1.statFile.getName());
114 stats1.statistics_from_fstat_and_data();
116 logger(
INFO,
"Test StatisticsVector for different CG functions (Gauss, Heaviside, Lucy)");
118 std::array<std::string,3> str = {
"Gaussian",
"HeavisideSphere",
"Lucy"};
120 for (
int i=0;
i<3;
i++) {
123 if (
i==2) w*=2*sqrt(3);
126 stats0.setZMinStat(-0.5);
127 stats0.statFile.setName(stats0.getName() +
"_" + str[
i] +
"Z.stat");
130 stats0.setCGWidth(w);
131 stats0.setSuperExact(
true);
132 stats0.setCGShape(str[
i].c_str());
133 stats0.setCGTimeMin(problem.
getTimeMax()*.999999);
134 stats0.setTimeMaxStat(1e20);
135 logger(
INFO,
"Creating %",stats0.statFile.getName());
136 stats0.statistics_from_fstat_and_data();
139 stats2.setZMinStat(-0.5);
140 stats2.statFile.setName(stats2.getName() +
"_" + str[
i] +
"XYZ.stat");
143 stats2.setCGWidth(w);
144 stats2.setSuperExact(
true);
145 stats2.setCGShape(str[
i].c_str());
146 stats2.setCGTimeMin(problem.
getTimeMax()*.999999);
147 stats2.setTimeMaxStat(1e20);
148 logger(
INFO,
"Creating %",stats2.statFile.getName());
149 stats2.statistics_from_fstat_and_data();
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 restartAndEvaluateDataFiles(const std::string &name, bool evaluateFStatFiles=true)
Definition: CGHandler.cc:188
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
CGHandler cgHandler
Object of the class cgHandler.
Definition: DPMBase.h:1473
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
This adds on the hierarchical grid code for 3D problems.
Definition: Mercury3D.h:37
Definition: NewtonsCradleSelfTest.cpp:35
int N
Definition: NewtonsCradleSelfTest.cpp:72
This class is used to extract statistical data from MD simulations.
Definition: StatisticsVector.h:62
Evaluates time-averaged continuum fields and writes the data into a stat file.
Definition: TimeAveragedCG.h:59
const Mdouble pi
Definition: ExtendedMath.h:45
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51
bool writeToFile(std::string filename, std::string filecontent)
Writes a string to a file.
Definition: FileIOHelpers.cc:58