MercuryDPM
Alpha
|
#include <string>
#include <sstream>
#include <functional>
#include <type_traits>
#include "GeneralDefine.h"
Go to the source code of this file.
Classes | |
class | LoggerOutput |
Default functions for output generation. More... | |
class | Logger< L, ASSERTS > |
See How to use the logger for details on how to use the logger. More... | |
class | LL< Level > |
Tag for template metaprogramming. More... | |
class | Logger< L, ASSERTS > |
See How to use the logger for details on how to use the logger. More... | |
Macros | |
#define | MERCURY_LOGLEVEL Log::DEFAULT |
#define | MERCURY_ASSERTS true |
#define | assert(e,...) assert(true,"") |
Enumerations | |
enum | Log : signed char { Log::FATAL = -20, Log::ERROR = -15, Log::WARN = -10, Log::INFO = -5, Log::DEFAULT = 0, Log::VERBOSE = 5, Log::DEBUG = 10 } |
The different loglevels. More... | |
Functions | |
constexpr bool | operator<= (const Log rhs, const Log lhs) |
Internally used to filter on loglevel. Do not edit, as this is required for an optimised logger. More... | |
Variables | |
LoggerOutput * | loggerOutput |
Declaration of the output functions. If the output needs to be redirected, please swap the loggerOutput pointer to your preferred LoggerOutput instance, and make sure this exists until AFTER an std::exit() invocation. (e.g. clean up with std::atexit()) More... | |
LL< Log::FATAL > | FATAL |
Fatal log level. More... | |
LL< Log::ERROR > | ERROR |
Error log level. More... | |
LL< Log::WARN > | WARN |
Warning log level. More... | |
LL< Log::INFO > | INFO |
Info log level. More... | |
LL< Log::DEFAULT > | DEFAULT |
Default log level. More... | |
LL< Log::VERBOSE > | VERBOSE |
Verbose information. More... | |
LL< Log::DEBUG > | DEBUG |
Debug information. More... | |
Logger< MERCURY_LOGLEVEL > | logger |
#define assert | ( | e, | |
... | |||
) | assert(true,"") |
Definition at line 584 of file Logger.h.
Referenced by mathsFunc::chebyshev(), ChargedBondedInteraction::computeAdhesionForce(), HertzianSinterNormalSpecies::computeTimeStep(), ChargedBondedInteraction::getElasticEnergy(), helpers::loadingTest(), helpers::normalAndTangentialLoadingTest(), and helpers::objectivenessTest().
#define MERCURY_ASSERTS true |
#define MERCURY_LOGLEVEL Log::DEFAULT |
|
strong |
The different loglevels.
The different loglevels, represented as signed characters, in descending order of severeness. Worst is FATAL, best is DEBUG.
Please, use the tags FATAL/ERROR/etc without class/enum/namespace instead.
Enumerator | |
---|---|
FATAL | |
ERROR | |
WARN | |
INFO | |
DEFAULT | |
VERBOSE | |
DEBUG |
Definition at line 155 of file Logger.h.
LL<Log::DEBUG> DEBUG |
Debug information.
Only used for internal development. Can be very cryptic, as it is only meant for finding bugs / oddities by the internal development team.
Example: Collission found between Particle #38201 and Wall #5
Default behaviour: ignore.
Definition at line 56 of file Logger.cc.
Referenced by BaseHandler< T >::BaseHandler(), and BaseHandler< T >::~BaseHandler().
LL<Log::DEFAULT> DEFAULT |
LL<Log::ERROR> ERROR |
Error log level.
Error, as in, the program has found a severe problem which it cannot resolve any further. It does not know how to recover in a sane way.
Example: Negative timestep, Infinite end time and no override of the continuation function.
Default behaviour: log to std::cerr, followed by std::exit().
Definition at line 51 of file Logger.cc.
Referenced by BaseHandler< T >::getObjectById(), helpers::getSaveCountFromNumberOfSavesAndTimeMaxAndTimestep(), main(), Species< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >::mixAll(), and operator>>().
LL<Log::FATAL> FATAL |
Fatal log level.
These are the loglevels which should be used to control the logger. They are declared here but defined in Logger.cpp
Fatal, as in, the program has suffered from the worst possible failure and there is no way it can gracefully recover.
Example: No memory allocations possible
Default behaviour: log to std::cerr, followed by std::exit().
Definition at line 50 of file Logger.cc.
Referenced by main(), and transformMercuryToVTK().
LL<Log::INFO> INFO |
Info log level.
Useful information, small oddities found which should be of no real effect to the user. Also information about the current state and progress of the program.
Example: Finished inserting particles.
Default behaviour: log to std::cout, returns afterwards.
Definition at line 53 of file Logger.cc.
Referenced by helpers::compare(), helpers::loadingTest(), main(), helpers::normalAndTangentialLoadingTest(), helpers::objectivenessTest(), helpers::readFromFile(), SinterNormalSpecies::setParhamiMcKeeping(), and transformMercuryToVTK().
Logger<MERCURY_LOGLEVEL> logger |
Default logger. Use this for general logging.
For very specific modules, define your own logger. If you want to make extensive use of Debug messages, please use a custom logger as well, to prevent polluting the output.
Referenced by PossibleContactList::add_PossibleContact(), ParticleHandler::addObject(), WallHandler::addObject(), IntersectionOfWalls::addObject(), MaserBoundary::addParticleToMaser(), AxisymmetricIntersectionOfWalls::AxisymmetricIntersectionOfWalls(), BaseHandler< T >::BaseHandler(), BaseInteractable::BaseInteractable(), BaseObject::BaseObject(), BaseParticle::BaseParticle(), BaseWall::BaseWall(), BoundaryHandler::BoundaryHandler(), helpers::check(), MaserBoundary::checkBoundaryAfterParticleMoved(), MercuryBase::checkParticleForInteractionLocal(), Chute::Chute(), Chute::cleanChute(), BaseWall::clear(), Coil::Coil(), helpers::compare(), ParticleHandler::computeLargestParticle(), ParticleSpecies::computeMass(), SinterInteraction::computeNormalForce(), ParticleHandler::computeSmallestParticle(), Chute::createBottom(), DeletionBoundary::DeletionBoundary(), FileReader::FileReader(), FilesAndRunNumber::FilesAndRunNumber(), Vec3D::getComponent(), AxisymmetricIntersectionOfWalls::getDistanceAndNormal(), IntersectionOfWalls::getDistanceAndNormal(), BaseHandler< T >::getDPMBase(), ChargedBondedInteraction::getElasticEnergy(), ParticleHandler::getFastestParticle(), ParticleHandler::getHighestPositionComponentParticle(), ParticleHandler::getHighestVelocityComponentParticle(), ReversibleAdhesiveSpecies::getInteractionDistance(), ParticleHandler::getLargestParticle(), ParticleHandler::getLightestParticle(), ParticleHandler::getLowestPositionComponentParticle(), ParticleHandler::getLowestVelocityComponentParticle(), SpeciesHandler::getMixedObject(), ParticleHandler::getNewObject(), PossibleContact::getNext(), BaseHandler< T >::getObject(), BaseHandler< T >::getObjectById(), PossibleContact::getPrevious(), helpers::getSaveCountFromNumberOfSavesAndTimeMaxAndTimestep(), ParticleHandler::getSmallestParticle(), ChuteWithHopper::getTimeStepRatio(), BaseParticle::getVolume(), ParticleSpecies::getVolumeFromRadius(), HGrid::HGrid(), MercuryBase::hGridActionsBeforeTimeStep(), Mercury2D::hGridHasParticleContacts(), MercuryBase::hGridInfo(), MercuryBase::hGridNeedsRebuilding(), MercuryBase::hGridRebuild(), InfiniteWall::InfiniteWall(), HGrid::info(), HGrid::insertParticleToHgrid(), InteractionHandler::InteractionHandler(), IntersectionOfWalls::IntersectionOfWalls(), BaseWall::intersectVTK(), helpers::loadingTest(), main(), ChuteBottom::makeRoughBottom(), Mercury2D::Mercury2D(), Mercury3D::Mercury3D(), MercuryBase::MercuryBase(), MindlinInteraction::MindlinInteraction(), Species< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >::mixAll(), InfiniteWall::move(), helpers::normalAndTangentialLoadingTest(), Vec3D::normalize(), helpers::objectivenessTest(), SpeciesHandler::operator=(), InteractionHandler::operator=(), BoundaryHandler::operator=(), ParticleHandler::operator=(), WallHandler::operator=(), IntersectionOfWalls::operator=(), TriangulatedWall::operator=(), operator>>(), ParticleHandler::ParticleHandler(), PeriodicBoundary::PeriodicBoundary(), PossibleContactList::PossibleContactList(), HGridOptimiser::radius2Cell(), ChargedBondedSpecies::read(), FileReader::read(), BaseHandler< T >::read(), Chute::read(), DPMBase::read(), helpers::readFromFile(), DPMBase::readNextDataFile(), SpeciesHandler::readObject(), InteractionHandler::readObject(), BoundaryHandler::readObject(), WallHandler::readObject(), ParticleHandler::readObject(), SpeciesHandler::readOldObject(), WallHandler::readOldObject(), ParticleHandler::readOldObject(), TriangulatedWall::readVTK(), PossibleContactList::remove_ParticlePosibleContacts(), BaseInteractable::removeInteraction(), BaseHandler< T >::removeLastObject(), BaseHandler< T >::removeObject(), RestrictedWall::RestrictedWall(), Screw::Screw(), PeriodicBoundary::set(), InfiniteWall::set(), Chute::setChuteAngle(), Chute::setChuteAngleAndMagnitudeOfGravity(), ChuteWithHopper::setChuteLength(), LinearViscoelasticNormalSpecies::setCollisionTimeAndRestitutionCoefficient(), Vec3D::setComponent(), ParticleSpecies::setDensity(), SinterNormalSpecies::setDissipation(), HertzianViscoelasticNormalSpecies::setElasticModulusAndRestitutionCoefficient(), Chute::setFixedParticleRadius(), ThermalSpecies< NormalForceSpecies >::setHeatCapacity(), ChuteWithHopper::setHopper(), ChuteWithHopper::setHopperShift(), BaseWall::setIndSpecies(), BaseParticle::setIndSpecies(), BaseParticle::setInertia(), Chute::setInflowParticleRadius(), Chute::setInflowVelocity(), Chute::setInflowVelocityVariance(), SinterNormalSpecies::setInverseSinterViscosity(), BaseParticle::setMass(), BaseParticle::setMassForP3Statistics(), Chute::setMaxInflowParticleRadius(), Chute::setMinInflowParticleRadius(), PossibleContact::setNextPosition(), SinterNormalSpecies::setParhamiMcKeeping(), DPMBase::setParticleDimensions(), PossibleContact::setPreviousPosition(), SphericalWall::setRadius(), Chute::setRoughBottomType(), SinterNormalSpecies::setSinterAdhesion(), SinterNormalSpecies::setSinterForceAndTime(), SinterNormalSpecies::setSinterRate(), SinterNormalSpecies::setSinterType(), BaseInteractable::setSpecies(), DPMBase::setSystemDimensions(), ThermalSpecies< NormalForceSpecies >::setThermalConductivity(), ChuteBottom::setThickness(), DPMBase::setTimeMax(), DPMBase::setTimeStep(), ChuteBottom::setupInitialConditions(), Chute::setupInitialConditions(), DPMBase::setXMax(), DPMBase::setXMin(), DPMBase::setYMax(), DPMBase::setYMin(), DPMBase::setZMax(), DPMBase::setZMin(), DPMBase::solve(), SpeciesHandler::SpeciesHandler(), SphericalWall::SphericalWall(), transformMercuryToVTK(), TriangulatedWall::TriangulatedWall(), MercuryBase::userHGridCellSize(), WallHandler::WallHandler(), WallHandler::writeVTK(), InteractionHandler::writeVTK(), BaseWall::writeVTK(), ParticleHandler::writeVTK(), DPMBase::writeVTK(), WallHandler::writeVTKBoundingBox(), WallHandler::writeVTKFile(), AxisymmetricIntersectionOfWalls::~AxisymmetricIntersectionOfWalls(), BaseHandler< T >::~BaseHandler(), BaseInteractable::~BaseInteractable(), BaseObject::~BaseObject(), BaseParticle::~BaseParticle(), BaseWall::~BaseWall(), BoundaryHandler::~BoundaryHandler(), Coil::~Coil(), DeletionBoundary::~DeletionBoundary(), FileReader::~FileReader(), FilesAndRunNumber::~FilesAndRunNumber(), HGrid::~HGrid(), InfiniteWall::~InfiniteWall(), InteractionHandler::~InteractionHandler(), IntersectionOfWalls::~IntersectionOfWalls(), MercuryBase::~MercuryBase(), ParticleHandler::~ParticleHandler(), PeriodicBoundary::~PeriodicBoundary(), RestrictedWall::~RestrictedWall(), Screw::~Screw(), SpeciesHandler::~SpeciesHandler(), SphericalWall::~SphericalWall(), TriangulatedWall::~TriangulatedWall(), and WallHandler::~WallHandler().
LoggerOutput* loggerOutput |
Declaration of the output functions. If the output needs to be redirected, please swap the loggerOutput pointer to your preferred LoggerOutput instance, and make sure this exists until AFTER an std::exit() invocation. (e.g. clean up with std::atexit())
Definition at line 143 of file Logger.cc.
Referenced by DPMBase::constructor().
LL<Log::VERBOSE> VERBOSE |
Verbose information.
Information which is not useful to anybody except those looking for weird behaviour and statistics. These should however still be clear in meaning.
Example: Inserted 381 particles in Insertion Boundary #1.
Default behaviour: ignore.
Definition at line 55 of file Logger.cc.
Referenced by main(), and BaseHandler< T >::read().
LL<Log::WARN> WARN |
Warning log level.
Warning, as in, the program has detected a problem but does know a solution. The simulation can continue with this fix, but the user should look at fixing his / her simulation so this won't occur in the future.
Example: Setting a smaller Xmax than Xmin.
Default behaviour: log to std::cerr, returns afterwards.
Definition at line 52 of file Logger.cc.
Referenced by main(), helpers::readFromFile(), BaseHandler< T >::removeLastObject(), and transformMercuryToVTK().