Basilisk CFD
Adaptive Cartesian mesh PDE framework
Loading...
Searching...
No Matches
tree-common.h File Reference
#include "multigrid-common.h"
Include dependency graph for tree-common.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  astats
 

Macros

#define QUADTREE   1
 
#define TREE   1
 
#define periodic_clamp(a, level)
 

Functions

int refine_cell (Point point, scalar *list, int flag, Cache *refined)
 
bool coarsen_cell (Point point, scalar *list)
 
void coarsen_cell_recursive (Point point, scalar *list)
 
void mpi_boundary_refine (scalar *)
 
void mpi_boundary_coarsen (int, int)
 
void mpi_boundary_update (scalar *)
 
static scalarlist_add_depend (scalar *list, scalar s)
 
trace astats adapt_wavelet (scalar *slist, double *max, int maxlevel, int minlevel=1, scalar *list=all)
 
macro refine (bool cond)
 
static void refine_level (int depth)
 
macro unrefine (bool cond)
 
static trace void halo_face (vectorl vl)
 
static scalar tree_init_scalar (scalar s, const char *name)
 
static void prolongation_vertex (Point point, scalar s)
 
static scalar tree_init_vertex_scalar (scalar s, const char *name)
 
static void tree_setup_vector (vector v)
 
static vector tree_init_vector (vector v, const char *name)
 
 for (int _d=0;_d< 2;_d++) static void refine_face_x(Point point
 
 if (!(!is_leaf(neighbor(-1)) &&neighbor(-1) .neighbors &&neighbor(-1) .pid >=0) &&(is_local(cell)||is_local(neighbor(-1))))
 
 if (!(!is_leaf(neighbor(1)) &&neighbor(1) .neighbors &&neighbor(1) .pid >=0) &&neighbor(1).neighbors &&(is_local(cell)||is_local(neighbor(1))))
 
 if (is_local(cell))
 
void refine_face (Point point, scalar s)
 
void refine_face_solenoidal (Point point, scalar s)
 
static vector tree_init_face_vector (vector v, const char *name)
 
static tensor tree_init_tensor (tensor t, const char *name)
 
static trace void tree_boundary_level (scalar *list, int l)
 
double treex (Point point)
 
double treey (Point point)
 
void output_tree (FILE *fp)
 
trace void tree_check ()
 
static trace void tree_restriction (scalar *list)
 
void tree_methods ()
 

Variables

 attribute
 
scalar s
 

Macro Definition Documentation

◆ periodic_clamp

#define periodic_clamp (   a,
  level 
)
Value:
do { \
if (a < GHOSTS) a += 1 << level; \
else if (a >= GHOSTS + (1 << level)) a -= 1 << level; } while(0)
const vector a
Definition all-mach.h:59
#define GHOSTS
Definition cartesian.h:13
int x
Definition common.h:76
int int int level

Definition at line 16 of file tree-common.h.

◆ QUADTREE

#define QUADTREE   1

Definition at line 3 of file tree-common.h.

◆ TREE

#define TREE   1

Definition at line 4 of file tree-common.h.

Function Documentation

◆ adapt_wavelet()

trace astats adapt_wavelet ( scalar slist,
double max,
int  maxlevel,
int  minlevel = 1,
scalar list = all 
)

Definition at line 175 of file tree-common.h.

References _i, all, b, boundary, cell(), cm, coarsen_cell(), depth, dimension, flags, fm, free(), i, is_boundary, l, level, list, list_add(), list_add_depend(), list_concat(), list_copy(), max, mpi_boundary_coarsen(), mpi_boundary_refine(), mpi_boundary_update(), point, refine_cell(), restriction, s, tree, user, and x.

Here is the call graph for this function:

◆ coarsen_cell()

bool coarsen_cell ( Point  point,
scalar list 
)

Definition at line 102 of file tree-common.h.

References active, allocated(), border, cell(), decrement_neighbors(), leaf, point, s, and x.

Referenced by adapt_wavelet(), coarsen_cell_recursive(), mpi_boundary_update_buffers(), and unrefine().

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

◆ coarsen_cell_recursive()

