diff --git a/.gitignore b/.gitignore
index d085775b76..efec6b54f2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -25,6 +25,7 @@ doxygen/
CMakeCache.txt
CMakeFiles/
version.txt
+Testing/
src/stamp-h1
src/t8_config.h
diff --git a/NEWS.md b/NEWS.md
index d2587d9865..54ade4e905 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,6 +1,6 @@
# User Updates for the upcoming t8code v4.0.0
-We have just merged another branch into our main branch that introduces a lot of changes. Here, we want to explain what is new, why we decided on this feature, what we intend with the feature in the (near) future and most importantly what do you as a user have to change to be on par with the upcoming t8code v4.0.0
+We have just merged another branch into our main branch that introduces a lot of changes. Here, we want to explain what is new, why we decided on this feature, what we intend with the feature in the (near) future and most importantly what do you as a user have to [change](#what-do-you-have-to-change) to be on par with the upcoming t8code v4.0.0
## What is new?
Long story short: We completely changed the element-schemes, the part of t8code that decides how any element in a forest behaves. Before this update was introduced we used a virtual base class defining all functions. For each type of tree shape there was a class inheriting from the base class and implementing all these functions for a specific type of tree shape (vertex, line, triangle, tetrahedra, ...).
@@ -8,7 +8,7 @@ We provided you with a default implementation for all standard shapes supported
If you wanted to use an element function you needed the scheme and the eclass of the tree the element belongs to to call the proper function.
### CRTP instead of a virtual base class
-We left this approach and now use a [CRTP](https://www.fluentcpp.com/2017/05/16/what-the-crtp-brings-to-code/) approach instead. That way we can get rid of the virtual base class and hopefully by avoiding virtual function calls and now with the opportunity to inline functions we can optimize the code further.
+We left this approach and now use a [CRTP](https://www.fluentcpp.com/2017/05/16/what-the-crtp-brings-to-code/) approach instead. That way we can get rid of the virtual base class and hopefully by avoiding virtual function calls and now with the opportunity to inline functions we can optimize the code further.
### The scheme builder
Furthermore, we now provide a scheme builder instead of only the default scheme with our default implementation (don't worry, the default implementation is still there and untouched, t8code will still behave in the way that you know it).
@@ -31,7 +31,7 @@ for (t8_locidx_t itree = 0; itree < num_local_trees; ++itree){
/* Get the eclass of the tree. */
const t8_eclass_t tree_class = t8_forest_get_tree_class (forest, itree);
/* Get the scheme of of this eclass. */
- const t8_eclass_scheme_c *tscheme = t8_forest_get_eclass_scheme (forest_from, tree_class);
+ const t8_eclass_scheme_c *tscheme = t8_forest_get_eclass_scheme (forest_from, tree_class);
/* Get the number of elements in the tree itree. */
const t8_locidx_t num_elems = t8_forest_get_tree_num_elements (forest, itree);
/* Loop over all elements */
diff --git a/src/t8_forest/t8_forest.cxx b/src/t8_forest/t8_forest.cxx
index 809e77d622..f3e6e5638b 100644
--- a/src/t8_forest/t8_forest.cxx
+++ b/src/t8_forest/t8_forest.cxx
@@ -59,12 +59,12 @@ t8_forest_is_incomplete_family (const t8_forest_t forest, const t8_locidx_t ltre
T8_ASSERT (elements != NULL);
T8_ASSERT (elements_size > 0);
- const t8_scheme *tscheme = t8_forest_get_scheme (forest);
- T8_ASSERT (tscheme != NULL);
+ const t8_scheme *scheme = t8_forest_get_scheme (forest);
+ T8_ASSERT (scheme != NULL);
const t8_eclass_t tree_class = t8_forest_get_tree_class (forest, ltree_id);
/* If current considered element has level 0 there is no coarsening possible */
- if (0 == tscheme->element_get_level (tree_class, elements[0])) {
+ if (0 == scheme->element_get_level (tree_class, elements[0])) {
return 0;
}
@@ -76,17 +76,17 @@ t8_forest_is_incomplete_family (const t8_forest_t forest, const t8_locidx_t ltre
/* Buffer for elements */
t8_element_t *element_parent_current;
t8_element_t *element_compare;
- tscheme->element_new (tree_class, 1, &element_parent_current);
- tscheme->element_new (tree_class, 1, &element_compare);
+ scheme->element_new (tree_class, 1, &element_parent_current);
+ scheme->element_new (tree_class, 1, &element_compare);
/* We first assume that we have an (in)complete family with the size of array elements.
* In the following we try to disprove this. */
int family_size = elements_size;
/* Get level, child ID and parent of first element of possible family */
- const int level_current = tscheme->element_get_level (tree_class, elements[0]);
- const int child_id_current = tscheme->element_get_child_id (tree_class, elements[0]);
- tscheme->element_get_parent (tree_class, elements[0], element_parent_current);
+ const int level_current = scheme->element_get_level (tree_class, elements[0]);
+ const int child_id_current = scheme->element_get_child_id (tree_class, elements[0]);
+ scheme->element_get_parent (tree_class, elements[0], element_parent_current);
/* Elements of the current family could already be passed, so that
* the element/family currently under consideration can no longer be coarsened.
@@ -95,18 +95,18 @@ t8_forest_is_incomplete_family (const t8_forest_t forest, const t8_locidx_t ltre
* */
if (child_id_current > 0 && el_considered > 0) {
const t8_element_t *element_temp = t8_forest_get_tree_element (tree, el_considered - 1);
- const int level_temp = tscheme->element_get_level (tree_class, element_temp);
+ const int level_temp = scheme->element_get_level (tree_class, element_temp);
/* Only elements with higher or equal level then level of current considered
* element, can get potentially be overlapped. */
if (level_temp >= level_current) {
/* Compare ancestors */
- tscheme->element_get_nca (tree_class, element_parent_current, element_temp, element_compare);
- const int level_compare = tscheme->element_get_level (tree_class, element_compare);
+ scheme->element_get_nca (tree_class, element_parent_current, element_temp, element_compare);
+ const int level_compare = scheme->element_get_level (tree_class, element_compare);
/* Level_current-1 is level of element_parent_current */
T8_ASSERT (level_compare <= level_current - 1);
if (level_compare == level_current - 1) {
- tscheme->element_destroy (tree_class, 1, &element_parent_current);
- tscheme->element_destroy (tree_class, 1, &element_compare);
+ scheme->element_destroy (tree_class, 1, &element_parent_current);
+ scheme->element_destroy (tree_class, 1, &element_compare);
return 0;
}
}
@@ -114,16 +114,16 @@ t8_forest_is_incomplete_family (const t8_forest_t forest, const t8_locidx_t ltre
/* Reduce family_size to the number of family members that directly follow each other. */
for (int family_iter = 1; family_iter < family_size; family_iter++) {
- const int level = tscheme->element_get_level (tree_class, elements[family_iter]);
+ const int level = scheme->element_get_level (tree_class, elements[family_iter]);
/* By comparing the levels in advance we may be able to avoid
* the more complex test with the parent element.*/
if (level != level_current) {
family_size = family_iter;
break;
}
- tscheme->element_get_parent (tree_class, elements[family_iter], element_compare);
+ scheme->element_get_parent (tree_class, elements[family_iter], element_compare);
/* If the levels are equal, check if the parents are too. */
- if (!tscheme->element_is_equal (tree_class, element_parent_current, element_compare)) {
+ if (!scheme->element_is_equal (tree_class, element_parent_current, element_compare)) {
family_size = family_iter;
break;
}
@@ -136,28 +136,28 @@ t8_forest_is_incomplete_family (const t8_forest_t forest, const t8_locidx_t ltre
* family_size in this family) that would be overlapped after coarsening. */
if (family_size < elements_size) {
/* Get level of element after last element of current possible family */
- const int level = tscheme->element_get_level (tree_class, elements[family_size]);
+ const int level = scheme->element_get_level (tree_class, elements[family_size]);
/* Only elements with higher level then level of current element, can get
* potentially be overlapped. */
if (level > level_current) {
/* Compare ancestors */
- tscheme->element_get_nca (tree_class, element_parent_current, elements[family_size], element_compare);
- const int level_compare = tscheme->element_get_level (tree_class, element_compare);
+ scheme->element_get_nca (tree_class, element_parent_current, elements[family_size], element_compare);
+ const int level_compare = scheme->element_get_level (tree_class, element_compare);
T8_ASSERT (level_compare <= level_current - 1);
if (level_compare == level_current - 1) {
- tscheme->element_destroy (tree_class, 1, &element_parent_current);
- tscheme->element_destroy (tree_class, 1, &element_compare);
+ scheme->element_destroy (tree_class, 1, &element_parent_current);
+ scheme->element_destroy (tree_class, 1, &element_compare);
return 0;
}
}
}
/* clean up */
- tscheme->element_destroy (tree_class, 1, &element_parent_current);
- tscheme->element_destroy (tree_class, 1, &element_compare);
+ scheme->element_destroy (tree_class, 1, &element_parent_current);
+ scheme->element_destroy (tree_class, 1, &element_compare);
#if T8_ENABLE_MPI
- const int num_siblings = tscheme->element_get_num_siblings (tree_class, elements[0]);
+ const int num_siblings = scheme->element_get_num_siblings (tree_class, elements[0]);
T8_ASSERT (family_size <= num_siblings);
/* If the first/last element at a process boundary is not the first/last
* element of a possible family, we are not guaranteed to consider all
diff --git a/src/t8_geometry/t8_geometry_implementations/t8_geometry_analytic.h b/src/t8_geometry/t8_geometry_implementations/t8_geometry_analytic.h
index 8964216246..b7255e15c6 100644
--- a/src/t8_geometry/t8_geometry_implementations/t8_geometry_analytic.h
+++ b/src/t8_geometry/t8_geometry_implementations/t8_geometry_analytic.h
@@ -27,6 +27,9 @@
#ifndef T8_GEOMETRY_ANALYTIC_H
#define T8_GEOMETRY_ANALYTIC_H
+#include
+#include
+
/**
* Definition of an analytic geometry function.
* This function maps reference coordinates to physical
diff --git a/src/t8_geometry/t8_geometry_with_vertices.h b/src/t8_geometry/t8_geometry_with_vertices.h
index 2616187a72..92699c7ce8 100644
--- a/src/t8_geometry/t8_geometry_with_vertices.h
+++ b/src/t8_geometry/t8_geometry_with_vertices.h
@@ -28,6 +28,7 @@
#ifndef T8_GEOMETRY_WITH_VERTICES_H
#define T8_GEOMETRY_WITH_VERTICES_H
+#include
#include
T8_EXTERN_C_BEGIN ();
diff --git a/src/t8_vtk/t8_vtk_write_ASCII.cxx b/src/t8_vtk/t8_vtk_write_ASCII.cxx
index eeb6c9e53f..1f345ed60e 100644
--- a/src/t8_vtk/t8_vtk_write_ASCII.cxx
+++ b/src/t8_vtk/t8_vtk_write_ASCII.cxx
@@ -82,7 +82,7 @@ typedef int (*t8_forest_vtk_cell_data_kernel) (t8_forest_t forest, const t8_loci
static t8_locidx_t
t8_forest_num_points (t8_forest_t forest, const int count_ghosts)
{
- const t8_scheme *tscheme = t8_forest_get_scheme (forest);
+ const t8_scheme *scheme = t8_forest_get_scheme (forest);
t8_locidx_t num_points = 0;
for (t8_locidx_t itree = 0; itree < (t8_locidx_t) forest->trees->elem_count; itree++) {
@@ -93,7 +93,7 @@ t8_forest_num_points (t8_forest_t forest, const int count_ghosts)
const size_t num_elements = t8_element_array_get_count (&tree->elements);
for (t8_locidx_t ielem = 0; ielem < (t8_locidx_t) num_elements; ielem++) {
const t8_element_t *elem = t8_element_array_index_locidx (&tree->elements, ielem);
- num_points += tscheme->element_get_num_corners (tree_class, elem);
+ num_points += scheme->element_get_num_corners (tree_class, elem);
}
}
if (count_ghosts) {
@@ -107,7 +107,7 @@ t8_forest_num_points (t8_forest_t forest, const int count_ghosts)
const size_t num_elements = t8_forest_ghost_tree_num_elements (forest, itree);
for (t8_locidx_t ielem = 0; ielem < (t8_locidx_t) num_elements; ielem++) {
const t8_element_t *elem = t8_element_array_index_locidx (ghost_elem, ielem);
- num_points += tscheme->element_get_num_corners (ghost_class, elem);
+ num_points += scheme->element_get_num_corners (ghost_class, elem);
}
}
}