t8  1.2.0
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 
38 typedef struct t8_geometry t8_geometry_c;
39 
40 /* The t8_geometry_c type must be know to cmesh.h, thus we
41  * include it after the typedef. */
42 #include <t8_cmesh.h>
43 
44 typedef struct t8_geometry_handler
45 {
57 
58 T8_EXTERN_C_BEGIN ();
59 
66  **pgeom_handler);
67 
72 void t8_geom_handler_ref (t8_geometry_handler_t *geom_handler);
73 
81  **pgeom_handler);
82 
91  **pgeom_handler);
92 
99  *geom_handler,
100  const t8_geometry_c
101  *geometry);
102 
109  *geom_handler);
110 
111 /* Check if a geometry handler was committed. */
112 int t8_geom_handler_is_committed (const t8_geometry_handler_t
113  *geom_handler);
114 
121  *geom_handler);
122 
132  *geom_handler);
133 
143  *geom_handler,
144  const char *name);
145 
146 void t8_geometry_evaluate (t8_cmesh_t cmesh,
147  t8_gloidx_t gtreeid,
148  const double *ref_coords,
149  double *out_coords);
150 
151 void t8_geometry_jacobian (t8_cmesh_t cmesh,
152  t8_gloidx_t gtreeid,
153  const double *ref_coords,
154  double *jacobian);
155 
156 T8_EXTERN_C_END ();
157 
158 #endif /* !T8_GEOMETRY_H! */
This structure holds the connectivity data of the coarse mesh.
Definition: t8_cmesh_types.h:83
Definition: t8_geometry.h:45
t8_refcount_t rc
The reference count of the geometry handler.
Definition: t8_geometry.h:54
int is_committed
If true, no new geometries can be registered.
Definition: t8_geometry.h:52
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:48
t8_gloidx_t active_tree
The global tree id of the last tree for which geometry was used.
Definition: t8_geometry.h:50
sc_array_t registered_geometries
Stores all geometries that are handled by this geometry_handler.
Definition: t8_geometry.h:46
Definition: t8_geometry_base.hxx:38
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:105
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:196
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:126
void t8_geom_handler_destroy(t8_geometry_handler_t **pgeom_handler)
Destroy a geometry handler and free its memory.
Definition: t8_geometry.cxx:139
void t8_geom_handler_commit(t8_geometry_handler_t *geom_handler)
Commit a geometry handler.
Definition: t8_geometry.cxx:213
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:272
void t8_geom_handler_ref(t8_geometry_handler_t *geom_handler)
Increase the reference counter of a geometry handler.
Definition: t8_geometry.cxx:118
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:252
void t8_geom_handler_init(t8_geometry_handler_t **pgeom_handler)
Initialize a geometry handler.
Definition: t8_geometry.cxx:74
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:279
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