![]() | ![]() | ![]() | Gerris Flow Solver Reference Manual | ![]() |
---|
#include <gfs.h> #define GFS_EVENT_CLASS (klass) #define GFS_EVENT (obj) #define GFS_IS_EVENT (obj) GfsEventClass; GfsEvent; GfsEventClass* gfs_event_class (void); GfsEvent* gfs_event_new (GfsEventClass *klass);void gfs_event_set (GfsEvent *e,gdouble start,gdouble end,gdouble step,gint istart,gint iend,gint istep); #define gfs_event_is_repetitive (e)
Events are used to control any action which needs to be performed at a given time during a simulation. This includes one off actions as well as periodically repeated actions.
The syntax in parameter files is as follows:
GfsEvent { start = 0.1 istart = 10 ( step = 1.2 | istep = 10 ) end = 0.4 iend = 123 }
start | Physical starting time (default is zero). The end keyword can be used to indicate the end of the simulation. |
istart | Time step starting time (default is zero). |
step | Repeat every step physical time units (default is infinity). |
istep | Repeat every istep time steps (default is infinity). |
end | Stop at or before this physical time (default is infinity). |
iend | Stop at or before this number of time steps (default is infinity). |
typedef struct { GtsSListContaineeClass parent_class; gboolean (* event) (GfsEvent * event, GfsSimulation * sim); void (* post_event) (GfsEvent * event, GfsSimulation * sim); void (* event_half) (GfsEvent * event, GfsSimulation * sim); } GfsEventClass;
typedef struct { GtsSListContainee parent; gdouble t, start, end, step; guint i, istart, iend, istep; guint n; gboolean end_event, realised; } GfsEvent;
void gfs_event_set (GfsEvent *e,gdouble start,gdouble end,gdouble step,gint istart,gint iend,gint istep);
Sets the properties of event e
.
If any of the arguments is negative, the corresponding value in e
is unchanged.
e : | a GfsEvent. |
start : | start time. |
end : | end time. |
step : | time step. |
istart : | start iteration. |
iend : | end iteration. |
istep : | iteration step. |
#define gfs_event_is_repetitive(e) ((e)->step < G_MAXDOUBLE || (e)->istep < G_MAXINT)
e : |
|
<<< Events | Script event >>> |