# Values, macros and structures in Gerris

### From Gerris

Revision as of 13:50, 15 May 2012Blagree (Talk | contribs) ← Previous diff |
Revision as of 14:09, 15 May 2012Blagree (Talk | contribs) Next diff → |
||

Line 25: |
Line 25: | ||

</source> | </source> | ||

- | The vertices of the cube are stored in the GtsPoint array and the edges in the [[GfsSegment]] array. | + | The vertices of the cube are stored in the GtsPoint array and the edges in the [[#GfsSegment|GfsSegment]] array. |

=== CellFace === | === CellFace === | ||

Line 36: |
Line 36: | ||

</source> | </source> | ||

- | The vertices of the face are stored in the GtsPoint array and the edges in the [[GfsSegment]] array. | + | The vertices of the face are stored in the GtsPoint array and the edges in the [[#GfsSegment|GfsSegment]] array. |

=== CompatPar === | === CompatPar === | ||

Line 47: |
Line 47: | ||

</source> | </source> | ||

- | The homogeneous version of the considered [[GfsVariable]] is stored in lhs. | + | The homogeneous version of the considered [[#GfsVariable|GfsVariable]] is stored in lhs. |

=== DiffusionCoeff === | === DiffusionCoeff === | ||

Line 62: |
Line 62: | ||

</source> | </source> | ||

- | d is a [[GfsSourceDiffusion]], dt is the timestep, the [[GfsVariable]] rhoc is the mass, metric is the implicit metric term, the [[GfsFunction]] alpha is the inverse of the density and domain is the considered [[GfsDomain]]. | + | d is a [[#GfsSourceDiffusion|GfsSourceDiffusion]], dt is the timestep, the [[#GfsVariable|GfsVariable]] rhoc is the mass, metric is the implicit metric term, the [[#GfsFunction|GfsFunction]] alpha is the inverse of the density and domain is the considered [[#GfsDomain|GfsDomain]]. |

=== FttCell === | === FttCell === | ||

Line 77: |
Line 77: | ||

</source> | </source> | ||

- | children and parent are the two [[The Fully Threaded Tree|_FttOct]] associated with the FttCell. | + | children and parent are the two [[The Fully Threaded Tree/Basic Concepts|FttOct]] associated with the FttCell. |

=== FttCellChildren === | === FttCellChildren === | ||

Line 88: |
Line 88: | ||

The children of the considered [[#FttCell|FttCell]] are stored in c (4 in 2D and 8 in 3D). | The children of the considered [[#FttCell|FttCell]] are stored in c (4 in 2D and 8 in 3D). | ||

+ | |||

+ | === FttCellFace === | ||

+ | |||

+ | See [[The Fully Threaded Tree/Basic Concepts/FttDirection|FttDirection]]. | ||

+ | |||

+ | === FttCellFlags === | ||

+ | |||

+ | <source lang="c"> | ||

+ | typedef enum { | ||

+ | FTT_FLAG_ID = 7, | ||

+ | FTT_FLAG_DESTROYED = 1 << 3, | ||

+ | FTT_FLAG_LEAF = 1 << 4, /* used only for I/O operations */ | ||

+ | FTT_FLAG_TRAVERSED = FTT_FLAG_LEAF, /* used for face traversal */ | ||

+ | FTT_FLAG_USER = 5 /* user flags start here */ | ||

+ | } | ||

+ | </source> |

## Revision as of 14:09, 15 May 2012

## Contents |

## Values defined in Gerris

N_CELLS = FTT_CELLS = <math>2^{dimension}</math>

FTT_NEIGHBORS_2D = (FTT_BOTTOM) + 1

GFS_STATUS_UNDEFINED = 0

GFS_STATUS_SOLID = 1

GFS_STATUS_FLUID = 2

## Gerris Macros

## Gerris structures

### CellCube

typedef struct {

GtsPoint p[8];

GfsSegment s[12];

}

The vertices of the cube are stored in the GtsPoint array and the edges in the GfsSegment array.

### CellFace

typedef struct {

GtsPoint p[4];

GfsSegment s[4];

}

The vertices of the face are stored in the GtsPoint array and the edges in the GfsSegment array.

### CompatPar

typedef struct {

GfsVariable * lhs;

gboolean dirichlet;

}

The homogeneous version of the considered GfsVariable is stored in lhs.

### DiffusionCoeff

typedef struct {

GfsSourceDiffusion * d;

gdouble lambda2[FTT_DIMENSION];

gdouble dt;

GfsVariable * rhoc, * metric;

GfsFunction * alpha;

GfsDomain * domain;

}

d is a GfsSourceDiffusion, dt is the timestep, the GfsVariable rhoc is the mass, metric is the implicit metric term, the GfsFunction alpha is the inverse of the density and domain is the considered GfsDomain.

### FttCell

struct {

/*<public>*/

guint flags;

gpointer data;

/*<private>*/

struct _FttOct * parent, * children;

}

children and parent are the two FttOct associated with the FttCell.

### FttCellChildren

struct {

FttCell * c[FTT_CELLS];

};

The children of the considered FttCell are stored in c (4 in 2D and 8 in 3D).

### FttCellFace

See FttDirection.

### FttCellFlags

typedef enum {

FTT_FLAG_ID = 7,

FTT_FLAG_DESTROYED = 1 << 3,

FTT_FLAG_LEAF = 1 << 4, /* used only for I/O operations */

FTT_FLAG_TRAVERSED = FTT_FLAG_LEAF, /* used for face traversal */

FTT_FLAG_USER = 5 /* user flags start here */

}