Cell faces operations

Name

Cell faces operations -- 

Synopsis


#include <gfs.h>

#define             FTT_FACE_DIRECT                     (f)
#define             FTT_FACE_REVERSE                    (dst, src)

                    FttCellFace;

FttCellFace         ftt_cell_face                       (FttCell *cell);
FttFaceType         ftt_face_type                       ();
enum                FttFaceType;
void                ftt_face_pos                        (const FttCellFace *face,
                                                         FttVector *pos);
void                ftt_face_traverse                   (FttCell *root,
                                                         FttComponent c,
                                                         FttTraverseType order,
                                                         FttTraverseFlags flags,
                                                         gint max_depth,
                                                         FttFaceTraverseFunc func,
                                                         gpointer data);
void                (*FttFaceTraverseFunc)              (FttCellFace *face,
                                                         gpointer data);
void                ftt_face_traverse_boundary          (FttCell *root,
                                                         FttDirection d,
                                                         FttTraverseType order,
                                                         FttTraverseFlags flags,
                                                         gint max_depth,
                                                         FttFaceTraverseFunc func,
                                                         gpointer data);
void                ftt_face_draw                       (const FttCellFace *face,
                                                         FILE *fp);

Description

Details

FTT_FACE_DIRECT()

#define  FTT_FACE_DIRECT(f)       ((f)->d % 2 == 0)

f :


FTT_FACE_REVERSE()

#define             FTT_FACE_REVERSE(dst, src)

dst :

src :


FttCellFace

typedef struct {
  FttCell * cell, * neighbor;
  FttDirection d;
} FttCellFace;


ftt_cell_face ()

FttCellFace         ftt_cell_face                       (FttCell *cell);

cell :

a FttCell.

Returns :

the face of cell in direction d.


ftt_face_type ()

FttFaceType         ftt_face_type                       ();

Returns :

the type of face.


enum FttFaceType

typedef enum {
  FTT_BOUNDARY,
  FTT_FINE_FINE,
  FTT_FINE_COARSE
} FttFaceType;


ftt_face_pos ()

void                ftt_face_pos                        (const FttCellFace *face,
                                                         FttVector *pos);

Fills pos with the coordinates of the center of face.

face :

a FttCellFace.

pos :

a FttVector.


ftt_face_traverse ()

void                ftt_face_traverse                   (FttCell *root,
                                                         FttComponent c,
                                                         FttTraverseType order,
                                                         FttTraverseFlags flags,
                                                         gint max_depth,
                                                         FttFaceTraverseFunc func,
                                                         gpointer data);

Traverses a cell tree starting at the given root FttCell. Calls the given function for each face of the cells of the tree.

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.

root :

the root FttCell of the tree to traverse.

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.


FttFaceTraverseFunc ()

void                (*FttFaceTraverseFunc)              (FttCellFace *face,
                                                         gpointer data);

face :

data :


ftt_face_traverse_boundary ()

void                ftt_face_traverse_boundary          (FttCell *root,
                                                         FttDirection d,
                                                         FttTraverseType order,
                                                         FttTraverseFlags flags,
                                                         gint max_depth,
                                                         FttFaceTraverseFunc func,
                                                         gpointer data);

Traverses a cell tree starting at the given root FttCell. Calls the given function for each face of the cell tree forming the boundary of the domain in direction d.

root :

the root FttCell of the tree to traverse.

d :

the direction of the boundary to visit.

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 FttCellFace.

data :

user data to pass to func.


ftt_face_draw ()

void                ftt_face_draw                       (const FttCellFace *face,
                                                         FILE *fp);

Outputs in fp an OOGL (geomview) representation of face.

face :

a FttCellFace.

fp :

a file pointer.