|
Basilisk CFD
Adaptive Cartesian mesh PDE framework
|
#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"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 } |
| #define _DELTA (1./(1 << point.level)) |
| #define is_neighbor | ( | ... | ) |
| #define update_cache | ( | ) | { if (tree->dirty) update_cache_f(); } |
Definition at line 123 of file tree.h.
Referenced by new_layer(), and poolsize().
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().
| 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().
Definition at line 853 of file tree.h.
Referenced by alloc_children(), and init_grid().
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().
Definition at line 526 of file tree.h.
Referenced by update_cache_f().
|
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().
|
static |
|
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().
Definition at line 233 of file tree.h.
References c, and cache_level_shrink().
Referenced by update_cache_f().
Referenced by alloc_children(), has_local_children(), increment_neighbors(), is_boundary_point(), locate(), masked_average(), normal_neighbor(), and update_cache_f().
Referenced by balance(), bilinear(), biquadratic(), curvature_prolongation(), multigrid_debug(), refine_embed_linear(), tag(), and update_saint_venant().
Definition at line 1054 of file tree.h.
Referenced by coarsen_cell().
Definition at line 157 of file tree.h.
References free(), l, mem_destroy(), and mempool_destroy().
| for | ( | ) |
Definition at line 279 of file cartesian.h.
References list_add(), periodic_bc(), right, s, and x.
| macro2 for | ( | ) |
Definition at line 732 of file tree.h.
References depth, foreach_cache_level(), l, reductions, tree, update_cache, and x.
| 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().
Definition at line 494 of file tree.h.
References depth, foreach_cache_level(), tree, update_cache, and x.
|
static |
Definition at line 1462 of file tree.h.
Referenced by init_grid(), and tree_periodic().
Definition at line 1043 of file tree.h.
References alloc_children(), cell(), GHOSTS, point, tree, and x.
Referenced by refine_cell().
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.
Definition at line 1292 of file tree.h.
References cell(), and is_boundary.
|
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().
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().
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().
Definition at line 1742 of file tree.h.
Referenced by adapt_wavelet(), refine(), refine_level(), and unrefine().
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().
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().
Definition at line 128 of file tree.h.
References _size(), cube(), depth, size, and sq().
Referenced by mempool_new(), and new_layer().
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().
| 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().
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.
Definition at line 785 of file tree.h.
Referenced by alloc_children().
| _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] |
Definition at line 319 of file tree.h.
Referenced by alloc_children(), cell(), check_two_one(), init_grid(), normal_neighbor(), and update_cache_f().
| define l |
Definition at line 318 of file tree.h.
Referenced by alloc_children(), allocated(), check_two_one(), destroy_layer(), for(), init_grid(), locate(), new_layer(), periodic_function(), and update_cache_f().
Definition at line 1399 of file tree.h.
Referenced by alloc_children(), allocated(), init_grid(), locate(), masked_average(), and periodic_function().
Definition at line 319 of file tree.h.
Referenced by cache_append(), cache_level_append(), and periodic_function().
| scalar s |
Definition at line 1148 of file tree.h.
Referenced by alloc_children(), masked_average(), and normal_neighbor().
| bool* zn |
Definition at line 1272 of file tree.h.
Referenced by balance(), and update_saint_venant().