Basilisk CFD
Adaptive Cartesian mesh PDE framework
Loading...
Searching...
No Matches
tree.h File Reference
#include "mempool.h"
#include "memindex/virtual.h"
#include "foreach_cell.h"
#include "neighbors.h"
#include "variables.h"
#include "tree-common.h"
#include "tree-mpi.h"
#include "balance.h"
Include dependency graph for tree.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _Point
 
struct  Cell
 
struct  CacheLevel
 
struct  Index
 
struct  Cache
 
struct  Layer
 
struct  Tree
 

Macros

#define TWO_ONE   1
 
#define GHOSTS   2
 
#define _I   (point.i - GHOSTS)
 
#define _J   (point.j - GHOSTS)
 
#define _DELTA   (1./(1 << point.level))
 
#define tree   ((Tree *)grid)
 
#define BSIZE   128
 
#define update_cache()   { if (tree->dirty) update_cache_f(); }
 
#define is_refined(cell)   (!is_leaf (cell) && cell.neighbors && cell.pid >= 0)
 
#define is_prolongation(cell)   (!is_leaf(cell) && !cell.neighbors && cell.pid >= 0)
 
#define is_boundary(cell)   (cell.pid < 0)
 
#define bid(cell)   (- cell.pid - 1)
 
#define foreach_halo(type, l)   foreach_halo_##type(l)
 
#define FBOUNDARY   1
 
#define foreach_edge(...)   for (int _i = 0; _i < _N; _i++) /* foreach_face */
 
#define is_neighbor(...)
 
#define periodic(dir)   tree_periodic(dir)
 

Typedefs

typedef double real
 
typedef void(* PeriodicFunction) (struct _Memindex *, int, int, int, void *)
 

Enumerations

enum  {
  active = 1 << 0 , leaf = 1 << 1 , border = 1 << 2 , vertex = 1 << 3 ,
  user = 4 , face_x = 1 << 0 , face_y = 1 << 1
}
 

Functions

