SIMLIB/C++ 3.09
Loading...
Searching...
No Matches
Classes | Namespaces | Macros | Typedefs | Enumerations | Functions | Variables
internal.h File Reference

Internal header file for SIMLIB/C++. More...

#include "errors.h"
Include dependency graph for internal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  simlib3::SIMLIB_module
 Class for internal registration of modules. More...
 
class  simlib3::AlgLoopDetector
 class for algebraic loop detection AlgLoopDetector object should be used in Value() method only it checks for recursion in continuous block expression evaluation
User should remove algebraic loop manualy using special block (see AlgLoop solvers) More...
 

Namespaces

namespace  simlib3
 Implementation of class CalendarList
interface is static - using global functions in SQS namespace.
 
namespace  simlib3::SQS
 Special namespace for calendar implementation.
 

Macros

#define DEBUG_INFO   "/debug"
 
#define Dprintf(f)
 
#define DEBUG(c, f)
 
#define DBG_ALL   ~0UL
 
#define DBG_NEW   (1UL)
 
#define DBG_CTR   (1UL<<1)
 
#define DBG_INIT   (1UL<<2)
 
#define DBG_CHG   (1UL<<3)
 
#define DBG_STEP   (1UL<<4)
 
#define DBG_CONTI   (1UL<<5)
 
#define DBG_FACSTO   (1UL<<6)
 
#define DBG_PROC   (1UL<<7)
 
#define DBG_QUEUE   (1UL<<8)
 
#define DBG_CALENDAR   (1UL<<9)
 
#define DBG_SIMULATOR   (1UL<<10)
 
#define DBG_BEXPR   (1UL<<11)
 
#define DBG_WU   (1UL<<12)
 
#define DBG_NUMINT   (1UL<<13)
 
#define DBG_PROCESS   (1UL<<14)
 
#define DBG_MODULE   (1UL<<15)
 
#define DBG_ATEXIT   (1UL<<16)
 
#define SIMLIB_IMPLEMENTATION
 internal module identification
 
#define SIMLIB_internal_error()   SIMLIB_error(__FILE__, __LINE__)
 
#define _SetTime(t, x)   (SIMLIB_##t = x)
 macro for simple assignement to internal time variables
 
#define HOOK_PTR_NAME(id)   SIMLIB_Hook_Ptr_##id
 
#define HOOK_INST_NAME(id)   SIMLIB_Install_hook_##id
 
#define INSTALL_HOOK(name, function)
 
#define DEFINE_HOOK(name)
 
#define CALL_HOOK(name)    if( HOOK_PTR_NAME(name) ) HOOK_PTR_NAME(name) ()
 

Typedefs

typedef void(* simlib3::SIMLIB_atexit_function_t) ()
 
typedef void(* simlib3::VoidFunctionPtr) ()
 

Enumerations

enum  simlib3::SIMLIB_Phase_t {
  simlib3::START , simlib3::INITIALIZATION , simlib3::SIMULATION , simlib3::TERMINATION ,
  simlib3::ERROREXIT
}
 values indicate current phase of experiment More...
 

Functions

void simlib3::SIMLIB_atexit (SIMLIB_atexit_function_t p)
 
void simlib3::SIMLIB_error (const enum _ErrEnum N)
 print error message and abort program
 
void simlib3::SIMLIB_error (const char *fmt,...)
 print error message and abort program
 
void simlib3::SIMLIB_error (const char *filename, const int linenum)
 print error message and abort program
 
void simlib3::SIMLIB_warning (const enum _ErrEnum N)
 print warning message and continue
 
void simlib3::SIMLIB_warning (const char *fmt,...)
 print warning message and continue
 
void simlib3::SQS::ScheduleAt (Entity *e, double t)
 schedule entity e at given time t using scheduling priority from e
 
Entitysimlib3::SQS::GetFirst ()
 remove entity with minimum activation time
 
void simlib3::SQS::Get (Entity *e)
 remove selected entity activation record from calendar
 
