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_cad Struct Reference

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

#include <t8_geometry_cad.hxx>

Inheritance diagram for t8_geometry_cad:
t8_geometry_with_vertices t8_geometry

Public Member Functions

 t8_geometry_cad (int dim, std::string fileprefix, std::string name="t8_geom_cad")
 Constructor of the cad geometry with a given dimension. More...
 
 t8_geometry_cad (int dim, const TopoDS_Shape cad_shape, std::string name="t8_geom_cad")
 Constructor of the cad geometry with a given dimension. More...
 
 t8_geometry_cad (int dim)
 Constructor of the cad geometry for testing purposes. More...
 
virtual ~t8_geometry_cad ()
 The destructor.
 
t8_geometry_type_t t8_geom_get_type () const
 Get the type of this geometry. More...
 
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 \). More...
 
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} \). More...
 
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. More...
 
int t8_geom_is_line (const int curve_index) const
 Check if a cad_curve is a line. More...
 
int t8_geom_is_plane (const int surface_index) const
 Check if a cad_surface is a plane. More...
 
const gp_Pnt t8_geom_get_cad_point (const int index) const
 Get an cad point from the cad_shape. More...
 
const Handle_Geom_Curve t8_geom_get_cad_curve (const int index) const
 Get an cad curve from the cad_shape. More...
 
const Handle_Geom_Surface t8_geom_get_cad_surface (const int index) const
 Get an cad surface from the cad_shape. More...
 
const TopTools_IndexedMapOfShape t8_geom_get_cad_shape_vertex_map () const
 Get the cad_shape_vertex2edge_map. More...
 
const TopTools_IndexedMapOfShape t8_geom_get_cad_shape_edge_map () const
 Get the cad_shape_edge2face_map. More...
 
const TopTools_IndexedMapOfShape t8_geom_get_cad_shape_face_map () const
 Get the cad_shape_face_map. More...
 
int t8_geom_get_common_edge (const int vertex1_index, const int vertex2_index) const
 Check if two cad points share a common cad edge. More...
 
int t8_geom_get_common_face (const int edge1_index, const int edge2_index) const
 Check if two cad edges share a common cad face. More...
 
int t8_geom_is_vertex_on_edge (const int vertex_index, const int edge_index) const
 Check if a cad vertex lies on an cad edge. More...
 
int t8_geom_is_edge_on_face (const int edge_index, const int face_index) const
 Check if a cad vertex lies on an cad edge. More...
 
int t8_geom_is_vertex_on_face (const int vertex_index, const int face_index) const
 Check if a cad vertex lies on an cad face. More...
 
void t8_geom_get_parameter_of_vertex_on_edge (const int vertex_index, const int edge_index, double *edge_param) const
 Retrieves the parameter of an cad vertex on an cad edge. More...
 
void t8_geom_get_parameters_of_vertex_on_face (const int vertex_index, const int face_index, double *face_params) const
 Retrieves the parameters of an cad vertex on a cad face. More...
 
void t8_geom_edge_parameter_to_face_parameters (const int edge_index, const int face_index, const int num_face_nodes, const double edge_param, const double *surface_params, double *face_params) const
 Converts the parameters of an cad edge to the corresponding parameters on an cad face. More...
 
void t8_geom_get_face_parametric_bounds (const int surface_index, double *bounds) const
 Finds the parametric bounds of an cad face. More...
 
void t8_geom_get_edge_parametric_bounds (const int edge_index, double *bounds) const
 Finds the parametric bounds of an cad edge. More...
 
int t8_geom_is_edge_closed (int edge_index) const
 Checks if an edge is closed in its U parameter. More...
 
int t8_geom_is_surface_closed (int geometry_index, int parameter) const
 Checks if a surface is closed in its U parameter or V parameter. More...
 
- Public Member Functions inherited from t8_geometry_with_vertices
 t8_geometry_with_vertices (int dimension, std::string name)
 
virtual ~t8_geometry_with_vertices ()
 The destructor. More...
 
virtual bool t8_geom_tree_negative_volume () const
 Check if the currently active tree has a negative volume. More...
 
