Gerris
|
GfsFunction and various utility functions. More...
Functions | |
gchar * | gfs_mkftemp (gchar *tmpl) |
gchar * | gfs_template (void) |
void | gfs_object_clone (GtsObject *object, GtsObject *clone) |
gboolean | gfs_char_in_string (char c, const char *s) |
gchar * | gfs_file_statement (GtsFile *fp) |
void | gfs_pending_functions_compilation (GtsFile *fp) |
GString * | gfs_function_expression (GtsFile *fp, gboolean *is_expression) |
GfsFunction * | gfs_function_new (GfsFunctionClass *klass, gdouble val) |
void | gfs_function_set_units (GfsFunction *f, gdouble units) |
gchar * | gfs_function_description (GfsFunction *f, gboolean truncate) |
gdouble | gfs_function_value (GfsFunction *f, FttCell *cell) |
gdouble | gfs_function_face_value (GfsFunction *f, FttCellFace *fa) |
void | gfs_function_set_constant_value (GfsFunction *f, gdouble val) |
gdouble | gfs_function_get_constant_value (GfsFunction *f) |
gboolean | gfs_function_is_constant (const GfsFunction *f) |
GfsVariable * | gfs_function_get_variable (GfsFunction *f) |
void | gfs_function_read (GfsFunction *f, gpointer domain, GtsFile *fp) |
void | gfs_function_write (GfsFunction *f, FILE *fp) |
gdouble | gfs_function_spatial_value (GfsFunction *f, const FttVector *p) |
gdouble | gfs_read_constant (GtsFile *fp, gpointer domain) |
GtsObjectClass * | gfs_object_class_from_name (const gchar *name) |
void | gfs_eigenvalues (gdouble a[FTT_DIMENSION][FTT_DIMENSION], gdouble d[FTT_DIMENSION], gdouble v[FTT_DIMENSION][FTT_DIMENSION]) |
gdouble | gfs_matrix_inverse (gdouble **m, guint n, gdouble pivmin) |
gpointer | gfs_matrix_new (guint n, guint p, guint size) |
void | gfs_matrix_free (gpointer m) |
GfsClock * | gfs_clock_new (void) |
void | gfs_clock_start (GfsClock *t) |
void | gfs_clock_stop (GfsClock *t) |
gdouble | gfs_clock_elapsed (GfsClock *t) |
void | gfs_clock_destroy (GfsClock *t) |
FILE * | gfs_union_open (FILE *fp, int rank, GfsUnionFile *file) |
void | gfs_union_close (FILE *fp, int rank, GfsUnionFile *file) |
GSList * | gfs_format_new (const gchar *format, GtsFile *fp, gboolean *dynamic, gboolean *parallel) |
void | gfs_format_destroy (GSList *f) |
gchar * | gfs_format_string (GSList *format, gint pid, guint niter, gdouble time) |
gdouble | gfs_format_time_value (GSList *format, const gchar *string) |
void | gfs_cell_message (const FttCell *cell, const gchar *format,...) |
void | gfs_debug (const gchar *format,...) |
void | gfs_debug_enabled (gboolean enabled) |
gboolean | gfs_read_vector (GtsFile *fp, gchar *component[FTT_DIMENSION]) |
gboolean | gfs_read_variable_vector (GtsFile *fp, GfsVariable *vector[FTT_DIMENSION], GfsDomain *domain) |
gboolean | gfs_read_function_vector (GtsFile *fp, GfsVariable *vector[FTT_DIMENSION], GfsFunction *function[FTT_DIMENSION], gpointer sim) |
GfsFunction and various utility functions.
void gfs_cell_message | ( | const FttCell * | cell, |
const gchar * | format, | ||
... | |||
) |
cell | a #FttCell. |
format | a string format. ...: arguments for format. |
Logs a message preceded by the pointer, position and level of cell.
gboolean gfs_char_in_string | ( | char | c, |
const char * | s | ||
) |
c | a character. |
s | a string. |
void gfs_clock_destroy | ( | GfsClock * | t | ) |
t | a #GfsClock. |
Destroys the clock, freeing the memory allocated for it.
gdouble gfs_clock_elapsed | ( | GfsClock * | t | ) |
t | a #GfsClock. |
GfsClock* gfs_clock_new | ( | void | ) |
void gfs_clock_start | ( | GfsClock * | t | ) |
t | a #GfsClock. |
Starts clock t.
void gfs_clock_stop | ( | GfsClock * | t | ) |
t | a #GfsClock. |
Stops clock t.
void gfs_debug | ( | const gchar * | format, |
... | |||
) |
format | a string format. ...: arguments for format. |
Logs a debugging message (only when gfs_debug_enabled() is set to TRUE).
void gfs_debug_enabled | ( | gboolean | enabled | ) |
enabled | whether to enable debug message logging. |
Enables or disables debug message logging (see also gfs_debug()).
void gfs_eigenvalues | ( | gdouble | a[FTT_DIMENSION][FTT_DIMENSION], |
gdouble | d[FTT_DIMENSION], | ||
gdouble | v[FTT_DIMENSION][FTT_DIMENSION] | ||
) |
a | a symmetric matrix. |
d | a vector. |
v | another matrix. |
Fills d (resp. v) with the eigenvalues (resp. eigenvectors) of matrix a.
gchar* gfs_file_statement | ( | GtsFile * | fp | ) |
fp | a #GtsFile. |
Reads the next brackets-delimited ({...}) statemement in fp, including all comments.
void gfs_format_destroy | ( | GSList * | f | ) |
f | a list of #GfsFormat. |
Frees all memory allocated for f.
GSList* gfs_format_new | ( | const gchar * | format, |
GtsFile * | fp, | ||
gboolean * | dynamic, | ||
gboolean * | parallel | ||
) |
format | a string. |
fp | a #GtsFile or NULL. |
dynamic | set to TRUE if the format is time-dependent. |
parallel | set to TRUE if the format is PID-dependent. |
If fp is not NULL and and error occurs, an error message is set in fp.
gchar* gfs_format_string | ( | GSList * | format, |
gint | pid, | ||
guint | niter, | ||
gdouble | time | ||
) |
format | a GSList of #GfsFormat. |
pid | the PID. |
niter | number of iterations done in the simulation. |
time | simulation time. |
gdouble gfs_format_time_value | ( | GSList * | format, |
const gchar * | string | ||
) |
format | a list of #GfsFormat. |
string | a string formatted according to format. |
void gfs_matrix_free | ( | gpointer | m | ) |
m | a matrix allocated with gfs_matrix_new(). |
Frees the memory occupied by m.
gdouble gfs_matrix_inverse | ( | gdouble ** | m, |
guint | n, | ||
gdouble | pivmin | ||
) |
m | a square matrix. |
n | size of the matrix. |
pivmin | the minimum value of the pivoting coefficient. |
Replaces m with its inverse.
gpointer gfs_matrix_new | ( | guint | n, |
guint | p, | ||
guint | size | ||
) |
n | the size of the matrix. |
p | the size of the matrix. |
size | the size of the matrix elements. |
The matrix elements are initialised to zero.
gchar* gfs_mkftemp | ( | gchar * | tmpl | ) |
tmpl | template FIFO name |
Creates a temporary FIFO. See the mkfifo() documentation on most UNIX-like systems.
GtsObjectClass* gfs_object_class_from_name | ( | const gchar * | name | ) |
name | the name of the class. |
Looks for a class called name. If none is found append the "Gfs" prefix and look again.
void gfs_object_clone | ( | GtsObject * | object, |
GtsObject * | clone | ||
) |
object | the #GtsObject to clone. |
clone | the clone of object. |
Makes clone the clone of object using the write() and read() methods of object.
void gfs_pending_functions_compilation | ( | GtsFile * | fp | ) |
fp | a #GtsFile. |
Compiles and links pending #GfsFunction definitions.
Compilation errors are reported in fp.
gboolean gfs_read_function_vector | ( | GtsFile * | fp, |
GfsVariable * | vector[FTT_DIMENSION], | ||
GfsFunction * | function[FTT_DIMENSION], | ||
gpointer | sim | ||
) |
fp | a #GtsFile. |
vector | an array of vector component variables. |
function | an array of vector component #GfsFunction corresponding to vector. |
sim | the #GfsSimulation to which vector belongs. |
Reads a vector from fp and fills vector.
gboolean gfs_read_variable_vector | ( | GtsFile * | fp, |
GfsVariable * | vector[FTT_DIMENSION], | ||
GfsDomain * | domain | ||
) |
fp | a #GtsFile. |
vector | an array of vector component variables. |
domain | the #GfsDomain to which vector belongs. |
Reads a vector from fp and fills vector.
gboolean gfs_read_vector | ( | GtsFile * | fp, |
gchar * | component[FTT_DIMENSION] | ||
) |
fp | a #GtsFile. |
component | an array of vector component names. |
Reads a vector from fp and fills component. Note that the component strings need to be freed after use.
gchar* gfs_template | ( | void | ) |
void gfs_union_close | ( | FILE * | fp, |
int | rank, | ||
GfsUnionFile * | file | ||
) |
fp | a file pointer. |
rank | the rank of the current parallel process. |
file | a #GfsUnionFile returned by a call to gfs_union_open(). |
Closes a "parallel" file previously opened using gfs_union_open().
FILE* gfs_union_open | ( | FILE * | fp, |
int | rank, | ||
GfsUnionFile * | file | ||
) |
fp | a file pointer. |
rank | the rank of the current parallel process. |
file | a #GfsUnionFile. |
Opens a "parallel" file which serialises multiple parallel (write) accesses to the file pointed to by fp.
This file must be closed with gfs_union_close().