Afivo
0.3
|
In Afivo, the computational domain is defined by the coarse grid.
First a user has to call m_a2_core::a2_init()
, for example as shown below.
The coarse boxes on this quadtree contain \(4 \times 4\) cells, and these cells have spacing of dr = 1.0
.
The user can now choose how many boxes to add to the computational domain. For each box, a spatial index has to be given, which will determine where the box is located. The lowest index a box can have is [1, 1]. A box with index [2, 1] lies to the right (+x direction) of the box at [1, 1], etc. One could for example do the following:
The coordinates of these boxes would then be
box | x,y min | x,y max |
---|---|---|
1 | 0, 0 | 4, 4 |
2 | 4, 0 | 8, 4 |
To specify two boxes that touch in the y-direction, one would similarly do:
Now the user can call m_a2_core::a2_set_base
to create the computational domain:
call a2_set_base(tree, n_boxes, ix_list)
Afivo will automatically resolve the connectivity between neighbors. This routine accepts an optional argument with the connectivity, which can for example be used to specify periodic boundary conditions. An example is shown below:
By specifying the default value af_no_box
, Afivo will automatically handle the internal connectivity between the boxes. Note also that the periodic boundary only needs to be specified from one side, the other sides are handled automatically.