t8_geometry_type_t t8_geom_get_type () const
 Get the type of this geometry. More...
 
- Public Member Functions inherited from t8_geometry
 t8_geometry (int dim, std::string name)
 
virtual ~t8_geometry ()
 The destructor. More...
 
virtual void t8_geom_point_batch_inside_element (t8_forest_t forest, t8_locidx_t ltreeid, const t8_element_t *element, const double *points, const int num_points, int *is_inside, const double tolerance) const
 Query whether a batch of points lies inside an element. More...
 
int t8_geom_get_dimension () const
 Get the dimension of this geometry. More...
 
const std::string t8_geom_get_name () const
 Get the name of this geometry. More...
 
const size_t t8_geom_get_hash () const
 

Additional Inherited Members

- Protected Attributes inherited from t8_geometry_with_vertices
t8_gloidx_t active_tree
 
t8_eclass_t active_tree_class
 
const double * active_tree_vertices
 
- Protected Attributes inherited from t8_geometry
int dimension
 The dimension of reference space for which this is a geometry.
 
std::string name
 The name of this geometry.
 
size_t hash
 The hash of the name of this geometry.
 

Detailed Description

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

Constructor & Destructor Documentation

◆ t8_geometry_cad() [1/3]

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

Constructor of the cad geometry with a given dimension.

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_readmshfile function.

Parameters
[in]dimThe dimension of this geometry.
[in]fileprefixPrefix of a .brep file from which to extract an cad geometry.
[in]nameThe name to give this geometry.

◆ t8_geometry_cad() [2/3]

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

Constructor of the cad geometry with a given dimension.

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 (int dim, std::string fileprefix, std::string name) constructor.

Parameters
[in]dimThe dimension of this geometry.
[in]cad_shapecad shape geometry.
[in]nameThe name to give this geometry.

◆ t8_geometry_cad() [3/3]

t8_geometry_cad::t8_geometry_cad ( int  dim)

Constructor of the cad geometry for testing purposes.

Sets an invalid cad_shape.

Parameters
[in]dimThe dimension of this geometry.

Member Function Documentation

◆ t8_geom_edge_parameter_to_face_parameters()

void t8_geometry_cad::t8_geom_edge_parameter_to_face_parameters ( const int  edge_index,
const int  face_index,
const int  num_face_nodes,
const double  edge_param,
const double *  surface_params,
double *  face_params 
) const

Converts the parameters of an cad edge to the corresponding parameters on an cad face.

The edge has to lie on the face. For the conversion of edge parameters of mesh elements to topological face parameters of a closed surface, it is additionally checked, whether the conversion was correct, to prevent disorted elements.

Parameters
[in]edge_indexThe index of the cad edge, which parameters should be converted to face parameters.
[in]face_indexThe index of the cad face, on to which the edge parameters should be converted.
[in]num_face_nodesThe number of the face nodes of the evaluated element. Only needed for closed surface check, otherwise NULL.
[in]edge_paramThe parameter on the edge.
[in]surface_paramThe parameters of the surface nodes. When provided, there are additional checks for closed geometries. If there are no surface parameter to pass in to the function, you can pass NULL.
[out]face_paramsThe corresponding parameters on the face.

◆ t8_geom_evaluate()

void t8_geometry_cad::t8_geom_evaluate ( t8_cmesh_t  cmesh,
t8_gloidx_t  gtreeid,
const double *  ref_coords,
const size_t  num_coords,
double *  out_coords 
) const
virtual

Maps points in the reference space \( [0,1]^\mathrm{dim} \to \mathbb{R}^3 \).

Parameters
[in]cmeshThe cmesh in which the point lies.
[in]gtreeidThe global tree (of the cmesh) in which the reference point is.
[in]ref_coordsArray of dimension x num_coords many entries, specifying points in \( [0,1]^\mathrm{dim} \).
[in]num_coordsAmount of points of /f$ \mathrm{dim} /f$ to map.
[out]out_coordsThe mapped coordinates in physical space of ref_coords. The length is num_coords * 3.

