![]() | ![]() | ![]() | Gerris Flow Solver Reference Manual | ![]() |
---|
#include <gfs.h> #define GFS_FUNCTION_CLASS (klass) #define GFS_FUNCTION (obj) #define GFS_IS_FUNCTION (obj) struct GfsFunctionClass; struct GfsFunction; GfsFunctionClass* gfs_function_class (void); GfsFunction* gfs_function_new (GfsFunctionClass *klass,gdouble val);gdouble gfs_function_face_value (GfsFunction *f, FttCellFace *fa,gdouble t);gdouble gfs_function_value (GfsFunction *f, FttVector *p,gdouble t);void gfs_function_read (GfsFunction *f,GtsFile *fp);void gfs_function_write (GfsFunction *f,FILE *fp);
Functions can be used in most objects which require a numerical parameter. A function can be either a constant or a piece of C code taking coordinates (x,y,z) and time t as arguments and returning a floating-point value.
The syntax in parameter files is as follows:
or a C functionGfsFunction* gfs_function_new (GfsFunctionClass *klass,gdouble val);
klass : | |
val : | |
Returns : |
|
gdouble gfs_function_face_value (GfsFunction *f, FttCellFace *fa,gdouble t);
f : | a GfsFunction. |
fa : | a FttCellFace. |
t : | the time. |
Returns : | the value of function f at the center of face fa. |
gdouble gfs_function_value (GfsFunction *f, FttVector *p,gdouble t);
f : | a GfsFunction. |
p : | a FttVector. |
t : | the time. |
Returns : | the value of function f at location p. |
void gfs_function_read (GfsFunction *f,GtsFile *fp);
Calls the read()
f : | a GfsFunction. |
fp : | a |
void gfs_function_write (GfsFunction *f,FILE *fp);
Calls the write()
f : | a GfsFunction. |
fp : | a file pointer. |
<<< Simple statistics | Fully threaded tree >>> |