Blender V2.61 - r43446
|
#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 |
Definition in file utilities.cpp.
#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().
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.
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 | ) |
Definition at line 50 of file utilities.cpp.
References gElbeemState.
Referenced by ntlWorld::advanceSims(), elbeemAddDomain(), elbeemAddMesh(), elbeemContinueSimulation(), elbeemSimulate(), isSimworldOk(), ntlWorld::renderAnimation(), and ntlWorld::renderVisualization().
myTime_t getTime | ( | ) |
get the current system time
Definition at line 220 of file utilities.cpp.
References INT.
Referenced by LbmFsgrSolver::advanceParticles(), ntlWorld::advanceSims(), elbeemContinueSimulation(), elbeemSimulate(), ntlWorld::finishWorldInit(), LbmFsgrSolver::handleCpdata(), ControlParticles::initFromMVCMesh(), LbmFsgrSolver::initGeometryFlags(), LbmFsgrSolver::initializeSolverPostinit(), LbmFsgrSolver::initMovingObstacles(), LbmFsgrSolver::initStandingFluidGradient(), messageOutputFunc(), ntlWorld::renderScene(), ntlBlenderDumper::renderScene(), ntlWorld::renderVisualization(), LbmFsgrSolver::stepMain(), and IsoSurface::triangulate().
string getTimeString | ( | myTime_t | usecs | ) |
convert time to readable string
Definition at line 241 of file utilities.cpp.
Referenced by LbmFsgrSolver::advanceParticles(), ntlWorld::advanceSims(), elbeemContinueSimulation(), elbeemSimulate(), ntlWorld::finishWorldInit(), LbmFsgrSolver::handleCpdata(), ControlParticles::initFromMVCMesh(), LbmFsgrSolver::initGeometryFlags(), LbmFsgrSolver::initializeSolverPostinit(), LbmFsgrSolver::initMovingObstacles(), LbmFsgrSolver::initStandingFluidGradient(), ntlWorld::renderScene(), ntlBlenderDumper::renderScene(), ntlWorld::renderVisualization(), LbmFsgrSolver::stepMain(), and IsoSurface::triangulate().
int isSimworldOk | ( | void | ) |
Definition at line 53 of file utilities.cpp.
References getElbeemState().
Referenced by Parametrizer::calculateAllMissingValues(), SimulationObject::checkCallerStatus(), elbeemSimulate(), ntlWorld::finishWorldInit(), SimulationObject::initializeLbmSimulation(), and ntlWorld::renderVisualization().
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 | ||
) |
Definition at line 307 of file utilities.cpp.
References col_black(), col_bright_cyan(), col_bright_gray(), col_bright_green(), col_bright_purple(), col_bright_red(), col_bright_yellow(), col_cyan(), col_dark_gray(), col_green(), col_neutral(), col_purple(), col_red(), col_std, col_yellow(), DM_DIRECT, DM_ERROR, DM_FATAL, DM_IMPORTANT, DM_MSG, DM_NONE, DM_NOTIFY, DM_WARNING, gDebugLevel, gElbeemErrorString, gElbeemState, getTime(), glob_mpindex, globalColorSetting, globalIntervalTime, and logf.
Referenced by elbeemDebugOut(), and messageOutputForce().
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 | ) |
Definition at line 47 of file utilities.cpp.
References gElbeemState.
Referenced by SimulationObject::checkCallerStatus(), elbeemInit(), ntlWorld::finishWorldInit(), and ntlWorld::renderAnimation().
int writePng | ( | const char * | fileName, |
unsigned char ** | rowsp, | ||
int | w, | ||
int | h | ||
) |
write png image
Definition at line 134 of file utilities.cpp.
Referenced by ntlWorld::renderScene().
string col_std = col_bright_gray [static] |
Definition at line 295 of file utilities.cpp.
Referenced by messageOutputFunc().
int gDebugLevel = DEBUG |
Definition at line 38 of file utilities.cpp.
Referenced by elbeemCheckDebugEnv(), elbeemDebugOut(), elbeemInit(), elbeemSetDebugLevel(), LbmSolverInterface::LbmSolverInterface(), and messageOutputFunc().
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 |
Definition at line 86 of file utilities.cpp.
Referenced by LbmFsgrSolver::adaptTimestep(), LbmFsgrSolver::initializeSolverMemory(), ParticleTracer::notifyOfDump(), LbmFsgrSolver::parseAttrList(), LbmFsgrSolver::prepareVisualization(), ntlBlenderDumper::renderScene(), and ntlWorld::renderScene().
int glob_mpindex = -1 |
Definition at line 89 of file utilities.cpp.
Referenced by LbmFsgrSolver::adaptTimestep(), LbmFsgrSolver::initializeSolverMemory(), messageOutputFunc(), ParticleTracer::notifyOfDump(), LbmFsgrSolver::parseAttrList(), LbmFsgrSolver::prepareVisualization(), ntlBlenderDumper::renderScene(), ntlWorld::renderScene(), and LbmFsgrSolver::stepMain().
int glob_mpnum = -1 |
Definition at line 88 of file utilities.cpp.
Referenced by LbmFsgrSolver::adaptTimestep(), SimulationObject::initializeLbmSimulation(), LbmFsgrSolver::initializeSolverMemory(), LbmFsgrSolver::parseAttrList(), and LbmFsgrSolver::prepareVisualization().
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().
int globalFirstEnvCheck = 0 |
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<<().