t8  UNKNOWN
t8code is a C library to manage a forest of adaptive space-trees of general element classes in parallel.
t8_forest_geometrical.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 
27 /* TODO: begin documenting this file: make doxygen 2>&1 | grep t8_forest */
28 
29 #ifndef T8_FOREST_GEOMETRICAL_H
30 #define T8_FOREST_GEOMETRICAL_H
31 
32 #include <sc_statistics.h>
33 #include <t8_cmesh.h>
34 T8_EXTERN_C_BEGIN ();
35 
45 void
46 t8_forest_element_coordinate (t8_forest_t forest, t8_locidx_t ltree_id, const t8_element_t *element, int corner_number,
47  double *coordinates);
48 
66 void
68  const double *ref_coords, const size_t num_coords, double *coords_out,
69  const double *stretch_factors);
70 
83 void
85  const double *ref_coords, const size_t num_coords, double *coords_out);
86 
97 void
98 t8_forest_element_centroid (t8_forest_t forest, t8_locidx_t ltreeid, const t8_element_t *element, double *coordinates);
99 
109 double
110 t8_forest_element_diam (t8_forest_t forest, t8_locidx_t ltreeid, const t8_element_t *element);
111 
122 double
123 t8_forest_element_volume (t8_forest_t forest, t8_locidx_t ltreeid, const t8_element_t *element);
124 
135 double
136 t8_forest_element_face_area (t8_forest_t forest, t8_locidx_t ltreeid, const t8_element_t *element, int face);
137 
147 void
148 t8_forest_element_face_centroid (t8_forest_t forest, t8_locidx_t ltreeid, const t8_element_t *element, int face,
149  double centroid[3]);
150 
160 void
161 t8_forest_element_face_normal (t8_forest_t forest, t8_locidx_t ltreeid, const t8_element_t *element, int face,
162  double normal[3]);
163 
164 T8_EXTERN_C_END ();
165 
166 #endif /* !T8_FOREST_GEOMETRICAL_H */
This structure is private to the implementation.
Definition: t8_forest_types.h:69
int32_t t8_locidx_t
A type for processor-local indexing.
Definition: t8.h:89
We define the coarse mesh of trees in this file.
struct t8_element t8_element_t
Opaque structure for a generic element, only used as pointer.
Definition: t8_element.h:42
double t8_forest_element_face_area(t8_forest_t forest, t8_locidx_t ltreeid, const t8_element_t *element, int face)
Compute the area of an element's face if a geometry for this tree is registered in the forest's cmesh...
Definition: t8_forest_cxx.cxx:723
double t8_forest_element_volume(t8_forest_t forest, t8_locidx_t ltreeid, const t8_element_t *element)
Compute the volume of an element if a geometry for this tree is registered in the forest's cmesh.
Definition: t8_forest_cxx.cxx:556
double t8_forest_element_diam(t8_forest_t forest, t8_locidx_t ltreeid, const t8_element_t *element)
Compute the diameter of an element if a geometry for this tree is registered in the forest's cmesh.
Definition: t8_forest_cxx.cxx:436
void t8_forest_element_face_centroid(t8_forest_t forest, t8_locidx_t ltreeid, const t8_element_t *element, int face, double centroid[3])
Compute the vertex coordinates of the centroid of an element's face if a geometry for this tree is re...
Definition: t8_forest_cxx.cxx:806
void t8_forest_element_from_ref_coords_ext(t8_forest_t forest, t8_locidx_t ltreeid, const t8_element_t *element, const double *ref_coords, const size_t num_coords, double *coords_out, const double *stretch_factors)
Compute the coordinates of a point inside an element inside a tree.
Definition: t8_forest_cxx.cxx:395
void t8_forest_element_centroid(t8_forest_t forest, t8_locidx_t ltreeid, const t8_element_t *element, double *coordinates)
Compute the coordinates of the centroid of an element if a geometry for this tree is registered in th...
Definition: t8_forest_cxx.cxx:473
void t8_forest_element_from_ref_coords(t8_forest_t forest, t8_locidx_t ltreeid, const t8_element_t *element, const double *ref_coords, const size_t num_coords, double *coords_out)
Compute the coordinates of a point inside an element inside a tree.
Definition: t8_forest_cxx.cxx:428
void t8_forest_element_coordinate(t8_forest_t forest, t8_locidx_t ltree_id, const t8_element_t *element, int corner_number, double *coordinates)
Compute the coordinates of a given vertex of an element if a geometry for this tree is registered in ...
Definition: t8_forest_cxx.cxx:370
void t8_forest_element_face_normal(t8_forest_t forest, t8_locidx_t ltreeid, const t8_element_t *element, int face, double normal[3])
Compute the normal vector of an element's face if a geometry for this tree is registered in the fores...
Definition: t8_forest_cxx.cxx:922