# Object hierarchy

(Difference between revisions)
 Revision as of 21:21, 13 June 2012Popinet (Talk | contribs) (→Variables - Added GfsVariableLaplacian)← Previous diff Revision as of 21:23, 13 June 2012Popinet (Talk | contribs) (→Variables)Next diff → Line 58: Line 58: **** '''[[GfsVariablePoisson]]''' — Maintaining a scalar field solution of a Poisson equation **** '''[[GfsVariablePoisson]]''' — Maintaining a scalar field solution of a Poisson equation **** '''[[GfsVariableAverage]]''' **** '''[[GfsVariableAverage]]''' - **** '''[[GfsVariableLaplacian]]''' + **** '''[[GfsVariableLaplacian]]''' — Laplacian of a function *** '''[[GfsVariableCurvature]]''' — Curvature of an interface *** '''[[GfsVariableCurvature]]''' — Curvature of an interface **** '''[[GfsVariablePosition]]''' — Coordinates of a VOF interface **** '''[[GfsVariablePosition]]''' — Coordinates of a VOF interface

## Introduction

This page describes all the objects which can be used in Gerris parameter files. The syntax of each object is given using a simple convention which expresses "inheritance" from the parent object. This is more simply explained using an example e.g. GfsOutputScalarSum. The syntax of this object is described as

```[ GfsOutputScalar ]
```

which means that this object is a descendant of GfsOutputScalar. Following the link gives the syntax of GfsOutputScalar as

```[ GfsOutput ] {
v = [ GfsFunction ]
maxlevel = 6
min = -12.1
max = 1e3
box = -0.1,-0.1,0.1,0.1
}
```

which in turns means that this object is a descendant of GfsOutput but also takes the additional arguments described. Similarly GfsOutput is a descendent of GfsEvent and finally GfsEvent is a "root object class" which has no parent. Putting it all together, an example of use of GfsOutputScalarSum is

```GfsOutputScalarSum { istep = 1 } sum { v = U }
```

where the red text is "inherited" from the GfsEvent great-grandparent, the blue text from the GfsOutput grandparent and the green text from the GfsOutputScalar parent.

## Common objects

Note that the way the following list is indented reflects the inheritance hierarchy of each object.

### Solid boundaries

• GfsSurfaceBc — Boundary conditions for diffusion and Poisson equations

### Boundary conditions

• GfsBc — Base class for boundary conditions on individual variables

## Modules

### Map

The Map module defines the objects used to perform cartographic projections within Gerris. As all modules, it is optional and depends on the availability of the PROJ.4 cartographic projections library on your system. The module is initialised in parameter files using

```GModule map
```

and defines the GfsMapProjection object with the following inheritance hierarchy

### Terrain

The Terrain module contains a set of objects which can be used to define solid boundaries using large Digital Terrain Model (DTM) databases. The databases are only limited in size by the amount of disk space available and include an Kd-tree spatial index for efficient retrieval of subsets of the original data. The module is initialised in parameter files using

```GModule terrain
```

and defines the GfsRefineTerrain, GfsTerrain and GfsVariableTerrain objects with the following inheritance hierarchy

Real terrains are often defined in a geographic coordinate system (e.g. longitude, latitude and height) and in practice this module is often combined with the Map module.

The terrain databases used by GfsRefineTerrain and GfsVariableTerrain need to be created in a pre-processing step using the xyz2kdt command-line utility.

### Wavewatch

The Wavewatch module can be used only in GfsWave simulations. When this module is included, the GfsWave simulation will call the source terms routines (wind, wave breaking etc...) of the WaveWatch III spectral wave model. The module is initialised in parameter files using

```GModule wavewatch
```

The wind field is defined by the `U10` and `V10` variables: the coordinates of the local wind vector (in m/sec and at a reference height of 10 m).

If the `AS` field is defined an "atmospheric stability correction" is applied to the wind field (see Section 2.3.5 of WaveWatch manual version 3.12). The `AS` field must be initialised with the air/sea temperature difference in degree Celsius.

