/** # Advection of a Gaussian Pulse on an Adaptive Grid Similar to a study for the diffusion solver [here](diffgausspulse3b.c), this page presents how adaptivity affects the error in the solution for an advection problem (introduced [here](advgausspulse.c). The focus will be on the role of the refinement criterion $\zeta$. */ #include "grid/bitree.h" #include "run.h" #include "tracer.h" double t0=1./3.; double xo=-0.5; int maxlevel = 12; double zeta,referr; face vector uf[]; scalar c[]; scalar * tracers = {c}; int m; char name1[100]; FILE * fp1; double f(double t,double to,double xi,double Delta){ return (pow(M_PI*0.01*to,0.5)*(erf(((xi-xo-t)+(Delta/2))/(2*pow(0.01*(to),0.5)))-erf(((xi-xo-t)-(Delta/2))/(2*pow(0.01*(to),0.5)))))/Delta; } /** Fourteen simulations are run with different values for the refinement criterion $\zeta$, supplemented with a benchmark run using a fixed-equidistant grid with $N=4096$. */ int main(){ L0=5; X0=-L0/2; sprintf(name1,"zetavstoterr.dat"); fp1=fopen(name1,"w"); for (m=0;m<15;m++) run(); } event init(t=0){ DT=1e-4; init_grid(1<