Basilisk source code (http://basilisk.fr/src/)

root / src / run.h.page

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/**
# Generic time loop

The `run()` function below implements a generic time loop which
executes events until termination.

The timestep `dt` can be accessed as a global variable. */

double dt = 1.;

#include "utils.h"

trace
void run (void)
{
  iter = 0, t = 0., dt = 1.;
  init_grid (N);

  perf.nc = perf.tnc = 0;
  perf.gt = timer_start();
  while (events (true)) {

    /**
    We store the total number of cells advanced in time for computing
    speed statistics. */

    update_perf();
    iter = inext, t = tnext;
  }

  /**
  Time/speed statistics are written out on standard output. */

  timer_print (perf.gt, iter, perf.tnc);

  free_grid();
}