Functions

Name

Functions -- Values varying in space and time

Synopsis


#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);

Description

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:

-1.78e-3

or a C function

{
  double a = sin (x + y);
  double b = cos (x - z);
  double c = sin (M_PI*t);
  return a + b + c;
}

Details

GFS_FUNCTION_CLASS()

#define     GFS_FUNCTION_CLASS(klass)

klass :


GFS_FUNCTION()

#define     GFS_FUNCTION(obj)

obj :


GFS_IS_FUNCTION()

#define     GFS_IS_FUNCTION(obj)

obj :


struct GfsFunctionClass

struct GfsFunctionClass {

  GtsObjectClass parent_class;
};


struct GfsFunction

struct GfsFunction {

};


gfs_function_class ()

GfsFunctionClass* gfs_function_class        (void);

Returns :


gfs_function_new ()

GfsFunction* gfs_function_new               (GfsFunctionClass *klass,
                                             gdouble val);

klass :

val :

Returns :


gfs_function_face_value ()

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.


gfs_function_value ()

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.


gfs_function_read ()

void        gfs_function_read               (GfsFunction *f,
                                             GtsFile *fp);

Calls the read() method of f.

f :

a GfsFunction.

fp :

a GtsFile.


gfs_function_write ()

void        gfs_function_write              (GfsFunction *f,
                                             FILE *fp);

Calls the write() method of f.

f :

a GfsFunction.

fp :

a file pointer.