src/test/boundary_face.c
Periodic boundary conditions on face fields
Checks on different grids in Makefile.
#include "utils.h"
int main() {
(2);
init_grid foreach_dimension()
periodic (left);
face vector v[];
foreach_face()
.x[] = (x + 1)*(3.*y + 7.);
vscalar a[], div[];
foreach() {
[] = div[] = 0;
aforeach_dimension()
[] = (v.x[1] - v.x[])/Delta;
divfprintf (stderr, "c %g %g %g\n", x, y, div[]);
fprintf (stderr, "F %g %g %g\n", x + Delta/2., y, v.x[1]);
fprintf (stderr, "F %g %g %g\n", x - Delta/2., y, v.x[0]);
fprintf (stderr, "F %g %g %g\n", x, y + Delta/2., v.y[0,1]);
fprintf (stderr, "F %g %g %g\n", x, y - Delta/2., v.y[0]);
}
output_cells();
}