bool simlib3::SQS::Empty ()
 empty calendar predicate
 
void simlib3::SQS::Clear ()
 remove all scheduled entities
 
int simlib3::SQS::debug_print ()
 
void simlib3::SIMLIB_Dynamic ()
 performs evaluation of integrators and status blocks
 
void simlib3::SIMLIB_DoActions ()
 
void simlib3::SIMLIB_ContinueInit ()
 
void simlib3::SIMLIB_DoConditions ()
 
void simlib3::SIMLIB_WUClear ()
 
double simlib3::min (double a, double b)
 
double simlib3::max (double a, double b)
 
std::string simlib3::SIMLIB_create_tmp_name (const char *fmt,...)
 printf-like function to create temporary name (the length of temporary names is limited)
used only for printing
 

Variables

static SIMLIB_module simlib3::SIMLIB_module_id
 Create single global registration object in each SIMLIB module.
 
const SIMLIB_Phase_tsimlib3::Phase = SIMLIB_Phase
 This variable contains the current phase of experiment (used for internal checking)
 
double simlib3::SIMLIB_Time
 
bool simlib3::SIMLIB_DynamicFlag = false
 in dynamic section
 
bool simlib3::SIMLIB_ResetStatus = false
 flag set if there is a need for integration method restart
 
SIMLIB_Phase_t simlib3::SIMLIB_Phase = START
 
Entitysimlib3::SIMLIB_Current = NULL
 
int simlib3::SIMLIB_ERRNO =0
 
bool simlib3::SIMLIB_ContractStepFlag = false
 requests shorter step
 
double simlib3::SIMLIB_ContractStep = SIMLIB_MAXTIME
 requested step size
 
double simlib3::SIMLIB_StepStartTime
 last step time
 
double simlib3::SIMLIB_DeltaTime
 Time-SIMLIB_StepStartTime.
 
double simlib3::SIMLIB_OptStep
 optimal step
 
double simlib3::SIMLIB_MinStep =1e-10
 minimal step
 
double simlib3::SIMLIB_MaxStep =1
 max. step
 
double simlib3::SIMLIB_StepSize
 actual step
 
double simlib3::SIMLIB_AbsoluteError =0
 absolute error
 
double simlib3::SIMLIB_RelativeError =0.001
 relative error
 
double simlib3::SIMLIB_StartTime
 
double simlib3::SIMLIB_NextTime
 
double simlib3::SIMLIB_EndTime
 

Detailed Description

Internal header file for SIMLIB/C++.

Definition in file internal.h.

Macro Definition Documentation

◆ _SetTime