define is_active() cell ((cell).flags &active) @define is_leaf(cell)((cell).flags &leaf) @define is_coarse()((cell).neighbors > 0) @define is_border(cell)((cell).flags &border) @define is_local(cell)((cell).pid
 
static size_t _size (size_t depth)
 
static size_t poolsize (size_t depth, size_t size)
 
static Layernew_layer (int depth)
 
static void destroy_layer (Layer *l)
 
static void cache_level_append (CacheLevel *c, Point p)
 
static void cache_level_shrink (CacheLevel *c)
 
static void cache_append (Cache *c, Point p, unsigned short flags)
 
void cache_shrink (Cache *c)
 
def allocated (k, l, n)(mem_allocated(((Tree *) grid) -> L[point.level]->m, point.i+k, point.j+l)) @ @def NEIGHBOR(k, l, n)(((((Tree *) grid) ->L[point.level]->m) ->b[point.i+k][point.j+l])) @ @def PARENT(k, l, n)(((((Tree *) grid) ->L[point.level-1]->m) ->b[(point.i+2)/2+k][(point.j+2)/2+l])) @ @def allocated_child(k, l, n)(level< depth() &&mem_allocated(((Tree *) grid) ->L[point.level+1]->m, 2 *point.i- 2+k, 2 *point.j- 2+l)) @ @def CHILD(k, l, n)(((((Tree *) grid) ->L[point.level+1]->m) ->b[2 *point.i- 2+k][2 *point.j- 2+l])) @ @define CELL(m)(*((Cell *)(m))) @define depth()(grid->depth) @define aparent(k, l, n) CELL(PARENT(k, l, n)) @define child(k, l, n) CELL(CHILD(k, l, n)) @define cell CELL(NEIGHBOR(0, 0, 0)) @define neighbor(k, l, n) CELL(NEIGHBOR(k, l, n)) @def neighborp(l, m, n)(Point)
 
define data (k, l, n)((double *)(NEIGHBOR(k
 
define n sizeof (Cell))) @define fine(a
 
definen ((double *)(CHILD(k, p, n)+sizeof(Cell)))[_index(a
 
define n n define coarse (a, k, p, n)((double *)(PARENT(k
 
define n n define n n macro POINT_VARIABLES (Point point=point)
 
macro1 foreach_child (Point point=point, break=(_k=_l=2))
 
def is_refined_check ()((!is_leaf(cell) &&cell .neighbors &&cell .pid >=0) &&point.i > 0 &&point.i<(1<< level)+2 *2 - 1 &&point.j > 0 &&point.j<(1<< level)+2 *2 - 1) @ macro2 for(int _i=0
 
 foreach_cache_level (_boundary, _l, reductions)
 
macro2 foreach_halo_prolongation (int _l)
 
macro2 foreach_halo_restriction (int _l)
 
static bool has_local_children (Point point)
 
static void cache_append_face (Point point, unsigned short flags)
 
static void update_cache_f (void)
 
macro2 foreach (char flags=0, Reduce reductions=None)
 
macro2 foreach_face_generic (char flags=0, Reduce reductions=None, const char *order="xyz")
 
macro1 is_face_x (unsigned short _f=_flags)
 
macro1 is_face_y (unsigned short _f=_flags)
 
macro2 for (int _l=0;_l< int l, char flags=0, Reduce reductions=None;_l++)
 
if TRASH undef trash define trash (list) reset(list
 
if TRASH undef trash define undefined endif void reset (void *alist, double val)
 
static CacheLevelcache_level_resize (CacheLevel *name, int a)
 
static void update_depth (int inc)
 
static void periodic_function (struct _Memindex *m, int i, int j, int len, void *b, PeriodicFunction f)
 
static void assign_periodic (struct _Memindex *m, int i, int j, int len, void *b)
 
static void free_periodic (struct _Memindex *m, int i, int j, int len)
 
static void alloc_children (Point point)
 
static void free_children (Point point)
 
void increment_neighbors (Point point)
 
void decrement_neighbors (Point point)
 
void realloc_scalar (int size)
 
if define disable_fpe_for_mpi () disable_fpe(FE_DIVBYZERO|FE_INVALID) @ define enable_fpe_for_mpi() enable_fpe(FE_DIVBYZERO|FE_INVALID) @else @ define disable_fpe_for_mpi() @ define enable_fpe_for_mpi() @endif static inline void no_restriction(Point point
 
static bool normal_neighbor (Point point, scalar *scalars, vector *vectors)
 
static bool diagonal_neighbor_2D (Point point, scalar *scalars, vector *vectors)
 
static bool diagonal_neighbor_3D (Point point, scalar *scalars, vector *vectors)
 
static bool is_boundary_point (Point point)
 
static void box_boundary_level (const Boundary *b, scalar *list, int l)
 
undef VN undef VT define VN _attribute[s.i] v x define VT _attribute[s.i] v static y double masked_average (Point point, scalar s)
 
 for (int _c=0;_c< 4;_c++) if(child.x< 0 &&(!(cell .pid< 0)||!(neighbor(1) .pid< 0)) &&s[1] !
 
static void masked_boundary_restriction (const Boundary *b, scalar *list, int l)
 
macro mask (double func)
 
static void free_cache (CacheLevel *c)
 
void free_grid (void)
 
static void refine_level (int depth)
 
trace void init_grid (int n)
 
void check_two_one (void)
 
Point locate (double xp=0., double yp=0., double zp=0.)
 
bool tree_is_full ()
 
void tree_periodic (int dir)
 
if else void mpi_boundary_refine (scalar *list)
 
void mpi_boundary_coarsen (int a, int b)
 
void mpi_boundary_update (scalar *list)
 

Variables

static Point last_point
 
define l
 
define n k
 
define n p
 
_i< 1;_i++) { OMP_PARALLEL(reductions) { int ig=0, jg=0, kg=0;NOT_UNUSED(ig);NOT_UNUSED(jg);NOT_UNUSED(kg);Point point={0};NOT_UNUSED(point);point.i=2 ;point.j=2 ;int _k;unsigned short _flags;NOT_UNUSED(_flags);for(_k=0;_k< cache.n;_k++) { point.i=cache.p[_k].i;point.j=cache.p[_k].j;point.level=cache.p[_k].level;_flags=cache.p[_k].flags;{...} } }}macro2 foreach_cache_level(Cache cache, int _l, Reduce reductions=None){ OMP_PARALLEL(reductions) { int ig=0, jg=0, kg=0;NOT_UNUSED(ig);NOT_UNUSED(jg);NOT_UNUSED(kg);Point point={0};NOT_UNUSED(point);point.i=2 ;point.j=2 ;point.level=_l;int _k;for(_k=0;_k< cache.n;_k++) { point.i=cache.p[_k].i;point.j=cache.p[_k].j;{...} } }}static void update_cache_f(void);macro2 foreach_boundary_level(int _l, Reduce reductions=None){ if(_l<=depth()) { { if(((Tree *) grid) ->dirty) update_cache_f();};CacheLevel _boundary=((Tree *) grid) -> boundary [_l]
 
if define scalar s
 
boolzn
 
return n sum n
 

Macro Definition Documentation

◆ _DELTA

#define _DELTA   (1./(1 << point.level))

Definition at line 49 of file tree.h.

◆ _I

#define _I   (point.i - GHOSTS)

Definition at line 42 of file tree.h.

◆ _J

#define _J   (point.j - GHOSTS)

Definition at line 44 of file tree.h.

◆ bid

#define bid (   cell)    (- cell.pid - 1)

Definition at line 492 of file tree.h.

◆ BSIZE

#define BSIZE   128

Definition at line 188 of file tree.h.

◆ FBOUNDARY

#define FBOUNDARY   1

Definition at line 552 of file tree.h.

◆ foreach_edge

#define foreach_edge (   ...)    for (int _i = 0; _i < _N; _i++) /* foreach_face */

Definition at line 729 of file tree.h.

◆ foreach_halo

#define foreach_halo (   type,
  l 
)    foreach_halo_##type(l)

Definition at line 514 of file tree.h.

◆ GHOSTS

#define GHOSTS   2

Definition at line 8 of file tree.h.

◆ is_boundary

#define is_boundary (   cell)    (cell.pid < 0)

Definition at line 412 of file tree.h.

◆ is_neighbor

#define is_neighbor (   ...)
Value:
define neighbor(o, p, q)((Point)
Definition cartesian.h:146
int x
Definition common.h:76
def allocated(k, l, n)(mem_allocated(((Tree *) grid) -> L[point.level]->m, point.i+k, point.j+l)) @ @def NEIGHBOR(k, l, n)(((((Tree *) grid) ->L[point.level]->m) ->b[point.i+k][point.j+l])) @ @def PARENT(k, l, n)(((((Tree *) grid) ->L[point.level-1]->m) ->b[(point.i+2)/2+k][(point.j+2)/2+l])) @ @def allocated_child(k, l, n)(level< depth() &&mem_allocated(((Tree *) grid) ->L[point.level+1]->m, 2 *point.i- 2+k, 2 *point.j- 2+l)) @ @def CHILD(k, l, n)(((((Tree *) grid) ->L[point.level+1]->m) ->b[2 *point.i- 2+k][2 *point.j- 2+l])) @ @define CELL(m)(*((Cell *)(m))) @define depth()(grid->depth) @define aparent(k, l, n) CELL(PARENT(k, l, n)) @define child(k, l, n) CELL(CHILD(k, l, n)) @define cell CELL(NEIGHBOR(0, 0, 0)) @define neighbor(k, l, n) CELL(NEIGHBOR(k, l, n)) @def neighborp(l, m, n)(Point)
Definition tree.h:253
#define is_boundary(cell)
Definition tree.h:412

Definition at line 1137 of file tree.h.

◆ is_prolongation

#define is_prolongation (   cell)    (!is_leaf(cell) && !cell.neighbors && cell.pid >= 0)

Definition at line 411 of file tree.h.

◆ is_refined

#define is_refined (   cell)    (!is_leaf (cell) && cell.neighbors && cell.pid >= 0)

Definition at line 410 of file tree.h.

◆ periodic

#define periodic (   dir)    tree_periodic(dir)

Definition at line 1734 of file tree.h.

◆ tree

#define tree   ((Tree *)grid)

Definition at line 184 of file tree.h.

◆ TWO_ONE

#define TWO_ONE   1

Definition at line 7 of file tree.h.

◆ update_cache

#define update_cache ( )    { if (tree->dirty) update_cache_f(); }

Definition at line 408 of file tree.h.

Typedef Documentation

◆ PeriodicFunction

typedef void(* PeriodicFunction) (struct _Memindex *, int, int, int, void *)

Definition at line 825 of file tree.h.

◆ real

Definition at line 3 of file tree.h.

Enumeration Type Documentation

◆ anonymous enum

Enumerator
active 
leaf 
border 
vertex 
user 
face_x 
face_y 

Definition at line 58 of file tree.h.

Function Documentation

◆ _size()

static size_t _size ( size_t  depth)
static

Definition at line 123 of file tree.h.

References depth, and GHOSTS.

Referenced by new_layer(), and poolsize().

Here is the caller graph for this function:

◆ alloc_children()

static void alloc_children ( Point  point)
static

Definition at line 940 of file tree.h.

References assign_periodic(), b, cell(), datasize, Grid::depth, GHOSTS, grid, i, Point::i, j, k, l, Layer::len, Point::level, m(), Layer::m, mempool_alloc0(), n, Layer::nc, point, Layer::pool, s, tree, undefined(), update_depth(), and x.

Referenced by foreach_tree(), and increment_neighbors().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ allocated()

def allocated ( k  ,
l  ,
n   
) -> L[point.level]->m, point.i+k, point.j+l)) @ @def NEIGHBOR(k,l,n) ( (( ((Tree *)grid) ->L[point.level]->m )->b[ point.i+k ][ point.j+l ])) @ @def PARENT(k,l,n) ( (( ((Tree *)grid) ->L[point.level-1]->m )->b[ (point.i+ 2 )/2+k ][ (point.j+ 2 )/2+l ])) @ @def allocated_child(k,l,n) (level < depth() && mem_allocated ( ((Tree *)grid) ->L[point.level+1]->m, 2*point.i- 2 +k, 2*point.j- 2 +l)) @ @def CHILD(k,l,n) ( (( ((Tree *)grid) ->L[point.level+1]->m )->b[ 2*point.i- 2 +k ][ 2*point.j- 2 +l ])) @ @define CELL(m) (*((Cell *)(m))) @define depth() (grid->depth) @define aparent(k,l,n) CELL(PARENT(k,l,n)) @define child(k,l,n) CELL(CHILD(k,l,n)) @define cell CELL(NEIGHBOR(0,0,0)) @define neighbor(k,l,n) CELL(NEIGHBOR(k,l,n)) @def neighborp(l,m,n) (Point)

Definition at line 253 of file tree.h.

References Point::i, l, Point::level, m(), n, point, and x.

Referenced by apply_bc(), cartesian_debug(), check_flags(), coarsen_cell(), for(), foreach_cell_post_root(), locate(), mpi_boundary_refine(), POINT_VARIABLES(), rcv_pid_send(), tree_check(), and update_cache_f().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ assign_periodic()

static void assign_periodic ( struct _Memindex m,
int  i,
int  j,
int  len,
void b 
)
static

Definition at line 853 of file tree.h.

Referenced by alloc_children(), and init_grid().

Here is the caller graph for this function:

◆ box_boundary_level()

static void box_boundary_level ( const Boundary b,
scalar list,
int  l 
)
static

Definition at line 1296 of file tree.h.

◆ cache_append()

static void cache_append ( Cache c,
Point  p,
unsigned short  flags 
)
static

Definition at line 215 of file tree.h.

References BSIZE, c, flags, scalar::i, p, and x.

Referenced by refine_cell(), and update_cache_f().

Here is the caller graph for this function:

◆ cache_append_face()

static void cache_append_face ( Point  point,
unsigned short  flags 
)
inlinestatic

Definition at line 526 of file tree.h.

Referenced by update_cache_f().

Here is the caller graph for this function:

◆ cache_level_append()

static void cache_level_append ( CacheLevel c,
Point  p 
)
static

Definition at line 190 of file tree.h.

References BSIZE, c, scalar::i, p, and x.

Referenced by rcv_append(), and update_cache_f().

Here is the caller graph for this function:

◆ cache_level_resize()

static CacheLevel * cache_level_resize ( CacheLevel name,
int  a 
)
static

Definition at line 777 of file tree.h.

◆ cache_level_shrink()

static void cache_level_shrink ( CacheLevel c)
static

Definition at line 206 of file tree.h.

References assert, BSIZE, c, realloc(), sizeof(), and x.

Referenced by cache_shrink(), and update_cache_f().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cache_shrink()

void cache_shrink ( Cache c)

Definition at line 233 of file tree.h.

References c, and cache_level_shrink().

Referenced by update_cache_f().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cell()

define is_active() cell ( (cell).flags active) &

References i, j, and k.

Referenced by alloc_children(), has_local_children(), increment_neighbors(), is_boundary_point(), locate(), masked_average(), normal_neighbor(), and update_cache_f().

Here is the caller graph for this function:

◆ check_two_one()

void check_two_one ( void  )

Definition at line 1597 of file tree.h.

References _i, active, assert, fp, GHOSTS, i, Point::i, j, k, l, Point::level, level, output_cells(), point, x, and y.

Here is the call graph for this function:

◆ coarse()

define n n define coarse ( a  ,
k  ,
p  ,
n   
)

Referenced by balance(), bilinear(), biquadratic(), curvature_prolongation(), multigrid_debug(), refine_embed_linear(), tag(), and update_saint_venant().

Here is the caller graph for this function:

◆ data()

define data ( k  ,
l  ,
n   
)

◆ decrement_neighbors()

void decrement_neighbors ( Point  point)

Definition at line 1054 of file tree.h.

Referenced by coarsen_cell().

Here is the caller graph for this function:

◆ destroy_layer()

static void destroy_layer ( Layer l)
static

Definition at line 157 of file tree.h.

References free(), l, mem_destroy(), and mempool_destroy().

Here is the call graph for this function:

◆ diagonal_neighbor_2D()

static bool diagonal_neighbor_2D ( Point  point,
scalar scalars,
vector vectors 
)
static

Definition at line 1180 of file tree.h.

◆ diagonal_neighbor_3D()

static bool diagonal_neighbor_3D ( Point  point,
scalar scalars,
vector vectors 
)
static

Definition at line 1223 of file tree.h.

◆ disable_fpe_for_mpi()

if define disable_fpe_for_mpi ( )

◆ for() [1/2]

for ( )

Definition at line 279 of file cartesian.h.

References list_add(), periodic_bc(), right, s, and x.

Here is the call graph for this function:

◆ for() [2/2]

macro2 for ( )

Definition at line 732 of file tree.h.

References depth, foreach_cache_level(), l, reductions, tree, update_cache, and x.

Here is the call graph for this function:

◆ foreach()

macro2 foreach ( char  flags = 0,
Reduce  reductions = None 
)

Definition at line 685 of file tree.h.

◆ foreach_cache_level()

foreach_cache_level ( _boundary  ,
_l  ,
reductions   
)

Definition at line 487 of file tree.h.

Referenced by apply_bc(), for(), foreach_halo_prolongation(), rcv_pid_send(), and rcv_print().

Here is the caller graph for this function:

◆ foreach_child()

macro1 foreach_child ( Point  point = point,
break  = (_k = _l = 2) 
)

Definition at line 370 of file tree.h.

References _i, _j, _k, GHOSTS, Point::i, Point::level, point, POINT_VARIABLES(), and x.

Here is the call graph for this function:

◆ foreach_face_generic()

macro2 foreach_face_generic ( char  flags = 0,
Reduce  reductions = None,
const char order = "xyz" 
)

Definition at line 691 of file tree.h.

◆ foreach_halo_prolongation()

macro2 foreach_halo_prolongation ( int  _l)

Definition at line 494 of file tree.h.

References depth, foreach_cache_level(), tree, update_cache, and x.

Here is the call graph for this function:

◆ foreach_halo_restriction()

macro2 foreach_halo_restriction ( int  _l)

Definition at line 504 of file tree.h.

◆ free_cache()

static void free_cache ( CacheLevel c)
static

Definition at line 1455 of file tree.h.

◆ free_children()

static void free_children ( Point  point)
static

Definition at line 1002 of file tree.h.

Referenced by balance().

Here is the caller graph for this function:

◆ free_grid()

void free_grid ( void  )

Definition at line 1462 of file tree.h.

Referenced by init_grid(), and tree_periodic().

Here is the caller graph for this function:

◆ free_periodic()

static void free_periodic ( struct _Memindex m,
int  i,
int  j,
int  len 
)
static

Definition at line 858 of file tree.h.

◆ has_local_children()

static bool has_local_children ( Point  point)
inlinestatic

Definition at line 518 of file tree.h.

References cell(), and x.

Here is the call graph for this function:

◆ increment_neighbors()

void increment_neighbors ( Point  point)

Definition at line 1043 of file tree.h.

References alloc_children(), cell(), GHOSTS, point, tree, and x.

Referenced by refine_cell().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ init_grid()

trace void init_grid ( int  n)

Definition at line 1499 of file tree.h.

References active, assert, assign_periodic(), bottom, calloc(), CELL, datasize, Grid::depth, depth, free_grid(), GHOSTS, grid, i, j, k, l, leaf, left, Layer::len, Layer::m, mem_data, mpi_boundary_new(), N, n, new_layer(), Period, q, qcalloc, qmalloc, right, top, and x.

Here is the call graph for this function:

◆ is_boundary_point()

static bool is_boundary_point ( Point  point)
inlinestatic

Definition at line 1292 of file tree.h.

References cell(), and is_boundary.

Here is the call graph for this function:

◆ is_face_x()

macro1 is_face_x ( unsigned short  _f = _flags)

Definition at line 699 of file tree.h.

◆ is_face_y()

macro1 is_face_y ( unsigned short  _f = _flags)

Definition at line 707 of file tree.h.

References face_y, and x.

◆ is_refined_check()

def is_refined_check ( ) &&
pure virtual

References _k, GHOSTS, Point::i, Point::level, OMP_PARALLEL(), point, reductions, and x.

Referenced by flag_border_cells(), is_newpid(), and refine_cell().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ locate()

Point locate ( double  xp = 0.,
double  yp = 0.,
double  zp = 0. 
)

Definition at line 1631 of file tree.h.

References allocated(), cell(), depth, dimension, GHOSTS, Point::i, l, L0, Point::level, n, point, x, X0, Y0, and Z0.

Here is the call graph for this function:

◆ mask()

macro mask ( double  func)

Definition at line 1432 of file tree.h.

◆ masked_average()

undef VN undef VT define VN _attribute[s.i] v x define VT _attribute[s.i] v static y double masked_average ( Point  point,
scalar  s 
)
static

Definition at line 1382 of file tree.h.

References cell(), is_boundary, n, nodata, s, sum, and x.

Here is the call graph for this function:

◆ masked_boundary_restriction()

static void masked_boundary_restriction ( const Boundary b,
scalar list,
int  l 
)
static

Definition at line 1402 of file tree.h.

◆ mpi_boundary_coarsen()

void mpi_boundary_coarsen ( int  a,
int  b 
)

Definition at line 1741 of file tree.h.

References _i, assert, cell(), check_depth(), coarsen_cell_recursive(), is_refined, l, leaf, level, mpi_boundary, mpi_boundary_level(), npe, point, REMOTE, and x.

Referenced by adapt_wavelet(), and unrefine().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mpi_boundary_refine()

if else void mpi_boundary_refine ( scalar list)

Definition at line 1740 of file tree.h.

References _i, allocated(), cell(), depth, free(), i, int, Array::len, level, list, mpi, mpi_boundary, mpi_boundary_refine(), mpi_recv_check(), nr, Array::p, p, point, refine_cell(), REFINE_TAG, s, set_dirty_stencil(), source, tree, and x.

Referenced by adapt_wavelet(), refine(), and refine_level().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mpi_boundary_update()

void mpi_boundary_update ( scalar list)

Definition at line 1742 of file tree.h.

Referenced by adapt_wavelet(), refine(), refine_level(), and unrefine().

Here is the caller graph for this function:

◆ n()

define n n ( (double *)(CHILD(k, p, n)+sizeof(Cell))  )

◆ new_layer()

static Layer * new_layer ( int  depth)
static

Definition at line 140 of file tree.h.

References _size(), datasize, depth, dimension, l, mem_new(), mempool_new(), poolsize(), qmalloc, size, and x.

Referenced by init_grid().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ normal_neighbor()

static bool normal_neighbor ( Point  point,
scalar scalars,
vector vectors 
)
static

Definition at line 1150 of file tree.h.

References BGHOSTS, bid, cell(), dimension, i, is_neighbor, k, neighborp(), point, s, v, and x.

Here is the call graph for this function:

◆ periodic_function()

static void periodic_function ( struct _Memindex m,
int  i,
int  j,
int  len,
void b,
PeriodicFunction  f 
)
static

Definition at line 827 of file tree.h.

References b, f, GHOSTS, i, j, l, m(), n, nl, o, p, and Period.

Here is the call graph for this function:

◆ POINT_VARIABLES()

define n n define n n macro POINT_VARIABLES ( Point  point = point)

Definition at line 322 of file tree.h.

References allocated(), depth, GHOSTS, Point::i, Point::level, level, point, VARIABLES(), x, y, and z.

Referenced by foreach_child(), foreach_neighbor(), and foreach_visible().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ poolsize()

static size_t poolsize ( size_t  depth,
size_t  size 
)
static

Definition at line 128 of file tree.h.

References _size(), cube(), depth, size, and sq().

Referenced by mempool_new(), and new_layer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ realloc_scalar()

void realloc_scalar ( int  size)

Definition at line 1072 of file tree.h.

◆ refine_level()

static void refine_level ( int  depth)
static

◆ reset()

if TRASH undef trash define undefined endif void reset ( void alist,
double  val 
)

Definition at line 759 of file tree.h.

◆ sizeof()

define n n define n sizeof ( Cell  )

Referenced by cache_level_shrink(), display_control_internal(), heap_read(), heap_write(), kdt_create(), kdt_heap_rewind(), kdt_heap_sort(), kdt_open(), mem_destroy(), new_bid(), query(), query_sum(), save(), and split().

Here is the caller graph for this function:

◆ trash()

if TRASH undef trash define trash ( list  )

◆ tree_is_full()

bool tree_is_full ( )

Definition at line 1665 of file tree.h.

References dimension, grid, Grid::maxdepth, Grid::tn, and update_cache.

Referenced by tree_boundary_level(), and tree_restriction().

Here is the caller graph for this function:

◆ tree_periodic()

void tree_periodic ( int  dir)

Definition at line 1725 of file tree.h.

References depth, dir, free_grid(), grid, and periodic.

Here is the call graph for this function:

◆ update_cache_f()

static void update_cache_f ( void  )
static

Definition at line 554 of file tree.h.

References _i, allocated(), BGHOSTS, cache_append(), cache_append_face(), cache_level_append(), cache_level_shrink(), cache_shrink(), cell(), Grid::depth, depth, dimension, face_x, flags, foreach_cell_all(), grid, i, is_boundary, is_prolongation, j, k, l, level, Grid::maxdepth, Grid::n, neighbor(), neighborp(), point, q, Grid::tn, tree, user, vertex, and x.

Here is the call graph for this function:

◆ update_depth()

static void update_depth ( int  inc)
static

Definition at line 785 of file tree.h.

Referenced by alloc_children().

Here is the caller graph for this function:

Variable Documentation

◆ boundary

◆ k

define n k

Definition at line 319 of file tree.h.

Referenced by alloc_children(), cell(), check_two_one(), init_grid(), normal_neighbor(), and update_cache_f().

◆ l

◆ last_point

Point last_point
static

Definition at line 186 of file tree.h.

◆ n

return n sum n

Definition at line 1399 of file tree.h.

Referenced by alloc_children(), allocated(), init_grid(), locate(), masked_average(), and periodic_function().

◆ p

Definition at line 319 of file tree.h.

Referenced by cache_append(), cache_level_append(), and periodic_function().

◆ s

scalar s
Initial value:
{
double sum = 0., n = 0.
double * sum
return n sum n
Definition tree.h:1399

Definition at line 1148 of file tree.h.

Referenced by alloc_children(), masked_average(), and normal_neighbor().

◆ zn

bool* zn
Initial value:
{
for (int k = 1; k <= 1; k++)
for (int j = -k; j <= k; j += 2*k) {
if ((allocated( 0,j ) && !( neighbor( 0,j ) .pid < 0)) || (allocated( -1,j ) && !( neighbor( -1,j ) .pid < 0))) {
*zn = false;
return neighborp(0,j);
}
}
return (Point){.level = -1}
*cs[i, 0, 0] a *[i -1, 0, 0] j
Definition embed.h:88
define neighborp(k, l, o) neighbor(k
Definition linear.h:21
define n k
Definition tree.h:319
bool * zn
Definition tree.h:1273

Definition at line 1272 of file tree.h.

Referenced by balance(), and update_saint_venant().