t8  UNKNOWN
t8code is a C library to manage a forest of adaptive space-trees of general element classes in parallel.
Public Member Functions
t8_geometry_handler Struct Reference

Public Member Functions

 t8_geometry_handler ()
 Constructor.
 
 ~t8_geometry_handler ()
 Destructor.
 
template<typename geometry_type , typename... _args>
geometry_type * register_geometry (_args &&...args)
 Register a geometry with the geometry handler. More...
 
void register_geometry (t8_geometry **geom)
 Register a geometry with the geometry handler. More...
 
t8_geometryget_geometry (const std::string &name)
 Find a geometry by its name. More...
 
t8_geometryget_geometry (const size_t hash)
 Find a geometry by its hash. More...
 
size_t get_num_geometries () const
 Get the number of registered geometries. More...
 
t8_geometryget_unique_geometry ()
 If a geometry handler only has one registered geometry, get a pointer to this geometry. More...
 
void deactivate_tree ()
 Deactivate the current active tree. More...
 
t8_geometryget_tree_geometry (t8_cmesh_t cmesh, t8_gloidx_t gtreeid)
 Get the geometry of the provided tree. More...
 
void evaluate_tree_geometry (t8_cmesh_t cmesh, t8_gloidx_t gtreeid, const double *ref_coords, const size_t num_coords, double *out_coords)
 Evaluate the geometry of the provided tree at the given reference coordinates. More...
 
void evaluate_tree_geometry_jacobian (t8_cmesh_t cmesh, t8_gloidx_t gtreeid, const double *ref_coords, const size_t num_coords, double *out_coords)
 Evaluate the Jacobian of the geometry of the provided tree at the given reference coordinates. More...
 
t8_geometry_type_t get_tree_geometry_type (t8_cmesh_t cmesh, t8_gloidx_t gtreeid)
 Get the geometry type of the provided tree. More...
 
bool tree_negative_volume (const t8_cmesh_t cmesh, const t8_gloidx_t gtreeid)
 Check if the volume of a tree is negative. More...
 

Member Function Documentation

◆ deactivate_tree()

void t8_geometry_handler::deactivate_tree ( )
inline

Deactivate the current active tree.

Can be used to reload data, after it has been moved, for example by the partition-algorithm

◆ evaluate_tree_geometry()

void t8_geometry_handler::evaluate_tree_geometry ( t8_cmesh_t  cmesh,
t8_gloidx_t  gtreeid,
const double *  ref_coords,
const size_t  num_coords,
double *  out_coords 
)
inline

Evaluate the geometry of the provided tree at the given reference coordinates.

Parameters
[in]cmeshThe cmesh.
[in]gtreeidThe global tree id of the tree for which the geometry should be evaluated.
[in]ref_coordsThe reference coordinates at which to evaluate the geometry.
[in]num_coordsThe number of reference coordinates.
[out]out_coordsThe evaluated coordinates.

◆ evaluate_tree_geometry_jacobian()

void t8_geometry_handler::evaluate_tree_geometry_jacobian ( t8_cmesh_t  cmesh,
t8_gloidx_t  gtreeid,
const double *  ref_coords,
const size_t  num_coords,
double *  out_coords 
)
inline

Evaluate the Jacobian of the geometry of the provided tree at the given reference coordinates.

Parameters
[in]cmeshThe cmesh.
[in]gtreeidThe global tree id of the tree for which the geometry should be evaluated.
[in]ref_coordsThe reference coordinates at which to evaluate the geometry.
[in]num_coordsThe number of reference coordinates.
[out]out_coordsThe evaluated Jacobian coordinates.

◆ get_geometry() [1/2]

t8_geometry* t8_geometry_handler::get_geometry ( const size_t  hash)
inline

Find a geometry by its hash.

Parameters
[in]hashThe hash of the geometry to find.
Returns
An iterator to the geometry if found, NULL otherwise.

◆ get_geometry() [2/2]

t8_geometry* t8_geometry_handler::get_geometry ( const std::string &  name)
inline

Find a geometry by its name.

Parameters
[in]nameThe name of the geometry to find.
Returns
An iterator to the geometry if found, NULL otherwise.

◆ get_num_geometries()

size_t t8_geometry_handler::get_num_geometries ( ) const
inline

Get the number of registered geometries.

Returns
The number of registered geometries.

◆ get_tree_geometry()

t8_geometry* t8_geometry_handler::get_tree_geometry ( t8_cmesh_t  cmesh,
t8_gloidx_t  gtreeid 
)
inline

Get the geometry of the provided tree.

Parameters
[in]cmeshThe cmesh.
[in]gtreeidThe global tree id of the tree for which the geometry should be returned.
Returns
The geometry of the tree.

◆ get_tree_geometry_type()

t8_geometry_type_t t8_geometry_handler::get_tree_geometry_type ( t8_cmesh_t  cmesh,
t8_gloidx_t  gtreeid 
)
inline

Get the geometry type of the provided tree.

Parameters
[in]cmeshThe cmesh.
[in]gtreeidThe global tree id of the tree for which the geometry type should be returned.
Returns
The geometry type of the tree.

◆ get_unique_geometry()

t8_geometry* t8_geometry_handler::get_unique_geometry ( )
inline

If a geometry handler only has one registered geometry, get a pointer to this geometry.

Returns
The only registered geometry of geom_handler.
Note
Most cmeshes will have only one geometry and this function is an optimization for that special case. It is used for example in t8_cmesh_get_tree_geometry.

◆ register_geometry() [1/2]

template<typename geometry_type , typename... _args>
geometry_type* t8_geometry_handler::register_geometry ( _args &&...  args)
inline

Register a geometry with the geometry handler.

Template Parameters
geometry_typeThe type of the geometry to register.
_argsThe constructor arguments of the geometry.
Parameters
[in]argsThe constructor arguments of the geometry.
Returns
A pointer to the geometry.

◆ register_geometry() [2/2]

void t8_geometry_handler::register_geometry ( t8_geometry **  geom)

Register a geometry with the geometry handler.

The handler will take ownership of the geometry.

Parameters
[in]geomThe geometry to register.

◆ tree_negative_volume()

bool t8_geometry_handler::tree_negative_volume ( const t8_cmesh_t  cmesh,
const t8_gloidx_t  gtreeid 
)
inline

Check if the volume of a tree is negative.

Parameters
[in]cmeshThe cmesh.
[in]gtreeidThe global tree id of the tree to check.
Returns
True if the volume of the tree is negative, false otherwise.

The documentation for this struct was generated from the following files: