GfsDefine
From Gerris
Define is used to define text macros in parameter files, similar to the macros of the C preprocessor.
Examples of valid macros are:
Define PI 3.14159265359
Define SQUARE(x) (x*x)
Define REYNOLDS(U,L,nu) (U*L/nu)
Note that Define macros are more general than the C macros which can be defined using GfsGlobal. They apply to the parameter file as a whole rather than just to the GfsFunctions. For example, this parameter file:
...
Define LEVEL 7
...
Refine LEVEL
...
OutputSimulation { start = end } sim-LEVEL.gfs
...
will result in Gerris generating a simulation file called sim-7.gfs.
Note that macro support needs to be turned on explicitly (using the -m or -D options when starting gerris).
Examples
- Lunar tides in Cook Strait, New Zealand
- Viscous flow past a sphere
- Circular droplet in equilibrium
- Axisymmetric spherical droplet in equilibrium
- Shape oscillation of an inviscid droplet
Define M2F (2.*M_PI/44700.)
Define M2(t) (A_amp*cos (M2F*t)+B_amp*sin (M2F*t))
Define A0 0.5
Define U0 1.
Define CIRCLE (ellipse (-0.5,0.5,0.4,0.4))
Define MU sqrt(0.8/LAPLACE)
Define CIRCLE (ellipse (-0.5,0.,0.4,0.4))
Define MU sqrt(0.8/LAPLACE)
Define DIAMETER 0.2
Define EPSILON 0.05
Define VAR(T,min,max) (min + CLAMP(T,0,1)*(max - min))
Define RHO(T) VAR(T, 1., 1e-3)
Define RADIUS(x,y) (DIAMETER/2.*(1. + EPSILON*cos (2.*atan2 (y, x))))

