Blender V2.61 - r43446
Defines | Functions | Variables

utilities.cpp File Reference

#include <iostream>
#include <sstream>
#include <time.h>
#include <sys/time.h>
#include <sys/times.h>
#include "utilities.h"
#include <png.h>
#include <zlib.h>
#include "solver_interface.h"

Go to the source code of this file.

Defines

#define DEF_globalColorSetting   1
 color output setting for messages (0==off, else on)
#define DM_NONE   100

Functions

void setElbeemState (int set)
int getElbeemState (void)
int isSimworldOk (void)
void setElbeemErrorString (const char *set)
char * getElbeemErrorString (void)
void resetGlobalColorSetting ()
 reset color output for elbeem init
int convertString2Int (const char *str, int alt)
 helper function that converts a string to integer
string convertFlags2String (int flags)
 helper function that converts a flag field to a readable integer
int writePng (const char *fileName, unsigned char **rowsp, int w, int h)
 write png image
myTime_t getTime ()
 get the current system time
string getTimeString (myTime_t usecs)
 convert time to readable string
bool checkBoundingBox (ntlVec3Gfx s, ntlVec3Gfx e, string checker)
 helper to check if a bounding box was specified in the right way
static string col_black ("\033[0;30m")
static string col_dark_gray ("\033[1;30m")
static string col_bright_gray ("\033[0;37m")
static string col_red ("\033[0;31m")
static string col_bright_red ("\033[1;31m")
static string col_green ("\033[0;32m")
static string col_bright_green ("\033[1;32m")
static string col_bright_yellow ("\033[1;33m")
static string col_yellow ("\033[0;33m")
static string col_cyan ("\033[0;36m")
static string col_bright_cyan ("\033[1;36m")
static string col_purple ("\033[0;35m")
static string col_bright_purple ("\033[1;35m")
static string col_neutral ("\033[0m")
void messageOutputForce (string from)
void messageOutputFunc (string from, int id, string msg, myTime_t interval)
void elbeemCheckDebugEnv (void)
void elbeemDebugOut (char *msg)
void elbeemSetDebugLevel (int level)
double elbeemEstimateMemreq (int res, float sx, float sy, float sz, int refine, char *retstr)

Variables

int gDebugLevel = DEBUG
int gElbeemState = SIMWORLD_INVALID
char gElbeemErrorString [256] = {'-','\0' }
myTime_t globalIntervalTime = 0
 for interval debugging output
int globalColorSetting = DEF_globalColorSetting
int globalFirstEnvCheck = 0
const char * globVecFormatStr = "V[%f,%f,%f]"
 global string for formatting vector output in utilities.cpp
bool glob_mpactive = false
int glob_mpnum = -1
int glob_mpindex = -1
int glob_mppn = -1
static string col_std = col_bright_gray
std::ostringstream globOutstr
bool globOutstrForce = false

Detailed Description

Definition in file utilities.cpp.


Define Documentation

#define DEF_globalColorSetting   1

color output setting for messages (0==off, else on)

Definition at line 75 of file utilities.cpp.

Referenced by resetGlobalColorSetting().

#define DM_NONE   100

Definition at line 299 of file utilities.cpp.

Referenced by messageOutputForce(), and messageOutputFunc().


Function Documentation

bool checkBoundingBox ( ntlVec3Gfx  s,
ntlVec3Gfx  e,
string  checker 
)

helper to check if a bounding box was specified in the right way

Definition at line 266 of file utilities.cpp.

References errFatal, and SIMWORLD_INITERROR.

Referenced by SimulationObject::initializeLbmSimulation().

static string col_black ( "\033[0;30m"  ) [static]

Referenced by messageOutputFunc().

static string col_bright_cyan ( "\033[1;36m"  ) [static]

Referenced by messageOutputFunc().

static string col_bright_gray ( "\033[0;37m"  ) [static]

Referenced by messageOutputFunc().

static string col_bright_green ( "\033[1;32m"  ) [static]

Referenced by messageOutputFunc().

static string col_bright_purple ( "\033[1;35m"  ) [static]

Referenced by messageOutputFunc().

static string col_bright_red ( "\033[1;31m"  ) [static]

Referenced by messageOutputFunc().

static string col_bright_yellow ( "\033[1;33m"  ) [static]

Referenced by messageOutputFunc().

static string col_cyan ( "\033[0;36m"  ) [static]

Referenced by messageOutputFunc().

static string col_dark_gray ( "\033[1;30m"  ) [static]

Referenced by messageOutputFunc().

