Struct t8_geometry_cad

Inheritance Relationships

Base Type

Struct Documentation

struct t8_geometry_cad : public t8_geometry_with_vertices

This geometry uses OpenCASCADE CAD geometries to curve the trees to the actual shape of the underlying domain.

Public Functions

t8_geometry_cad(std::string fileprefix, std::string name = "t8_geom_cad")

Constructor of the cad geometry.

The geometry is currently viable with quad/hex and triangle trees. Tets will be supported soon. The geometry uses as many vertices as the tree type has, as well as additional geometry information, which is extracted from a .brep file. The vertices are saved via the t8_cmesh_set_tree_vertices function. Since the internals of this geometry are finely tuned to the .brep file it is recommended to only use it with the t8_cmesh_from_msh_file function.

Parameters:
  • fileprefix[in] Prefix of a .brep file from which to extract an cad geometry.

  • name[in] The name to give this geometry.

t8_geometry_cad(const TopoDS_Shape cad_shape, std::string name = "t8_geom_cad")

Constructor of the cad geometry.

The geometry is currently viable with quad/hex and triangle trees. Tets will be supported soon. The geometry uses as many vertices as the tree type has, as well as additional geometry information, which is given via the cad_shape. The vertices are saved via the t8_cmesh_set_tree_vertices function. This constructor can be used in short scripts or in combination with a mesh generator, to omit the file IO of the t8_geometry_cad (std::string fileprefix, std::string name) constructor.

Parameters:
  • cad_shape[in] cad shape geometry.

  • name[in] The name to give this geometry.

t8_geometry_cad()

Constructor of the cad geometry for testing purposes.

Sets an invalid cad_shape.

inline virtual ~t8_geometry_cad()

The destructor.

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_load_tree_data(t8_cmesh_t cmesh, 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. 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 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.

inline std::shared_ptr<t8_cad_handle> get_cad_handle() const

Getter function for the CAD handle.

Returns:

The CAD handle of the geometry.

inline void update_cad_handle(std::shared_ptr<t8_cad_handle> new_cad_handle)

Update the CAD handle with a new one.

Parameters:

new_cad_handle[in] The new CAD handle to be used.