t8  UNKNOWN
t8code is a C library to manage a forest of adaptive space-trees of general element classes in parallel.
t8_default_common_cxx.hxx
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 #ifndef T8_DEFAULT_COMMON_CXX_HXX
28 #define T8_DEFAULT_COMMON_CXX_HXX
29 
30 #include <t8_element_cxx.hxx>
31 
32 /* Macro to check whether a pointer (VAR) to a base class, comes from an
33  * implementation of a child class (TYPE). */
34 #define T8_COMMON_IS_TYPE(VAR, TYPE) ((dynamic_cast<TYPE> (VAR)) != NULL)
35 
37  public:
39  virtual ~t8_default_scheme_common_c ();
40 
42  virtual int
43  t8_element_num_corners (const t8_element_t *elem) const;
44 
46  virtual void
47  t8_element_new (int length, t8_element_t **elem) const;
48 
50  virtual void
51  t8_element_destroy (int length, t8_element_t **elem) const;
52 
54  virtual t8_element_shape_t
55  t8_element_shape (const t8_element_t *elem) const;
56 
65  virtual t8_gloidx_t
66  t8_element_count_leafs (const t8_element_t *t, int level) const;
67 
74  virtual int
75  t8_element_num_siblings (const t8_element_t *elem) const;
76 
82  virtual t8_gloidx_t
83  t8_element_count_leafs_from_root (int level) const;
84 
95  virtual void
96  t8_element_general_function (const t8_element_t *elem, const void *indata, void *outdata) const;
97 
108  virtual void
109  t8_element_vertex_coords (const t8_element_t *elem, int vertex, int coords[]) const
110  = 0;
111 
122  virtual void
123  t8_element_reference_coords (const t8_element_t *elem, const double *ref_coords, const size_t num_coords,
124  double *out_coords) const
125  = 0;
126 
137  virtual void
138  t8_element_anchor (const t8_element_t *elem, int anchor[3]) const
139  = 0;
140 #if T8_ENABLE_DEBUG
141  virtual void
142  t8_element_debug_print (const t8_element_t *elem) const;
143 #endif
144 };
145 
146 #endif /* !T8_DEFAULT_COMMON_CXX_HXX */
Definition: t8_default_common_cxx.hxx:36
virtual t8_gloidx_t t8_element_count_leafs(const t8_element_t *t, int level) const
Count how many leaf descendants of a given uniform level an element would produce.
Definition: t8_default_common_cxx.cxx:121
virtual void t8_element_reference_coords(const t8_element_t *elem, const double *ref_coords, const size_t num_coords, double *out_coords) const =0
Convert points in the reference space of an element to points in the reference space of the tree.
virtual void t8_element_vertex_coords(const t8_element_t *elem, int vertex, int coords[]) const =0
Compute the integer coordinates of a given element vertex.
virtual int t8_element_num_siblings(const t8_element_t *elem) const
Compute the number of siblings of an element.
Definition: t8_default_common_cxx.cxx:139
virtual t8_element_shape_t t8_element_shape(const t8_element_t *elem) const
Return the shape of an element.
Definition: t8_default_common_cxx.cxx:107
virtual int t8_element_num_corners(const t8_element_t *elem) const
Compute the number of corners of a given element.
Definition: t8_default_common_cxx.cxx:59
virtual void t8_element_destroy(int length, t8_element_t **elem) const
Deallocate space for a bunch of elements.
Definition: t8_default_common_cxx.cxx:73
virtual void t8_element_debug_print(const t8_element_t *elem) const
Print a given element.
Definition: t8_default_common_cxx.cxx:165
virtual t8_gloidx_t t8_element_count_leafs_from_root(int level) const
Count how many leaf descendants of a given uniform level the root element will produce.
Definition: t8_default_common_cxx.cxx:147
virtual ~t8_default_scheme_common_c()
Destructor for all default schemes.
Definition: t8_default_common_cxx.cxx:50
virtual void t8_element_anchor(const t8_element_t *elem, int anchor[3]) const =0
Get the integer coordinates of the anchor node of an element.
virtual void t8_element_general_function(const t8_element_t *elem, const void *indata, void *outdata) const
The common implementation of the general function for the default scheme has no effect.
Definition: t8_default_common_cxx.cxx:157
virtual void t8_element_new(int length, t8_element_t **elem) const
Allocate space for a bunch of elements.
Definition: t8_default_common_cxx.cxx:67
This struct holds virtual functions for a particular element class.
Definition: t8_element_cxx.hxx:47
int64_t t8_gloidx_t
A type for global indexing that holds really big numbers.
Definition: t8.h:98
struct t8_element t8_element_t
Opaque structure for a generic element, only used as pointer.
Definition: t8_element.h:42
This file defines basic operations on an element in a refinement tree.
t8_eclass_t t8_element_shape_t
Type definition for the geometric shape of an element.
Definition: t8_element_shape.h:38