Next: 2.3 Controlling the simulation
Up: 2 A simple simulation
Previous: 2.1 A few comments
Contents
Ok, so what are all these ``objects'' for? The first line of the
simulation file defines a graph representing the general layout
of the simulation domain and follows this syntax:
- 1st field
- number of nodes in the graph (1)
- 2nd field
- number of edges connecting the nodes (2)
- 3rd field
- object type for the graph (GfsSimulation)
- 4th field
- default object type for the nodes (GfsBox)
- 5th field
- object type for the edges (GfsGEdge)
- 6th field
- 1st optional parameters (braced block)
- 7th field
- 2nd optional parameters (braced block)
We then jump to the end of the 2nd optional parameters to line
GfsBox {}
which describes the first (and unique in this case) node of the
graph. The first field is the object type of the node (GfsBox),
the second field contains optional parameters.
The following two lines
1 1 right
1 1 top
define the edges of the graph as follows:
- 1st field
- index of the starting node (1)
- 2nd field
- index of the ending node (1)
- 3rd field
- spatial direction in which the two nodes are
connected (right and top)
The nodes are always indexed starting from one. The spatial directions
are defined on figure 1.
From this, we see that this file defines a simulation domain
containing one node (a GfsBox) connected with itself in both the
horizontal (right) and vertical (top) directions.
Figure 1:
Definition of spatial directions
|
By default, a GfsBox is a square (in 2D) or a cube (in 3D) of
size unity. The first node of the graph is always centered on the
origin and is used as the reference to position the other nodes. We
have consequently defined a square simulation domain of size unity,
centered on the origin and using periodic boundary conditions.
Next: 2.3 Controlling the simulation
Up: 2 A simple simulation
Previous: 2.1 A few comments
Contents