t8  UNKNOWN
t8code is a C library to manage a forest of adaptive space-trees of general element classes in parallel.
Data Structures | Typedefs | Enumerations | Functions
t8_geometry.h File Reference

Typedef for the t8_geometry class in order to be usable as a pointer from .c files. More...

#include <t8.h>
#include <t8_refcount.h>
#include <t8_cmesh.h>

Go to the source code of this file.

Data Structures

struct  t8_geometry_handler
 

Typedefs

typedef enum t8_geometry_type t8_geometry_type_t
 This enumeration contains all possible geometries.
 
typedef struct t8_geometry t8_geometry_c
 This typedef holds virtual functions for a particular geometry. More...
 
typedef struct t8_geometry_handler t8_geometry_handler_t
 

Enumerations

enum  t8_geometry_type {
  T8_GEOMETRY_TYPE_ZERO = 0 ,
  T8_GEOMETRY_TYPE_LINEAR ,
  T8_GEOMETRY_TYPE_LINEAR_AXIS_ALIGNED ,
  T8_GEOMETRY_TYPE_ANALYTIC ,
  T8_GEOMETRY_TYPE_OCC ,
  T8_GEOMETRY_TYPE_COUNT ,
  T8_GEOMETRY_TYPE_UNDEFINED
}
 This enumeration contains all possible geometries. More...
 

Functions

void t8_geom_handler_init (t8_geometry_handler_t **pgeom_handler)
 Initialize a geometry handler. More...
 
void t8_geom_handler_ref (t8_geometry_handler_t *geom_handler)
 Increase the reference counter of a geometry handler. More...
 
void t8_geom_handler_unref (t8_geometry_handler_t **pgeom_handler)
 Decrease the reference count of a geometry handler, if the refcount reaches 0, the handler will get destroyed. More...
 
void t8_geom_handler_destroy (t8_geometry_handler_t **pgeom_handler)
 Destroy a geometry handler and free its memory. More...
 
void t8_geom_handler_register_geometry (t8_geometry_handler_t *geom_handler, const t8_geometry_c *geometry)
 Add a geometry to the geometry handler. More...
 
void t8_geom_handler_commit (t8_geometry_handler_t *geom_handler)
 Commit a geometry handler. More...
 
int t8_geom_handler_is_committed (const t8_geometry_handler_t *geom_handler)
 
size_t t8_geom_handler_get_num_geometries (const t8_geometry_handler_t *geom_handler)
 Return the number of registered geometries. More...
 
const t8_geometry_ct8_geom_handler_get_unique_geometry (const t8_geometry_handler_t *geom_handler)
 If a geometry handler only has one registered geometry, get a pointer to this geometry. More...
 
t8_geometry_ct8_geom_handler_find_geometry (const t8_geometry_handler_t *geom_handler, const char *name)
 Given a geometry's name find that geometry in the geometry handler and return it. More...
 
void t8_geometry_evaluate (t8_cmesh_t cmesh, t8_gloidx_t gtreeid, const double *ref_coords, const size_t num_coords, double *out_coords)
 
void t8_geometry_jacobian (t8_cmesh_t cmesh, t8_gloidx_t gtreeid, const double *ref_coords, const size_t num_coords, double *jacobian)
 
t8_geometry_type_t t8_geometry_get_type (t8_cmesh_t cmesh, t8_gloidx_t gtreeid)
 

Detailed Description

Typedef for the t8_geometry class in order to be usable as a pointer from .c files.

Typedef Documentation

◆ t8_geometry_c

typedef struct t8_geometry t8_geometry_c

This typedef holds virtual functions for a particular geometry.

We need it so that we can use t8_geometry_c pointers in .c files without them seeing the actual C++ code (and then not compiling)

Enumeration Type Documentation

◆ t8_geometry_type

This enumeration contains all possible geometries.

Enumerator
T8_GEOMETRY_TYPE_ZERO 

The zero geometry maps all points to zero.

T8_GEOMETRY_TYPE_LINEAR 

The linear geometry uses linear interpolations to interpolate between the tree vertices.

T8_GEOMETRY_TYPE_LINEAR_AXIS_ALIGNED 

The linear, axis aligned geometry uses only 2 vertices, since it is axis aligned.

T8_GEOMETRY_TYPE_ANALYTIC 

The analytic geometry uses a user-defined analytic function to map into the physical domain.

T8_GEOMETRY_TYPE_OCC 

The OCC geometry uses OCC CAD shapes to map trees exactly to the underlying CAD model.

T8_GEOMETRY_TYPE_COUNT 

This is no geometry type but can be used as the number of geometry types.

T8_GEOMETRY_TYPE_UNDEFINED 

This is no geometry type but is used for every geometry, where no type is defined.

Function Documentation

◆ t8_geom_handler_commit()

void t8_geom_handler_commit ( t8_geometry_handler_t geom_handler)

Commit a geometry handler.

This specifies that no geometries will be added to it and makes it ready to be used.

Parameters
[in,out]geom_handlerAn initialized but not committed geometry handler.

◆ t8_geom_handler_destroy()

void t8_geom_handler_destroy ( t8_geometry_handler_t **  pgeom_handler)

Destroy a geometry handler and free its memory.

This is only valid if its reference count is 1. If you are unsure, call t8_geom_handler_unref instead.

Parameters
[in,out]pgeom_handlerPointer to an initialized geometry handler. Will point to NULL afterwards.

◆ t8_geom_handler_find_geometry()

t8_geometry_c* t8_geom_handler_find_geometry ( const t8_geometry_handler_t geom_handler,
const char *  name 
)

Given a geometry's name find that geometry in the geometry handler and return it.

Parameters
[in]geom_handlerA committed geometry handler.
[in]nameThe name of a geometry.
Returns
A pointer to the geometry or NULL if it was not found.

◆ t8_geom_handler_get_num_geometries()

size_t t8_geom_handler_get_num_geometries ( const t8_geometry_handler_t geom_handler)

Return the number of registered geometries.

Parameters
[in]geom_handlerA geometry handler (must be initialized and may or may not be committed).
Returns
The number of registered geometries in geom_handler.

◆ t8_geom_handler_get_unique_geometry()

const t8_geometry_c* t8_geom_handler_get_unique_geometry ( const t8_geometry_handler_t geom_handler)

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

Parameters
[in]geom_handlerMust be committed and have exactly one geometry registered.
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.

◆ t8_geom_handler_init()

void t8_geom_handler_init ( t8_geometry_handler_t **  pgeom_handler)

Initialize a geometry handler.

This will allocate memory.

Parameters
[in,out]pgeom_handlerOn input a pointer to unallocated memory. On output this will point to an initialized geometry handler.

◆ t8_geom_handler_ref()

void t8_geom_handler_ref ( t8_geometry_handler_t geom_handler)

Increase the reference counter of a geometry handler.

Parameters
[in]geom_handlerAn initialized geometry handler.

◆ t8_geom_handler_register_geometry()

void t8_geom_handler_register_geometry ( t8_geometry_handler_t geom_handler,
const t8_geometry_c geometry 
)

Add a geometry to the geometry handler.

Parameters
[in,out]geom_handlerAn initialized but not committed geometry handler.
[in]geometryThe geometry to add.

◆ t8_geom_handler_unref()

void t8_geom_handler_unref ( t8_geometry_handler_t **  pgeom_handler)

Decrease the reference count of a geometry handler, if the refcount reaches 0, the handler will get destroyed.

Parameters
[in,out]pgeom_handlerPointer to an initialized geometry handler. If the refcount reaches 0, will point to NULL afterwards.