Struct t8_geometry_linear

Inheritance Relationships

Base Type

Struct Documentation

struct t8_geometry_linear : public t8_geometry_with_vertices

Linear geometry.

Performs a (tri-/bi-)linear interpolation between the vertices of the assigned tree. Produces linear trees and elements.

Public Functions

t8_geometry_linear()

Constructor of the linear geometry.

The geometry is viable with all tree types and uses as many vertices as the tree type has. The vertices are saved via the t8_cmesh_set_tree_vertices function. Sets the dimension and the name to “t8_geom_linear”

virtual ~t8_geometry_linear()

The destructor.

Clears the allocated memory.

inline virtual t8_geometry_type_t t8_geom_get_type() const

Get the type of this geometry.

Returns:

The type.

virtual void t8_geom_evaluate(t8_cmesh_t cmesh, t8_gloidx_t gtreeid, const double *ref_coords, const size_t num_coords, double *out_coords) const

Maps points in the reference space \( [0,1]^\mathrm{dim} \to \mathbb{R}^3 \).

Parameters:
  • cmesh[in] The cmesh in which the point lies.

  • gtreeid[in] The global tree (of the cmesh) in which the reference point is.

  • ref_coords[in] Array of tree dimension x num_coords many entries, specifying points in \( [0,1]^\mathrm{dim} \).

  • num_coords[in] Amount of points of \( \mathrm{dim} \) to map.

  • out_coords[out] The mapped coordinates in physical space of ref_coords. The length is num_coords * 3.

virtual void t8_geom_evaluate_jacobian(t8_cmesh_t cmesh, t8_gloidx_t gtreeid, const double *ref_coords, const size_t num_coords, double *jacobian) const

Compute the jacobian of the t8_geom_evaluate map at a point in the reference space \( [0,1]^\mathrm{dim} \).

Parameters:
  • cmesh[in] The cmesh in which the point lies.

  • gtreeid[in] The global tree (of the cmesh) in which the reference point is.

  • ref_coords[in] Array of tree dimension x num_coords many entries, specifying points in \( [0,1]^\mathrm{dim} \).

  • num_coords[in] Amount of points of \( \mathrm{dim} \) to map.

  • jacobian[out] The jacobian at ref_coords. Array of size num_coords x dimension x 3. Indices \( 3 \cdot i\) , \( 3 \cdot i+1 \) , \( 3 \cdot i+2 \) correspond to the \( i \)-th column of the jacobian (Entry \( 3 \cdot i + j \) is \( \frac{\partial f_j}{\partial x_i} \)).

virtual void t8_geom_point_batch_inside_element(t8_forest_t forest, t8_locidx_t ltreeid, const t8_element_t *element, const double *points, const int num_points, int *is_inside, const double tolerance) const
Parameters:
  • forest[in] The forest of the element.

  • ltreeid[in] The local tree id of the element’s tree

  • element[in] The element

  • points[in] points to check

  • num_points[in] Number of points to check

  • is_inside[inout] Array to fill with flags whether the point is inside or not

  • tolerance[in] Tolerance of the inside-check

inline virtual bool t8_geom_check_tree_compatibility() const

Check for compatibility of the currently loaded tree with the geometry.

This geometry supports all element types, hence it returns true.

Returns:

True if the geometry is compatible with the tree.

virtual bool get_tree_bounding_box([[maybe_unused]] const t8_cmesh_t cmesh, double bounds[6]) const

Get the bounding box of the tree in the geometry.

Parameters:
  • cmesh[in] The cmesh containing the tree.

  • bounds[out] The bounding box of the tree, stored as {xmin, xmax, ymin, ymax, zmin, zmax}.

Returns:

True if the bounding box was successfully computed, false otherwise.