![]() | ![]() | ![]() | Gerris Flow Solver Reference Manual | ![]() |
---|
#include <gfs.h> #define GFS_FUNCTION_CLASS (klass) #define GFS_FUNCTION (obj) #define GFS_IS_FUNCTION (obj) GfsFunctionClass; GfsFunction; GfsFunctionClass* gfs_function_class (void); GfsFunction* gfs_function_new (GfsFunctionClass *klass,gdouble val);gdouble gfs_function_face_value (GfsFunction *f, FttCellFace *fa);gdouble gfs_function_value (GfsFunction *f, FttCell *cell);void gfs_function_read (GfsFunction *f,gpointer domain,GtsFile *fp);void gfs_function_write (GfsFunction *f,FILE *fp);gchar * gfs_function_description (GfsFunction *f,gboolean truncate);gdouble gfs_function_get_constant_value (GfsFunction *f);void gfs_function_set_constant_value (GfsFunction *f,gdouble val); GfsVariable* gfs_function_get_variable (GfsFunction *f);
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), time t or any of the domain variables as arguments and returning a floating-point value.
The syntax in parameter files is as follows:
or a C function or a C expressionGfsFunction* gfs_function_new (GfsFunctionClass *klass,gdouble val);
klass : | |
val : | |
Returns : |
|
gdouble gfs_function_face_value (GfsFunction *f, FttCellFace *fa);
f : | a GfsFunction. |
fa : | a FttCellFace. |
Returns : | the value of function |
gdouble gfs_function_value (GfsFunction *f, FttCell *cell);
f : | a GfsFunction. |
cell : | a FttCell or NULL. |
Returns : | the value of function |
void gfs_function_read (GfsFunction *f,gpointer domain,GtsFile *fp);
Calls the read()
f
.
f : | a GfsFunction. |
domain : | a GfsDomain. |
fp : | a |
void gfs_function_write (GfsFunction *f,FILE *fp);
Calls the write()
f
.
f : | a GfsFunction. |
fp : | a file pointer. |
gchar * gfs_function_description (GfsFunction *f,gboolean truncate);
f : | a GfsFunction. |
truncate : | whether to truncate long descriptions. |
Returns : | a newly allocated string describing |
gdouble gfs_function_get_constant_value (GfsFunction *f);
f : | a GfsFunction. |
Returns : | the value of function |
void gfs_function_set_constant_value (GfsFunction *f,gdouble val);
Sets the value of the constant function f
to val
.
f : | a GfsFunction. |
val : | the value. |
GfsVariable* gfs_function_get_variable (GfsFunction *f);
f : | a GfsFunction. |
Returns : | the variable containing the value of |
<<< Simple statistics | Fully threaded tree >>> |