t8  UNKNOWN
t8code is a C library to manage a forest of adaptive space-trees of general element classes in parallel.
t8_default_quad.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 
31 #ifndef T8_DEFAULT_QUAD_H
32 #define T8_DEFAULT_QUAD_H
33 
34 #include <p4est.h>
35 #include <t8_element.h>
36 
41 typedef p4est_quadrant_t t8_pquad_t;
42 
44 #define T8_QUAD_GET_TDIM(quad) ((int) (quad)->pad8)
45 
49 #define T8_QUAD_GET_TNORMAL(quad) (T8_ASSERT (T8_QUAD_GET_TDIM (quad) == 3), ((int) (quad)->pad16))
50 
54 #define T8_QUAD_GET_TCOORD(quad) (T8_ASSERT (T8_QUAD_GET_TDIM (quad) == 3), ((int) (quad)->p.user_long))
55 
57 #define T8_QUAD_SET_TDIM(quad, dim) \
58  do { \
59  T8_ASSERT ((dim) == 2 || (dim) == 3); \
60  (quad)->pad8 = (int8_t) (dim); \
61  } while (0)
62 
64 #define T8_QUAD_SET_TNORMAL(quad, normal) \
65  do { \
66  T8_ASSERT ((normal) >= 0 && (normal) < 3); \
67  (quad)->pad16 = (int16_t) (normal); \
68  } while (0)
69 
71 #define T8_QUAD_SET_TCOORD(quad, coord) \
72  do { \
73  (quad)->p.user_long = (long) (coord); \
74  } while (0)
75 
77 t8_eclass_scheme_t*
79 
80 #endif /* !T8_DEFAULT_QUAD_H */
p4est_quadrant_t t8_pquad_t
The structure holding a quadrilateral element in the default scheme.
Definition: t8_default_quad.h:41
t8_eclass_scheme_t * t8_default_scheme_new_quad(void)
Provide an implementation for the quadrilateral element class.
This file defines basic operations on an element in a refinement tree.