Note that due to the license of recent versions of WaveWatch III, the wavewatch module is not provided in pre-compiled binaries of Gerris. It needs to be installed from source first.

The Okada module defines objects computing displacement solutions for the Okada fault model. The module is initialised in parameter files using

```GModule okada
```

and defines the GfsInitOkada object with the following inheritance hierarchy

• GfsInit
• GfsInitOkada — Initialises a field with the vertical displacement of an Okada fault model

### DF3

The DF3 module allows to create a POV-Ray DF3 file mapping values of a variable from a simulation to a cube. Such output can be used to visualize a variable in 3D using POV-Ray. The module is initialised in parameter files using

```GModule df3
```

and defines the GfsOutputPovrayDF3 object with the following inheritance hierarchy.

### Particulates

This is an attempt at documenting the particulates module. I think I understand how it works, that might help you to get started. Please complete that section if you can.

The aim of the particulate module is to allow to have Lagrangian particles in a Gerris simulation. Contrarily to GfsOutputParticle which only allows to simulate inert particles, a GfsParticulate can have physical properties such as a mass and a volume. Initial forces and velocity can also be specified. The syntax for the use of the particulate module is completely different to the one of GfsOutputParticle and is mainly detailed in GfsParticleList.

The module is initialised in parameter files using

```GModule particulates
```

and allows to create lists of Lagrangian particles using the keyword GfsParticleList. Each list contains GfsParticle (inert) or GfsParticulates which are advected by the velocity field and can experience various types of forces (GfsForceLift, GfsForceDrag, GfsForceBuoy).\

The module defines the following objects (in bold):

#### Bubbles

The module is initialised in parameter files using

```GModule particulates
GModule bubbles
```

The module defines the following objects (in bold):

### Ode

The Open Dynamics Engine module.

### Hypre

This module uses the Hypre library (the algebraic multigrid (AMG) solver in particular) instead of Gerris' native multigrid solver to solve Poisson equations. The module is initialised in parameter files using

```GModule hypre
```

This will use default settings which can be changed using an optional parameter block.

### Electrohydro

This module can be used to solve 2D/3D electrohydrodynamics problems. The module is initialised in parameter files using

```GModule electrohydro
```

The module defines the following objects:

J. M. Lopez-Herrera, S. Popinet, M. A. Herrada - A charge-conservative approach for simulating electrohydrodynamic two-phase flows using Volume-Of-Fluid

Journal of Computational Physics 230:1939-1955, 2010
Bibtex

### Skewsymmetric

This module can be used to solve 2D/3D problems using the skew-symmetric formulation proposed by Verstappen (JCP, 2007). The module is initialised in parameter files using

```GModule skewsymmetric
```

The module defines the following object:

### FFT

This module computes FFTs of given variables

```GModule fft
```

The module defines the following object:

### GfsView

This module can be used to create GfsView visualisations from within Gerris. This eliminates the need to couple Gerris with GfsView through pipes and more importantly this means that the simulation does not need to be copied from Gerris into GfsView, thus saving CPU and memory. This can also be used to efficiently create visualisations of large-scale parallel computations: the visualisation itself is created in parallel for individual subdomains. The module is initialised in parameter files using

```GModule gfsview
```

The module defines the following objects:

### Topics

This module implements initial conditions for the simulation of landslide generated tsunamis. It is a directly inspired from the software TOPICS developped by Dr. P. Watts. The sources are that used in the version 1.2 of TOPICS, last modified in August 2009 by Dr. P. Watts and published under the GPL license.

```GModule topics
```

The module defines the following objects:

• GfsOutput
• GfsOutputInterfaceGrid — Outputs function that can be used to transport the characteristics of an interface generated in GfsSimulation 3D to GfsRiver.

## Command-line programs

• gerris — The Gerris flow solver simulation engine
• gfsview-batch — Command-line description of GfsView (in batch and interactive mode)