Struct t8_geometry
Defined in File t8_geometry_base.hxx
Inheritance Relationships
Derived Types
public t8_geometry_analytic(Struct t8_geometry_analytic)public t8_geometry_extended(Struct t8_geometry_extended)public t8_geometry_with_vertices(Struct t8_geometry_with_vertices)public t8_geometry_zero(Struct t8_geometry_zero)
Struct Documentation
-
struct t8_geometry
The base class for all geometries.
This class provides a general template for all geometries. It is a pure virtual class and has to be inherited by a concrete geometry implementation.
Subclassed by t8_geometry_analytic, t8_geometry_extended, t8_geometry_with_vertices, t8_geometry_zero
Public Functions
-
inline t8_geometry(std::string name)
Basic constructor that sets the name.
- Parameters:
name – [in] The name of the geometry. Used to distinct the geometry from other geometries.
-
inline t8_geometry()
-
inline virtual ~t8_geometry()
The destructor.
It does nothing but has to be defined since we may want to delete geometry that is actually inherited and providing an implementation for the destructor ensures that the destructor of the child class will be executed.
-
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 = 0
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 = 0
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_load_tree_data(const t8_cmesh_t cmesh, const t8_gloidx_t gtreeid)
Update a possible internal data buffer for per tree data.
This function is called before the first coordinates in a new tree are evaluated. In this base implementation we use it to load the treeid and class to the internal member variables active_tree and active_tree_class.
- Parameters:
cmesh – [in] The cmesh.
gtreeid – [in] The global tree.
-
inline virtual void t8_geom_point_batch_inside_element([[maybe_unused]] t8_forest_t forest, [[maybe_unused]] t8_locidx_t ltreeid, [[maybe_unused]] const t8_element_t *element, [[maybe_unused]] const double *points, [[maybe_unused]] const int num_points, [[maybe_unused]] int *is_inside, [[maybe_unused]] const double tolerance) const
Query whether a batch of points lies inside an element.
- Parameters:
forest – [in] The forest.
ltreeid – [in] The forest local id of the tree in which the element is.
element – [in] The element.
points – [in] 3-dimensional coordinates of the points to check
num_points – [in] The number of points to check
is_inside – [inout] An array of length num_points, filled with 0/1 on output. True (non-zero) if a point lies within an element, false otherwise. The return value is also true if the point lies on the element boundary. Thus, this function may return true for different leaf elements, if they are neighbors and the point lies on the common boundary.
tolerance – [in] Tolerance that we allow the point to not exactly match the element. If this value is larger we detect more points. If it is zero we probably do not detect points even if they are inside due to rounding errors.
-
inline virtual bool t8_geom_tree_negative_volume() const
Check if the currently active tree has a negative volume.
- Returns:
True if the currently loaded tree has a negative volume.
-
virtual bool t8_geom_check_tree_compatibility() const = 0
Check for compatibility of the currently loaded tree with the geometry.
If the geometry has limitations these can be checked here. This includes for example if only specific tree types or dimensions are supported. If all trees are supported, this function should return true.
- Returns:
True if the geometry is compatible with the tree.
-
inline const std::string &t8_geom_get_name() const
Get the name of this geometry.
- Returns:
The name.
-
inline virtual bool get_tree_bounding_box([[maybe_unused]] const t8_cmesh_t cmesh, [[maybe_unused]] double bounds[6]) const
Compute the bounding box of the currently active tree.
Note
This function updates the active tree to the provided gtreeid.
- Parameters:
cmesh – [in] The cmesh.
bounds – [out] The bounding box of the tree in the form (xmin, xmax, ymin, ymax, zmin, zmax).
- Returns:
True if the bounding box was computed successfully, false otherwise.
-
inline t8_geometry_hash t8_geom_get_hash() const
Get the hash value of this geometry.
- Returns:
The hash.
-
virtual t8_geometry_type_t t8_geom_get_type() const = 0
Get the type of this geometry.
- Returns:
The type.
Protected Attributes
-
std::string name
The name of this geometry.
-
t8_geometry_hash hash
The hash of the name of this geometry.
See also t8_geometry_compute_hash
-
t8_gloidx_t active_tree
The tree of which currently vertices are loaded.
-
t8_eclass_t active_tree_class
The class of the currently active tree.
-
inline t8_geometry(std::string name)