IBAMR  IBAMR version 0.19.
Static Public Member Functions | List of all members
SAMRAI::tbox::Utilities Struct Reference

#include <tbox/Utilities.h>

Static Public Member Functions

static void recursiveMkdir (const std::string &path, mode_t mode=(S_IRUSR|S_IWUSR|S_IXUSR), bool only_node_zero_creates=true)
 
static void renameFile (const std::string &old_filename, const std::string &new_filename)
 
static std::string intToString (int num, int min_width=1)
 
static std::string nodeToString (int num)
 
static std::string processorToString (int num)
 
static std::string patchToString (int num)
 
static std::string levelToString (int num)
 
static std::string blockToString (int num)
 
static void abort (const std::string &message, const std::string &filename, const int line)
 

Detailed Description

Utilities is a Singleton class containing basic routines for error reporting, file manipulations, etc.

Member Function Documentation

◆ recursiveMkdir()

static void SAMRAI::tbox::Utilities::recursiveMkdir ( const std::string &  path,
mode_t  mode = (S_IRUSR|S_IWUSR|S_IXUSR),
bool  only_node_zero_creates = true 
)
static

Create the directory specified by the path string. Permissions are set by default to rwx by user. The intermediate directories in the path are created if they do not already exist. When only_node_zero_creates is true, only node zero creates the directories. Otherwise, all nodes create the directories.

◆ renameFile()

static void SAMRAI::tbox::Utilities::renameFile ( const std::string &  old_filename,
const std::string &  new_filename 
)
static

Rename a file from old file name to new file name.

◆ intToString()

static std::string SAMRAI::tbox::Utilities::intToString ( int  num,
int  min_width = 1 
)
static

Convert an integer to a string.

The returned string is padded with zeros as needed so that it contains at least the number of characters indicated by the minimum width argument. When the number is positive, the string is padded on the left. When the number is negative, the '-' sign appears first, followed by the integer value padded on the left with zeros. For example, the statement intToString(12, 5) returns "00012" and the statement intToString(-12, 5) returns "-0012".

◆ nodeToString()

static std::string SAMRAI::tbox::Utilities::nodeToString ( int  num)
static

Convert common integer values to strings.

These are simply wrappers around intToString that ensure the same width is uniformally used when converting to string representations.

◆ processorToString()

static std::string SAMRAI::tbox::Utilities::processorToString ( int  num)
static

◆ patchToString()

static std::string SAMRAI::tbox::Utilities::patchToString ( int  num)
static

◆ levelToString()

static std::string SAMRAI::tbox::Utilities::levelToString ( int  num)
static

◆ blockToString()

static std::string SAMRAI::tbox::Utilities::blockToString ( int  num)
static

◆ abort()

static void SAMRAI::tbox::Utilities::abort ( const std::string &  message,
const std::string &  filename,
const int  line 
)
static

Aborts the run after printing an error message with file and linenumber information.


The documentation for this struct was generated from the following file: