t8  1.2.0
t8code is a C library to manage a forest of adaptive space-trees of general element classes in parallel.
Functions
t8_dvertex_bits.h File Reference

Definitions of vertex-specific functions. More...

#include <t8_element.h>
#include <t8_schemes/t8_default/t8_default_vertex/t8_dvertex.h>

Go to the source code of this file.

Functions

int t8_dvertex_get_level (const t8_dvertex_t *v)
 Compute the level of a vertex. More...
 
void t8_dvertex_copy (const t8_dvertex_t *v, t8_dvertex_t *dest)
 Copy all values from one vertex to another. More...
 
int t8_dvertex_compare (const t8_dvertex_t *l1, const t8_dvertex_t *l2)
 Compare two elements. More...
 
void t8_dvertex_parent (const t8_dvertex_t *v, t8_dvertex_t *parent)
 Compute the parent of a vertex. More...
 
void t8_dvertex_child (const t8_dvertex_t *v, t8_dvertex_t *child)
 Compute the childid-th child in Morton order of a vertex. More...
 
void t8_dvertex_nearest_common_ancestor (const t8_dvertex_t *t1, const t8_dvertex_t *t2, t8_dvertex_t *r)
 Computes the nearest common ancestor of two vertexs in the same tree. More...
 
int t8_dvertex_ancestor_id (const t8_dvertex_t *v, int level)
 Compute the position of the ancestor of this child at level level within its siblings. More...
 
int t8_dvertex_child_id (const t8_dvertex_t *t)
 Compute the position of the ancestor of this child at level level within its siblings. More...
 
void t8_dvertex_sibling (const t8_dvertex_t *v, int sibid, t8_dvertex_t *s)
 Compute the sibling of a vertex. More...
 
void t8_dvertex_childrenpv (const t8_dvertex_t *t, t8_dvertex_t *c[T8_DVERTEX_CHILDREN])
 Compute the 2 children of a vertex, array version. More...
 
int t8_dvertex_is_familypv (const t8_dvertex_t *f[])
 Check whether a collection of two vertexs is a family in Morton order. More...
 
int t8_dvertex_is_root_boundary (const t8_dvertex_t *p, int face)
 Compute whether a given vertex shares a given face with its root tree. More...
 
int t8_dvertex_is_inside_root (const t8_dvertex_t *v)
 Test if a vertex lies inside of the root vertex, that is the vertex of level 0, anchor node (0,0) More...
 
void t8_dvertex_init_linear_id (t8_dvertex_t *v, int level, t8_linearidx_t id)
 Initialize a vertex as the vertex with a given global id in a uniform refinement of a given level. More...
 
void t8_dvertex_transform_face (const t8_dvertex_t *vertex1, t8_dvertex_t *vertex2)
 Suppose we have two trees that share a common vertex face f. More...
 
void t8_dvertex_first_descendant (const t8_dvertex_t *v, t8_dvertex_t *s, int level)
 Compute the first descendant of a vertex at a given level. More...
 
void t8_dvertex_last_descendant (const t8_dvertex_t *v, t8_dvertex_t *s, int level)
 Compute the last descendant of a vertex at a given level. More...
 
void t8_dvertex_vertex_coords (const t8_dvertex_t *elem, int vertex, int coords[])
 Compute the coordinates of a vertex (always 0). More...
 
void t8_dvertex_vertex_ref_coords (const t8_dvertex_t *elem, int vertex, double coords[])
 Compute the coordinates of a vertex (always 0) inside the [0,1]^0 reference space. More...
 
t8_linearidx_t t8_dvertex_linear_id (const t8_dvertex_t *elem, int level)
 Computes the linear position of a vertex in an uniform grid. More...
 
int t8_dvertex_is_valid (const t8_dvertex_t *v)
 Query whether all entries of a vertex are in valid ranges. More...
 
void t8_dvertex_debug_print (const t8_dvertex_t *v)
 Print a vertex. More...
 
void t8_dvertex_init (t8_dvertex_t *v)
 Set default values for a vertex, such that it passes t8_dvertex_is_valid. More...
 