Implements t8_geometry.

◆ t8_geom_evaluate_jacobian()

void t8_geometry_cad::t8_geom_evaluate_jacobian ( t8_cmesh_t  cmesh,
t8_gloidx_t  gtreeid,
const double *  ref_coords,
const size_t  num_coords,
double *  jacobian 
) const
virtual

Compute the jacobian of the t8_geom_evaluate map at a point in the reference space \( [0,1]^\mathrm{dim} \).

Parameters
[in]cmeshThe cmesh in which the point lies.
[in]gtreeidThe global tree (of the cmesh) in which the reference point is.
[in]ref_coordsArray of dimension x num_coords many entries, specifying points in \( [0,1]^\mathrm{dim} \).
[in]num_coordsAmount of points of /f$ \mathrm{dim} /f$ to map.
[out]jacobianThe 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} \)).

Implements t8_geometry.

◆ t8_geom_get_cad_curve()

const Handle_Geom_Curve t8_geometry_cad::t8_geom_get_cad_curve ( const int  index) const

Get an cad curve from the cad_shape.

Parameters
[in]indexThe index of the curve in the cad_shape.
Returns
The cad curve.

◆ t8_geom_get_cad_point()

const gp_Pnt t8_geometry_cad::t8_geom_get_cad_point ( const int  index) const

Get an cad point from the cad_shape.

Parameters
[in]indexThe index of the point in the cad_shape.
Returns
The cad point.

◆ t8_geom_get_cad_shape_edge_map()

const TopTools_IndexedMapOfShape t8_geometry_cad::t8_geom_get_cad_shape_edge_map ( ) const

Get the cad_shape_edge2face_map.

Returns
The cad_shape_edge_map.

◆ t8_geom_get_cad_shape_face_map()

const TopTools_IndexedMapOfShape t8_geometry_cad::t8_geom_get_cad_shape_face_map ( ) const

Get the cad_shape_face_map.

Returns
The cad_shape_face_map.

◆ t8_geom_get_cad_shape_vertex_map()

const TopTools_IndexedMapOfShape t8_geometry_cad::t8_geom_get_cad_shape_vertex_map ( ) const

Get the cad_shape_vertex2edge_map.

Returns
The cad_shape_vertex_map.

◆ t8_geom_get_cad_surface()

const Handle_Geom_Surface t8_geometry_cad::t8_geom_get_cad_surface ( const int  index) const

Get an cad surface from the cad_shape.

Parameters
[in]indexThe index of the surface in the cad_shape.
Returns
The cad surface.

◆ t8_geom_get_common_edge()

int t8_geometry_cad::t8_geom_get_common_edge ( const int  vertex1_index,
const int  vertex2_index 
) const

Check if two cad points share a common cad edge.

Parameters
[in]vertex1_indexThe index of the first cad point.
[in]vertex2_indexThe index of the second cad point.
Returns
Index of the shared edge. 0 if there is no shared edge.

◆ t8_geom_get_common_face()

int t8_geometry_cad::t8_geom_get_common_face ( const int  edge1_index,
const int  edge2_index 
) const

Check if two cad edges share a common cad face.

Parameters
[in]edge1_indexThe index of the first cad edge.
[in]edge2_indexThe index of the second cad edge.
Returns
Index of the shared face. 0 if there is no shared face.

◆ t8_geom_get_edge_parametric_bounds()

void t8_geometry_cad::t8_geom_get_edge_parametric_bounds ( const int  edge_index,
double *  bounds 
) const

Finds the parametric bounds of an cad edge.

Parameters
[in]edge_indexThe index of the cad edge.
[out]boundsThe parametric bounds of the cad edge.

◆ t8_geom_get_face_parametric_bounds()

void t8_geometry_cad::t8_geom_get_face_parametric_bounds ( const int  surface_index,
double *  bounds 
) const

Finds the parametric bounds of an cad face.

Parameters
[in]face_indexThe index of the cad face.
[out]boundsThe parametric bounds of the cad face.

◆ t8_geom_get_parameter_of_vertex_on_edge()

