19 double ox = 0.,
double oy = 0.,
double width =
L0)
27 fprintf (
stderr,
"input_pgm: magic number '%s' does not match PGM\n",
33 fprintf (
stderr,
"input_pgm: could not read width and height\n");
39 fprintf (
stderr,
"input_pgm: could not read width and height\n");
52 unsigned char *
a =
qmalloc (
W*
H,
unsigned char);
66 int i = (
x -
ox)*
W/width,
j = (
y -
oy)*
W/width;
75 unsigned short *
a =
qmalloc (
W*
H,
unsigned short);
89 int i = (
x -
ox)*
W/width,
j = (
y -
oy)*
W/width;
103 if (
c ==
'{')
para++;
104 if (
c ==
'}')
para--;
120 if (
c ==
'{')
para++;
121 if (
c ==
'}')
para--;
128 if (
c ==
'{')
para++;
129 if (
c ==
'}')
para--;
130 for (
int i = 0;
i <
slen - 1;
i++)
182 while (
c !=
EOF &&
c !=
'}') {
195 fprintf (
stderr,
"input_gfs(): error: expecting 'variables'\n");
212 char * name =
replace (
s1,
'_',
'.',
false);
214 for (
int _s = 0;
_s < 1;
_s++)
249 fprintf (
stderr,
"input_gfs(): error: expecting 'GfsBox'\n");
270 if (
fread (&
a,
sizeof (
double), 1,
fp) != 1 ||
a != -1) {
274 for (
int _s = 0;
_s < 1;
_s++) {
275 if (
fread (&
a,
sizeof (
double), 1,
fp) != 1) {
276 fprintf (
stderr,
"input_gfs(): error: expecting a scalar\n");
284 if (
s.v.x.
i ==
s.
i) {
288 else if (
s.v.y.
i ==
s.
i) {
305 for (
int _s = 0;
_s < 1;
_s++)
308 for (
int _s = 0;
_s < 1;
_s++)
322#define valgrd(v,i,j) ((v)[(j) + 1 + ((i) + 1)*(nx + 2)])
327 for (
int i = 0;
i <
ny;
i++) {
332 for (
int i = 0;
i <
ny;
i++) {
337 for (
int j = -1;
j <=
nx;
j++) {
342 for (
int j = -1;
j <=
nx;
j++) {
440 double * value =
qmalloc ((
nx + 2)*(
ny + 2),
double);
441 for (
int i =
ny - 1;
i >= 0;
i--)
442 for (
int j = 0 ;
j <
nx;
j++) {
456 for (
int i = 0;
i <
ny;
i++)
457 for (
int j = 0 ;
j <
nx;
j++) {
460 for (
int k = -1;
k <= 1;
k++)
461 for (
int l = -1;
l <= 1;
l++)
462 if ((
l != 0 ||
k != 0) &&
515 "%s:%d: warning: raster data is not covering all the simulation area\n",
define double double char flags
define VT _attribute[s.i] v y scalar * list
static number sq(number x)
scalar * list_append(scalar *list, scalar s)
#define qmalloc(size, type)
define sysmalloc malloc define syscalloc calloc define sysrealloc realloc define sysfree free define systrdup strdup define file
define sysmalloc malloc define syscalloc calloc define sysrealloc realloc define sysfree free define systrdup strdup define line line realloc(p, s) @ define pfree(p
define sysmalloc malloc define syscalloc calloc define sysrealloc realloc define sysfree free define systrdup strdup define line line line line strdup(s) @ define tracing(...) @ define end_tracing(...) @define tid() 0 @define pid() 0 @define npe() 1 @define mpi_all_reduce(v
*cs[i, 0, 0] a *[i -1, 0, 0] j
#define dx(s)
We first define some useful macros, following the notations in Bonneton et al, 2011.
define is_active() cell(true) @define is_leaf(cell)(point.level
static void set_dirty_stencil(scalar s)
int refine_cell(Point point, scalar *list, int flag, Cache *refined)