Gerris
|
Classes | |
GfsDomainProjection | |
GfsSimulation | |
Functions | |
void | gfs_domain_copy_bc (GfsDomain *domain, FttTraverseFlags flags, gint max_depth, GfsVariable *v, GfsVariable *v1) |
void | gfs_domain_bc (GfsDomain *domain, FttTraverseFlags flags, gint max_depth, GfsVariable *v) |
void | gfs_domain_homogeneous_bc (GfsDomain *domain, FttTraverseFlags flags, gint max_depth, GfsVariable *ov, GfsVariable *v) |
void | gfs_domain_homogeneous_bc_stencil (GfsDomain *domain, FttTraverseFlags flags, gint max_depth, GfsVariable *ov, GfsVariable *v, GfsLinearProblem *lp) |
void | gfs_traverse_and_homogeneous_bc (GfsDomain *domain, FttTraverseType order, FttTraverseFlags flags, gint max_depth, FttCellTraverseFunc func, gpointer data, GfsVariable *ov, GfsVariable *v) |
void | gfs_traverse_and_bc (GfsDomain *domain, FttTraverseType order, FttTraverseFlags flags, gint max_depth, FttCellTraverseFunc func, gpointer data, GfsVariable *v, GfsVariable *v1) |
void | gfs_domain_face_bc (GfsDomain *domain, FttComponent c, GfsVariable *v) |
void | gfs_domain_match (GfsDomain *domain) |
void | gfs_domain_forget_boundary (GfsDomain *domain, GfsBoundary *boundary) |
void | gfs_domain_surface_bc (GfsDomain *domain, GfsVariable *v) |
void | gfs_domain_cell_traverse (GfsDomain *domain, FttTraverseType order, FttTraverseFlags flags, gint max_depth, FttCellTraverseFunc func, gpointer data) |
FttCellTraverse * | gfs_domain_cell_traverse_new (GfsDomain *domain, FttTraverseType order, FttTraverseFlags flags, gint max_depth) |
void | gfs_domain_traverse_layers (GfsDomain *domain, FttCellTraverseFunc func, gpointer data) |
void | gfs_domain_cell_traverse_box (GfsDomain *domain, GtsBBox *box, FttTraverseType order, FttTraverseFlags flags, gint max_depth, FttCellTraverseFunc func, gpointer data) |
void | gfs_domain_cell_traverse_condition (GfsDomain *domain, FttTraverseType order, FttTraverseFlags flags, gint max_depth, FttCellTraverseFunc func, gpointer data, gboolean(*condition)(FttCell *, gpointer), gpointer cdata) |
void | gfs_domain_traverse_mixed (GfsDomain *domain, FttTraverseType order, FttTraverseFlags flags, FttCellTraverseFunc func, gpointer data) |
void | gfs_domain_traverse_cut (GfsDomain *domain, GfsGenericSurface *s, FttTraverseType order, FttTraverseFlags flags, FttCellTraverseCutFunc func, gpointer data) |
void | gfs_domain_traverse_cut_2D (GfsDomain *domain, GfsGenericSurface *s, FttTraverseType order, FttTraverseFlags flags, FttCellTraverseCutFunc func, gpointer data) |
guint | gfs_domain_depth (GfsDomain *domain) |
void | gfs_domain_face_traverse (GfsDomain *domain, FttComponent c, FttTraverseType order, FttTraverseFlags flags, gint max_depth, FttFaceTraverseFunc func, gpointer data) |
void | gfs_domain_cell_traverse_boundary (GfsDomain *domain, FttDirection d, FttTraverseType order, FttTraverseFlags flags, gint max_depth, FttCellTraverseFunc func, gpointer data) |
GtsRange | gfs_domain_stats_variable (GfsDomain *domain, GfsVariable *v, FttTraverseFlags flags, gint max_depth, gboolean(*condition)(FttCell *, gpointer), gpointer cdata) |
GtsRange | gfs_domain_stats_solid (GfsDomain *domain) |
void | gfs_domain_stats_merged (GfsDomain *domain, GtsRange *solid, GtsRange *number) |
void | gfs_domain_stats_balance (GfsDomain *domain, GtsRange *size, GtsRange *boundary, GtsRange *mpiwait) |
GfsNorm | gfs_domain_norm_variable (GfsDomain *domain, GfsVariable *v, GfsFunction *w, FttTraverseFlags flags, gint max_depth, gboolean(*condition)(FttCell *, gpointer), gpointer cdata) |
GfsNorm | gfs_domain_norm_residual (GfsDomain *domain, FttTraverseFlags flags, gint max_depth, gdouble dt, GfsVariable *res) |
GfsVariable ** | gfs_domain_velocity (GfsDomain *domain) |
GfsNorm | gfs_domain_norm_velocity (GfsDomain *domain, FttTraverseFlags flags, gint max_depth) |
GfsDomain * | gfs_domain_read (GtsFile *fp) |
void | gfs_domain_split (GfsDomain *domain, gboolean one_box_per_pe) |
FttCell * | gfs_domain_locate (GfsDomain *domain, FttVector target, gint max_depth, GfsBox **where) |
FttCell * | gfs_domain_boundary_locate (GfsDomain *domain, FttVector target, gint max_depth, GtsObject **where) |
gdouble | gfs_domain_cell_point_distance2 (GfsDomain *domain, GtsPoint *p, gdouble(*distance2)(FttCell *, GtsPoint *, gpointer), gpointer data, FttCell **closest) |
void | gfs_domain_advect_point (GfsDomain *domain, FttVector *p, gdouble dt) |
guint | gfs_domain_size (GfsDomain *domain, FttTraverseFlags flags, gint max_depth) |
gdouble | gfs_domain_cfl (GfsDomain *domain, FttTraverseFlags flags, gint max_depth) |
void | gfs_cell_init (FttCell *cell, GfsDomain *domain) |
void | gfs_cell_reinit (FttCell *cell, GfsDomain *domain) |
void | gfs_cell_fine_init (FttCell *parent, GfsDomain *domain) |
void | gfs_cell_copy (const FttCell *from, FttCell *to, GfsDomain *domain) |
void | gfs_cell_write (const FttCell *cell, FILE *fp, GSList *variables) |
void | gfs_cell_read (FttCell *cell, GtsFile *fp, GfsDomain *domain) |
void | gfs_cell_write_binary (const FttCell *cell, FILE *fp, GSList *variables) |
void | gfs_cell_read_binary (FttCell *cell, GtsFile *fp, GfsDomain *domain) |
guint | gfs_domain_alloc (GfsDomain *domain) |
void | gfs_domain_free (GfsDomain *domain, guint i) |
GfsVariable * | gfs_domain_add_variable (GfsDomain *domain, const gchar *name, const gchar *description) |
GfsVariable * | gfs_domain_get_or_add_variable (GfsDomain *domain, const gchar *name, const gchar *description) |
void | gfs_domain_solid_force (GfsDomain *domain, FttVector *pf, FttVector *vf, FttVector *pm, FttVector *vm, GfsFunction *weight) |
guint | gfs_domain_tag_droplets (GfsDomain *domain, GfsVariable *c, GfsVariable *tag) |
void | gfs_domain_remove_droplets (GfsDomain *domain, GfsVariable *c, GfsVariable *v, gint min, gdouble val) |
void | gfs_domain_remove_ponds (GfsDomain *domain, gint min, FttCellCleanupFunc cleanup, gpointer data) |
void | gfs_domain_remove_specks (GfsDomain *domain) |
void | gfs_domain_timer_start (GfsDomain *domain, const gchar *name) |
void | gfs_domain_timer_stop (GfsDomain *domain, const gchar *name) |
void | gfs_domain_combine_traverse (GfsDomain *domain1, GfsDomain *domain2, FttCellCombineTraverseFunc inside, gpointer idata, FttCellTraverseFunc outside, gpointer odata) |
GfsDerivedVariable * | gfs_domain_add_derived_variable (GfsDomain *domain, GfsDerivedVariableInfo info) |
gboolean | gfs_domain_remove_derived_variable (GfsDomain *domain, const gchar *name) |
void | gfs_domain_sum (GfsDomain *domain, FttDirection d, GfsFunction *f, GfsVariable *v) |
void | gfs_domain_filter (GfsDomain *domain, GfsVariable *v, GfsVariable *fv) |
GfsRequest * | gfs_send_objects (GSList *list, int dest) |
void | gfs_wait (GfsRequest *r) |
GSList * | gfs_receive_objects (GfsDomain *domain, int src) |
GfsRequest * | gfs_send_boxes (GfsDomain *domain, GSList *boxes, int dest) |
GSList * | gfs_receive_boxes (GfsDomain *domain, int src) |
GtsObject * | gfs_object_from_name (GfsDomain *domain, const gchar *name) |
Spatial domain.
void gfs_cell_copy | ( | const FttCell * | from, |
FttCell * | to, | ||
GfsDomain * | domain | ||
) |
from | a #FttCell to copy attributes from. |
to | a #FttCell to copy attributes to. |
domain | the #GfsDomain containing from. |
Copies the attributes of the fluid cell from to the fluid cell to.
void gfs_cell_fine_init | ( | FttCell * | parent, |
GfsDomain * | domain | ||
) |
parent | a #FttCell. |
domain | a #GfsDomain containing parent. |
Initialises the children of parent.
void gfs_cell_init | ( | FttCell * | cell, |
GfsDomain * | domain | ||
) |
cell | a #FttCell. |
domain | a #GfsDomain containing cell. |
Allocates the memory for fluid state data associated to cell or its children.
void gfs_cell_read | ( | FttCell * | cell, |
GtsFile * | fp, | ||
GfsDomain * | domain | ||
) |
cell | a #FttCell. |
fp | a #GtsFile. |
domain | the #GfsDomain containing cell. |
Reads from fp the fluid data associated with cell and described by domain->variables_io. This function is generally used in association with ftt_cell_read().
void gfs_cell_read_binary | ( | FttCell * | cell, |
GtsFile * | fp, | ||
GfsDomain * | domain | ||
) |
cell | a #FttCell. |
fp | a #GtsFile. |
domain | the #GfsDomain containing cell. |
Reads from fp the fluid data associated with cell and described by domain->variables_io. This function is generally used in association with ftt_cell_read_binary().
void gfs_cell_reinit | ( | FttCell * | cell, |
GfsDomain * | domain | ||
) |
cell | a #FttCell. |
domain | a #GfsDomain containing cell. |
Re-allocates the memory for fluid state data associated to cell.
void gfs_cell_write | ( | const FttCell * | cell, |
FILE * | fp, | ||
GSList * | variables | ||
) |
cell | a #FttCell. |
fp | a file pointer. |
variables | the list of #GfsVariable to be written. |
Writes in fp the fluid data associated with cell and described by variables. This function is generally used in association with ftt_cell_write().
void gfs_cell_write_binary | ( | const FttCell * | cell, |
FILE * | fp, | ||
GSList * | variables | ||
) |
cell | a #FttCell. |
fp | a file pointer. |
variables | the list of #GfsVariable to be written. |
Writes in fp the fluid data associated with cell and described by variables. This function is generally used in association with ftt_cell_write_binary().
GfsDerivedVariable* gfs_domain_add_derived_variable | ( | GfsDomain * | domain, |
GfsDerivedVariableInfo | info | ||
) |
domain | a #GfsDomain. |
info | the #GfsDerivedVariableInfo. |
Adds a derived variable described by info to domain.
GfsVariable* gfs_domain_add_variable | ( | GfsDomain * | domain, |
const gchar * | name, | ||
const gchar * | description | ||
) |
domain | a #GfsDomain. |
name | the name of the variable to add or NULL. |
description | the variable description or NULL. |
Adds a new variable name to domain.
void gfs_domain_advect_point | ( | GfsDomain * | domain, |
FttVector * | p, | ||
gdouble | dt | ||
) |
domain | a #GfsDomain. |
p | a #FttVector. |
dt | the time step. |
Updates the coordinates of point p at time t + dt using the velocity field defined by domain.
If p is not contained within domain, the coordinates are unchanged.
guint gfs_domain_alloc | ( | GfsDomain * | domain | ) |
domain | a #GfsDomain. |
void gfs_domain_bc | ( | GfsDomain * | domain, |
FttTraverseFlags | flags, | ||
gint | max_depth, | ||
GfsVariable * | v | ||
) |
domain | a #GfsDomain. |
flags | the traversal flags. |
max_depth | the maximum depth of the traversal. |
v | a #GfsVariable. |
Apply the boundary conditions in domain for variable v.
FttCell* gfs_domain_boundary_locate | ( | GfsDomain * | domain, |
FttVector | target, | ||
gint | max_depth, | ||
GtsObject ** | where | ||
) |
domain | a #GfsDomain. |
target | position of the point to look for. |
max_depth | maximum depth to consider (-1 means no restriction). |
where | a pointer to a #GtsObject. |
Locates the cell of domain or of its boundary containing target.
If where is not NULL it is filled with the #GtsObject (either a #GfsBox or a #GfsBoundary) containing the cell.
gdouble gfs_domain_cell_point_distance2 | ( | GfsDomain * | domain, |
GtsPoint * | p, | ||
gdouble(*)(FttCell *, GtsPoint *, gpointer) | distance2, | ||
gpointer | data, | ||
FttCell ** | closest | ||
) |
domain | a #GfsDomain. |
p | a #GtsPoint. |
distance2 | the squared distance function. |
data | user data to pass to distance2. |
closest | where to return the closest cell or NULL. |
For non-leafs cells distance2 must return a lower-bound for the minimum distance (using for example ftt_cell_point_distance2_min()).
void gfs_domain_cell_traverse | ( | GfsDomain * | domain, |
FttTraverseType | order, | ||
FttTraverseFlags | flags, | ||
gint | max_depth, | ||
FttCellTraverseFunc | func, | ||
gpointer | data | ||
) |
domain | a #GfsDomain. |
order | the order in which the cells are visited - FTT_PRE_ORDER, FTT_POST_ORDER. |
flags | which types of children are to be visited. |
max_depth | the maximum depth of the traversal. Cells below this depth will not be traversed. If max_depth is -1 all cells in the tree are visited. |
func | the function to call for each visited #FttCell. |
data | user data to pass to func. |
Traverses the cell trees of domain. Calls the given function for each cell visited.
void gfs_domain_cell_traverse_boundary | ( | GfsDomain * | domain, |
FttDirection | d, | ||
FttTraverseType | order, | ||
FttTraverseFlags | flags, | ||
gint | max_depth, | ||
FttCellTraverseFunc | func, | ||
gpointer | data | ||
) |
domain | a #GfsDomain. |
d | the direction of the boundary to traverse. |
order | the order in which the cells are visited - FTT_PRE_ORDER, FTT_POST_ORDER. |
flags | which types of children are to be visited. |
max_depth | the maximum depth of the traversal. Cells below this depth will not be traversed. If max_depth is -1 all cells in the tree are visited. |
func | the function to call for each visited #FttCell. |
data | user data to pass to func. |
Traverses the boundary of a domain in direction d. Calls the given function for each cell visited.
void gfs_domain_cell_traverse_box | ( | GfsDomain * | domain, |
GtsBBox * | box, | ||
FttTraverseType | order, | ||
FttTraverseFlags | flags, | ||
gint | max_depth, | ||
FttCellTraverseFunc | func, | ||
gpointer | data | ||
) |
domain | a #GfsDomain. |
box | a #GtsBBox. |
order | the order in which the cells are visited - FTT_PRE_ORDER, FTT_POST_ORDER. |
flags | which types of children are to be visited. |
max_depth | the maximum depth of the traversal. Cells below this depth will not be traversed. If max_depth is -1 all cells in the tree are visited. |
func | the function to call for each visited #FttCell. |
data | user data to pass to func. |
Traverses the cell trees of domain. Calls the given function for each cell visited. Only the cells overlapping with box are visited.
void gfs_domain_cell_traverse_condition | ( | GfsDomain * | domain, |
FttTraverseType | order, | ||
FttTraverseFlags | flags, | ||
gint | max_depth, | ||
FttCellTraverseFunc | func, | ||
gpointer | data, | ||
gboolean(*)(FttCell *, gpointer) | condition, | ||
gpointer | cdata | ||
) |
domain | a #GfsDomain. |
order | the order in which the cells are visited - FTT_PRE_ORDER, FTT_POST_ORDER. |
flags | which types of children are to be visited. |
max_depth | the maximum depth of the traversal. Cells below this depth will not be traversed. If max_depth is -1 all cells in the tree are visited. |
func | the function to call for each visited #FttCell. |
data | user data to pass to func. |
condition | the condition. |
cdata | user data to pass to condition. |
Traverses the cell trees of domain. Calls the given function for each cell visited.
Traversal of any branch of the tree is stopped whenever condition is not verified.
FttCellTraverse* gfs_domain_cell_traverse_new | ( | GfsDomain * | domain, |
FttTraverseType | order, | ||
FttTraverseFlags | flags, | ||
gint | max_depth | ||
) |
domain | a #GfsDomain. |
order | the order in which the cells are visited - FTT_PRE_ORDER, FTT_POST_ORDER. |
flags | which types of children are to be visited. |
max_depth | the maximum depth of the traversal. Cells below this depth will not be traversed. If max_depth is -1 all cells in the tree are visited. |
gdouble gfs_domain_cfl | ( | GfsDomain * | domain, |
FttTraverseFlags | flags, | ||
gint | max_depth | ||
) |
domain | a #GfsDomain. |
flags | which types of cells are to be visited. |
max_depth | maximum depth of the traversal. |
void gfs_domain_combine_traverse | ( | GfsDomain * | domain1, |
GfsDomain * | domain2, | ||
FttCellCombineTraverseFunc | inside, | ||
gpointer | idata, | ||
FttCellTraverseFunc | outside, | ||
gpointer | odata | ||
) |
domain1 | a #GfsDomain. |
domain2 | another #GfsDomain. |
inside | function to call for each pair of cells. |
idata | user data to pass to inside. |
outside | function to call for cells falling outside of domain2 or NULL. |
odata | user data to pass to outside. |
Calls inside for each leaf cell of domain1 contained in domain2. The second cell argument to inside is set to the cell of domain2 containing the first cell argument.
If outside is not NULL it is called for each leaf cell of domain1 which is outside of domain2.
void gfs_domain_copy_bc | ( | GfsDomain * | domain, |
FttTraverseFlags | flags, | ||
gint | max_depth, | ||
GfsVariable * | v, | ||
GfsVariable * | v1 | ||
) |
domain | a #GfsDomain. |
flags | the traversal flags. |
max_depth | the maximum depth of the traversal. |
v | a #GfsVariable. |
v1 | another #GfsVariable. |
Apply the boundary conditions of variable v in domain to variable v1.
guint gfs_domain_depth | ( | GfsDomain * | domain | ) |
domain | a #GfsDomain. |
void gfs_domain_face_bc | ( | GfsDomain * | domain, |
FttComponent | c, | ||
GfsVariable * | v | ||
) |
domain | a #GfsDomain. |
c | a component. |
v | a #GfsVariable. |
Apply the boundary conditions on the faces of domain for variable v.
void gfs_domain_face_traverse | ( | GfsDomain * | domain, |
FttComponent | c, | ||
FttTraverseType | order, | ||
FttTraverseFlags | flags, | ||
gint | max_depth, | ||
FttFaceTraverseFunc | func, | ||
gpointer | data | ||
) |
domain | a #GfsDomain. |
c | only the faces orthogonal to this component will be traversed - one of FTT_X, FTT_Y, (FTT_Z), FTT_XYZ. |
order | the order in which the cells are visited - FTT_PRE_ORDER, FTT_POST_ORDER. |
flags | which types of children and faces are to be visited. |
max_depth | the maximum depth of the traversal. Cells below this depth will not be traversed. If max_depth is -1 all cells in the tree are visited. |
func | the function to call for each visited #FttCellFace. |
data | user data to pass to func. |
Traverses a domain. Calls the given function for each face of the cells of the domain.
If FTT_TRAVERSE_BOUNDARY_FACES is not set in flags, only "double-sided" faces are traversed i.e. the neighbor field of the face is never NULL.
void gfs_domain_filter | ( | GfsDomain * | domain, |
GfsVariable * | v, | ||
GfsVariable * | fv | ||
) |
domain | a #GfsDomain. |
v | a #GfsVariable. |
fv | the filtered variable or NULL. |
Apply a "corner-averaging" filter to variable v on all leaf cells of domain.
If fv is NULL, v is replaced by its filtered value.
void gfs_domain_forget_boundary | ( | GfsDomain * | domain, |
GfsBoundary * | boundary | ||
) |
domain | a #GfsDomain. |
boundary | a #GfsBoundary belonging to domain. |
Makes domain permanently ignore boundary when performing "locate()" queries.
void gfs_domain_free | ( | GfsDomain * | domain, |
guint | i | ||
) |
domain | a #GfsDomain. |
i | a memory location index previously allocated using gfs_domain_alloc(). |
Frees the memory location of domain defined by i.
GfsVariable* gfs_domain_get_or_add_variable | ( | GfsDomain * | domain, |
const gchar * | name, | ||
const gchar * | description | ||
) |
domain | a #GfsDomain. |
name | the name of the variable to add or get. |
description | the variable description or NULL. |
Adds a new variable name to domain or returns the variable of domain with the same name. In either case the description of the variable name is set to description (if it is not NULL).
void gfs_domain_homogeneous_bc | ( | GfsDomain * | domain, |
FttTraverseFlags | flags, | ||
gint | max_depth, | ||
GfsVariable * | ov, | ||
GfsVariable * | v | ||
) |
domain | a #GfsDomain. |
flags | the traversal flags. |
max_depth | the maximum depth of the traversal. |
ov | a #GfsVariable. |
v | a #GfsVariable of which ov is an homogeneous version. |
Apply the boundary conditions in domain for variable ov using the homogeneous version of the boundary condititons for v.
void gfs_domain_homogeneous_bc_stencil | ( | GfsDomain * | domain, |
FttTraverseFlags | flags, | ||
gint | max_depth, | ||
GfsVariable * | ov, | ||
GfsVariable * | v, | ||
GfsLinearProblem * | lp | ||
) |
domain | a #GfsDomain. |
flags | the traversal flags. |
max_depth | the maximum depth of the traversal. |
ov | a #GfsVariable. |
v | a #GfsVariable of which ov is an homogeneous version. |
lp | a #GfsLinearProblem in which to store the stencil. |
Gets the stencils corresponding to the homogeneous boundary conditions in domain for variable v.
FttCell* gfs_domain_locate | ( | GfsDomain * | domain, |
FttVector | target, | ||
gint | max_depth, | ||
GfsBox ** | where | ||
) |
domain | a #GfsDomain. |
target | position of the point to look for. |
max_depth | maximum depth to consider (-1 means no restriction, see below for -2). |
where | a pointer to a #GfsBox or NULL. |
Locates the cell of domain containing target. This is done efficiently in log(n) operations by using the topology of the cell trees.
If max_depth is set to -2, the finest cell containing target is returned. This cell is not necessarily a leaf-cell in contrast to the case where max_depth is set to -1.
If where is not NULL it is filled with the #GfsBox containing the cell.
void gfs_domain_match | ( | GfsDomain * | domain | ) |
domain | a #GfsDomain. |
Match the boundaries of domain.
GfsNorm gfs_domain_norm_residual | ( | GfsDomain * | domain, |
FttTraverseFlags | flags, | ||
gint | max_depth, | ||
gdouble | dt, | ||
GfsVariable * | res | ||
) |
domain | the domain to obtain the norm from. |
flags | which types of cells are to be visited. |
max_depth | maximum depth of the traversal. |
dt | the time step. |
res | the residual. |
Traverses the domain defined by domain using gfs_domain_cell_traverse() and gathers norm statistics about the volume weighted relative residual (i.e. the sum of the residual over the volume defined by each cell divided by the total volume of the cell).
GfsNorm gfs_domain_norm_variable | ( | GfsDomain * | domain, |
GfsVariable * | v, | ||
GfsFunction * | w, | ||
FttTraverseFlags | flags, | ||
gint | max_depth, | ||
gboolean(*)(FttCell *, gpointer) | condition, | ||
gpointer | cdata | ||
) |
domain | the domain to obtain norm from. |
v | a #GfsVariable. |
w | a #GfsFunction or NULL. |
flags | which types of cells are to be visited. |
max_depth | maximum depth of the traversal. |
condition | a condition or NULL. |
cdata | user data to pass to condition. |
Traverses the domain defined by domain using gfs_domain_cell_traverse() and gathers norm statistics about variable v.
The norm is weighted by the volume of each cell times the value of function w (if w is not NULL).
Only cells veryfing condition are taken into account (if condition is not NULL). See also gfs_domain_cell_traverse_condition().
GfsNorm gfs_domain_norm_velocity | ( | GfsDomain * | domain, |
FttTraverseFlags | flags, | ||
gint | max_depth | ||
) |
domain | the domain to obtain the norm from. |
flags | which types of cells are to be visited. |
max_depth | maximum depth of the traversal. |
Traverses the domain defined by domain using gfs_domain_cell_traverse() and gathers norm statistics about velocity.
GfsDomain* gfs_domain_read | ( | GtsFile * | fp | ) |
fp | a #GtsFile. |
Reads the graph nodes (#GfsBox) and edges and the corresponding boundaries (#GfsBoundaryMpi if necessary) defined in fp.
gboolean gfs_domain_remove_derived_variable | ( | GfsDomain * | domain, |
const gchar * | name | ||
) |
domain | a #GfsDomain. |
name | the name of a #GfsDerivedVariable. |
Removes derived variable name from domain.
void gfs_domain_remove_droplets | ( | GfsDomain * | domain, |
GfsVariable * | c, | ||
GfsVariable * | v, | ||
gint | min, | ||
gdouble | val | ||
) |
domain | a #GfsDomain. |
c | a #GfsVariable. |
v | a #GfsVariable. |
min | the minimum size (in cells) of the droplets. |
val | the value used to reset v. |
Resets the v variable (using val) of all the droplets (defined by the c variable) smaller than min cells if min is positive, or all the droplets but the -$min largest ones if min is negative.
void gfs_domain_remove_ponds | ( | GfsDomain * | domain, |
gint | min, | ||
FttCellCleanupFunc | cleanup, | ||
gpointer | data | ||
) |
domain | a #GfsDomain. |
min | the minimum size (in cells) of the ponds. |
cleanup | a #FttCellCleanupFunc or NULL. |
data | user data to pass to cleanup. |
Removes all the fluid "ponds" of domain smaller than min cells if min is positive, or all the ponds but the -min largest ones if min is negative.
If the domain is modified its boundaries are re"matched" using gfs_domain_match().
void gfs_domain_remove_specks | ( | GfsDomain * | domain | ) |
domain | a #GfsDomain. |
Removes all the solid "specks" of domain. Solid specks are islands which do not contain any empty cell.
Note that the domain's boundaries are not "matched" automatically.
guint gfs_domain_size | ( | GfsDomain * | domain, |
FttTraverseFlags | flags, | ||
gint | max_depth | ||
) |
domain | a #GfsDomain. |
flags | which types of cells are to be visited. |
max_depth | maximum depth of the traversal. |
void gfs_domain_solid_force | ( | GfsDomain * | domain, |
FttVector * | pf, | ||
FttVector * | vf, | ||
FttVector * | pm, | ||
FttVector * | vm, | ||
GfsFunction * | weight | ||
) |
domain | a #GfsDomain. |
pf | a #FttVector. |
vf | a #FttVector. |
pm | a #FttVector. |
vm | a #FttVector. |
weight | an optional weight. |
Fills pf and vf (resp. pm and vm) with the components of the net pressure and viscous forces (resp. pressure and viscous moments) applied by the fluid on the solid surface embedded in domain.
The reference point for the moments is the origin of the coordinate system.
void gfs_domain_split | ( | GfsDomain * | domain, |
gboolean | one_box_per_pe | ||
) |
domain | a #GfsDomain. |
one_box_per_pe | if TRUE each new box created is assigned to a different process, otherwise the newly created box inherits the pid of its parent. |
Splits each box of domain into its (4 in 2D, 8 in 3D) children. The corresponding newly created boxes are added to the graph and the parent boxes are destroyed.
void gfs_domain_stats_balance | ( | GfsDomain * | domain, |
GtsRange * | size, | ||
GtsRange * | boundary, | ||
GtsRange * | mpiwait | ||
) |
domain | the domain to obtain statistics from. |
size | #GtsRange in which to return stats for the total size of the domain. |
boundary | #GtsRange in which to return stats for the size of the parallel boundaries of the domain. |
mpiwait | #GtsRange in which to return stats for the average time spend waiting for MPI calls in each PE. |
Gathers statistics about the sizes of the domains, their parallel boundaries and the execution time on each PE.
void gfs_domain_stats_merged | ( | GfsDomain * | domain, |
GtsRange * | solid, | ||
GtsRange * | number | ||
) |
domain | the domain to obtain statistics from. |
solid | #GtsRange in which to return stats for the total solid volume fraction of merged cells. |
number | #GtsRange in which to return stats for the number of cells used per merged cell. |
Traverses the domain defined by domain using gfs_domain_traverse_merged() and gathers statistics about the total solid volume fraction of merged cells and the number of cells used per merged cell.
GtsRange gfs_domain_stats_solid | ( | GfsDomain * | domain | ) |
domain | the domain to obtain statistics from. |
Traverses the domain defined by domain using gfs_domain_traverse_mixed() and gathers statistics about the solid volume fraction in mixed cells.
GtsRange gfs_domain_stats_variable | ( | GfsDomain * | domain, |
GfsVariable * | v, | ||
FttTraverseFlags | flags, | ||
gint | max_depth, | ||
gboolean(*)(FttCell *, gpointer) | condition, | ||
gpointer | cdata | ||
) |
domain | the domain to obtain statistics from. |
v | a #GfsVariable. |
flags | which types of cells are to be visited. |
max_depth | maximum depth of the traversal. |
condition | a condition or NULL. |
cdata | user data to pass to condition. |
Traverses the domain defined by domain using gfs_domain_cell_traverse() and gathers statistics about variable v.
Only cells veryfing condition are taken into account (if condition is not NULL). See also gfs_domain_cell_traverse_condition().
void gfs_domain_sum | ( | GfsDomain * | domain, |
FttDirection | d, | ||
GfsFunction * | f, | ||
GfsVariable * | v | ||
) |
domain | a #GfsDomain. |
d | the #FttDirection. |
f | a #GfsFunction. |
v | a #GfsVariable. |
Fills variable v of each cell of domain with the sum in direction d of the volume-weighted function f.
void gfs_domain_surface_bc | ( | GfsDomain * | domain, |
GfsVariable * | v | ||
) |
domain | a #GfsDomain. |
v | a #GfsVariable. |
Apply boundary conditions for variable v on embedded surfaces.
guint gfs_domain_tag_droplets | ( | GfsDomain * | domain, |
GfsVariable * | c, | ||
GfsVariable * | tag | ||
) |
domain | a #GfsDomain. |
c | the volume fraction. |
tag | a #GfsVariable. |
Fills the tag variable of the cells of domain with the (strictly positive) index of the droplet they belong to. The cells belonging to the background phase have an index of zero.
Note that the volume fraction c must be defined on all levels.
void gfs_domain_timer_start | ( | GfsDomain * | domain, |
const gchar * | name | ||
) |
domain | a #GfsDomain. |
name | the name of the timer. |
Starts timer name of domain. If name does not exist it is created first.
void gfs_domain_timer_stop | ( | GfsDomain * | domain, |
const gchar * | name | ||
) |
domain | a #GfsDomain. |
name | the name of the timer. |
Stops timer name of domain. This function fails if name is not a timer of domain.
void gfs_domain_traverse_cut | ( | GfsDomain * | domain, |
GfsGenericSurface * | s, | ||
FttTraverseType | order, | ||
FttTraverseFlags | flags, | ||
FttCellTraverseCutFunc | func, | ||
gpointer | data | ||
) |
domain | a #GfsDomain. |
s | a #GfsGenericSurface. |
order | the order in which the cells are visited - FTT_PRE_ORDER, FTT_POST_ORDER. |
flags | which types of children are to be visited. |
func | the function to call for each visited #FttCell. |
data | user data to pass to func. |
Calls func for each cell of domain cut by s.
void gfs_domain_traverse_cut_2D | ( | GfsDomain * | domain, |
GfsGenericSurface * | s, | ||
FttTraverseType | order, | ||
FttTraverseFlags | flags, | ||
FttCellTraverseCutFunc | func, | ||
gpointer | data | ||
) |
domain | a #GfsDomain. |
s | a #GfsGenericSurface. |
order | the order in which the cells are visited - FTT_PRE_ORDER, FTT_POST_ORDER. |
flags | which types of children are to be visited. |
func | the function to call for each visited #FttCell. |
data | user data to pass to func. |
Calls func for each cell of domain cut by s.
The cells are flattened in the z-direction.
void gfs_domain_traverse_layers | ( | GfsDomain * | domain, |
FttCellTraverseFunc | func, | ||
gpointer | data | ||
) |
domain | a #GfsDomain. |
func | the function to call for each visited #FttCell. |
data | user data to pass to func. |
Traverses the leaf cells of domain for each layer. Calls the given function for each cell visited.
By default it is identical to gfs_domain_traverse_leaves() but can be overloaded for specific (layered) domains.
void gfs_domain_traverse_mixed | ( | GfsDomain * | domain, |
FttTraverseType | order, | ||
FttTraverseFlags | flags, | ||
FttCellTraverseFunc | func, | ||
gpointer | data | ||
) |
domain | a #GfsDomain. |
order | the order in which the cells are visited - FTT_PRE_ORDER, FTT_POST_ORDER. |
flags | which types of children are to be visited. |
func | the function to call for each visited #FttCell. |
data | user data to pass to func. |
Calls func for each mixed cell of domain.
GfsVariable** gfs_domain_velocity | ( | GfsDomain * | domain | ) |
domain | a #GfsDomain. |
GtsObject* gfs_object_from_name | ( | GfsDomain * | domain, |
const gchar * | name | ||
) |
domain | a #GfsDomain. |
name | the name. |
GSList* gfs_receive_boxes | ( | GfsDomain * | domain, |
int | src | ||
) |
domain | a #GfsDomain. |
src | the source processor id. |
Receive boxes from src and adds them to domain.
GSList* gfs_receive_objects | ( | GfsDomain * | domain, |
int | src | ||
) |
domain | a #GfsDomain. |
src | the rank of the source PE. |
Receives a list of #GtsObject from PE src of a parallel simulation.
GfsRequest* gfs_send_boxes | ( | GfsDomain * | domain, |
GSList * | boxes, | ||
int | dest | ||
) |
domain | a #GfsDomain. |
boxes | a list of #GfsBox belonging to domain. |
dest | the destination processor id. |
Send boxes to dest and removes them from domain. This is a non-blocking operation.
GfsRequest* gfs_send_objects | ( | GSList * | list, |
int | dest | ||
) |
list | a list of #GtsObject. |
dest | the rank of the destination PE. |
Sends the objects in list to PE dest of a parallel simulation. This is a non-blocking operation which returns a handler which must be cleared by calling gfs_wait().
Note that this functions assumes that the write() method of the #GtsObject sent begins by writing the object class name.
void gfs_traverse_and_bc | ( | GfsDomain * | domain, |
FttTraverseType | order, | ||
FttTraverseFlags | flags, | ||
gint | max_depth, | ||
FttCellTraverseFunc | func, | ||
gpointer | data, | ||
GfsVariable * | v, | ||
GfsVariable * | v1 | ||
) |
domain | a #GfsDomain. |
order | the order in which the cells are visited - FTT_PRE_ORDER, FTT_POST_ORDER. |
flags | which types of children are to be visited. |
max_depth | the maximum depth of the traversal. Cells below this depth will not be traversed. If max_depth is -1 all cells in the tree are visited. |
func | the function to call for each visited #FttCell. |
data | user data to pass to func. |
v | a #GfsVariable. |
v1 | another #GfsVariable. |
gfs_domain_cell_traverse (domain, order, flags, max_depth, func, data); gfs_domain_copy_bc (domain, flags, max_depth, v, v1);
For parallel runs, the communications needed to apply the boundary conditions are overlapped with the calls to func in the bulk of the domain.
void gfs_traverse_and_homogeneous_bc | ( | GfsDomain * | domain, |
FttTraverseType | order, | ||
FttTraverseFlags | flags, | ||
gint | max_depth, | ||
FttCellTraverseFunc | func, | ||
gpointer | data, | ||
GfsVariable * | ov, | ||
GfsVariable * | v | ||
) |
domain | a #GfsDomain. |
order | the order in which the cells are visited - FTT_PRE_ORDER, FTT_POST_ORDER. |
flags | which types of children are to be visited. |
max_depth | the maximum depth of the traversal. Cells below this depth will not be traversed. If max_depth is -1 all cells in the tree are visited. |
func | the function to call for each visited #FttCell. |
data | user data to pass to func. |
ov | a #GfsVariable. |
v | a #GfsVariable of which ov is an homogeneous version. |
gfs_domain_cell_traverse (domain, order, flags, max_depth, func, data); gfs_domain_homogeneous_bc (domain, flags, max_depth, ov, v);
For parallel runs, the communications needed to apply the boundary conditions are overlapped with the calls to func in the bulk of the domain.
void gfs_wait | ( | GfsRequest * | r | ) |
r | a #GfsRequest. |
Waits for completion of and deallocates r.