t8
UNKNOWN
t8code is a C library to manage a forest of adaptive space-trees of general element classes in parallel.
|
This geometry uses OpenCASCADE CAD geometries to curve the trees to the actual shape of the underlying domain. More...
#include <t8_geometry_cad.hxx>
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... | |
![]() | |
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... | |
![]() | |
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 | |
![]() | |
t8_gloidx_t | active_tree |
t8_eclass_t | active_tree_class |
const double * | active_tree_vertices |
![]() | |
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. | |
This geometry uses OpenCASCADE CAD geometries to curve the trees to the actual shape of the underlying domain.
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.
[in] | dim | The dimension of this geometry. |
[in] | fileprefix | Prefix of a .brep file from which to extract an cad geometry. |
[in] | name | The name to give this geometry. |
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.
[in] | dim | The dimension of this geometry. |
[in] | cad_shape | cad shape geometry. |
[in] | name | The name to give this geometry. |
t8_geometry_cad::t8_geometry_cad | ( | int | dim | ) |
Constructor of the cad geometry for testing purposes.
Sets an invalid cad_shape.
[in] | dim | The dimension of this geometry. |
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.
[in] | edge_index | The index of the cad edge, which parameters should be converted to face parameters. |
[in] | face_index | The index of the cad face, on to which the edge parameters should be converted. |
[in] | num_face_nodes | The number of the face nodes of the evaluated element. Only needed for closed surface check, otherwise NULL. |
[in] | edge_param | The parameter on the edge. |
[in] | surface_param | The 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_params | The corresponding parameters on the face. |
|
virtual |
Maps points in the reference space \( [0,1]^\mathrm{dim} \to \mathbb{R}^3 \).
[in] | cmesh | The cmesh in which the point lies. |
[in] | gtreeid | The global tree (of the cmesh) in which the reference point is. |
[in] | ref_coords | Array of dimension x num_coords many entries, specifying points in \( [0,1]^\mathrm{dim} \). |
[in] | num_coords | Amount of points of /f$ \mathrm{dim} /f$ to map. |
[out] | out_coords | The mapped coordinates in physical space of ref_coords. The length is num_coords * 3. |
Implements t8_geometry.
|
virtual |
Compute the jacobian of the t8_geom_evaluate map at a point in the reference space \( [0,1]^\mathrm{dim} \).
[in] | cmesh | The cmesh in which the point lies. |
[in] | gtreeid | The global tree (of the cmesh) in which the reference point is. |
[in] | ref_coords | Array of dimension x num_coords many entries, specifying points in \( [0,1]^\mathrm{dim} \). |
[in] | num_coords | Amount of points of /f$ \mathrm{dim} /f$ to map. |
[out] | jacobian | 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} \)). |
Implements t8_geometry.
const Handle_Geom_Curve t8_geometry_cad::t8_geom_get_cad_curve | ( | const int | index | ) | const |
Get an cad curve from the cad_shape.
[in] | index | The index of the curve in the cad_shape. |
const gp_Pnt t8_geometry_cad::t8_geom_get_cad_point | ( | const int | index | ) | const |
Get an cad point from the cad_shape.
[in] | index | The index of the point in the cad_shape. |
const TopTools_IndexedMapOfShape t8_geometry_cad::t8_geom_get_cad_shape_edge_map | ( | ) | const |
Get the cad_shape_edge2face_map.
const TopTools_IndexedMapOfShape t8_geometry_cad::t8_geom_get_cad_shape_face_map | ( | ) | const |
Get the cad_shape_face_map.
const TopTools_IndexedMapOfShape t8_geometry_cad::t8_geom_get_cad_shape_vertex_map | ( | ) | const |
Get the cad_shape_vertex2edge_map.
const Handle_Geom_Surface t8_geometry_cad::t8_geom_get_cad_surface | ( | const int | index | ) | const |
Get an cad surface from the cad_shape.
[in] | index | The index of the surface in the cad_shape. |
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.
[in] | vertex1_index | The index of the first cad point. |
[in] | vertex2_index | The index of the second cad point. |
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.
[in] | edge1_index | The index of the first cad edge. |
[in] | edge2_index | The index of the second cad edge. |
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.
[in] | edge_index | The index of the cad edge. |
[out] | bounds | The parametric bounds of the cad edge. |
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.
[in] | face_index | The index of the cad face. |
[out] | bounds | The parametric bounds of the cad face. |
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.
[in] | vertex_index | The index of the cad vertex. |
[in] | edge_index | The index of the cad edge. |
[out] | edge_param | The parameter of the vertex on the edge. |
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.
[in] | vertex_index | The index of the cad vertex. |
[in] | face_index | The index of the cad face. |
[out] | face_params | The parameters of the vertex on the face. |
|
inlinevirtual |
int t8_geometry_cad::t8_geom_is_edge_closed | ( | int | edge_index | ) | const |
Checks if an edge is closed in its U parameter.
[in] | edge_index | The index of the closed edge. |
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.
[in] | edge_index | The index of the cad vertex. |
[in] | face_index | The index of the cad edge. |
int t8_geometry_cad::t8_geom_is_line | ( | const int | curve_index | ) | const |
Check if a cad_curve is a line.
[in] | curve_index | The index of the cad_curve. |
int t8_geometry_cad::t8_geom_is_plane | ( | const int | surface_index | ) | const |
Check if a cad_surface is a plane.
[in] | surface_index | The index of the cad_surface. |
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.
[in] | geometry_index | The index of the closed geometry. |
[in] | parameter | The parameter, which should be check for closeness. 0 stands for the U parameter and 1 for the V parameter. |
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.
[in] | vertex_index | The index of the cad vertex. |
[in] | edge_index | The index of the cad edge. |
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.
[in] | vertex_index | The index of the cad vertex. |
[in] | face_index | The index of the cad face. |
|
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).
[in] | cmesh | The cmesh. |
[in] | gtreeid | The global tree. |
Reimplemented from t8_geometry_with_vertices.