![]() | ![]() | ![]() | Gerris Flow Solver Reference Manual | ![]() |
---|
#include <gfs.h> #define GFS_SIMULATION_CLASS (klass) #define GFS_SIMULATION (obj) #define GFS_IS_SIMULATION (obj) GfsSimulationClass; GfsSimulation; GfsTime; GfsPhysicalParams;void gfs_init (int *argc,char ***argv); GfsSimulationClass* gfs_simulation_class (void); GfsSimulation* gfs_simulation_new (GfsSimulationClass *klass); GfsSimulation* gfs_simulation_read (GtsFile *fp);void gfs_simulation_refine (GfsSimulation *sim);void gfs_simulation_set_timestep (GfsSimulation *sim);void gfs_simulation_adapt (GfsSimulation *simulation,GfsAdaptStats *s);void gfs_simulation_write (GfsSimulation *sim,gint max_depth,FILE *fp);void gfs_simulation_run (GfsSimulation *sim); #define gfs_object_simulation (o)void gfs_time_init (GfsTime *t);void gfs_time_read (GfsTime *t,GtsFile *fp);void gfs_time_write (GfsTime *t,FILE *fp);void gfs_physical_params_init (GfsPhysicalParams *p);void gfs_physical_params_read (GfsPhysicalParams *p, GfsDomain *domain,GtsFile *fp);void gfs_physical_params_write (GfsPhysicalParams *p,FILE *fp);
typedef struct { GfsDomainClass parent_class; void (* run) (GfsSimulation *); } GfsSimulationClass;
typedef struct { GfsDomain parent; GfsTime time; GfsPhysicalParams physical_params; GfsMultilevelParams projection_params; GfsMultilevelParams approx_projection_params; GfsAdvectionParams advection_params; GtsSurface * surface; guint thin; gboolean output_surface; GtsSListContainer * refines; GtsSListContainer * adapts; GfsAdaptStats adapts_stats; GtsSListContainer * events; GSList * modules; GSList * variables; gdouble tnext; } GfsSimulation;
void gfs_init (int *argc,char ***argv);
Initializes the Gerris library. This function must be called before any other function of the library.
argc : | a pointer on the number of command line arguments passed to the program. |
argv : | a pointer on the command line arguments passed to the program. |
GfsSimulation* gfs_simulation_read (GtsFile *fp);
Reads a simulation file from fp
.
fp : | a |
Returns : | the GfsSimulation or NULL if an error occured, in which
case the |
void gfs_simulation_refine (GfsSimulation *sim);
Calls the @refine()
sim
. Matches the
boundaries by calling gfs_domain_match()
.
sim : |
void gfs_simulation_set_timestep (GfsSimulation *sim);
Sets the time step for the next iteration of sim
using the CFL
(computed using gfs_domain_cfl()
) and taking into account the
timings of the various GfsEvent associated to sim
.
More precisely, the time step is adjusted (if necessary) so that the time of the closest event is exactly reached after the iteration.
sim : |
void gfs_simulation_adapt (GfsSimulation *simulation,GfsAdaptStats *s);
Checks if any mesh adaptation is necessary and adapts the mesh
using an OR combination of all the regular criteria defined in
simulation
->adapts.
If any one or several criteria are defined as "not" refinements, the mesh will be refined only if all of this criteria AND any other regular criterion is verified.
simulation : | |
s : | where to put statistics (or NULL). |
void gfs_simulation_write (GfsSimulation *sim,gint max_depth,FILE *fp);
Writes in fp
a text representation of sim
. If max_depth
is
smaller or equal to -2, no cell tree data is written.
sim : | |
max_depth : | the maximum depth at which to stop writing cell tree data (-1 means no limit). |
fp : | a file pointer. |
void gfs_time_init (GfsTime *t);
Initializes the time structure t
with default values.
t : | the GfsTime. |
void gfs_time_read (GfsTime *t,GtsFile *fp);
Reads a time structure from fp
and puts it in t
.
t : | the GfsTime. |
fp : | the |
void gfs_time_write (GfsTime *t,FILE *fp);
Writes in fp
a text representation of the time structure t
.
t : | the time structure. |
fp : | a file pointer. |
void gfs_physical_params_init (GfsPhysicalParams *p);
Initializes the physical parameters structure p
with default values.
p : | the GfsPhysicalParams. |
void gfs_physical_params_read (GfsPhysicalParams *p, GfsDomain *domain,GtsFile *fp);
Reads a physical parameters structure from fp
and puts it in p
.
p : | the GfsPhysicalParams. |
domain : | a GfsDomain. |
fp : | the |
void gfs_physical_params_write (GfsPhysicalParams *p,FILE *fp);
Writes in fp
a text representation of the physical parameters
structure p
.
p : | the physical parameters structure. |
fp : | a file pointer. |
<<< Simulations, initialisations, events | Refinements >>> |