void coarsen_cell_recursive ( Point  point,
scalar list 
)

Definition at line 140 of file tree-common.h.

References assert, cell(), coarsen_cell(), coarsen_cell_recursive(), is_refined, list, point, and x.

Referenced by balance(), coarsen_cell_recursive(), and mpi_boundary_coarsen().

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

◆ for()

for ( )

◆ halo_face()

static trace void halo_face ( vectorl  vl)
static

Definition at line 395 of file tree-common.h.

References depth, dimension, fine(), foreach_halo, is_refined, l, neighbor(), s, s_face, and x.

Referenced by tree_methods().

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

◆ if() [1/3]

if ( !is_leaf(neighbor(-1)) && neighbor(-1) .neighbors && neighbor(-1) .pid >=0) &&(is_local(cell)||is_local(neighbor(-1)))

Definition at line 513 of file tree-common.h.

References fine(), j, v, and x.

Here is the call graph for this function:

◆ if() [2/3]

if ( !is_leaf(neighbor(1)) && neighbor(1) .neighbors && neighbor(1) .pid >=0) &&neighbor(1).neighbors &&(is_local(cell)||is_local(neighbor(1)))

Definition at line 521 of file tree-common.h.

References fine(), j, v, and x.

Here is the call graph for this function:

◆ if() [3/3]