#define _SetTime (   t,
 
)    (SIMLIB_##t = x)

macro for simple assignement to internal time variables

Definition at line 228 of file internal.h.

◆ CALL_HOOK

#define CALL_HOOK (   name)     if( HOOK_PTR_NAME(name) ) HOOK_PTR_NAME(name) ()

Definition at line 278 of file internal.h.

◆ DBG_ALL

#define DBG_ALL   ~0UL

Definition at line 111 of file internal.h.

◆ DBG_ATEXIT

#define DBG_ATEXIT   (1UL<<16)

Definition at line 128 of file internal.h.

◆ DBG_BEXPR

#define DBG_BEXPR   (1UL<<11)

Definition at line 123 of file internal.h.

◆ DBG_CALENDAR

#define DBG_CALENDAR   (1UL<<9)

Definition at line 121 of file internal.h.

◆ DBG_CHG

#define DBG_CHG   (1UL<<3)

Definition at line 115 of file internal.h.

◆ DBG_CONTI

#define DBG_CONTI   (1UL<<5)

Definition at line 117 of file internal.h.

◆ DBG_CTR

#define DBG_CTR   (1UL<<1)

Definition at line 113 of file internal.h.

◆ DBG_FACSTO

#define DBG_FACSTO   (1UL<<6)

Definition at line 118 of file internal.h.

◆ DBG_INIT

#define DBG_INIT   (1UL<<2)

Definition at line 114 of file internal.h.

◆ DBG_MODULE

#define DBG_MODULE   (1UL<<15)

Definition at line 127 of file internal.h.

◆ DBG_NEW

#define DBG_NEW   (1UL)

Definition at line 112 of file internal.h.

◆ DBG_NUMINT

#define DBG_NUMINT   (1UL<<13)

Definition at line 125 of file internal.h.

◆ DBG_PROC

#define DBG_PROC   (1UL<<7)

Definition at line 119 of file internal.h.

◆ DBG_PROCESS

#define DBG_PROCESS   (1UL<<14)

Definition at line 126 of file internal.h.

◆ DBG_QUEUE

#define DBG_QUEUE   (1UL<<8)

Definition at line 120 of file internal.h.

◆ DBG_SIMULATOR

#define DBG_SIMULATOR   (1UL<<10)

Definition at line 122 of file internal.h.

◆ DBG_STEP

#define DBG_STEP   (1UL<<4)

Definition at line 116 of file internal.h.

◆ DBG_WU

#define DBG_WU   (1UL<<12)

Definition at line 124 of file internal.h.

◆ DEBUG

#define DEBUG (   c,
 
)
Value:
do{ if( SIMLIB_debug_flag & (c) ) \
{ _Print("DEBUG: T=%-10g ", SIMLIB_Time); \
_Print f; _Print("\n"); \
} }while(0)

Definition at line 105 of file internal.h.

◆ DEBUG_INFO

#define DEBUG_INFO   "/debug"

Definition at line 98 of file internal.h.

◆ DEFINE_HOOK

#define DEFINE_HOOK (   name)
Value:
static void (* HOOK_PTR_NAME(name) )() = 0; \
void HOOK_INST_NAME(name)(void (*f)()) { HOOK_PTR_NAME(name) = f; }
#define HOOK_INST_NAME(id)
Definition: internal.h:247
#define HOOK_PTR_NAME(id)
Definition: internal.h:246

Definition at line 267 of file internal.h.

◆ Dprintf

#define Dprintf (   f)
Value:
do { if( SIMLIB_debug_flag ) \
{ _Print("DEBUG: T=%-10g ", SIMLIB_Time); \
_Print f; _Print("\n"); \
} }while(0)

Definition at line 100 of file internal.h.

◆ HOOK_INST_NAME

#define HOOK_INST_NAME (   id)    SIMLIB_Install_hook_##id

Definition at line 247 of file internal.h.

◆ HOOK_PTR_NAME

#define HOOK_PTR_NAME (   id)    SIMLIB_Hook_Ptr_##id

Definition at line 246 of file internal.h.

◆ INSTALL_HOOK

#define INSTALL_HOOK (   name,
  function 
)
Value:
do {\
void HOOK_INST_NAME(name) (void (*f)()); /* prototype */ \
HOOK_INST_NAME(name)(function); /* call of installer */ \
}while (0)

Definition at line 255 of file internal.h.

◆ SIMLIB_IMPLEMENTATION

#define SIMLIB_IMPLEMENTATION
Value:
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wunused-variable\"") \
static int SIMLIB_module_num = \
SIMLIB_module_id.Init( \
"(" __FILE__ \
", SIMLIB-" SIMLIB_VERSION DEBUG_INFO \
", " SIMLIB_SYSTEM \
"/" SIMLIB_COMPILER \
", " __DATE__ " " __TIME__ \
")" \
); \
_Pragma("GCC diagnostic pop")
int Init(const char *s)
Definition: atexit.cc:56
#define DEBUG_INFO
Definition: internal.h:98
#define SIMLIB_VERSION
Definition: simlib.h:9

internal module identification

Definition at line 135 of file internal.h.

◆ SIMLIB_internal_error

#define SIMLIB_internal_error ( )    SIMLIB_error(__FILE__, __LINE__)

Definition at line 167 of file internal.h.