PeriDEM 0.2.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... | |
Functions | |
std::string | getTabS (int nt) |
Returns tab spaces of 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<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. | |
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.
|
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 443 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 428 of file io.h.
Referenced by checkAndCreateNewFilename(), fe::Mesh::createData(), and fe::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 404 of file io.h.
Referenced by test::testGraphPartitioning(), and test::testMPI().
|
inline |
Returns tab spaces of given size.
nt | Number of tabs |
Definition at line 40 of file io.h.
Referenced by model::DEMModel::output(), printBoxStr(), printBoxStr(), printStr(), printStr(), printStr(), printStr(), material::BaseInfluenceFn::printStr(), material::Material::printStr(), util::geometry::GeomObject::printStr(), material::ConstInfluenceFn::printStr(), material::LinearInfluenceFn::printStr(), material::GaussianInfluenceFn::printStr(), material::RnpMaterial::printStr(), material::PmbMaterial::printStr(), material::PdElastic::printStr(), material::PdState::printStr(), util::geometry::NullGeomObject::printStr(), util::geometry::Line::printStr(), util::geometry::Triangle::printStr(), util::geometry::Square::printStr(), util::geometry::Rectangle::printStr(), util::geometry::Hexagon::printStr(), util::geometry::Drum2D::printStr(), util::geometry::Cube::printStr(), util::geometry::Cuboid::printStr(), util::geometry::Circle::printStr(), util::geometry::Sphere::printStr(), util::geometry::Cylinder::printStr(), util::geometry::AnnulusGeomObject::printStr(), util::geometry::ComplexGeomObject::printStr(), fe::Mesh::printStr(), fe::QuadData::printStr(), geometry::Fracture::printStr(), inp::MatData::printStr(), inp::MaterialDeck::printStr(), inp::MeshDeck::printStr(), inp::ModelDeck::printStr(), inp::OutputDeck::printStr(), inp::ContactPairDeck::printStr(), inp::ContactDeck::printStr(), inp::ParticleDeck::printStr(), inp::PBCData::printStr(), inp::PICDeck::printStr(), inp::PNeighborDeck::printStr(), inp::Zone::printStr(), inp::ParticleZone::printStr(), particle::BaseParticle::printStr(), particle::ParticleTransform::printStr(), particle::RefParticle::printStr(), and util::geometry::GeomData::printStr().
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 15 of file io.cpp.
References anonymous_namespace{io.cpp}::logger_p.
Referenced by model::DEMModel::DEMModel(), and main().
|
inline |
|
inline |
Check if file is empty or null.
filename | Filename with/without extension |
Definition at line 469 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 24 of file io.cpp.
References util::io::Logger::log(), and anonymous_namespace{io.cpp}::logger_p.
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 38 of file io.cpp.
References util::io::Logger::log(), and anonymous_namespace{io.cpp}::logger_p.
Referenced by fe::Mesh::createData(), model::DEMModel::log(), model::DEMModel::log(), and fe::Mesh::readElementData().
|
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 154 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 120 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 108 of file io.h.
References util::parallel::mpiRank(), and printStr().
Referenced by anonymous_namespace{testParallelCompLib.cpp}::exchangeDispData(), main(), main(), 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 208 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 184 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 193 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 168 of file io.h.
References getTabS().
Referenced by printBox(), printBox(), util::geometry::Line::printStr(), util::geometry::Square::printStr(), util::geometry::Rectangle::printStr(), util::geometry::Cube::printStr(), util::geometry::Cuboid::printStr(), util::geometry::Circle::printStr(), util::geometry::Sphere::printStr(), util::geometry::Cylinder::printStr(), util::geometry::AnnulusGeomObject::printStr(), util::geometry::ComplexGeomObject::printStr(), and fe::Mesh::printStr().
|
inline |
Returns formatted string for output.
list | List of objects |
nt | Number of tabs to prefix |
Definition at line 128 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 67 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 85 of file io.h.
References getTabS().
|
inline |
Returns formatted string for output.
msg | Message |
nt | Number of tabs to prefix |
Definition at line 54 of file io.h.
References getTabS().
Referenced by util::checkMatrix(), fe::Mesh::computeVol(), model::DEMModel::createGeometryAtSite(), util::geometry::createGeomObjectOld(), model::DEMModel::createParticlesFromFile(), model::DEMModel::output(), print(), print(), print(), anonymous_namespace{geomObjects.cpp}::printErrMsg(), anonymous_namespace{geomObjectsUitl.cpp}::printErrMsg(), util::geometry::Triangle::printStr(), util::geometry::Square::printStr(), util::geometry::Rectangle::printStr(), util::geometry::Hexagon::printStr(), util::geometry::Drum2D::printStr(), util::geometry::Cube::printStr(), util::geometry::Cuboid::printStr(), fe::QuadData::printStr(), util::geometry::GeomData::printStr(), and test::testTetElem().
|
inline |
Remove extension from the filename Source - https://stackoverflow.com/a/24386991.
filename | Filename with extension |
Definition at line 416 of file io.h.
Referenced by test::testGraphPartitioning(), and test::testMPI().
const int util::io::logger_default_debug_lvl = 5 |
const int util::io::print_default_mpi_rank = 0 |
const int util::io::print_default_tab = 0 |
Default value of tab used in outputting formatted information.
Definition at line 27 of file io.h.
Referenced by anonymous_namespace{testParallelCompLib.cpp}::exchangeDispData(), and test::testMPI().