Struct t8_geometry_analytic
Defined in File t8_geometry_analytic.hxx
Inheritance Relationships
Base Type
public t8_geometry(Struct t8_geometry)
Struct Documentation
-
struct t8_geometry_analytic : public t8_geometry
Geometry which maps the trees interior to a user-specified analytical function. No class has to be implemented and every member function can be filled with a function pointer.
Public Functions
-
t8_geometry_analytic(std::string name, t8_geom_analytic_fn analytical, t8_geom_analytic_jacobian_fn jacobian, t8_geom_load_tree_data_fn load_tree_data, t8_geom_tree_negative_volume_fn tree_negative_volume_in, t8_geom_tree_compatible_fn tree_compatible_in, const void *user_data)
Constructor of the analytic geometry. The geometry is viable with all tree types and uses a user-provided analytic and jacobian function. The actual mappings are done by these functions.
- Parameters:
name – [in] The name to give this geometry.
analytical – [in] The analytical function to use for this geometry.
jacobian – [in] The jacobian of analytical.
load_tree_data – [in] The function that is used to load a tree’s data.
tree_negative_volume_in – [in] The function that is used to compute if a trees volume is negative.
tree_compatible_in – [in] The function that is used to check if a tree is compatible with the geometry.
user_data – [in] User data saved by the geometry. Can be accessed via t8_geom_analytic_get_user_data.
-
t8_geometry_analytic(std::string name)
Constructor of the analytic geometry for testing purposes.
- Parameters:
name – [in] The name to give this geometry.
-
inline virtual ~t8_geometry_analytic()
The destructor.
-
inline virtual t8_geometry_type_t t8_geom_get_type() const override
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 override
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 override
Compute the jacobian of the t8_geom_evaluate map at a point in the reference space \( [0,1]^\mathrm{dim} \).
Note
The jacobian will be (1) (1 0) (1 0 0) dim 1: J = (0) dim 2: J = (0 1) dim 3: J = (0 1 0) (0) (0 0) (0 0 1)
- 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 \( \mathrm{dim} \cdot 3 \) x num_coords. 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} \)).
-
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 override
- 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
-
virtual bool t8_geom_tree_negative_volume() const override
Check if the currently active tree has a negative volume
- Returns:
True (non-zero) if the currently loaded tree has a negative volume. 0 otherwise.
-
virtual bool t8_geom_check_tree_compatibility() const override
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.
-
virtual void t8_geom_load_tree_data(t8_cmesh_t cmesh, t8_gloidx_t gtreeid) override
Update a possible internal data buffer for per tree data. This function is called before the first coordinates in a new tree are evaluated. You can use it for example to load the vertex coordinates of the tree into an internal buffer (as is done in the linear geometry).
- Parameters:
cmesh – [in] The cmesh.
gtreeid – [in] The global tree.
-
inline const void *t8_geom_analytic_get_user_data()
Returns the user data stored in this geometry.
- Returns:
The user data.
-
t8_geometry_analytic(std::string name, t8_geom_analytic_fn analytical, t8_geom_analytic_jacobian_fn jacobian, t8_geom_load_tree_data_fn load_tree_data, t8_geom_tree_negative_volume_fn tree_negative_volume_in, t8_geom_tree_compatible_fn tree_compatible_in, const void *user_data)