![]() |
PeriDEM 0.3.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
|
Provides geometrical methods such as point inside rectangle. More...
Data Structures | |
| class | InputParser |
| Input command line argument parser. More... | |
| class | Logger |
| Prints log to std::cout and also write to the file. More... | |
| struct | LoggerDeck |
| Deck to store log parameters. More... | |
| class | Msg |
| Collects a message with stream syntax for use in an exception. More... | |
Functions | |
| std::string | getTabS (int nt) |
| Returns tab spaces of a given size. | |
| template<class T > | |
| std::string | printStr (const T &msg, int nt=print_default_tab) |
| Returns formatted string for output. | |
| template<class T > | |
| std::string | printStr (const std::vector< T > &list, int nt=print_default_tab) |
| Returns formatted string for output. | |
| template<> | |
| std::string | printStr (const std::vector< util::Point > &list, int nt) |
| Returns formatted string for output. | |
| template<typename T , typename U > | |
| std::string | printStr (const std::map< T, U > &map, int nt=print_default_tab) |
| Returns formatted string for output. | |
| template<class T > | |
| void | print (const T &msg, int nt=print_default_tab, int printMpiRank=print_default_mpi_rank) |
| Prints formatted information. | |
| template<class T > | |
| void | print (const std::vector< T > &list, int nt=print_default_tab, int printMpiRank=print_default_mpi_rank) |
| Prints formatted information. | |
| template<class T > | |
| std::string | printStr (const std::vector< std::vector< T > > &list, int nt=print_default_tab) |
| Returns formatted string for output. | |
| template<class T > | |
| void | print (const std::vector< std::vector< T > > &list, int nt=print_default_tab, int printMpiRank=print_default_mpi_rank) |
| Prints formatted information. | |
| std::string | printBoxStr (const std::pair< util::Point, util::Point > &box, int nt=print_default_tab) |
| Returns formatted string for output. | |
| void | printBox (const std::pair< util::Point, util::Point > &box, int nt=print_default_tab, int printMpiRank=print_default_mpi_rank) |
| Prints formatted string for output. | |
| std::string | printBoxStr (const std::pair< std::vector< double >, std::vector< double > > &box, int nt=print_default_tab) |
| Returns formatted string for output. | |
| void | printBox (const std::pair< std::vector< double >, std::vector< double > > &box, int nt=print_default_tab, int printMpiRank=print_default_mpi_rank) |
| Prints formatted string for output. | |
| void | initLogger (int debug_level=logger_default_debug_lvl, std::string filename="") |
| Initializes the logger. | |
| void | log (std::ostringstream &oss, bool screen_out=false, int printMpiRank=print_default_mpi_rank) |
| Global method to log the message. | |
| void | log (const std::string &str, bool screen_out=false, int printMpiRank=print_default_mpi_rank) |
| Global method to log the message. | |
| bool | logEnabled (int priority, bool check_condition=true, int override_priority=-1) |
| True if a message at this priority would be logged (uses LoggerDeck::d_debugLevel) | |
| void | log (int priority, const std::string &str, bool check_condition=true, int override_priority=-1, bool screen_out=false) |
| Log if LoggerDeck debug level passes the priority gate. | |
| void | log (int priority, std::ostringstream &oss, bool check_condition=true, int override_priority=-1, bool screen_out=false) |
| std::string | getFilenameFromPath (std::string const &path, std::string const &delims="/\\") |
| Get filename removing path from the string Source - https://stackoverflow.com/a/24386991. | |
| std::string | removeExtensionFromFile (std::string const &filename) |
| Remove extension from the filename Source - https://stackoverflow.com/a/24386991. | |
| std::string | getExtensionFromFile (std::string const &filename) |
| Get extension from the filename. | |
| std::string | checkAndCreateNewFilename (std::string const &filename, std::string filename_ext) |
| Check for extension and if possible create new filename from a given filename and a given extension. | |
| bool | isFileEmpty (std::string filename) |
| Check if file is empty or null. | |
| bool | isFileEmpty (std::ifstream &pFile) |
| Check if file is empty or null. | |
Variables | |
| const int | print_default_tab = 0 |
| Default value of tab used in outputting formatted information. | |
| const int | print_default_mpi_rank = 0 |
| Default mpi rank in printing information. | |
| const int | logger_default_debug_lvl = 5 |
| Default debug level for logger. | |
Provides geometrical methods such as point inside rectangle.
Provides utility function for input and output.
|
inline |
Check for extension and if possible create new filename from a given filename and a given extension.
| filename | Filename with/without extension |
| filename_ext | Extension to check for and append if needed |
Definition at line 366 of file io.h.
References getExtensionFromFile().
Referenced by rw::writer::MshWriter::MshWriter(), rw::reader::VtkParticleReader::VtkParticleReader(), and rw::reader::VtkReader::VtkReader().
|
inline |
Get extension from the filename.
| filename | Filename with extension |
Definition at line 351 of file io.h.
Referenced by checkAndCreateNewFilename(), mesh::Mesh::createData(), and mesh::Mesh::readElementData().
|
inline |
Get filename removing path from the string Source - https://stackoverflow.com/a/24386991.
| path | Filename with path |
| delims | Delimiter to separate the filename from the path |
Definition at line 327 of file io.h.
Referenced by test::testGraphPartitioning(), and test::testMPI().
|
inline |
Returns tab spaces of a given size.
| nt | Number of tabs |
Definition at line 82 of file io.h.
Referenced by printBoxStr(), printBoxStr(), printStr(), printStr(), printStr(), printStr(), printStr(), geom::GeomObject::printStr(), material::BaseInfluenceFn::printStr(), material::Material::printStr(), geom::AnnulusGeomObject::printStr(), geom::ComplexGeomObject::printStr(), geom::NullGeomObject::printStr(), geom::Plane::printStr(), geom::Line::printStr(), geom::Triangle::printStr(), geom::Square::printStr(), geom::Rectangle::printStr(), geom::Hexagon::printStr(), geom::Drum2D::printStr(), geom::Cube::printStr(), geom::Cuboid::printStr(), geom::Circle::printStr(), geom::Ellipse::printStr(), geom::Sphere::printStr(), geom::Ellipsoid::printStr(), geom::Cylinder::printStr(), material::ConstInfluenceFn::printStr(), material::LinearInfluenceFn::printStr(), material::GaussianInfluenceFn::printStr(), material::RnpMaterial::printStr(), material::PmbMaterial::printStr(), material::PdElastic::printStr(), material::PdState::printStr(), fe::QuadData::printStr(), geometry::Fracture::printStr(), geom::GeomData::printStr(), geom::ParticleTransform::printStr(), inp::BCBaseDeck::printStr(), inp::BCDeck::printStr(), inp::ContactDeck::printStr(), inp::ContactPairDeck::printStr(), inp::Input::printStr(), inp::MatData::printStr(), inp::MaterialDeck::printStr(), inp::MeshDeck::printStr(), inp::ModelDeck::printStr(), inp::OutputDeck::printStr(), inp::ParticleDeck::printStr(), inp::PGenDeck::printStr(), inp::PNeighborDeck::printStr(), inp::RestartDeck::printStr(), inp::TestDeck::printStr(), mesh::Mesh::printStr(), particle::BaseParticle::printStr(), particle::RefParticle::printStr(), geom::OpenCuboidChannel3D::printStr(), geom::OpenRectChannel2D::printStr(), and rw::writeOutput().
| void util::io::initLogger | ( | int | debug_level = logger_default_debug_lvl, |
| std::string | filename = "" |
||
| ) |
Initializes the logger.
| debug_level | Specify debug level/verbosity |
| filename | Specify filename for logs |
Definition at line 18 of file io.cpp.
References anonymous_namespace{io.cpp}::logger_p.
Referenced by main(), and PeriDEMModel::PeriDEMModel().
|
inline |
|
inline |
Check if file is empty or null.
| filename | Filename with/without extension |
Definition at line 393 of file io.h.
Referenced by rw::reader::MshReader::readCells(), rw::reader::MshReader::readMesh(), and rw::reader::MshReader::readNodes().
| void util::io::log | ( | const std::string & | str, |
| bool | screen_out = false, |
||
| int | printMpiRank = print_default_mpi_rank |
||
| ) |
Global method to log the message.
| str | Message |
| screen_out | Specify if it goes to std::cout as well |
| printMpiRank | MPI rank to do log/print. Negative value means all ranks log. |
Definition at line 27 of file io.cpp.
References util::io::Logger::log(), and anonymous_namespace{io.cpp}::logger_p.
| void util::io::log | ( | int | priority, |
| const std::string & | str, | ||
| bool | check_condition = true, |
||
| int | override_priority = -1, |
||
| bool | screen_out = false |
||
| ) |
Log if LoggerDeck debug level passes the priority gate.
Definition at line 64 of file io.cpp.
References log(), and logEnabled().
| void util::io::log | ( | int | priority, |
| std::ostringstream & | oss, | ||
| bool | check_condition = true, |
||
| int | override_priority = -1, |
||
| bool | screen_out = false |
||
| ) |
Definition at line 70 of file io.cpp.
References log(), and logEnabled().
| void util::io::log | ( | std::ostringstream & | oss, |
| bool | screen_out = false, |
||
| int | printMpiRank = print_default_mpi_rank |
||
| ) |
Global method to log the message.
| oss | Message |
| screen_out | Specify if it goes to std::cout as well |
| printMpiRank | MPI rank to do log/print. Negative value means all ranks log. |
Definition at line 41 of file io.cpp.
References util::io::Logger::log(), and anonymous_namespace{io.cpp}::logger_p.
Referenced by contact::Damping::apply(), anonymous_namespace{testMeshGen.cpp}::builtinMeshCheckForGeometry(), postprocess::Postprocess::checkStop(), contact::Contact::computeForces(), pd::computeForces(), mesh::Mesh::createData(), particle::createParticlesFromFile(), particle::createParticleUsingParticleZoneGeomObject(), particle::createReferenceParticles(), mesh::Mesh::finalizeMeshDerivedFieldsFromCurrentNodes(), PeriDEMModel::log(), log(), log(), PeriDEMModel::log(), main(), mesh::Mesh::readElementData(), contact::Contact::setup(), anonymous_namespace{testMeshGen.cpp}::testCircleMeshWritesFiles(), contact::Contact::updateSearchParameters(), and rw::writeOutput().
| bool util::io::logEnabled | ( | int | priority, |
| bool | check_condition = true, |
||
| int | override_priority = -1 |
||
| ) |
True if a message at this priority would be logged (uses LoggerDeck::d_debugLevel)
Definition at line 55 of file io.cpp.
References util::io::LoggerDeck::d_debugLevel, util::io::Logger::d_deck_p, and anonymous_namespace{io.cpp}::logger_p.
Referenced by log(), and log().
|
inline |
Prints formatted information.
| list | List of objects |
| nt | Number of tabs |
| printMpiRank | MPI rank to do log/print. Negative value means all ranks log. |
Definition at line 217 of file io.h.
References util::parallel::mpiRank(), and printStr().
|
inline |
Prints formatted information.
| list | List of objects |
| nt | Number of tabs |
| printMpiRank | MPI rank to do log/print. Negative value means all ranks log. |
Definition at line 183 of file io.h.
References util::parallel::mpiRank(), and printStr().
|
inline |
Prints formatted information.
| msg | Message |
| nt | Number of tabs |
| printMpiRank | MPI rank to do log/print. Negative value means all ranks log. |
Definition at line 171 of file io.h.
References util::parallel::mpiRank(), and printStr().
Referenced by anonymous_namespace{main.cpp}::ContactWitness::assertOk(), particle::assignMpiOwners(), anonymous_namespace{main.cpp}::buildInputJson(), anonymous_namespace{main.cpp}::buildInputJson(), anonymous_namespace{main.cpp}::buildInputJson(), anonymous_namespace{main.cpp}::GrainContactProbe::checkStop(), anonymous_namespace{testParallelCompLib.cpp}::exchangeDispData(), main(), anonymous_namespace{main.cpp}::runLaw(), pd::setupDofPartition(), test::testMPI(), and test::testTaskflow().
|
inline |
Prints formatted string for output.
| box | Pair of corner points of box |
| nt | Number of tabs to prefix |
| printMpiRank | MPI rank to do log/print. Negative value means all ranks log. |
Definition at line 271 of file io.h.
References util::parallel::mpiRank(), and printBoxStr().
|
inline |
Prints formatted string for output.
| box | Pair of corner points of box |
| nt | Number of tabs to prefix |
| printMpiRank | MPI rank to do log/print. Negative value means all ranks log. |
Definition at line 247 of file io.h.
References util::parallel::mpiRank(), and printBoxStr().
|
inline |
Returns formatted string for output.
| box | Pair of corner points of box |
| nt | Number of tabs to prefix |
Definition at line 256 of file io.h.
References getTabS().
|
inline |
Returns formatted string for output.
| box | Pair of corner points of box |
| nt | Number of tabs to prefix |
Definition at line 231 of file io.h.
References getTabS().
Referenced by printBox(), printBox(), geom::AnnulusGeomObject::printStr(), geom::ComplexGeomObject::printStr(), geom::Line::printStr(), geom::Square::printStr(), geom::Rectangle::printStr(), geom::Cube::printStr(), geom::Cuboid::printStr(), geom::Circle::printStr(), geom::Ellipse::printStr(), geom::Sphere::printStr(), geom::Ellipsoid::printStr(), geom::Cylinder::printStr(), and mesh::Mesh::printStr().
|
inline |
Returns formatted string for output.
| map | List of objects |
| nt | Number of tabs to prefix |
Definition at line 150 of file io.h.
References getTabS().
|
inline |
Returns formatted string for output.
| list | List of objects |
| nt | Number of tabs to prefix |
Definition at line 191 of file io.h.
References getTabS().
|
inline |
Returns formatted string for output.
| list | List of objects |
| nt | Number of tabs to prefix |
Definition at line 109 of file io.h.
References getTabS().
|
inline |
Returns formatted string for output.
| list | List of objects |
| nt | Number of tabs to prefix |
Definition at line 127 of file io.h.
References getTabS().
|
inline |
Returns formatted string for output.
| msg | Message |
| nt | Number of tabs to prefix |
Definition at line 96 of file io.h.
References getTabS().
Referenced by util::checkMatrix(), mesh::Mesh::computeVol(), geom::createGeomObjectOld(), print(), print(), print(), anonymous_namespace{complexGeomObjects.cpp}::printErrMsg(), anonymous_namespace{geomObjects.cpp}::printErrMsg(), anonymous_namespace{geomObjectsUtil.cpp}::printErrMsg(), geom::Triangle::printStr(), geom::Square::printStr(), geom::Rectangle::printStr(), geom::Hexagon::printStr(), geom::Drum2D::printStr(), geom::Cube::printStr(), geom::Cuboid::printStr(), fe::QuadData::printStr(), geom::GeomData::printStr(), geom::OpenRectChannel2D::printStr(), test::testTetElem(), and rw::writeOutput().
|
inline |
Remove extension from the filename Source - https://stackoverflow.com/a/24386991.
| filename | Filename with extension |
Definition at line 339 of file io.h.
Referenced by mesh_gen::createParticleMesh(), anonymous_namespace{particleMesh.cpp}::maybeWriteMeshFile(), test::testGraphPartitioning(), and test::testMPI().
| const int util::io::logger_default_debug_lvl = 5 |
Default debug level for logger.
Definition at line 24 of file constants.h.
| const int util::io::print_default_mpi_rank = 0 |
Default mpi rank in printing information.
Definition at line 21 of file constants.h.
| const int util::io::print_default_tab = 0 |
Default value of tab used in outputting formatted information.
Definition at line 18 of file constants.h.
Referenced by anonymous_namespace{testParallelCompLib.cpp}::exchangeDispData(), and test::testMPI().