sandbox/Antoonvh/profile5cusage.c
An example usage of profile function 5b.
#include "grid/octree.h" // Octree is 3D
//#include "grid/quadtree.h //<- Using a 2D grid gives identical results for this example
#include "profile5c.h"
scalar wave[], height[], lev[];
int main(){
(1 << 5);
init_grid = 2.*M_PI;
L0 refine (level < 7 && ((y + x/3.) < 3.));
foreach(){
[] = 2.*sin(y) + 3.;
wave[] = y;
height[] = level;
lev}
profile ();
profile (fname = "equi", n = 10);
}
Result
The code above prints to stdout
, whos content are
plotted below using an automated script:
datafile = 'out'
firstrow = system('head -1 '.datafile)
set yr [-0.5:8]
set xr [-0.5:7]
set ylabel word(firstrow, 1)
set key autotitle columnheader box on
set size square
plot datafile u 2:1 t 'wave' ,\
'y',\
datafile u 3:1 t 'level' datafile u 4:1 t
The content of the file “equi” is also plotted:
datafile = 'equi'
firstrow = system('head -1 '.datafile)
set yr [-0.5:8]
set xr [-0.5:7]
set ylabel word(firstrow, 1)
set key autotitle columnheader box on
plot datafile u 2:1 t 'wave' ,\
'y' ,\
datafile u 3:1 t 'level' datafile u 4:1 t
We are happy with the result as it shows some minimal consistency.