| Gerris Flow Solver Reference Manual |
|---|
#include <gfs.h> #define FTT_CELLS #define FTT_CELL_ID (c) #define FTT_OPPOSITE_DIRECTION (d) #define FTT_ORTHOGONAL_COMPONENT (c)void ftt_cell_children (const FttCell *cell, FttCellChildren *children); FttCellChildren; enum FttDirection; enum FttComponent;guint ftt_cell_children_direction (const FttCell *cell, FttDirection d, FttCellChildren *children); FttCell* ftt_cell_child_corner (const FttCell *cell,FttDirectiond [FTT_DIMENSION]);void ftt_cell_neighbors (const FttCell *cell, FttCellNeighbors *neighbors);void ftt_cell_neighbors_not_cached (const FttCell *cell, FttCellNeighbors *neighbors); FttCellNeighbors; FttCell* ftt_cell_neighbor (const FttCell *cell, FttDirection d); FttCell* ftt_cell_neighbor_not_cached (const FttCell *cell, FttDirection d);void ftt_cell_set_neighbor (FttCell *root, FttCell *neighbor, FttDirection d, FttCellInitFunc init,gpointer init_data);void ftt_cell_set_neighbor_match (FttCell *root, FttCell *neighbor, FttDirection d, FttCellInitFunc init,gpointer init_data);gboolean ftt_cell_neighbor_is_brother (FttCell *cell, FttDirection d);
#define FTT_CELLS
Evaluates to the maximum number of children of a FttCell (4 in 2D, 8 in 3D).
#define FTT_CELL_ID(c) ((c)->flags & FTT_FLAG_ID)
Evaluates to the child index of c.
c : | a FttCell. |
void ftt_cell_children (const FttCell *cell, FttCellChildren *children);
Fills children with the children of cell.
This function fails if cell is a leaf.
cell : | a FttCell. |
children : |
typedef enum
{
FTT_RIGHT = 0,
FTT_LEFT,
FTT_TOP,
FTT_BOTTOM,
#if (!FTT_2D)
FTT_FRONT,
FTT_BACK,
#endif /* FTT_3D || FTT_2D3 */
FTT_NEIGHBORS
} FttDirection;typedef enum
{
FTT_X = 0,
FTT_Y,
#if (!FTT_2D)
FTT_Z,
#endif /* FTT_3D || FTT_2D3 */
FTT_DIMENSION,
FTT_XY,
#if FTT_2D
FTT_XYZ = FTT_XY
#else /* FTT_3D || FTT_2D3 */
FTT_XYZ
#endif /* FTT_3D || FTT_2D3 */
} FttComponent;guint ftt_cell_children_direction (const FttCell *cell, FttDirection d, FttCellChildren *children);
Fills children with the children (2 in 2D, 4 in 3D, 2 or 4 in 2D3)
of cell in direction d.
This function fails if cell is a leaf.
cell : | a FttCell. |
d : | a direction. |
children : | |
| Returns : | the number of children in direction |
FttCell* ftt_cell_child_corner (const FttCell *cell,FttDirectiond [FTT_DIMENSION]);
This function fails if cell is a leaf.
cell : | a FttCell. |
Param2 : | |
| Returns : | the children of |
void ftt_cell_neighbors (const FttCell *cell, FttCellNeighbors *neighbors);
Fills neighbors with the neighbors of cell.
cell : | a FttCell. |
neighbors : |
void ftt_cell_neighbors_not_cached (const FttCell *cell, FttCellNeighbors *neighbors);
Fills neighbors with the neighbors of cell (does not use saved
values even if available).
cell : | a FttCell. |
neighbors : |
typedef struct {
/* right, left, top, bottom, front, back */
FttCell * c[FTT_NEIGHBORS];
} FttCellNeighbors;FttCell* ftt_cell_neighbor (const FttCell *cell, FttDirection d);
cell : | a FttCell. |
d : | a direction. |
| Returns : | the neighbor of |
FttCell* ftt_cell_neighbor_not_cached (const FttCell *cell, FttDirection d);
cell : | a FttCell. |
d : | a direction. |
| Returns : | the neighbor of |
void ftt_cell_set_neighbor (FttCell *root, FttCell *neighbor, FttDirection d, FttCellInitFunc init,gpointer init_data);
Sets the cell tree defined by neighbor as the neighbor in
direction d of the cell tree defined by root.
Any new cell created during the process is initialized using the
user-defined function init.
Both root and neighbor must be the roots of their respective cell
trees.
root : | a FttCell, root of a cell tree. |
neighbor : | a FttCell, root of a cell tree. |
d : | a direction. |
init : | a FttCellInitFunc or NULL. |
init_data : | user data to pass to |
void ftt_cell_set_neighbor_match (FttCell *root, FttCell *neighbor, FttDirection d, FttCellInitFunc init,gpointer init_data);
Sets the cell tree defined by neighbor as the neighbor in
direction d of the cell tree defined by root.
The boundary between both trees is matched i.e. the type of the
face between any pair of cells belonging to each tree is always
FTT_FINE_FINE. Any new cell created during the process is
initialized using the user-defined function init.
Both root and neighbor must be the roots of their respective cell
trees.
root : | a FttCell, root of a cell tree. |
neighbor : | a FttCell, root of a cell tree. |
d : | a direction. |
init : | a FttCellInitFunc or NULL. |
init_data : | user data to pass to |
gboolean ftt_cell_neighbor_is_brother (FttCell *cell, FttDirection d);
cell : | a FttCell. |
d : | a FttDirection. |
| Returns : | TRUE if a (potential) neighbor of |
| <<< Basic structure and properties | Cell faces operations >>> |