static string col_green ( "\033[0;32m"  ) [static]

Referenced by messageOutputFunc().

static string col_neutral ( "\033[0m"  ) [static]

Referenced by messageOutputFunc().

static string col_purple ( "\033[0;35m"  ) [static]

Referenced by messageOutputFunc().

static string col_red ( "\033[0;31m"  ) [static]

Referenced by messageOutputFunc().

static string col_yellow ( "\033[0;33m"  ) [static]

Referenced by messageOutputFunc().

string convertFlags2String ( int  flags)

helper function that converts a flag field to a readable integer

Definition at line 114 of file utilities.cpp.

References i, and max.

Referenced by LbmFsgrSolver::debugPrintNodeInfo(), and initGridSizes().

int convertString2Int ( const char *  str,
int  alt 
)

helper function that converts a string to integer

Definition at line 96 of file utilities.cpp.

References simple_enum_gen::val.

void elbeemCheckDebugEnv ( void  )

Definition at line 435 of file utilities.cpp.

References debMsgStd, DM_NOTIFY, gDebugLevel, and globalFirstEnvCheck.

Referenced by elbeemDebugOut(), and elbeemInit().

void elbeemDebugOut ( char *  msg)

Definition at line 455 of file utilities.cpp.

References DM_MSG, elbeemCheckDebugEnv(), gDebugLevel, and messageOutputFunc().

double elbeemEstimateMemreq ( int  res,
float  sx,
float  sy,
float  sz,
int  refine,
char *  retstr 
)

Definition at line 476 of file utilities.cpp.

References calculateMemreqEstimate(), initGridSizes(), and NULL.

void elbeemSetDebugLevel ( int  level)

Definition at line 465 of file utilities.cpp.

References gDebugLevel.

char* getElbeemErrorString ( void  )

Definition at line 64 of file utilities.cpp.

References gElbeemErrorString.

Referenced by elbeemGetErrorString().

int getElbeemState ( void  )
myTime_t getTime ( )
string getTimeString ( myTime_t  usecs)
int isSimworldOk ( void  )
void messageOutputForce ( string  from)

Definition at line 300 of file utilities.cpp.

References DM_NONE, globOutstrForce, and messageOutputFunc().

Referenced by LbmFsgrSolver::stepMain().

void messageOutputFunc ( string  from,
int  id,
string  msg,
myTime_t  interval 
)
void resetGlobalColorSetting ( )

reset color output for elbeem init

Definition at line 79 of file utilities.cpp.

References DEF_globalColorSetting, and globalColorSetting.

Referenced by elbeemInit().

void setElbeemErrorString ( const char *  set)

Definition at line 61 of file utilities.cpp.

References gElbeemErrorString.

Referenced by elbeemInit().

void setElbeemState ( int  set)
int writePng ( const char *  fileName,
unsigned char **  rowsp,
int  w,
int  h 
)

write png image

Definition at line 134 of file utilities.cpp.

References errMsg, and NULL.

Referenced by ntlWorld::renderScene().


Variable Documentation

string col_std = col_bright_gray [static]

Definition at line 295 of file utilities.cpp.

Referenced by messageOutputFunc().

int gDebugLevel = DEBUG
char gElbeemErrorString[256] = {'-','\0' }

Definition at line 58 of file utilities.cpp.

Referenced by getElbeemErrorString(), messageOutputFunc(), and setElbeemErrorString().

int gElbeemState = SIMWORLD_INVALID

Definition at line 44 of file utilities.cpp.

Referenced by getElbeemState(), messageOutputFunc(), and setElbeemState().

bool glob_mpactive = false
int glob_mpindex = -1
int glob_mpnum = -1
int glob_mppn = -1

Definition at line 90 of file utilities.cpp.

int globalColorSetting = DEF_globalColorSetting

Definition at line 77 of file utilities.cpp.

Referenced by messageOutputFunc(), and resetGlobalColorSetting().

Definition at line 78 of file utilities.cpp.

Referenced by elbeemCheckDebugEnv().

for interval debugging output

Definition at line 68 of file utilities.cpp.

Referenced by messageOutputFunc().

std::ostringstream globOutstr

Definition at line 297 of file utilities.cpp.

bool globOutstrForce = false

Definition at line 298 of file utilities.cpp.

Referenced by messageOutputForce().

const char* globVecFormatStr = "V[%f,%f,%f]"

global string for formatting vector output in utilities.cpp

Definition at line 82 of file utilities.cpp.

Referenced by BasicVector::operator<<(), and operator<<().