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_prism_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 
29 #ifndef T8_DEFAULT_PRISM_CXX_HXX
30 #define T8_DEFAULT_PRISM_CXX_HXX
31 
32 #include <t8_element_cxx.hxx>
33 #include <t8_schemes/t8_default/t8_default_line/t8_default_line_cxx.hxx>
34 #include <t8_schemes/t8_default/t8_default_tri/t8_default_tri_cxx.hxx>
36 
42 {
43 public:
48 
50 
68  virtual void t8_element_new (int length, t8_element_t **elem) const;
69 
87  virtual void t8_element_init (int length, t8_element_t *elem,
88  int called_new) const;
89 
94  virtual int t8_element_level (const t8_element_t *elem) const;
95 
99  virtual int t8_element_maxlevel (void) const;
100 
108  virtual void t8_element_copy (const t8_element_t *source,
109  t8_element_t *dest) const;
110 
118  virtual int t8_element_compare (const t8_element_t *elem1,
119  const t8_element_t *elem2) const;
120 
133  virtual void t8_element_parent (const t8_element_t *elem,
134  t8_element_t *parent) const;
135 
147  virtual void t8_element_sibling (const t8_element_t *elem,
148  int sibid,
149  t8_element_t *sibling) const
150  {
151  SC_ABORT ("This function is not implemented yet.\n");
152  return; /* suppresses compiler warning */
153  }
154 
159  virtual int t8_element_num_faces (const t8_element_t *elem) const;
160 
166  virtual int t8_element_max_num_faces (const t8_element_t *elem)
167  const;
168 
173  virtual int t8_element_num_children (const t8_element_t *elem)
174  const;
175 
181  virtual int t8_element_num_face_children (const t8_element_t *elem,
182  int face) const;
189  virtual int t8_element_get_face_corner (const t8_element_t *element,
190  int face, int corner) const;
191 
198  virtual int t8_element_get_corner_face (const t8_element_t *element,
199  int corner, int face) const
200  {
201  SC_ABORT ("This function is not implemented yet.\n");
202  return 0; /* suppresses compiler warning */
203  }
204 
210  virtual t8_eclass_t t8_element_child_eclass (int childid) const
211  {
212  SC_ABORT ("This function is not implemented yet.\n");
213  return T8_ECLASS_ZERO; /* suppresses compiler warning */
214  }
215 
225  virtual void t8_element_child (const t8_element_t *elem,
226  int childid,
227  t8_element_t *child) const;
228 
240  virtual void t8_element_children (const t8_element_t *elem,
241  int length,
242  t8_element_t *c[]) const;
243 
248  virtual int t8_element_child_id (const t8_element_t *elem) const;
249 
256  virtual int t8_element_ancestor_id (const t8_element_t *elem,
257  int level) const;
258 
265  virtual int t8_element_is_family (t8_element_t **fam) const;
266 
277  virtual void t8_element_nca (const t8_element_t *elem1,
278  const t8_element_t *elem2,
279  t8_element_t *nca) const;
280 
287  int face) const;
288 
303  virtual void t8_element_children_at_face (const t8_element_t *elem,
304  int face,
305  t8_element_t *children[],
306  int num_children,
307  int *child_indices) const;
308 
329  virtual int t8_element_face_child_face (const t8_element_t *elem,
330  int face,
331  int face_child) const;
332 
343  virtual int t8_element_face_parent_face (const t8_element_t *elem,
344  int face) const;
345 
355  virtual int t8_element_tree_face (const t8_element_t *elem,
356  int face) const;
357 
379  virtual void t8_element_transform_face (const t8_element_t *elem1,
380  t8_element_t *elem2,
381  int orientation, int sign,
382  int is_smaller_face) const
383  {
384  SC_ABORT ("This function is not implemented yet.\n");
385  return; /* suppresses compiler warning */
386  }
387 
401  virtual int t8_element_extrude_face (const t8_element_t *face,
402  const t8_eclass_scheme_c
403  *face_scheme,
404  t8_element_t *elem,
405  int root_face) const;
406 
416  *elem, int face,
418  *first_desc,
419  int level) const;
420 
430  *elem, int face,
432  *last_desc,
433  int level) const;
434 
444  virtual void t8_element_boundary_face (const t8_element_t *elem,
445  int face,
446  t8_element_t *boundary,
447  const t8_eclass_scheme_c
448  *boundary_scheme) const;
449 
455  virtual void t8_element_boundary (const t8_element_t *elem,
456  int min_dim, int length,
457  t8_element_t **boundary) const
458  {
459  SC_ABORT ("This function is not implemented yet.\n");
460  return; /* suppresses compiler warning */
461  }
462 
468  virtual int t8_element_is_root_boundary (const t8_element_t *elem,
469  int face) const;
470 
487  *elem,
488  t8_element_t *neigh,
489  int face,
490  int *neigh_face) const;
491 
499  virtual void t8_element_set_linear_id (t8_element_t *elem,
500  int level,
501  t8_linearidx_t id) const;
502 
510  t8_element_t *elem,
511  int level) const;
512 
519  virtual void t8_element_first_descendant (const t8_element_t *elem,
520  t8_element_t *desc,
521  int level) const;
522 
529  virtual void t8_element_last_descendant (const t8_element_t *elem,
530  t8_element_t *desc,
531  int level) const;
532 
538  virtual void t8_element_successor (const t8_element_t *t,
539  t8_element_t *s, int level) const;
540 
551  virtual void t8_element_anchor (const t8_element_t *elem,
552  int anchor[3]) const;
553 
559  virtual int t8_element_root_len (const t8_element_t *elem) const;
560 
571  virtual void t8_element_vertex_coords (const t8_element_t *t,
572  int vertex,
573  int coords[]) const;
574 
582  virtual void t8_element_general_function (const t8_element_t *elem,
583  const void *indata,
584  void *outdata) const;
585 
594  *elem,
595  const int vertex,
596  double coords[])
597  const;
598 
607  virtual void t8_element_reference_coords (const t8_element_t *elem,
608  const double *ref_coords,
609  const void *user_data,
610  double *out_coords)
611  const;
612 
617  virtual int t8_element_refines_irregular (void) const;
618 
619 #ifdef T8_ENABLE_DEBUG
634  virtual int t8_element_is_valid (const t8_element_t *t) const;
635 
643  virtual void t8_element_debug_print (const t8_element_t *elem) const;
644 #endif
645 };
646 
647 #endif /* !T8_DEFAULT_PRISM_CXX_HXX */
Definition: t8_default_common_cxx.hxx:38
Provide an implementation for the prism element class.
Definition: t8_default_prism_cxx.hxx:42
virtual void t8_element_anchor(const t8_element_t *elem, int anchor[3]) const
Get the integer coordinates of the anchor node of an element.
Definition: t8_default_prism_cxx.cxx:444
virtual void t8_element_vertex_coords(const t8_element_t *t, int vertex, int coords[]) const
Compute the integer coordinates of a given element vertex.
Definition: t8_default_prism_cxx.cxx:462
virtual void t8_element_last_descendant(const t8_element_t *elem, t8_element_t *desc, int level) const
Compute the last descendant of a given element.
Definition: t8_default_prism_cxx.cxx:431
virtual int t8_element_tree_face(const t8_element_t *elem, int face) const
Given an element and a face of this element.
Definition: t8_default_prism_cxx.cxx:250
virtual t8_linearidx_t t8_element_get_linear_id(const t8_element_t *elem, int level) const
Compute the linear id of a given element in a hypothetical uniform refinement of a given level.
Definition: t8_default_prism_cxx.cxx:509
virtual void t8_element_reference_coords(const t8_element_t *elem, const double *ref_coords, const void *user_data, double *out_coords) const
Convert a point in the reference space of an element to a point in the reference space of the tree.
Definition: t8_default_prism_cxx.cxx:484
virtual void t8_element_first_descendant_face(const t8_element_t *elem, int face, t8_element_t *first_desc, int level) const
Construct the first descendant of an element at a given level that touches a given face.
Definition: t8_default_prism_cxx.cxx:322
virtual int t8_element_get_corner_face(const t8_element_t *element, int corner, int face) const
Return the face numbers of the faces sharing an element's corner.
Definition: t8_default_prism_cxx.hxx:198
virtual int t8_element_is_root_boundary(const t8_element_t *elem, int face) const
Compute whether a given element shares a given face with its root tree.
Definition: t8_default_prism_cxx.cxx:362
virtual int t8_element_maxlevel(void) const
Return the maximum allowed level for this element class.
Definition: t8_default_prism_cxx.cxx:67
virtual void t8_element_transform_face(const t8_element_t *elem1, t8_element_t *elem2, int orientation, int sign, int is_smaller_face) const
Suppose we have two trees that share a common face f.
Definition: t8_default_prism_cxx.hxx:379
virtual int t8_element_is_family(t8_element_t **fam) const
Query whether a given set of elements is a family or not.
Definition: t8_default_prism_cxx.cxx:274
virtual int t8_element_get_face_corner(const t8_element_t *element, int face, int corner) const
Return the corner number of an element's face corner.
Definition: t8_default_prism_cxx.cxx:135
virtual int t8_element_compare(const t8_element_t *elem1, const t8_element_t *elem2) const
Compare two elements.
Definition: t8_default_prism_cxx.cxx:99
virtual void t8_element_copy(const t8_element_t *source, t8_element_t *dest) const
Copy all entries of source to dest.
Definition: t8_default_prism_cxx.cxx:90
virtual int t8_element_max_num_faces(const t8_element_t *elem) const
Compute the maximum number of faces of a given element and all of its descendants.
Definition: t8_default_prism_cxx.cxx:173
virtual int t8_element_extrude_face(const t8_element_t *face, const t8_eclass_scheme_c *face_scheme, t8_element_t *elem, int root_face) const
Given a boundary face inside a root tree's face construct the element inside the root tree that has t...
Definition: t8_default_prism_cxx.cxx:259
virtual void t8_element_boundary_face(const t8_element_t *elem, int face, t8_element_t *boundary, const t8_eclass_scheme_c *boundary_scheme) const
Construct the boundary element at a specific face.
Definition: t8_default_prism_cxx.cxx:301
virtual int t8_element_num_children(const t8_element_t *elem) const
Return the number of children of an element when it is refined.
Definition: t8_default_prism_cxx.cxx:119
virtual void t8_element_init(int length, t8_element_t *elem, int called_new) const
Initialize an array of allocated prism elements.
Definition: t8_default_prism_cxx.cxx:50
virtual void t8_element_new(int length, t8_element_t **elem) const
Allocate memory for an array of prisms and initialize them.
Definition: t8_default_prism_cxx.cxx:33
virtual void t8_element_nca(const t8_element_t *elem1, const t8_element_t *elem2, t8_element_t *nca) const
Compute the nearest common ancestor of two elements.
Definition: t8_default_prism_cxx.cxx:286
virtual void t8_element_vertex_reference_coords(const t8_element_t *elem, const int vertex, double coords[]) const
Compute the coordinates of a given element vertex inside a reference tree that is embedded into [0,...
Definition: t8_default_prism_cxx.cxx:471
virtual void t8_element_last_descendant_face(const t8_element_t *elem, int face, t8_element_t *last_desc, int level) const
Construct the last descendant of an element at a given level that touches a given face.
Definition: t8_default_prism_cxx.cxx:340
virtual int t8_element_num_faces(const t8_element_t *elem) const
Compute the number of faces of a given element.
Definition: t8_default_prism_cxx.cxx:148
virtual int t8_element_face_parent_face(const t8_element_t *elem, int face) const
Given a face of an element return the face number of the parent of the element that matches the eleme...
Definition: t8_default_prism_cxx.cxx:241
virtual void t8_element_children_at_face(const t8_element_t *elem, int face, t8_element_t *children[], int num_children, int *child_indices) const
Given an element and a face of the element, compute all children of the element that touch the face.
Definition: t8_default_prism_cxx.cxx:204
virtual int t8_element_refines_irregular(void) const
Returns true, if there is one element in the tree, that does not refine into 2^dim children.
Definition: t8_default_prism_cxx.cxx:517
virtual t8_eclass_t t8_element_child_eclass(int childid) const
Return the type of each child in the ordering of the implementation.
Definition: t8_default_prism_cxx.hxx:210
t8_default_scheme_prism_c(void)
The virtual table for a particular implementation of an element class.
Definition: t8_default_prism_cxx.cxx:543
virtual int t8_element_face_child_face(const t8_element_t *elem, int face, int face_child) const
Given a face of an element and a child number of a child of that face, return the face number of the ...
Definition: t8_default_prism_cxx.cxx:228
virtual void t8_element_parent(const t8_element_t *elem, t8_element_t *parent) const
Compute the parent of a given element elem and store it in parent.
Definition: t8_default_prism_cxx.cxx:110
virtual int t8_element_num_face_children(const t8_element_t *elem, int face) const
Return the number of children of an element's face when the element is refined.
Definition: t8_default_prism_cxx.cxx:126
virtual int t8_element_root_len(const t8_element_t *elem) const
Compute the root length of a given element, that is the length of its level 0 ancestor.
Definition: t8_default_prism_cxx.cxx:455
virtual int t8_element_child_id(const t8_element_t *elem) const
Compute the child id of an element.
Definition: t8_default_prism_cxx.cxx:155
virtual void t8_element_boundary(const t8_element_t *elem, int min_dim, int length, t8_element_t **boundary) const
Construct all codimension-one boundary elements of a given element.
Definition: t8_default_prism_cxx.hxx:455
virtual void t8_element_general_function(const t8_element_t *elem, const void *indata, void *outdata) const
The tetrahedron schemes uses the general function to return the type of a tetrahedron.
Definition: t8_default_prism_cxx.cxx:496
virtual int t8_element_face_neighbor_inside(const t8_element_t *elem, t8_element_t *neigh, int face, int *neigh_face) const
Construct the face neighbor of a given element if this face neighbor is inside the root tree.
Definition: t8_default_prism_cxx.cxx:370
virtual t8_element_shape_t t8_element_face_shape(const t8_element_t *elem, int face) const
Compute the shape of the face of an element.
Definition: t8_default_prism_cxx.cxx:80
virtual void t8_element_child(const t8_element_t *elem, int childid, t8_element_t *child) const
Construct the child element of a given number.
Definition: t8_default_prism_cxx.cxx:162
virtual void t8_element_children(const t8_element_t *elem, int length, t8_element_t *c[]) const
Construct all children of a given element.
Definition: t8_default_prism_cxx.cxx:180
virtual void t8_element_successor(const t8_element_t *t, t8_element_t *s, int level) const
Construct the successor in a uniform refinement of a given element.
Definition: t8_default_prism_cxx.cxx:405
virtual void t8_element_first_descendant(const t8_element_t *elem, t8_element_t *desc, int level) const
Compute the first descendant of a given element.
Definition: t8_default_prism_cxx.cxx:418
virtual int t8_element_level(const t8_element_t *elem) const
Return the refinement level of an element.
Definition: t8_default_prism_cxx.cxx:73
virtual int t8_element_ancestor_id(const t8_element_t *elem, int level) const
Compute the ancestor id of an element, that is the child id at a given level.
Definition: t8_default_prism_cxx.cxx:196
virtual void t8_element_sibling(const t8_element_t *elem, int sibid, t8_element_t *sibling) const
Compute a specific sibling of a given prism element elem and store it in sibling.
Definition: t8_default_prism_cxx.hxx:147
virtual void t8_element_set_linear_id(t8_element_t *elem, int level, t8_linearidx_t id) const
Initialize the entries of an allocated element according to a given linear id in a uniform refinement...
Definition: t8_default_prism_cxx.cxx:391
This struct holds virtual functions for a particular element class.
Definition: t8_element_cxx.hxx:47
uint64_t t8_linearidx_t
A type for storing SFC indices.
Definition: t8.h:114
We provide some functions that are useful across element classes.
enum t8_eclass t8_eclass_t
This enumeration contains all possible element classes.
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