PanPhaseField SDK
vtk_stream_utility Namespace Reference

Utilities writting/loading VTK format files. More...

Classes

class  VTK_Stream
 A class writes/loads VTK files. More...
 
class  VtkArgs
 Argument class for VTK stream. More...
 

Functions

string convert_time (double time_second)
 
void SwapEnd (float &var)
 
string my_int_to_string (int val)
 
bool hasEnding (std::string const &fullString, std::string const &ending)
 
string get_string_in_scientific_notation (double val, int prec=3)
 

Detailed Description

Utilities writting/loading VTK format files.

Function Documentation

◆ convert_time()

string vtk_stream_utility::convert_time ( double  time_second)
inline

Convert time from seconds to user-friendly format

Parameters
time_secondthe time in seconds
Returns
a string in user-friendly format

◆ SwapEnd()

void vtk_stream_utility::SwapEnd ( float &  var)
inline

Serialize float number for binary writer

Parameters
varthe float number
Returns
void

◆ my_int_to_string()

string vtk_stream_utility::my_int_to_string ( int  val)
inline

Convert int to string. Compatible with Linux OS

Parameters
[in]valthe int number
Returns
string of var number

◆ hasEnding()

bool vtk_stream_utility::hasEnding ( std::string const &  fullString,
std::string const &  ending 
)
inline

Determine if a string end with a pattern

Parameters
[in]fullStringthe string to be checked
[in]endingthe pattern
Returns
true if fullString ends with given pattern

◆ get_string_in_scientific_notation()

string vtk_stream_utility::get_string_in_scientific_notation ( double  val,
int  prec = 3 
)
inline

Convert numeric value to a string in scientific notation

Parameters
[in]valthe numeric value
[in]precthe precision of scientific notation (default is 3)
Returns
a string in scientific notation