t8  1.2.0
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) \
50  ( T8_ASSERT (T8_QUAD_GET_TDIM(quad) == 3), \
51  ((int) (quad)->pad16) )
52 
56 #define T8_QUAD_GET_TCOORD(quad) \
57  ( T8_ASSERT (T8_QUAD_GET_TDIM(quad) == 3), \
58  ((int) (quad)->p.user_long) )
59 
61 #define T8_QUAD_SET_TDIM(quad,dim) \
62  do { T8_ASSERT ((dim) == 2 || (dim) == 3); \
63  (quad)->pad8 = (int8_t) (dim); } while (0)
64 
66 #define T8_QUAD_SET_TNORMAL(quad,normal) \
67  do { T8_ASSERT ((normal) >= 0 && (normal) < 3); \
68  (quad)->pad16 = (int16_t) (normal); } while (0)
69 
71 #define T8_QUAD_SET_TCOORD(quad,coord) \
72  do { (quad)->p.user_long = (long) (coord); } while (0)
73 
75 t8_eclass_scheme_t *t8_default_scheme_new_quad (void);
76 
77 #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.