Another example is to add additional output to the Example.ene file, in this case the number of particles.
void writeEneHeader(std::ostream& os) const override
{
os << setw(8) << "N";
}
void writeEneTimeStep(std::ostream& os) const override
{
os << setw(8) << particleHandler.getNumberOfObjects();
}
virtual void writeEneTimeStep(std::ostream &os) const
Write the global kinetic, potential energy, etc. in the system.
Definition: DPMBase.cc:2104
virtual void writeEneHeader(std::ostream &os) const
Writes a header with a certain format for ENE file.
Definition: DPMBase.cc:2014
To change the terminal output after each written time step, use:
void printTime() const override
{
std::cout << "N" << particleHandler.getNumberOfObjects() << std::endl;
}
Other functions can be overridden, most notably:
void actionsOnRestart() override {...}
void actionsBeforeTimeLoop() override {...}
void actionsBeforeTimeStep() override {...}
void actionsAfterTimeStep() override {...}
void actionsAfterSolve() override {...}
Definition: BaseParticle.h:54