statistics_while_running_simple.cpp File Reference
#include "scr/Mercury3D.h"
#include "scr/StatisticsVector.h"
#include <sstream>
#include <iostream>
#include <cstdlib>

Classes

class  statistics_while_running< T >
 

Functions

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

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)
68 {
69 
71 
72  problem.setDoPeriodicWalls(false);
73  //~ problem.doTimeAverage(false);
74  problem.setN(20);
75  problem.setTimeMaxStat(0.01);
76  problem.setCGTimeMin(0.0);
77  problem.setDensity(20);
78  problem.setCGWidth(0.1);
79  problem.setStiffnessAndRestitutionCoefficient(10000,0.8,problem.get_mass_from_Radius(0.0037));
80  problem.speciesHandler.getObject(0)->setSlidingFrictionCoefficient(0.5);
81  problem.speciesHandler.getObject(0)->setSlidingStiffness(problem.speciesHandler.getObject(0)->getStiffness());
84 
85  problem.setTimeMax(0.01);
86  problem.setGravity(Vec3D(0,0,0));
87 
88  problem.setTimeStep();
90  problem.setName("statistics_while_running");
91  problem.write(std::cout,false);
92 
93  problem.readArguments(argc, argv);
94  problem.solve();
95 }
@ ONE_FILE
all data will be written into/ read from a single file called name_
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:613
void write(std::ostream &os, bool writeAllParticles=true) const override
This function writes the Chute properties to an ostream, and adds the properties of ALL chute particl...
Definition: Chute.cc:206
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
File fStatFile
An instance of class File to handle in- and output into a .fstat file.
Definition: DPMBase.h:1483
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:422
Mdouble getTimeStep() const
Returns the simulation time step.
Definition: DPMBase.cc:1250
bool readArguments(int argc, char *argv[])
Can interpret main function input arguments that are passed by the driver codes.
Definition: DPMBase.cc:4391
File dataFile
An instance of class File to handle in- and output into a .data file.
Definition: DPMBase.h:1478
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 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
void setFileType(FileType fileType)
Sets the type of file needed to write into or read from. File::fileType_.
Definition: File.cc:215
void setN(int n)
Definition: StatisticsVector.h:179
void setCGTimeMin(Mdouble t)
Definition: StatisticsVector.h:223
void setCGWidth(Mdouble w)
Set CG variables w2 and CG_invvolume.
Definition: StatisticsVector.h:317
void setDoPeriodicWalls(bool new_)
Definition: StatisticsVector.h:563
void setTimeMaxStat(Mdouble t)
Definition: StatisticsVector.h:231
Definition: Vector.h:51
Definition: statXY.cpp:30
unsigned int getSaveCountFromNumberOfSavesAndTimeMaxAndTimeStep(unsigned int numberOfSaves, Mdouble timeMax, Mdouble timeStep)
Returns the correct saveCount if the total number of saves, the final time and the time step is known...
Definition: FormulaHelpers.cc:96