t8
UNKNOWN
t8code is a C library to manage a forest of adaptive space-trees of general element classes in parallel.
|
We define the geometrical queries for a forest of trees in this file. More...
Go to the source code of this file.
Functions | |
void | t8_forest_element_coordinate (t8_forest_t forest, t8_locidx_t ltree_id, const t8_element_t *element, int corner_number, double *coordinates) |
Compute the coordinates of a given vertex of an element if a geometry for this tree is registered in the forest's cmesh. More... | |
void | t8_forest_element_from_ref_coords_ext (t8_forest_t forest, t8_locidx_t ltreeid, const t8_element_t *element, const double *ref_coords, const size_t num_coords, double *coords_out, const double *stretch_factors) |
Compute the coordinates of a point inside an element inside a tree. More... | |
void | t8_forest_element_from_ref_coords (t8_forest_t forest, t8_locidx_t ltreeid, const t8_element_t *element, const double *ref_coords, const size_t num_coords, double *coords_out) |
Compute the coordinates of a point inside an element inside a tree. More... | |
void | t8_forest_element_centroid (t8_forest_t forest, t8_locidx_t ltreeid, const t8_element_t *element, double *coordinates) |
Compute the coordinates of the centroid of an element if a geometry for this tree is registered in the forest's cmesh. More... | |
double | t8_forest_element_diam (t8_forest_t forest, t8_locidx_t ltreeid, const t8_element_t *element) |
Compute the diameter of an element if a geometry for this tree is registered in the forest's cmesh. More... | |
double | t8_forest_element_volume (t8_forest_t forest, t8_locidx_t ltreeid, const t8_element_t *element) |
Compute the volume of an element if a geometry for this tree is registered in the forest's cmesh. More... | |
double | t8_forest_element_face_area (t8_forest_t forest, t8_locidx_t ltreeid, const t8_element_t *element, int face) |
Compute the area of an element's face if a geometry for this tree is registered in the forest's cmesh. More... | |
void | t8_forest_element_face_centroid (t8_forest_t forest, t8_locidx_t ltreeid, const t8_element_t *element, int face, double centroid[3]) |
Compute the vertex coordinates of the centroid of an element's face if a geometry for this tree is registered in the forest's cmesh. More... | |
void | t8_forest_element_face_normal (t8_forest_t forest, t8_locidx_t ltreeid, const t8_element_t *element, int face, double normal[3]) |
Compute the normal vector of an element's face if a geometry for this tree is registered in the forest's cmesh. More... | |
We define the geometrical queries for a forest of trees in this file.
void t8_forest_element_centroid | ( | t8_forest_t | forest, |
t8_locidx_t | ltreeid, | ||
const t8_element_t * | element, | ||
double * | coordinates | ||
) |
Compute the coordinates of the centroid of an element if a geometry for this tree is registered in the forest's cmesh.
The centroid can be seen as the midpoint of an element and thus can for example be used to compute level-set values or the distance between two elements.
[in] | forest | The forest. |
[in] | ltree_id | The forest local id of the tree in which the element is. |
[in] | element | The element. |
[out] | coordinates | On input an allocated array to store 3 doubles, on output the x, y and z coordinates of the centroid. |
void t8_forest_element_coordinate | ( | t8_forest_t | forest, |
t8_locidx_t | ltree_id, | ||
const t8_element_t * | element, | ||
int | corner_number, | ||
double * | coordinates | ||
) |
Compute the coordinates of a given vertex of an element if a geometry for this tree is registered in the forest's cmesh.
[in] | forest | The forest. |
[in] | ltree_id | The forest local id of the tree in which the element is. |
[in] | element | The element. |
[in] | corner_number | The corner number, in Z-order, of the vertex which should be computed. |
[out] | coordinates | On input an allocated array to store 3 doubles, on output the x, y and z coordinates of the vertex. |
double t8_forest_element_diam | ( | t8_forest_t | forest, |
t8_locidx_t | ltreeid, | ||
const t8_element_t * | element | ||
) |
Compute the diameter of an element if a geometry for this tree is registered in the forest's cmesh.
This is only an approximation.
[in] | forest | The forest. |
[in] | ltree_id | The forest local id of the tree in which the element is. |
[in] | element | The element. |
double t8_forest_element_face_area | ( | t8_forest_t | forest, |
t8_locidx_t | ltreeid, | ||
const t8_element_t * | element, | ||
int | face | ||
) |
Compute the area of an element's face if a geometry for this tree is registered in the forest's cmesh.
Currently implemented for 2D elements only. This is only an approximation.
[in] | forest | The forest. |
[in] | ltree_id | The forest local id of the tree in which the element is. |
[in] | element | The element. |
[in] | face | A face of element. |
void t8_forest_element_face_centroid | ( | t8_forest_t | forest, |
t8_locidx_t | ltreeid, | ||
const t8_element_t * | element, | ||
int | face, | ||
double | centroid[3] | ||
) |
Compute the vertex coordinates of the centroid of an element's face if a geometry for this tree is registered in the forest's cmesh.
[in] | forest | The forest. |
[in] | ltree_id | The forest local id of the tree in which the element is. |
[in] | element | The element. |
[in] | face | A face of element. |
[out] | normal | On output the centroid of face. forest must be committed when calling this function. |
void t8_forest_element_face_normal | ( | t8_forest_t | forest, |
t8_locidx_t | ltreeid, | ||
const t8_element_t * | element, | ||
int | face, | ||
double | normal[3] | ||
) |
Compute the normal vector of an element's face if a geometry for this tree is registered in the forest's cmesh.
Currently implemented for 2D elements only.
[in] | forest | The forest. |
[in] | ltree_id | The forest local id of the tree in which the element is. |
[in] | element | The element. |
[in] | face | A face of element. |
[out] | normal | On output the normal vector of element at face. forest must be committed when calling this function. |
void t8_forest_element_from_ref_coords | ( | t8_forest_t | forest, |
t8_locidx_t | ltreeid, | ||
const t8_element_t * | element, | ||
const double * | ref_coords, | ||
const size_t | num_coords, | ||
double * | coords_out | ||
) |
Compute the coordinates of a point inside an element inside a tree.
The point is given in reference coordinates inside the element and gets converted to reference coordinates inside the tree. After that, the point is converted to global coordinates inside the domain.
[in] | forest | The forest. |
[in] | ltreeid | The forest local id of the tree in which the element is. |
[in] | element | The element. |
[in] | ref_coords | The reference coordinates of the point inside the element. |
[in] | num_coords | The number of coordinate sets in ref_coord (dimension x double). |
[out] | coords_out | On input an allocated array to store 3 doubles, on output the x, y and z coordinates of the point inside the domain. |
void t8_forest_element_from_ref_coords_ext | ( | t8_forest_t | forest, |
t8_locidx_t | ltreeid, | ||
const t8_element_t * | element, | ||
const double * | ref_coords, | ||
const size_t | num_coords, | ||
double * | coords_out, | ||
const double * | stretch_factors | ||
) |
Compute the coordinates of a point inside an element inside a tree.
The point is given in reference coordinates inside the element and gets converted to reference coordinates inside the tree. After that, the point is converted to global coordinates inside the domain. If needed, the element is stretched by the given stretch factors (the resulting mesh is then no longer non-overlapping).
[in] | forest | The forest. |
[in] | ltreeid | The forest local id of the tree in which the element is. |
[in] | element | The element. |
[in] | ref_coords | The reference coordinates of the point inside the element. |
[in] | num_coords | The number of coordinate sets in ref_coord (dimension x double). |
[out] | coords_out | On input an allocated array to store 3 doubles, on output the x, y and z coordinates of the point inside the domain. |
[in] | stretch_factors | If provided, elements are stretched according to the stretch factors of the tree. |
double t8_forest_element_volume | ( | t8_forest_t | forest, |
t8_locidx_t | ltreeid, | ||
const t8_element_t * | element | ||
) |
Compute the volume of an element if a geometry for this tree is registered in the forest's cmesh.
This is only an approximation.
[in] | forest | The forest. |
[in] | ltree_id | The forest local id of the tree in which the element is. |
[in] | element | The element. |