Is Restriction supposed to function on trees?

137 views
Skip to first unread message

Antoon van Hooft

unread,
Feb 13, 2019, 7:01:53 AM2/13/19
to basilisk-fr
Hallo,

Basilisk's `restriction()` computes coarse-cell values based on the leaf-cell values (Popinet, 2015).

However this code,
#include "grid/bitree.h" //May be a quadtree or octree.
scalar s
[];

int main() {
  init_grid
(16);
  unrefine
(x < 0.5);
 
foreach()
    s
[] = 1.;
  restriction
({s});
  foreach_cell
()
    printf
("%g %d %g\n",x, level, s[]);
}

Proves me wrong. See also,

Is this a bug?

Antoon

Reference:
S. Popinet, A quadtree-adaptive multigrid solver for the Serre–Green–Naghdi equations, JCP, 2015

Stephane Popinet

unread,
Feb 13, 2019, 8:53:49 AM2/13/19
to basil...@googlegroups.com
Hi Antoon,

You _must_ call

boundary({s});

after

foreach()
s[] = 1.;

since you modified s[].

Stephane

Reply all
Reply to author
Forward
0 new messages