void t8_geometry_cad::t8_geom_get_parameter_of_vertex_on_edge ( const int  vertex_index,
const int  edge_index,
double *  edge_param 
) const

Retrieves the parameter of an cad vertex on an cad edge.

The vertex has to lie on the edge.

Parameters
[in]vertex_indexThe index of the cad vertex.
[in]edge_indexThe index of the cad edge.
[out]edge_paramThe parameter of the vertex on the edge.

◆ t8_geom_get_parameters_of_vertex_on_face()

void t8_geometry_cad::t8_geom_get_parameters_of_vertex_on_face ( const int  vertex_index,
const int  face_index,
double *  face_params 
) const

Retrieves the parameters of an cad vertex on a cad face.

The vertex has to lie on the face.

Parameters
[in]vertex_indexThe index of the cad vertex.
[in]face_indexThe index of the cad face.
[out]face_paramsThe parameters of the vertex on the face.

◆ t8_geom_get_type()

t8_geometry_type_t t8_geometry_cad::t8_geom_get_type ( ) const
inlinevirtual

Get the type of this geometry.

Returns
The type.

Implements t8_geometry.

◆ t8_geom_is_edge_closed()

int t8_geometry_cad::t8_geom_is_edge_closed ( int  edge_index) const

Checks if an edge is closed in its U parameter.

Parameters
[in]edge_indexThe index of the closed edge.
Returns
1 if edge is closed in U. 0 if edge is not closed in U.

◆ t8_geom_is_edge_on_face()

int t8_geometry_cad::t8_geom_is_edge_on_face ( const int  edge_index,
const int  face_index 
) const

Check if a cad vertex lies on an cad edge.

Parameters
[in]edge_indexThe index of the cad vertex.
[in]face_indexThe index of the cad edge.
Returns
1 if vertex lies on edge, otherwise 0.

◆ t8_geom_is_line()

int t8_geometry_cad::t8_geom_is_line ( const int  curve_index) const

Check if a cad_curve is a line.

Parameters
[in]curve_indexThe index of the cad_curve.
Returns
1 if curve is a line, 0 if curve is not a line.

◆ t8_geom_is_plane()

int t8_geometry_cad::t8_geom_is_plane ( const int  surface_index) const

Check if a cad_surface is a plane.

Parameters
[in]surface_indexThe index of the cad_surface.
Returns
1 if surface is a plane linear, 0 if surface is not a plane.

◆ t8_geom_is_surface_closed()

int t8_geometry_cad::t8_geom_is_surface_closed ( int  geometry_index,
int  parameter 
) const

Checks if a surface is closed in its U parameter or V parameter.

Parameters
[in]geometry_indexThe index of the closed geometry.
[in]parameterThe parameter, which should be check for closeness. 0 stands for the U parameter and 1 for the V parameter.
Returns
1 if geometry is closed in U. 0 if geometry is not closed in U.

◆ t8_geom_is_vertex_on_edge()

int t8_geometry_cad::t8_geom_is_vertex_on_edge ( const int  vertex_index,
const int  edge_index 
) const

Check if a cad vertex lies on an cad edge.

Parameters
[in]vertex_indexThe index of the cad vertex.
[in]edge_indexThe index of the cad edge.
Returns
1 if vertex lies on edge, otherwise 0.

◆ t8_geom_is_vertex_on_face()

int t8_geometry_cad::t8_geom_is_vertex_on_face ( const int  vertex_index,
const int  face_index 
) const

Check if a cad vertex lies on an cad face.

Parameters
[in]vertex_indexThe index of the cad vertex.
[in]face_indexThe index of the cad face.
Returns
1 if vertex lies on face, otherwise 0.

◆ t8_geom_load_tree_data()

void t8_geometry_cad::t8_geom_load_tree_data ( t8_cmesh_t  cmesh,
t8_gloidx_t  gtreeid 
)
inlinevirtual

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
[in]cmeshThe cmesh.
[in]gtreeidThe global tree.

Reimplemented from t8_geometry_with_vertices.


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