t8
1.2.0
t8code is a C library to manage a forest of adaptive space-trees of general element classes in parallel.
|
Definitions of line-specific functions. More...
#include <t8_element.h>
#include <t8_schemes/t8_default/t8_default_line/t8_dline.h>
#include <t8_schemes/t8_default/t8_default_vertex/t8_dvertex.h>
Go to the source code of this file.
Functions | |
int | t8_dline_get_level (const t8_dline_t *l) |
Compute the level of a line. More... | |
void | t8_dline_copy (const t8_dline_t *l, t8_dline_t *dest) |
Copy all values from one line to another. More... | |
int | t8_dline_compare (const t8_dline_t *l1, const t8_dline_t *l2) |
Compare two elements. More... | |
void | t8_dline_parent (const t8_dline_t *l, t8_dline_t *parent) |
Compute the parent of a line. More... | |
void | t8_dline_ancestor (const t8_dline_t *t, int level, t8_dline_t *ancestor) |
Compute the ancestor of a line at a given level. More... | |
void | t8_dline_child (const t8_dline_t *l, int childid, t8_dline_t *child) |
Compute the childid-th child in Morton order of a line. More... | |
void | t8_dline_face_neighbour (const t8_dline_t *l, t8_dline_t *neigh, int face, int *dual_face) |
Compute the face neighbor of a line. More... | |
void | t8_dline_nearest_common_ancestor (const t8_dline_t *t1, const t8_dline_t *t2, t8_dline_t *r) |
Computes the nearest common ancestor of two lines in the same tree. More... | |
int | t8_dline_ancestor_id (const t8_dline_t *l, int level) |
Compute the position of the ancestor of this child at level level within its siblings. More... | |
int | t8_dline_face_parent_face (const t8_dline_t *l, int face) |
Given a face of a line return the face number of the parent of the line that matches the line's face. More... | |
int | t8_dline_child_id (const t8_dline_t *t) |
Compute the position of the ancestor of this child at level level within its siblings. More... | |
void | t8_dline_childrenpv (const t8_dline_t *t, t8_dline_t *c[T8_DLINE_CHILDREN]) |
Compute the 2 children of a line, array version. More... | |
int | t8_dline_is_familypv (const t8_dline_t *f[]) |
Check whether a collection of two lines is a family in Morton order. More... | |
int | t8_dline_is_root_boundary (const t8_dline_t *p, int face) |
Compute whether a given line shares a given face with its root tree. More... | |
int | t8_dline_is_inside_root (const t8_dline_t *l) |
Test if a line lies inside of the root line, that is the line of level 0, anchor node (0,0) More... | |
void | t8_dline_init_linear_id (t8_dline_t *l, int level, t8_linearidx_t id) |
Initialize a line as the line with a given global id in a uniform refinement of a given level. More... | |
void | t8_dline_successor (const t8_dline_t *l, t8_dline_t *succ, int level) |
Computes the successor of a line in a uniform grid of level level. More... | |
void | t8_dline_transform_face (const t8_dline_t *line1, t8_dline_t *line2, int orientation) |
Suppose we have two trees that share a common face f. More... | |
int | t8_dline_extrude_face (const t8_dvertex_t *face, int root_face, t8_dline_t *line) |
Given a vertex at the boundary of a line at a root tree boundary, construct the line from it. More... | |
void | t8_dline_first_descendant (const t8_dline_t *l, t8_dline_t *s, int level) |
Compute the first descendant of a line at a given level. More... | |
void | t8_dline_last_descendant (const t8_dline_t *l, t8_dline_t *s, int level) |
Compute the last descendant of a line at a given level. More... | |
void | t8_dline_vertex_coords (const t8_dline_t *elem, const int vertex, int coords[]) |
Compute the first or second vertex of a line. More... | |
void | t8_dline_vertex_ref_coords (const t8_dline_t *elem, const int vertex, double coordinates[1]) |
Compute the coordinates of a vertex of a line when the tree (level 0 line) is embedded in [0,1]^1. More... | |
t8_linearidx_t | t8_dline_linear_id (const t8_dline_t *elem, int level) |
Computes the linear position of a line in an uniform grid. More... | |
int | t8_dline_is_valid (const t8_dline_t *l) |
Query whether all entries of a line are in valid ranges. More... | |
void | t8_dline_debug_print (const t8_dline_t *l) |
Print a line. More... | |
void | t8_dline_init (t8_dline_t *l) |
Set default values for a line, such that it passes t8_dline_is_valid. More... | |
Definitions of line-specific functions.
void t8_dline_ancestor | ( | const t8_dline_t * | t, |
int | level, | ||
t8_dline_t * | ancestor | ||
) |
Compute the ancestor of a line at a given level.
[in] | t | Input line. |
[in] | level | A smaller level than t. |
[in,out] | ancestor | Existing line whose data will be filled with the data of t's ancestor on level level. |
int t8_dline_ancestor_id | ( | const t8_dline_t * | l, |
int | level | ||
) |
Compute the position of the ancestor of this child at level level within its siblings.
[in] | l | line to be considered. |
[in] | level | level to be considered. |
void t8_dline_child | ( | const t8_dline_t * | l, |
int | childid, | ||
t8_dline_t * | child | ||
) |
Compute the childid-th child in Morton order of a line.
[in] | l | Input Line. |
[in] | childid | The id of the child, 0 or 1, in Morton order. |
[in,out] | child | Existing Line whose data will be filled with the date of l's childid-th child. |
int t8_dline_child_id | ( | const t8_dline_t * | t | ) |
Compute the position of the ancestor of this child at level level within its siblings.
[in] | t | line to be considered. |
void t8_dline_childrenpv | ( | const t8_dline_t * | t, |
t8_dline_t * | c[T8_DLINE_CHILDREN] | ||
) |
Compute the 2 children of a line, array version.
[in] | t | Input line. |
[in,out] | c | Pointers to the 2 computed children in Morton order. t may point to the same quadrant as c[0]. |
int t8_dline_compare | ( | const t8_dline_t * | l1, |
const t8_dline_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.
void t8_dline_copy | ( | const t8_dline_t * | l, |
t8_dline_t * | dest | ||
) |
Copy all values from one line to another.
[in] | l | The line to be copied. |
[in,out] | dest | Existing line whose data will be filled with the data of l. |
void t8_dline_debug_print | ( | const t8_dline_t * | l | ) |
Print a line.
[in] | l | line to be initialized |
int t8_dline_extrude_face | ( | const t8_dvertex_t * | face, |
int | root_face, | ||
t8_dline_t * | line | ||
) |
Given a vertex at the boundary of a line at a root tree boundary, construct the line from it.
[in] | face | The face element (vertex). |
[in] | root_face | The index of the face of the tree. |
[out] | line | The line that has face as face element at face root_face |
void t8_dline_face_neighbour | ( | const t8_dline_t * | l, |
t8_dline_t * | neigh, | ||
int | face, | ||
int * | dual_face | ||
) |
Compute the face neighbor of a line.
[in] | l | Input line. |
[in,out] | neigh | Existing line whose data will be filled. |
[in] | face | The face across which to generate the neighbor. |
[out] | dual_face | If not NULL, the face number as seen from neigh is stored. |
int t8_dline_face_parent_face | ( | const t8_dline_t * | l, |
int | face | ||
) |
Given a face of a line return the face number of the parent of the line that matches the line's face.
Or return -1 if no face of the parent matches the face.
[in] | l | The line. |
[in] | face | The number of the face. |
void t8_dline_first_descendant | ( | const t8_dline_t * | l, |
t8_dline_t * | s, | ||
int | level | ||
) |
Compute the first descendant of a line at a given level.
This is the descendant of the line in a uniform level refinement that has the smallest id.
[in] | l | Line whose descendant is computed. |
[out] | s | Existing line whose data will be filled with the data of l's first descendant on level level. |
[in] | level | The refinement level. Must be greater than l's refinement level. |
int t8_dline_get_level | ( | const t8_dline_t * | l | ) |
Compute the level of a line.
[in] | l | Line whose level is computed. |
void t8_dline_init | ( | t8_dline_t * | l | ) |
Set default values for a line, such that it passes t8_dline_is_valid.
[in] | l | line to be initialized |
void t8_dline_init_linear_id | ( | t8_dline_t * | l, |
int | level, | ||
t8_linearidx_t | id | ||
) |
Initialize a line as the line with a given global id in a uniform refinement of a given level.
[in,out] | l | Existing line whose data will be filled. |
[in] | id | Index to be considered. |
[in] | level | level of uniform grid to be considered. |
int t8_dline_is_familypv | ( | const t8_dline_t * | f[] | ) |
Check whether a collection of two lines is a family in Morton order.
[in] | f | An array of two lines. |
int t8_dline_is_inside_root | ( | const t8_dline_t * | l | ) |
Test if a line lies inside of the root line, that is the line of level 0, anchor node (0,0)
[in] | l | Input line. |
int t8_dline_is_root_boundary | ( | const t8_dline_t * | p, |
int | face | ||
) |
Compute whether a given line shares a given face with its root tree.
[in] | p | The input line. |
[in] | face | A face of p. |
int t8_dline_is_valid | ( | const t8_dline_t * | l | ) |
Query whether all entries of a line are in valid ranges.
[in] | l | line to be considered. |
void t8_dline_last_descendant | ( | const t8_dline_t * | l, |
t8_dline_t * | s, | ||
int | level | ||
) |
Compute the last descendant of a line at a given level.
This is the descendant of the line in a uniform level refinement that has the largest id.
[in] | l | Line whose descendant is computed. |
[out] | s | Existing line whose data will be filled with the data of l's last descendant on level level. |
[in] | level | The refinement level. Must be greater than l's refinement level. |
t8_linearidx_t t8_dline_linear_id | ( | const t8_dline_t * | elem, |
int | level | ||
) |
Computes the linear position of a line in an uniform grid.
[in] | line | Line whose id will be computed. |
void t8_dline_nearest_common_ancestor | ( | const t8_dline_t * | t1, |
const t8_dline_t * | t2, | ||
t8_dline_t * | r | ||
) |
Computes the nearest common ancestor of two lines in the same tree.
[in] | l1 | First input line. |
[in] | l2 | Second input line. |
[in,out] | r | Existing line whose data will be filled. |
void t8_dline_parent | ( | const t8_dline_t * | l, |
t8_dline_t * | parent | ||
) |
Compute the parent of a line.
[in] | l | The input line. |
[in,out] | parent | Existing line whose data will be filled with the parent data of l. |
void t8_dline_successor | ( | const t8_dline_t * | l, |
t8_dline_t * | succ, | ||
int | level | ||
) |
Computes the successor of a line in a uniform grid of level level.
[in] | l | line whose id will be computed. |
[in,out] | s | Existing line whose data will be filled with the data of l's successor on level level. |
[in] | level | level of uniform grid to be considered. |
void t8_dline_transform_face | ( | const t8_dline_t * | line1, |
t8_dline_t * | line2, | ||
int | orientation | ||
) |
Suppose we have two trees that share a common face f.
Given a Line e that is a subface of f in one of the trees and given the orientation of the tree connection, construct the face Line of the respective tree neighbor that logically coincides with e but lies in the coordinate system of the neighbor tree.
[in] | elem1 | The face element. |
[in,out] | elem2 | On return the face elment elem1 with respective to the coordinate system of the other tree. |
[in] | orientation | The orientation of the tree-tree connection. 0 if vertex 0 of face 0 coincides with vertex 0 of face 1. 1 if vertex 0 of face 0 coincides with vertex 1 of face 1. |
void t8_dline_vertex_coords | ( | const t8_dline_t * | elem, |
const int | vertex, | ||
int | coords[] | ||
) |
Compute the first or second vertex of a line.
[in] | elem | Line whose vertex is computed. |
[in] | vertex | The number of the vertex of elem |
[out] | coords | The coordinates of the computed vertex |
void t8_dline_vertex_ref_coords | ( | const t8_dline_t * | elem, |
const int | vertex, | ||
double | coordinates[1] | ||
) |
Compute the coordinates of a vertex of a line when the tree (level 0 line) is embedded in [0,1]^1.
[in] | t | Input line. |
[in] | vertex | The number of the vertex. |
[out] | coordinates | An array of 1 double that will be filled with the reference coordinates of the vertex. |