Basilisk CFD
Adaptive Cartesian mesh PDE framework
Loading...
Searching...
No Matches
events.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _Event
 

Macros

#define INIT   ev->expr[0]
 
#define COND   ev->expr[1]
 
#define INC   ev->expr[2]
 

Typedefs

typedef struct _Event Event
 
typedef int(* Expr) (int *, double *, Event *)
 

Enumerations

enum  { event_done , event_alive , event_stop }
 

Functions

void init_events (void)
 
void event_register (Event event)
 
static void _init_solver (void)
 
static void event_error (Event *ev, const char *s)
 
static void init_event (Event *ev)
 
static int event_finished (Event *ev)
 
static int event_cond (Event *ev, int i, double t)
 
static bool overload_event ()
 The interpreter overloads the function below to control (i.e.
 
static int event_do (Event *ev, bool action)
 
static void end_event_do (bool action)
 
int events (bool action)
 
void event (const char *name)
 
double dtnext (double dt)
 
void init_solver ()
 

Variables

static EventEvents = NULL
 
int iter = 0
 
int inext = 0
 
double t = 0
 
double tnext = 0
 
static int END_EVENT = 1234567890
 
static double TEND_EVENT = 1234567890
 
static double TEPS = 1e-9
 

Macro Definition Documentation

◆ COND

#define COND   ev->expr[1]

Definition at line 30 of file events.h.

◆ INC

#define INC   ev->expr[2]

Definition at line 31 of file events.h.

◆ INIT

#define INIT   ev->expr[0]

Definition at line 29 of file events.h.

Typedef Documentation

◆ Event

Definition at line 3 of file events.h.

◆ Expr

typedef int(* Expr) (int *, double *, Event *)

Definition at line 4 of file events.h.

Enumeration Type Documentation

◆ anonymous enum

Enumerator
event_done 
event_alive 
event_stop 

Definition at line 107 of file events.h.

Function Documentation

◆ _init_solver()

static void _init_solver ( void  )
static

◆ dtnext()

double dtnext ( double  dt)

Definition at line 276 of file events.h.

References assert, dt, HUGE, n, t, TEPS, tnext, and x.

Referenced by event_face_fields(), event_stability(), event_velocity(), run(), and run().

Here is the caller graph for this function:

◆ end_event_do()

static void end_event_do ( bool  action)
static

Definition at line 209 of file events.h.

References END_EVENT, Events, iter, _Event::last, _Event::next, t, and x.

Referenced by events().

Here is the caller graph for this function:

◆ event()

void event ( const char name)

Definition at line 264 of file events.h.

References Events, _Event::last, _Event::next, and x.

Referenced by event_adapt(), event_init(), and event_register().

Here is the caller graph for this function:

◆ event_cond()

static int event_cond ( Event ev,
int  i,
double  t 
)
static

Definition at line 142 of file events.h.

References COND, i, t, and x.

Referenced by event_do().

Here is the caller graph for this function:

◆ event_do()

static int event_do ( Event ev,
bool  action 
)
static

Definition at line 166 of file events.h.

References COND, event_alive, event_cond(), event_finished(), event_stop, INC, INIT, iter, _Event::next, overload_event(), t, TEPS, and x.

Referenced by events().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ event_error()

static void event_error ( Event ev,
const char s 
)
static

Definition at line 37 of file events.h.

References s, and x.

Referenced by init_event().

Here is the caller graph for this function:

◆ event_finished()

static int event_finished ( Event ev)
static

Definition at line 109 of file events.h.

References event_done, TEND_EVENT, and x.

Referenced by event_do().

Here is the caller graph for this function:

◆ event_register()

void event_register ( Event  event)

Definition at line 115 of file events.h.

References assert, event(), Events, init_event(), _Event::last, n, _Event::next, qcalloc, realloc(), and x.

Here is the call graph for this function:

◆ events()

int events ( bool  action)

Definition at line 225 of file events.h.

References COND, END_EVENT, end_event_do(), event_alive, event_do(), event_stop, Events, HUGE, INC, inext, INIT, init_event(), iter, _Event::last, overload_event(), t, tnext, and x.

Here is the call graph for this function:

◆ init_event()

static void init_event ( Event ev)
static

Definition at line 43 of file events.h.

References COND, END_EVENT, event_error(), i, INC, init(), INIT, j, t, TEND_EVENT, and x.

Referenced by event_register(), and events().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ init_events()

void init_events ( void  )

◆ init_solver()

void init_solver ( )

Definition at line 298 of file events.h.

References _attribute, all, baseblock, calloc(), datasize, Events, scalar::i, i, _Event::last, n, pmtrace, and x.

Here is the call graph for this function:

◆ overload_event()

static bool overload_event ( )
static

The interpreter overloads the function below to control (i.e.

shorten) the events loop.

Definition at line 164 of file events.h.

Referenced by event_do(), and events().

Here is the caller graph for this function:

Variable Documentation

◆ END_EVENT

int END_EVENT = 1234567890
static

Definition at line 33 of file events.h.

Referenced by end_event_do(), events(), and init_event().

◆ Events

Event* Events = NULL
static

Definition at line 21 of file events.h.

Referenced by end_event_do(), event(), event_register(), events(), free_solver(), and init_solver().

◆ inext

int inext = 0

Definition at line 23 of file events.h.

Referenced by events(), last_events(), run(), and run().

◆ iter

int iter = 0

Definition at line 23 of file events.h.

Referenced by end_event_do(), event_do(), events(), last_events(), run(), and run().

◆ t

◆ TEND_EVENT

double TEND_EVENT = 1234567890
static

Definition at line 34 of file events.h.

Referenced by event_finished(), and init_event().

◆ TEPS

double TEPS = 1e-9
static

Definition at line 35 of file events.h.

Referenced by dtnext(), and event_do().

◆ tnext

double tnext = 0

Definition at line 24 of file events.h.

Referenced by dtnext(), events(), input_gfs(), last_events(), run(), and run().