if ( is_local(cell )

Definition at line 529 of file tree-common.h.

References fine(), j, v, and x.

Here is the call graph for this function:

◆ list_add_depend()

static scalar * list_add_depend ( scalar list,
scalar  s 
)
static

Definition at line 158 of file tree-common.h.

References d, scalar::i, list, list_add_depend(), list_append(), no_restriction(), s, t, and x.

Referenced by adapt_wavelet(), and list_add_depend().

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

◆ mpi_boundary_coarsen()

void mpi_boundary_coarsen ( int  l,
int  too_fine 
)

Definition at line 1132 of file tree-mpi.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()

void mpi_boundary_refine ( scalar list)

Definition at line 1020 of file tree-mpi.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(), mpi_boundary_refine(), 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 396 of file balance.h.

References balance(), boundary, grid, list, mpi_boundary_update_buffers(), s, set_dirty_stencil(), Grid::tn, and x.

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

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

◆ output_tree()

void output_tree ( FILE fp)

Definition at line 807 of file tree-common.h.

References _i, cell(), fp, point, treex(), treey(), and x.

Here is the call graph for this function:

◆ prolongation_vertex()

static void prolongation_vertex ( Point  point,
scalar  s 
)
static

Definition at line 449 of file tree-common.h.

References dimension, fine(), i, j, k, neighbor(), s, and x.

Referenced by tree_init_vertex_scalar().

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

◆ refine()

macro refine ( bool  cond)

Definition at line 323 of file tree-common.h.

References _i, all, boundary, mpi_boundary_refine(), mpi_boundary_update(), point, refine_cell(), tree, and x.

Referenced by event_vof().

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

◆ refine_cell()

int refine_cell ( Point  point,
scalar list,
int  flag,
Cache refined 
)

Definition at line 23 of file tree-common.h.

References active, border, cache_append(), cell(), dimension, GHOSTS, Point::i, increment_neighbors(), is_refined_check(), k, l, leaf, Point::level, level, list, m(), nr, p, periodic_clamp, point, refine_cell(), s, and x.

Referenced by adapt_wavelet(), foreach_tree(), input_gfs(), mpi_boundary_refine(), refine(), refine_cell(), refine_level(), and restore_mpi().

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

◆ refine_face()

void refine_face ( Point  point,
scalar  s 
)

Definition at line 569 of file tree-common.h.

References dimension, point, s, v, and x.

Referenced by event_defaults(), refine_face_solenoidal(), and tree_init_face_vector().

Here is the caller graph for this function:

◆ refine_face_solenoidal()

void refine_face_solenoidal ( Point  point,
scalar  s 
)

Definition at line 576 of file tree-common.h.

References cell(), d, dimension, fine(), i, j, k, m(), p, point, refine_face(), s, v, and x.

Referenced by event_defaults().

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

◆ refine_level()

static void refine_level ( int  depth)
static

Definition at line 346 of file tree-common.h.

References _i, depth, level, mpi_boundary_refine(), mpi_boundary_update(), point, refine_cell(), tree, and x.

Here is the call graph for this function:

◆ tree_boundary_level()

static trace void tree_boundary_level ( scalar list,
int  l 
)
static

Definition at line 652 of file tree-common.h.

References _i, boundary_iterate, cell(), depth, dimension, fine(), foreach_halo, free(), i, is_prolongation, is_refined, l, level, list, list_add(), neighbor(), no_restriction(), nodata, point, restriction, restriction_average(), restriction_vertex(), s, tree_is_full(), v, vectors_add(), and x.

Referenced by tree_methods().

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

◆ tree_check()

trace void tree_check ( )

Definition at line 818 of file tree-common.h.

References _i, allocated(), assert, cell(), foreach_cell_all(), is_prolongation, is_refined, and x.

Referenced by mpi_boundary_update_buffers().

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

◆ tree_init_face_vector()

static vector tree_init_face_vector ( vector  v,
const char name 
)
static

Definition at line 631 of file tree-common.h.

References cartesian_init_face_vector(), dimension, no_restriction(), refine_face(), restriction_face(), v, and x.

Referenced by tree_methods().

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

◆ tree_init_scalar()

static scalar tree_init_scalar ( scalar  s,
const char name 
)
static

Definition at line 442 of file tree-common.h.

References multigrid_init_scalar(), and s.

Referenced by tree_methods().

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

◆ tree_init_tensor()

static tensor tree_init_tensor ( tensor  t,
const char name 
)
static

Definition at line 643 of file tree-common.h.

References dimension, multigrid_init_tensor(), t, tree_setup_vector(), and x.

Referenced by tree_methods().

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

◆ tree_init_vector()

static vector tree_init_vector ( vector  v,
const char name 
)
static

Definition at line 501 of file tree-common.h.

References multigrid_init_vector(), tree_setup_vector(), and v.

Referenced by tree_methods().

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

◆ tree_init_vertex_scalar()

static scalar tree_init_vertex_scalar ( scalar  s,
const char name 
)
static

Definition at line 488 of file tree-common.h.

References multigrid_init_vertex_scalar(), prolongation_vertex(), and s.

Referenced by tree_methods().

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

◆ tree_methods()

void tree_methods ( )

Definition at line 871 of file tree-common.h.

References boundary_face, boundary_level, halo_face(), init_face_vector, init_scalar, init_tensor, init_vector, init_vertex_scalar, multigrid_methods(), restriction, tree_boundary_level(), tree_init_face_vector(), tree_init_scalar(), tree_init_tensor(), tree_init_vector(), tree_init_vertex_scalar(), and tree_restriction().

Referenced by bitree_methods(), octree_methods(), and quadtree_methods().

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

◆ tree_restriction()

static trace void tree_restriction ( scalar list)
static

Definition at line 865 of file tree-common.h.

References boundary, list, multigrid_restriction(), and tree_is_full().

Referenced by tree_methods().

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

◆ tree_setup_vector()

static void tree_setup_vector ( vector  v)
static

Definition at line 495 of file tree-common.h.

References dimension, v, and x.

Referenced by tree_init_tensor(), and tree_init_vector().

Here is the caller graph for this function:

◆ treex()

double treex ( Point  point)

Definition at line 788 of file tree-common.h.

References assert, i, level, treex(), and x.

Referenced by output_tree(), and treex().

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

◆ treey()

double treey ( Point  point)

Definition at line 801 of file tree-common.h.

References level, and treey().

Referenced by output_tree(), and treey().

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

◆ unrefine()

macro unrefine ( bool  cond)

Definition at line 366 of file tree-common.h.

References _i, all, cell(), coarsen_cell(), depth, level, mpi_boundary_coarsen(), mpi_boundary_update(), point, user, and x.

Here is the call graph for this function:

Variable Documentation

◆ attribute

attribute
Initial value:
{
Definition linear.h:21
macro refine(bool cond)

Definition at line 10 of file tree-common.h.

◆ s