PeriDEM 0.2.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
Loading...
Searching...
No Matches
io.h File Reference
#include "point.h"
#include "parallelUtil.h"
#include <fstream>
#include <iostream>
#include <vector>
#include <algorithm>
Include dependency graph for io.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  util::io::LoggerDeck
 Deck to store log parameters. More...
 
class  util::io::Logger
 Prints log to std::cout and also write to the file. More...
 
class  util::io::InputParser
 Input command line argument parser. More...
 

Namespaces

namespace  util
 Collection of methods useful in simulation.
 
namespace  util::io
 Provides geometrical methods such as point inside rectangle.
 

Functions

std::string util::io::getTabS (int nt)
 Returns tab spaces of given size.
 
template<class T >
std::string util::io::printStr (const T &msg, int nt=print_default_tab)
 Returns formatted string for output.
 
template<class T >
std::string util::io::printStr (const std::vector< T > &list, int nt=print_default_tab)
 Returns formatted string for output.
 
template<>
std::string util::io::printStr (const std::vector< util::Point > &list, int nt)
 Returns formatted string for output.
 
template<class T >
void util::io::print (const T &msg, int nt=print_default_tab, int printMpiRank=print_default_mpi_rank)
 Prints formatted information.
 
template<class T >
void util::io::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 util::io::printStr (const std::vector< std::vector< T > > &list, int nt=print_default_tab)
 Returns formatted string for output.
 
template<class T >
void util::io::print (const std::vector< std::vector< T > > &list, int nt=print_default_tab, int printMpiRank=print_default_mpi_rank)
 Prints formatted information.
 
std::string util::io::printBoxStr (const std::pair< util::Point, util::Point > &box, int nt=print_default_tab)
 Returns formatted string for output.
 
void util::io::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 util::io::printBoxStr (const std::pair< std::vector< double >, std::vector< double > > &box, int nt=print_default_tab)
 Returns formatted string for output.
 
void util::io::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 util::io::initLogger (int debug_level=logger_default_debug_lvl, std::string filename="")
 Initializes the logger.
 
void util::io::log (std::ostringstream &oss, bool screen_out=false, int printMpiRank=print_default_mpi_rank)
 Global method to log the message.
 
void util::io::log (const std::string &str, bool screen_out=false, int printMpiRank=print_default_mpi_rank)
 Global method to log the message.
 
std::string util::io::getFilenameFromPath (std::string const &path, std::string const &delims="/\\")
 Get filename removing path from the string Source - https://stackoverflow.com/a/24386991.
 
std::string util::io::removeExtensionFromFile (std::string const &filename)
 Remove extension from the filename Source - https://stackoverflow.com/a/24386991.
 
std::string util::io::getExtensionFromFile (std::string const &filename)
 Get extension from the filename.
 
std::string util::io::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 util::io::isFileEmpty (std::string filename)
 Check if file is empty or null.
 
bool util::io::isFileEmpty (std::ifstream &pFile)
 Check if file is empty or null.
 

Variables

const int util::io::print_default_tab = 0
 Default value of tab used in outputting formatted information.
 
const int util::io::print_default_mpi_rank = 0
 Default mpi rank in printing information.
 
const int util::io::logger_default_debug_lvl = 5
 Default debug level for logger.