Detailed Description

Definitions of vertex-specific functions.

Function Documentation

◆ t8_dvertex_ancestor_id()

int t8_dvertex_ancestor_id ( const t8_dvertex_t v,
int  level 
)

Compute the position of the ancestor of this child at level level within its siblings.

Parameters
[in]lvertex to be considered.
[in]levellevel to be considered.
Returns
Returns its child id 0 or 1.

◆ t8_dvertex_child()

void t8_dvertex_child ( const t8_dvertex_t v,
t8_dvertex_t child 
)

Compute the childid-th child in Morton order of a vertex.

Parameters
[in]lInput vertex.
[in]childidThe id of the child, 0 or 1, in Morton order.
[in,out]childExisting vertex whose data will be filled with the date of l's childid-th child.

◆ t8_dvertex_child_id()

int t8_dvertex_child_id ( const t8_dvertex_t t)

Compute the position of the ancestor of this child at level level within its siblings.

Parameters
[in]tvertex to be considered.
Returns
Returns its child id in 0,1

◆ t8_dvertex_childrenpv()

void t8_dvertex_childrenpv ( const t8_dvertex_t t,
t8_dvertex_t c[T8_DVERTEX_CHILDREN] 
)

Compute the 2 children of a vertex, array version.

Parameters
[in]tInput vertex.
[in,out]cPointers to the 2 computed children in Morton order. t may point to the same quadrant as c[0].

◆ t8_dvertex_compare()

int t8_dvertex_compare ( const t8_dvertex_t l1,
const t8_dvertex_t l2 
)

Compare two elements.

returns negativ if l1 < l2, zero if l1 equals l2 and positiv if l1 > l2. If l2 is a copy of l1 then the elements are equal.

◆ t8_dvertex_copy()

void t8_dvertex_copy ( const t8_dvertex_t v,
t8_dvertex_t dest 
)

Copy all values from one vertex to another.

Parameters
[in]lThe vertex to be copied.
[in,out]destExisting vertex whose data will be filled with the data of l.

◆ t8_dvertex_debug_print()

void t8_dvertex_debug_print ( const t8_dvertex_t v)

Print a vertex.

Parameters
[in]vvertex to be considered.

◆ t8_dvertex_first_descendant()

void t8_dvertex_first_descendant ( const t8_dvertex_t v,
t8_dvertex_t s,
int  level 
)

Compute the first descendant of a vertex at a given level.

This is the descendant of the vertex in a uniform level refinement that has the smallest id.

Parameters
[in]lvertex whose descendant is computed.
[out]sExisting vertex whose data will be filled with the data of l's first descendant on level level.
[in]levelThe refinement level. Must be greater than l's refinement level.

◆ t8_dvertex_get_level()

int t8_dvertex_get_level ( const t8_dvertex_t v)

Compute the level of a vertex.

Parameters
[in]lvertex whose level is computed.
Returns
The level of l.

◆ t8_dvertex_init()

void t8_dvertex_init ( t8_dvertex_t v)

Set default values for a vertex, such that it passes t8_dvertex_is_valid.

Parameters
[in]lvertex to be initialized

◆ t8_dvertex_init_linear_id()

void t8_dvertex_init_linear_id ( t8_dvertex_t v,
int  level,
t8_linearidx_t  id 
)

Initialize a vertex as the vertex with a given global id in a uniform refinement of a given level.

  • Parameters
    [in,out]lExisting vertex whose data will be filled.
    [in]idIndex to be considered.
    [in]levellevel of uniform grid to be considered.

◆ t8_dvertex_is_familypv()

int t8_dvertex_is_familypv ( const t8_dvertex_t f[])

Check whether a collection of two vertexs is a family in Morton order.

Parameters
[in]fAn array of two vertexs.
Returns
Nonzero if f is a family of vertexs.

◆ t8_dvertex_is_inside_root()

int t8_dvertex_is_inside_root ( const t8_dvertex_t v)

Test if a vertex lies inside of the root vertex, that is the vertex of level 0, anchor node (0,0)

