t8  UNKNOWN
t8code is a C library to manage a forest of adaptive space-trees of general element classes in parallel.
t8_geometry.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_H
29 #define T8_GEOMETRY_H
30 
31 #include <t8.h>
32 #include <t8_refcount.h>
33 
35 typedef enum t8_geometry_type {
51 
56 typedef struct t8_geometry t8_geometry_c;
57 
58 /* The t8_geometry_c type must be know to cmesh.h, thus we
59  * include it after the typedef. */
60 #include <t8_cmesh.h>
61 
62 typedef struct t8_geometry_handler
63 {
75 
76 T8_EXTERN_C_BEGIN ();
77 
83 void
85 
90 void
92 
99 void
101 
109 void
111 
117 void
119 
125 void
127 
128 /* Check if a geometry handler was committed. */
129 int
130 t8_geom_handler_is_committed (const t8_geometry_handler_t *geom_handler);
131 
136 size_t
138 
146 const t8_geometry_c *
148 
157 t8_geom_handler_find_geometry (const t8_geometry_handler_t *geom_handler, const char *name);
158 
159 void
160 t8_geometry_evaluate (t8_cmesh_t cmesh, t8_gloidx_t gtreeid, const double *ref_coords, const size_t num_coords,
161  double *out_coords);
162 
163 void
164 t8_geometry_jacobian (t8_cmesh_t cmesh, t8_gloidx_t gtreeid, const double *ref_coords, const size_t num_coords,
165  double *jacobian);
166 
168 t8_geometry_get_type (t8_cmesh_t cmesh, t8_gloidx_t gtreeid);
169 
170 T8_EXTERN_C_END ();
171 
172 #endif /* !T8_GEOMETRY_H! */
This structure holds the connectivity data of the coarse mesh.
Definition: t8_cmesh_types.h:88
Definition: t8_geometry.h:63
t8_refcount_t rc
The reference count of the geometry handler.
Definition: t8_geometry.h:72
int is_committed
If true, no new geometries can be registered.
Definition: t8_geometry.h:70
t8_geometry_c * active_geometry
Points to the currently loaded geometry (the geometry that was used last and is likely to be used nex...
Definition: t8_geometry.h:66
t8_gloidx_t active_tree
The global tree id of the last tree for which geometry was used.
Definition: t8_geometry.h:68
sc_array_t registered_geometries
Stores all geometries that are handled by this geometry_handler.
Definition: t8_geometry.h:64
Definition: t8_geometry_base.hxx:37
This is the administrative header file for t8code.
int64_t t8_gloidx_t
A type for global indexing that holds really big numbers.
Definition: t8.h:98
We define the coarse mesh of trees in this file.
void t8_geom_handler_register_geometry(t8_geometry_handler_t *geom_handler, const t8_geometry_c *geometry)
Add a geometry to the geometry handler.
Definition: t8_geometry.cxx:185
void t8_geom_handler_unref(t8_geometry_handler_t **pgeom_handler)
Decrease the reference count of a geometry handler, if the refcount reaches 0, the handler will get d...
Definition: t8_geometry.cxx:121
void t8_geom_handler_destroy(t8_geometry_handler_t **pgeom_handler)
Destroy a geometry handler and free its memory.
Definition: t8_geometry.cxx:134
void t8_geom_handler_commit(t8_geometry_handler_t *geom_handler)
Commit a geometry handler.
Definition: t8_geometry.cxx:199
size_t t8_geom_handler_get_num_geometries(const t8_geometry_handler_t *geom_handler)
Return the number of registered geometries.
Definition: t8_geometry.cxx:250
void t8_geom_handler_ref(t8_geometry_handler_t *geom_handler)
Increase the reference counter of a geometry handler.
Definition: t8_geometry.cxx:113
t8_geometry_type
This enumeration contains all possible geometries.
Definition: t8_geometry.h:35
@ T8_GEOMETRY_TYPE_UNDEFINED
This is no geometry type but is used for every geometry, where no type is defined.
Definition: t8_geometry.h:49
@ T8_GEOMETRY_TYPE_LINEAR
The linear geometry uses linear interpolations to interpolate between the tree vertices.
Definition: t8_geometry.h:39
@ T8_GEOMETRY_TYPE_ANALYTIC
The analytic geometry uses a user-defined analytic function to map into the physical domain.
Definition: t8_geometry.h:43
@ T8_GEOMETRY_TYPE_OCC
The OCC geometry uses OCC CAD shapes to map trees exactly to the underlying CAD model.
Definition: t8_geometry.h:45
@ T8_GEOMETRY_TYPE_LINEAR_AXIS_ALIGNED
The linear, axis aligned geometry uses only 2 vertices, since it is axis aligned.
Definition: t8_geometry.h:41
@ T8_GEOMETRY_TYPE_ZERO
The zero geometry maps all points to zero.
Definition: t8_geometry.h:37
@ T8_GEOMETRY_TYPE_COUNT
This is no geometry type but can be used as the number of geometry types.
Definition: t8_geometry.h:47
enum t8_geometry_type t8_geometry_type_t
This enumeration contains all possible geometries.
t8_geometry_c * t8_geom_handler_find_geometry(const t8_geometry_handler_t *geom_handler, const char *name)
Given a geometry's name find that geometry in the geometry handler and return it.
Definition: t8_geometry.cxx:233
void t8_geom_handler_init(t8_geometry_handler_t **pgeom_handler)
Initialize a geometry handler.
Definition: t8_geometry.cxx:72
const t8_geometry_c * t8_geom_handler_get_unique_geometry(const t8_geometry_handler_t *geom_handler)
If a geometry handler only has one registered geometry, get a pointer to this geometry.
Definition: t8_geometry.cxx:257
We inherit the reference counting mechanism from libsc.
sc_refcount_t t8_refcount_t
We can reuse the reference counter type from libsc.
Definition: t8_refcount.h:39