liveStatistics.cpp File Reference
#include <iostream>
#include <CG/CG.h>
#include "Mercury3D.h"

Classes

class  Mercury3DRestart
 

Functions

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

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)
40 {
41 // if (argc<2) {
42 // cout << "Please enter the name of the simulation you want to restart and, optionally, the name of the simulation after restart" << endl;
43 // exit(-1);
44 // } else {
45 // cout << "restart data: " << argv[1] << ".restart" << endl;
46 // }
47  Mercury3DRestart problem;
48  problem.setName("ShearCell3D_vol_75nl_surf7_30degree");
49  problem.readRestartFile();
50  problem.setName("Out");
51  problem.setRestarted(false);
52  problem.time = problem.getTime();
53  problem.write(std::cout,false);
54 
55 // auto cg2 = problem.cgHandler.copyAndAddObject(CG<CGCoordinates::R,CGFunctions::Gauss>());
56 // cg2->setN(100);
57 // cg2->setWidth(0.001);
58 // cg2->setTimeMin(problem.getTimeMax());
59 
60 
61  problem.solve(argc-1, argv+1);
62  for (BaseInteraction* p : problem.interactionHandler) {
63  if (p->getOverlap()>0) logger(INFO,"overlap %",p->getOverlap());
64  }
65  logger(INFO,"mean overlap %",problem.interactionHandler.getMeanOverlap());
66  logger(INFO,"mean radius %",problem.particleHandler.getMeanRadius());
67 }
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.
Stores information about interactions between two interactable objects; often particles but could be ...
Definition: BaseInteraction.h:60
Mdouble getOverlap() const
Returns a Mdouble with the current overlap between the two interacting objects.
Definition: BaseInteraction.h:240
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 getTime() const
Returns the current simulation time.
Definition: DPMBase.cc:808
void setRestarted(bool newRestartedFlag)
Allows to set the flag stating if the simulation is to be restarted or not.
Definition: DPMBase.cc:1501
InteractionHandler interactionHandler
An object of the class InteractionHandler.
Definition: DPMBase.h:1467
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created.
Definition: DPMBase.h:1437
void solve()
The work horse of the code.
Definition: DPMBase.cc:4270
bool readRestartFile(ReadOptions opt=ReadOptions::ReadAll)
Reads all the particle data corresponding to a given, existing . restart file (for more details regar...
Definition: DPMBase.cc:3006
Mdouble getMeanOverlap() const
The mean overlap of all interactions.
Definition: InteractionHandler.cc:406
Definition: liveStatistics.cpp:32
double time
Definition: liveStatistics.cpp:36
void write(std::ostream &os, bool writeAllParticles=true) const override
Writes all data into a restart file.
Definition: MercuryBase.cc:147
Mdouble getMeanRadius() const
Definition: ParticleHandler.cc:804

References InteractionHandler::getMeanOverlap(), ParticleHandler::getMeanRadius(), BaseInteraction::getOverlap(), DPMBase::getTime(), INFO, DPMBase::interactionHandler, logger, DPMBase::particleHandler, DPMBase::readRestartFile(), DPMBase::setName(), DPMBase::setRestarted(), DPMBase::solve(), Mercury3DRestart::time, and MercuryBase::write().