t8  UNKNOWN
t8code is a C library to manage a forest of adaptive space-trees of general element classes in parallel.
t8_geometry_helpers.h
Go to the documentation of this file.
1 /*
2  This file is part of t8code.
3  t8code is a C library to manage a collection (a forest) of multiple
4  connected adaptive space-trees of general element classes in parallel.
5 
6  Copyright (C) 2015 the developers
7 
8  t8code is free software; you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation; either version 2 of the License, or
11  (at your option) any later version.
12 
13  t8code is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with t8code; if not, write to the Free Software Foundation, Inc.,
20  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 */
22 
28 #ifndef T8_GEOMETRY_HELPERS_H
29 #define T8_GEOMETRY_HELPERS_H
30 
31 #include <t8.h>
32 
33 T8_EXTERN_C_BEGIN ();
34 
42 void
43 t8_geom_compute_linear_geometry (t8_eclass_t tree_class, const double *tree_vertices, const double *ref_coords,
44  const size_t num_coords, double *out_coords);
45 
55 void
56 t8_geom_compute_linear_axis_aligned_geometry (t8_eclass_t tree_class, const double *tree_vertices,
57  const double *ref_coords, const size_t num_coords, double *out_coords);
58 
67 void
68 t8_geom_linear_interpolation (const double *coefficients, const double *corner_values, int corner_value_dim,
69  int interpolation_dim, double *evaluated_function);
70 
81 void
82 t8_geom_triangular_interpolation (const double *coefficients, const double *corner_values, int corner_value_dim,
83  int interpolation_dim, double *evaluated_function);
84 
92 void
93 t8_geom_get_face_vertices (t8_eclass_t tree_class, const double *tree_vertices, int face_index, int dim,
94  double *face_vertices);
95 
103 void
104 t8_geom_get_edge_vertices (t8_eclass_t tree_class, const double *tree_vertices, int edge_index, int dim,
105  double *edge_vertices);
106 
118 void
119 t8_geom_get_ref_intersection (int edge_index, const double *ref_coords, double ref_intersection[2]);
120 
131 double
132 t8_geom_get_triangle_scaling_factor (int edge_index, const double *tree_vertices, const double *glob_intersection,
133  const double *glob_ref_point);
134 
142 double
143 t8_geom_get_scaling_factor_of_edge_on_face_tet (int edge_index, int face_index, const double *ref_coords);
144 
153 void
154 t8_geom_get_tet_face_intersection (const int face_index, const double *ref_coords, double face_intersection[3]);
162 int
163 t8_vertex_point_inside (const double vertex_coords[3], const double point[3], const double tolerance);
164 
175 int
176 t8_line_point_inside (const double *p_0, const double *vec, const double *point, const double tolerance);
177 
188 int
189 t8_triangle_point_inside (const double p_0[3], const double v[3], const double w[3], const double point[3],
190  const double tolerance);
191 
199 int
200 t8_plane_point_inside (const double point_on_face[3], const double face_normal[3], const double point[3]);
201 
202 T8_EXTERN_C_END ();
203 
204 #endif /* !T8_GEOMETRY_HELPERS_H */
This is the administrative header file for t8code.
enum t8_eclass t8_eclass_t
This enumeration contains all possible element classes.
double t8_geom_get_scaling_factor_of_edge_on_face_tet(int edge_index, int face_index, const double *ref_coords)
Calculates the scaling factor for the displacement of an edge over a face of a tetrahedral element.
Definition: t8_geometry_helpers.c:375
void t8_geom_compute_linear_axis_aligned_geometry(t8_eclass_t tree_class, const double *tree_vertices, const double *ref_coords, const size_t num_coords, double *out_coords)
Compute the linear, axis-aligned geometry of a tree at a given reference coordinate.
Definition: t8_geometry_helpers.c:178
int t8_vertex_point_inside(const double vertex_coords[3], const double point[3], const double tolerance)
Check if a point lies inside a vertex.
Definition: t8_geometry_helpers.c:463
double t8_geom_get_triangle_scaling_factor(int edge_index, const double *tree_vertices, const double *glob_intersection, const double *glob_ref_point)
Calculates the scaling factor for edge displacement along a triangular tree face depending on the pos...
Definition: t8_geometry_helpers.c:349
void t8_geom_get_face_vertices(t8_eclass_t tree_class, const double *tree_vertices, int face_index, int dim, double *face_vertices)
Copies the vertex coordinates of a tree face in zorder into a separate array.
Definition: t8_geometry_helpers.c:220
void t8_geom_get_tet_face_intersection(const int face_index, const double *ref_coords, double face_intersection[3])
Calculates the face intersection of a ray passing trough the reference coordinates and the opposite v...
Definition: t8_geometry_helpers.c:414
void t8_geom_get_ref_intersection(int edge_index, const double *ref_coords, double ref_intersection[2])
Calculates a point of intersection in a triangular reference space.
Definition: t8_geometry_helpers.c:246
void t8_geom_linear_interpolation(const double *coefficients, const double *corner_values, int corner_value_dim, int interpolation_dim, double *evaluated_function)
Interpolates linearly between 2, bilinearly between 4 or trilineraly between 8 points.
Definition: t8_geometry_helpers.c:29
int t8_line_point_inside(const double *p_0, const double *vec, const double *point, const double tolerance)
Check if a point is inside a line that is defined by a starting point p_0 and a vector vec.
Definition: t8_geometry_helpers.c:473
void t8_geom_triangular_interpolation(const double *coefficients, const double *corner_values, int corner_value_dim, int interpolation_dim, double *evaluated_function)
Triangular interpolation between 3 points (triangle) or 4 points (tetrahedron) using barycentric coor...
Definition: t8_geometry_helpers.c:57
int t8_plane_point_inside(const double point_on_face[3], const double face_normal[3], const double point[3])
Check if a point lays on the inner side of a plane of a bilinearly interpolated volume element.
Definition: t8_geometry_helpers.c:574
int t8_triangle_point_inside(const double p_0[3], const double v[3], const double w[3], const double point[3], const double tolerance)
Check if a point is inside of a triangle described by a point p_0 and two vectors v and w.
Definition: t8_geometry_helpers.c:520
void t8_geom_compute_linear_geometry(t8_eclass_t tree_class, const double *tree_vertices, const double *ref_coords, const size_t num_coords, double *out_coords)
Compute the linear geometry of a tree at a given reference coordinate.
Definition: t8_geometry_helpers.c:82
void t8_geom_get_edge_vertices(t8_eclass_t tree_class, const double *tree_vertices, int edge_index, int dim, double *edge_vertices)
Copies the vertex coordinates of a tree edge in zorder into a separate array.
Definition: t8_geometry_helpers.c:233