Parameters
[in]lInput vertex.
Returns
true If l lies inside of the root vertex.

◆ t8_dvertex_is_root_boundary()

int t8_dvertex_is_root_boundary ( const t8_dvertex_t p,
int  face 
)

Compute whether a given vertex shares a given face with its root tree.

Parameters
[in]pThe input vertex.
[in]faceA face of p.
Returns
True if face is a subface of the vertex's root element.

◆ t8_dvertex_is_valid()

int t8_dvertex_is_valid ( const t8_dvertex_t v)

Query whether all entries of a vertex are in valid ranges.

Parameters
[in]lvertex to be considered.
Returns
True, if l is a valid vertex and it is safe to call any function in this file on l. False otherwise.

◆ t8_dvertex_last_descendant()

void t8_dvertex_last_descendant ( const t8_dvertex_t v,
t8_dvertex_t s,
int  level 
)

Compute the last descendant of a vertex at a given level.

This is the descendant of the vertex in a uniform level refinement that has the largest id.

Parameters
[in]lvertex whose descendant is computed.
[out]sExisting vertex whose data will be filled with the data of l's last descendant on level level.
[in]levelThe refinement level. Must be greater than l's refinement level.

◆ t8_dvertex_linear_id()

t8_linearidx_t t8_dvertex_linear_id ( const t8_dvertex_t elem,
int  level 
)

Computes the linear position of a vertex in an uniform grid.

Parameters
[in]vertexvertex whose id will be computed.
Returns
Returns the linear position of this vertex on a grid.

◆ t8_dvertex_nearest_common_ancestor()

void t8_dvertex_nearest_common_ancestor ( const t8_dvertex_t t1,
const t8_dvertex_t t2,
t8_dvertex_t r 
)

Computes the nearest common ancestor of two vertexs in the same tree.

Parameters
[in]l1First input vertex.
[in]l2Second input vertex.
[in,out]rExisting vertex whose data will be filled.
Note
l1, l2, r may point to the same vertex.

◆ t8_dvertex_parent()

void t8_dvertex_parent ( const t8_dvertex_t v,
t8_dvertex_t parent 
)

Compute the parent of a vertex.

Parameters
[in]lThe input vertex.
[in,out]parentExisting vertex whose data will be filled with the parent data of l.

◆ t8_dvertex_sibling()

void t8_dvertex_sibling ( const t8_dvertex_t v,
int  sibid,
t8_dvertex_t s 
)

Compute the sibling of a vertex.

Parameters
[in]vvertex to be considered.
[in]sibidThe id of the sibling, must be 0.
[out]sThe sibling of v. For vertices s is just a copy of v.

◆ t8_dvertex_transform_face()

void t8_dvertex_transform_face ( const t8_dvertex_t vertex1,
t8_dvertex_t vertex2 
)

Suppose we have two trees that share a common vertex face f.

Given a vertex e that is a subface of f in one of the trees and given the orientation of the tree connection, construct the face vertex of the respective tree neighbor that logically coincides with e but lies in the coordinate system of the neighbor tree.

Parameters
[in]elem1The face element.
[in,out]elem2On return the face elment elem1 with respective to the coordinate system of the other tree.
Note
For vertices this function is equivalent to copy.

◆ t8_dvertex_vertex_coords()

void t8_dvertex_vertex_coords ( const t8_dvertex_t elem,
int  vertex,
int  coords[] 
)

Compute the coordinates of a vertex (always 0).

Parameters
[in]elemvertex whose vertex is computed.
[in]vertexThe number of the vertex of elem
[out]coordsThe coordinates of the computed vertex

◆ t8_dvertex_vertex_ref_coords()

void t8_dvertex_vertex_ref_coords ( const t8_dvertex_t elem,
int  vertex,
double  coords[] 
)

Compute the coordinates of a vertex (always 0) inside the [0,1]^0 reference space.

Parameters
[in]elemvertex whose vertex is computed.
[in]vertexThe number of the vertex of elem (must be 0).
[out]coordsThe coordinates of the computed vertex, must have one entry (will be set to 0).