From 519929df7f4dbb5eadbc1b2588fbe6857a0add5a Mon Sep 17 00:00:00 2001 From: Thomas Spenke Date: Mon, 2 Feb 2026 16:14:12 +0100 Subject: [PATCH 1/7] Improvement: Clean up src folder --- .typos.toml | 2 +- benchmarks/t8_time_fractal.cxx | 2 +- benchmarks/t8_time_set_join_by_vertices.cxx | 2 +- .../IO/cmesh/netcdf/t8_write_cmesh_netcdf.cxx | 4 +- .../IO/cmesh/vtk/t8_cmesh_read_from_vtk.cxx | 2 +- .../forest/netcdf/t8_write_forest_netcdf.cxx | 4 +- .../cmesh/t8_cmesh_set_join_by_vertices.cxx | 2 +- example/forest/t8_test_face_iterate.cxx | 2 +- example/forest/t8_test_ghost.cxx | 2 +- example/version/t8_version.cxx | 2 +- mesh_handle/element.hxx | 4 +- scripts/check_macros.sh | 4 +- scripts/t8indent_ignore.sh | 2 +- src/CMakeLists.txt | 73 +++++++++---------- src/t8.c | 2 +- src/t8.h | 2 +- src/t8_cmesh/t8_cmesh.cxx | 6 +- src/t8_cmesh/t8_cmesh.h | 4 +- src/t8_cmesh/t8_cmesh_examples.cxx | 4 +- src/t8_cmesh/t8_cmesh_helpers.cxx | 2 +- src/t8_cmesh/t8_cmesh_helpers.h | 2 +- .../t8_cmesh_internal/t8_cmesh_partition.cxx | 2 +- .../t8_cmesh_internal/t8_cmesh_stash.c | 2 +- .../t8_cmesh_internal/t8_cmesh_stash.h | 2 +- .../t8_cmesh_internal/t8_cmesh_types.h | 4 +- src/t8_cmesh/t8_cmesh_io/t8_cmesh_netcdf.c | 2 +- src/t8_cmesh/t8_cmesh_io/t8_cmesh_netcdf.h | 2 +- .../t8_cmesh_io/t8_cmesh_readmshfile.cxx | 2 +- .../t8_cmesh_io/t8_cmesh_readmshfile.h | 2 +- src/t8_cmesh/t8_cmesh_io/t8_cmesh_save.cxx | 4 +- src/t8_cmesh/t8_cmesh_io/t8_cmesh_tetgen.h | 2 +- src/t8_cmesh/t8_cmesh_io/t8_cmesh_triangle.h | 2 +- src/t8_data/t8_containers.h | 2 +- src/t8_data/t8_element_array_iterator.hxx | 2 +- src/{ => t8_element}/t8_eclass.c | 2 +- src/{ => t8_element}/t8_eclass.h | 0 src/{ => t8_element}/t8_element.cxx | 2 +- src/{ => t8_element}/t8_element.h | 4 +- src/{ => t8_element}/t8_element_shape.c | 2 +- src/{ => t8_element}/t8_element_shape.h | 2 +- src/t8_forest/t8_forest.cxx | 2 +- src/t8_forest/t8_forest_general.h | 2 +- src/t8_forest/t8_forest_io.h | 2 +- src/t8_forest/t8_forest_netcdf.cxx | 2 +- .../t8_forest_partition_for_coarsening.cxx | 4 +- src/t8_forest/t8_forest_pfc_helper.cxx | 2 +- src/t8_forest/t8_forest_pfc_helper.hxx | 2 +- src/t8_forest/t8_forest_pfc_message.hxx | 2 +- src/t8_forest/t8_forest_types.h | 4 +- src/t8_geometry/t8_geometry.h | 2 +- src/t8_geometry/t8_geometry_helpers.c | 2 +- .../t8_geometry_cad.cxx | 2 +- .../t8_geometry_lagrange.cxx | 2 +- src/{ => t8_helper_functions}/t8_mat.h | 0 src/{ => t8_helper_functions}/t8_refcount.c | 2 +- src/{ => t8_helper_functions}/t8_refcount.h | 0 src/{ => t8_misc}/t8_version.c | 2 +- src/{ => t8_misc}/t8_version.h | 0 src/{ => t8_misc}/t8_windows.h | 0 src/{ => t8_misc}/t8_with_macro_error.h | 0 src/{ => t8_netcdf}/t8_forest_netcdf.h | 2 +- src/{ => t8_netcdf}/t8_netcdf.c | 2 +- src/{ => t8_netcdf}/t8_netcdf.h | 0 .../t8_default/t8_default_c_interface.h | 2 +- .../t8_default_common/t8_default_common.hxx | 2 +- .../t8_default_hex/t8_default_hex.hxx | 2 +- .../t8_default/t8_default_hex/t8_dhex_bits.h | 2 +- .../t8_default_line/t8_default_line.hxx | 2 +- .../t8_default_line/t8_dline_bits.h | 2 +- .../t8_default_prism/t8_default_prism.hxx | 2 +- .../t8_default_prism/t8_dprism_bits.h | 2 +- .../t8_default_pyramid/t8_default_pyramid.hxx | 2 +- .../t8_default_pyramid/t8_dpyramid_bits.h | 2 +- .../t8_default_quad/t8_default_quad.hxx | 2 +- .../t8_default_quad/t8_default_quad_bits.hxx | 2 +- .../t8_default_tet/t8_default_tet.hxx | 2 +- .../t8_default/t8_default_tet/t8_dtet_bits.h | 2 +- .../t8_default_tet/t8_dtet_connectivity.h | 2 +- .../t8_default_tri/t8_default_tri.hxx | 2 +- .../t8_default/t8_default_tri/t8_dtri_bits.h | 2 +- .../t8_default_tri/t8_dtri_connectivity.h | 2 +- .../t8_default_vertex/t8_default_vertex.hxx | 2 +- src/t8_schemes/t8_scheme.cxx | 2 +- src/t8_schemes/t8_scheme.h | 2 +- src/t8_schemes/t8_scheme.hxx | 4 +- src/t8_schemes/t8_scheme_helpers.hxx | 4 +- .../t8_standalone_implementation.hxx | 2 +- src/{ => t8_vtk}/t8_vtk.c | 2 +- src/{ => t8_vtk}/t8_vtk.h | 0 src/t8_vtk/t8_vtk_types.h | 2 +- src/t8_vtk/t8_vtk_write_ASCII.cxx | 2 +- src/t8_vtk/t8_vtk_writer.h | 2 +- src/t8_vtk/t8_vtk_writer.hxx | 2 +- test/t8_cmesh/t8_gtest_cmesh_readmshfile.cxx | 2 +- .../t8_gtest_cmesh_set_join_by_vertices.cxx | 2 +- .../t8_cmesh_new_bigmesh_param.hxx | 2 +- .../t8_cmesh_new_empty.hxx | 2 +- .../t8_cmesh_new_from_class_param.hxx | 2 +- .../t8_cmesh_new_hypercube_param.hxx | 2 +- .../t8_cmesh_new_periodic.hxx | 2 +- .../t8_cmesh_params.hxx | 2 +- test/t8_forest/t8_gtest_balance.cxx | 2 +- test/t8_forest/t8_gtest_element_is_leaf.cxx | 2 +- test/t8_forest/t8_gtest_element_volume.cxx | 2 +- test/t8_forest/t8_gtest_find_owner.cxx | 2 +- test/t8_forest/t8_gtest_forest_commit.cxx | 2 +- .../t8_forest/t8_gtest_forest_face_normal.cxx | 2 +- test/t8_forest/t8_gtest_ghost_and_owner.cxx | 2 +- test/t8_forest/t8_gtest_ghost_delete.cxx | 2 +- test/t8_forest/t8_gtest_ghost_exchange.cxx | 2 +- test/t8_forest/t8_gtest_half_neighbors.cxx | 2 +- test/t8_forest/t8_gtest_search.cxx | 2 +- test/t8_forest/t8_gtest_transform.cxx | 2 +- .../t8_gtest_geometry_cad.cxx | 6 +- .../t8_gtest_geometry_lagrange.cxx | 2 +- .../t8_gtest_geometry_linear.cxx | 4 +- .../t8_gtest_geometry_handling.cxx | 2 +- .../t8_gtest_geometry_negative_volume.cxx | 2 +- test/t8_geometry/t8_gtest_point_inside.cxx | 2 +- test/t8_gtest_eclass.cxx | 2 +- test/t8_gtest_macros.hxx | 2 +- test/t8_gtest_mat.cxx | 2 +- test/t8_gtest_memory_macros.hxx | 2 +- test/t8_gtest_refcount.cxx | 2 +- test/t8_gtest_version.cxx | 2 +- test/t8_schemes/t8_gtest_ancestor.cxx | 2 +- test/t8_schemes/t8_gtest_ancestor_id.cxx | 2 +- test/t8_schemes/t8_gtest_bfs_base.hxx | 2 +- test/t8_schemes/t8_gtest_boundary_extrude.cxx | 2 +- .../t8_schemes/t8_gtest_child_parent_face.cxx | 2 +- test/t8_schemes/t8_gtest_descendant.cxx | 2 +- test/t8_schemes/t8_gtest_dfs_base.hxx | 2 +- .../t8_gtest_element_ref_coords.cxx | 2 +- .../t8_gtest_elements_are_family.cxx | 2 +- test/t8_schemes/t8_gtest_equal.cxx | 2 +- test/t8_schemes/t8_gtest_face_corner.cxx | 2 +- test/t8_schemes/t8_gtest_face_descendant.cxx | 2 +- test/t8_schemes/t8_gtest_face_neigh.cxx | 2 +- test/t8_schemes/t8_gtest_find_parent.cxx | 2 +- test/t8_schemes/t8_gtest_get_linear_id.cxx | 2 +- .../t8_gtest_input_equal_output.cxx | 2 +- test/t8_schemes/t8_gtest_nca.cxx | 2 +- test/t8_schemes/t8_gtest_pack_unpack.cxx | 2 +- test/t8_schemes/t8_gtest_root.cxx | 2 +- test/t8_schemes/t8_gtest_set_linear_id.cxx | 2 +- test/t8_schemes/t8_gtest_successor.cxx | 2 +- tutorials/general/t8_step7_interpolation.cxx | 2 +- 147 files changed, 192 insertions(+), 193 deletions(-) rename src/{ => t8_element}/t8_eclass.c (99%) rename src/{ => t8_element}/t8_eclass.h (100%) rename src/{ => t8_element}/t8_element.cxx (98%) rename src/{ => t8_element}/t8_element.h (96%) rename src/{ => t8_element}/t8_element_shape.c (98%) rename src/{ => t8_element}/t8_element_shape.h (99%) rename src/{ => t8_helper_functions}/t8_mat.h (100%) rename src/{ => t8_helper_functions}/t8_refcount.c (96%) rename src/{ => t8_helper_functions}/t8_refcount.h (100%) rename src/{ => t8_misc}/t8_version.c (97%) rename src/{ => t8_misc}/t8_version.h (100%) rename src/{ => t8_misc}/t8_windows.h (100%) rename src/{ => t8_misc}/t8_with_macro_error.h (100%) rename src/{ => t8_netcdf}/t8_forest_netcdf.h (99%) rename src/{ => t8_netcdf}/t8_netcdf.c (98%) rename src/{ => t8_netcdf}/t8_netcdf.h (100%) rename src/{ => t8_vtk}/t8_vtk.c (99%) rename src/{ => t8_vtk}/t8_vtk.h (100%) diff --git a/.typos.toml b/.typos.toml index fdab8ed1cc..11d8700b70 100644 --- a/.typos.toml +++ b/.typos.toml @@ -3,4 +3,4 @@ eles = "eles" packageid = "packageid" [files] -extend-exclude = ["scripts/t8indent.sh", "thirdparty/", "t8code_logo.png", "cmake/FindOpenCASCADE.cmake", "src/t8_with_macro_error.h", "doc/Doxyfile.in"] +extend-exclude = ["scripts/t8indent.sh", "thirdparty/", "t8code_logo.png", "cmake/FindOpenCASCADE.cmake", "src/t8_misc/t8_with_macro_error.h", "doc/Doxyfile.in"] diff --git a/benchmarks/t8_time_fractal.cxx b/benchmarks/t8_time_fractal.cxx index 8288f2f211..359b4c46d9 100644 --- a/benchmarks/t8_time_fractal.cxx +++ b/benchmarks/t8_time_fractal.cxx @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/benchmarks/t8_time_set_join_by_vertices.cxx b/benchmarks/t8_time_set_join_by_vertices.cxx index d9e7518b3a..210f4fd931 100644 --- a/benchmarks/t8_time_set_join_by_vertices.cxx +++ b/benchmarks/t8_time_set_join_by_vertices.cxx @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include #include diff --git a/example/IO/cmesh/netcdf/t8_write_cmesh_netcdf.cxx b/example/IO/cmesh/netcdf/t8_write_cmesh_netcdf.cxx index bea4589ed0..a258cf82f6 100644 --- a/example/IO/cmesh/netcdf/t8_write_cmesh_netcdf.cxx +++ b/example/IO/cmesh/netcdf/t8_write_cmesh_netcdf.cxx @@ -37,8 +37,8 @@ #include #include #include -#include -#include +#include +#include void t8_example_netcdf_write_cmesh (sc_MPI_Comm comm) diff --git a/example/IO/cmesh/vtk/t8_cmesh_read_from_vtk.cxx b/example/IO/cmesh/vtk/t8_cmesh_read_from_vtk.cxx index f5b62c84b0..0da13bbcad 100644 --- a/example/IO/cmesh/vtk/t8_cmesh_read_from_vtk.cxx +++ b/example/IO/cmesh/vtk/t8_cmesh_read_from_vtk.cxx @@ -21,7 +21,7 @@ along with t8code; if not, write to the Free Software Foundation, Inc., #include #include #include -#include +#include #include #include diff --git a/example/IO/forest/netcdf/t8_write_forest_netcdf.cxx b/example/IO/forest/netcdf/t8_write_forest_netcdf.cxx index ead4ffedb7..db609b8b71 100644 --- a/example/IO/forest/netcdf/t8_write_forest_netcdf.cxx +++ b/example/IO/forest/netcdf/t8_write_forest_netcdf.cxx @@ -29,7 +29,7 @@ #define NC_INDEPENDENT 0 #define NC_COLLECTIVE 1 #endif -#include +#include #include #include #include @@ -38,7 +38,7 @@ #include #include #include -#include +#include /* In this example is the use of the netcdf feature exemplary displayed. * We show how to write out a forest in the netCDF format and how to create additional (integer/double) netCDF variables which hold element data. diff --git a/example/cmesh/t8_cmesh_set_join_by_vertices.cxx b/example/cmesh/t8_cmesh_set_join_by_vertices.cxx index e4529e8928..e9672ee5b6 100644 --- a/example/cmesh/t8_cmesh_set_join_by_vertices.cxx +++ b/example/cmesh/t8_cmesh_set_join_by_vertices.cxx @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include #include diff --git a/example/forest/t8_test_face_iterate.cxx b/example/forest/t8_test_face_iterate.cxx index 6b987f871c..bbd811a12b 100644 --- a/example/forest/t8_test_face_iterate.cxx +++ b/example/forest/t8_test_face_iterate.cxx @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/example/forest/t8_test_ghost.cxx b/example/forest/t8_test_ghost.cxx index 4121ba77fb..a2b4d19015 100644 --- a/example/forest/t8_test_ghost.cxx +++ b/example/forest/t8_test_ghost.cxx @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include #include diff --git a/example/version/t8_version.cxx b/example/version/t8_version.cxx index ff85cbf15f..89774d0c66 100644 --- a/example/version/t8_version.cxx +++ b/example/version/t8_version.cxx @@ -22,7 +22,7 @@ #include #include -#include +#include int main (int argc, char **argv) diff --git a/mesh_handle/element.hxx b/mesh_handle/element.hxx index 51615ec637..17c5c0ebe3 100644 --- a/mesh_handle/element.hxx +++ b/mesh_handle/element.hxx @@ -27,8 +27,8 @@ along with t8code; if not, write to the Free Software Foundation, Inc., #pragma once #include -#include -#include +#include +#include #include #include #include diff --git a/scripts/check_macros.sh b/scripts/check_macros.sh index 7e5e8645c1..cd6cc8e5cf 100755 --- a/scripts/check_macros.sh +++ b/scripts/check_macros.sh @@ -29,9 +29,9 @@ file_path=$1 echo "$file_path" -if [[ "$file_path" -ef "src/t8_with_macro_error.h" ]] +if [[ "$file_path" -ef "src/t8_misc/t8_with_macro_error.h" ]] then - echo The file \"src/t8_with_macro_error.h\" will be ignored by the check_macros.sh script. + echo The file \"src/t8_misc/t8_with_macro_error.h\" will be ignored by the check_macros.sh script. exit 0 fi diff --git a/scripts/t8indent_ignore.sh b/scripts/t8indent_ignore.sh index 2aebf60489..6a0c982c23 100755 --- a/scripts/t8indent_ignore.sh +++ b/scripts/t8indent_ignore.sh @@ -32,4 +32,4 @@ # the usage of macros using the character '@'. # This causes clang to not recognize the file as a C++ # file and will throw an error when trying to indent it. -src/t8_with_macro_error.h +src/t8_misc/t8_with_macro_error.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e02137cad4..6634dab60c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -149,36 +149,33 @@ endif() target_sources( T8 PRIVATE t8.c - t8_eclass.c - t8_element_shape.c - t8_element.cxx - t8_refcount.c - t8_version.c - t8_vtk.c - t8_cmesh/t8_cmesh.cxx - t8_cmesh/t8_cmesh_cad.cxx - t8_cmesh/t8_cmesh_geometry.cxx + t8_cmesh/t8_cmesh.cxx + t8_cmesh/t8_cmesh_cad.cxx + t8_cmesh/t8_cmesh_geometry.cxx t8_cmesh/t8_cmesh_examples.cxx t8_cmesh/t8_cmesh_helpers.cxx - t8_cmesh/t8_cmesh_internal/t8_cmesh_commit.cxx - t8_cmesh/t8_cmesh_internal/t8_cmesh_copy.c - t8_cmesh/t8_cmesh_internal/t8_cmesh_offset.c - t8_cmesh/t8_cmesh_internal/t8_cmesh_partition.cxx - t8_cmesh/t8_cmesh_internal/t8_cmesh_stash.c - t8_cmesh/t8_cmesh_internal/t8_cmesh_trees.cxx - t8_cmesh/t8_cmesh_vertex_connectivity/t8_cmesh_vertex_conn_tree_to_vertex.cxx - t8_cmesh/t8_cmesh_vertex_connectivity/t8_cmesh_vertex_conn_vertex_to_tree.cxx - t8_cmesh/t8_cmesh_vertex_connectivity/t8_cmesh_vertex_connectivity.cxx + t8_cmesh/t8_cmesh_internal/t8_cmesh_commit.cxx + t8_cmesh/t8_cmesh_internal/t8_cmesh_copy.c + t8_cmesh/t8_cmesh_internal/t8_cmesh_offset.c + t8_cmesh/t8_cmesh_internal/t8_cmesh_partition.cxx + t8_cmesh/t8_cmesh_internal/t8_cmesh_stash.c + t8_cmesh/t8_cmesh_internal/t8_cmesh_trees.cxx + t8_cmesh/t8_cmesh_vertex_connectivity/t8_cmesh_vertex_conn_tree_to_vertex.cxx + t8_cmesh/t8_cmesh_vertex_connectivity/t8_cmesh_vertex_conn_vertex_to_tree.cxx + t8_cmesh/t8_cmesh_vertex_connectivity/t8_cmesh_vertex_connectivity.cxx t8_cmesh/t8_cmesh_io/t8_cmesh_readmshfile.cxx - t8_cmesh/t8_cmesh_io/t8_cmesh_save.cxx - t8_cmesh/t8_cmesh_io/t8_cmesh_triangle.cxx - t8_data/t8_shmem.c - t8_data/t8_containers.cxx - t8_forest/t8_forest_adapt.cxx - t8_forest/t8_forest_partition.cxx + t8_cmesh/t8_cmesh_io/t8_cmesh_save.cxx + t8_cmesh/t8_cmesh_io/t8_cmesh_triangle.cxx + t8_data/t8_shmem.c + t8_data/t8_containers.cxx + t8_element/t8_eclass.c + t8_element/t8_element_shape.c + t8_element/t8_element.cxx + t8_forest/t8_forest_adapt.cxx + t8_forest/t8_forest_partition.cxx t8_forest/t8_forest_partition_for_coarsening.cxx - t8_forest/t8_forest_pfc_helper.cxx - t8_forest/t8_forest.cxx + t8_forest/t8_forest_pfc_helper.cxx + t8_forest/t8_forest.cxx t8_forest/t8_forest_private.cxx t8_forest/t8_forest_ghost.cxx t8_forest/t8_forest_iterate.cxx @@ -195,6 +192,8 @@ target_sources( T8 PRIVATE t8_geometry/t8_geometry_implementations/t8_geometry_lagrange.cxx t8_geometry/t8_geometry_implementations/t8_geometry_zero.cxx t8_geometry/t8_geometry_implementations/t8_geometry_examples.cxx + t8_helper_functions/t8_refcount.c + t8_misc/t8_version.c t8_schemes/t8_scheme.cxx t8_schemes/t8_default/t8_default.cxx t8_schemes/t8_default/t8_default_hex/t8_default_hex.cxx @@ -217,6 +216,7 @@ target_sources( T8 PRIVATE t8_schemes/t8_default/t8_default_vertex/t8_default_vertex.cxx t8_types/t8_vec.cxx t8_schemes/t8_standalone/t8_standalone.cxx + t8_vtk/t8_vtk.c t8_vtk/t8_vtk_writer.cxx t8_vtk/t8_vtk_write_ASCII.cxx t8_vtk/t8_vtk_writer_helper.cxx @@ -242,16 +242,6 @@ target_compile_definitions( T8 PUBLIC T8_LIBS="${T8_LIBS}" ) install( FILES t8.h - t8_eclass.h - t8_element.h - t8_element_shape.h - t8_mat.h - t8_refcount.h - t8_types/t8_vec.hxx - t8_types/t8_vec.h - t8_version.h - t8_vtk.h - t8_with_macro_error.h TYPE INCLUDE ) @@ -263,13 +253,17 @@ install( FILES install ( DIRECTORY t8_helper_functions DESTINATION PRIVATE_HEADER FILES_MATCHING PATTERN "*.hxx" ) -install( DIRECTORY t8_cmesh TYPE INCLUDE FILES_MATCHING PATTERN "*.h" + + +install( DIRECTORY t8_cmesh TYPE INCLUDE FILES_MATCHING PATTERN "*.h" PATTERN "t8_cmesh/t8_cmesh_internal*" EXCLUDE PATTERN "t8_cmesh/t8_cmesh_io/t8_cmesh_netcdf.h" EXCLUDE PATTERN "t8_cmesh/t8_cmesh_vertex_connectivity/t8_cmesh_vertex_conn_*.hxx" EXCLUDE ) install( DIRECTORY t8_data TYPE INCLUDE FILES_MATCHING PATTERN "*.h" ) +install( DIRECTORY t8_element TYPE INCLUDE FILES_MATCHING PATTERN "*.h" ) + install( DIRECTORY t8_forest TYPE INCLUDE FILES_MATCHING PATTERN "*.h" PATTERN "t8_forest/t8_forest_balance.h" EXCLUDE PATTERN "t8_forest/t8_forest_ghost.h " EXCLUDE @@ -277,9 +271,14 @@ install( DIRECTORY t8_forest TYPE INCLUDE FILES_MATCHING PATTERN "*.h" ) install( DIRECTORY t8_geometry DESTINATION include FILES_MATCHING PATTERN "*.h" PATTERN "t8_geometry/t8_geometry_implementations/t8_geometry_cad.h" EXCLUDE) + +install( DIRECTORY t8_misc TYPE INCLUDE FILES_MATCHING PATTERN "*.h" ) +install( DIRECTORY t8_netcdf TYPE INCLUDE FILES_MATCHING PATTERN "*.h" ) install( DIRECTORY t8_schemes DESTINATION include FILES_MATCHING PATTERN "*.h" ) +install( DIRECTORY t8_types TYPE INCLUDE FILES_MATCHING PATTERN "*.h" ) install( DIRECTORY t8_vtk DESTINATION include FILES_MATCHING PATTERN "*.h" ) + install( DIRECTORY t8_cmesh DESTINATION include FILES_MATCHING PATTERN "*.hxx" PATTERN "t8_cmesh/t8_cmesh_vertex_connectivity/t8_cmesh_vertex_connectivity.hxx" EXCLUDE PATTERN "t8_cmesh/t8_cmesh_vertex_connectivity/t8_cmesh_vertex_conn_vertex_to_tree.hxx" EXCLUDE diff --git a/src/t8.c b/src/t8.c index f7c091ace7..b409ee974a 100644 --- a/src/t8.c +++ b/src/t8.c @@ -25,7 +25,7 @@ */ #include -#include +#include static int t8_package_id = -1; static void (*external_log_fcn) (int category, int priority, const char *msg) = NULL; diff --git a/src/t8.h b/src/t8.h index d3626802f7..1d817365f9 100644 --- a/src/t8.h +++ b/src/t8.h @@ -29,7 +29,7 @@ #ifndef T8_H #define T8_H -#include +#include #include #include diff --git a/src/t8_cmesh/t8_cmesh.cxx b/src/t8_cmesh/t8_cmesh.cxx index cc1cbbe98f..7ba197679d 100644 --- a/src/t8_cmesh/t8_cmesh.cxx +++ b/src/t8_cmesh/t8_cmesh.cxx @@ -28,10 +28,10 @@ #include #include #include -#include +#include #include #include -#include +#include #include #include #include @@ -41,7 +41,7 @@ #endif #include -#include +#include /** \file t8_cmesh.cxx * This file collects all general cmesh routines that need c++ compilation. diff --git a/src/t8_cmesh/t8_cmesh.h b/src/t8_cmesh/t8_cmesh.h index 6b5725010e..dc2bff8979 100644 --- a/src/t8_cmesh/t8_cmesh.h +++ b/src/t8_cmesh/t8_cmesh.h @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include /** Forward pointer reference to hidden cmesh implementation. @@ -47,7 +47,7 @@ typedef struct t8_cmesh *t8_cmesh_t; * Actually, we need eclass in the type definition in cmesh.c. * So we might as well use tree-related virtual functions there too. */ -#include +#include /* TODO: make it legal to call cmesh_set functions multiple times, * just overwrite the previous setting if no inconsistency can occur. diff --git a/src/t8_cmesh/t8_cmesh_examples.cxx b/src/t8_cmesh/t8_cmesh_examples.cxx index 738ab04d0e..59075daa33 100644 --- a/src/t8_cmesh/t8_cmesh_examples.cxx +++ b/src/t8_cmesh/t8_cmesh_examples.cxx @@ -31,8 +31,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include /* default refinement scheme. */ diff --git a/src/t8_cmesh/t8_cmesh_helpers.cxx b/src/t8_cmesh/t8_cmesh_helpers.cxx index 17e7c2411c..3ab6760e21 100644 --- a/src/t8_cmesh/t8_cmesh_helpers.cxx +++ b/src/t8_cmesh/t8_cmesh_helpers.cxx @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/t8_cmesh/t8_cmesh_helpers.h b/src/t8_cmesh/t8_cmesh_helpers.h index 4e129c7f97..d37ecb890f 100644 --- a/src/t8_cmesh/t8_cmesh_helpers.h +++ b/src/t8_cmesh/t8_cmesh_helpers.h @@ -30,7 +30,7 @@ #include #include -#include +#include T8_EXTERN_C_BEGIN (); diff --git a/src/t8_cmesh/t8_cmesh_internal/t8_cmesh_partition.cxx b/src/t8_cmesh/t8_cmesh_internal/t8_cmesh_partition.cxx index c732604bdd..9abdc42c13 100644 --- a/src/t8_cmesh/t8_cmesh_internal/t8_cmesh_partition.cxx +++ b/src/t8_cmesh/t8_cmesh_internal/t8_cmesh_partition.cxx @@ -29,7 +29,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/t8_cmesh/t8_cmesh_internal/t8_cmesh_stash.c b/src/t8_cmesh/t8_cmesh_internal/t8_cmesh_stash.c index 9f1275a18d..538b1be412 100644 --- a/src/t8_cmesh/t8_cmesh_internal/t8_cmesh_stash.c +++ b/src/t8_cmesh/t8_cmesh_internal/t8_cmesh_stash.c @@ -25,7 +25,7 @@ */ #include -#include +#include #include void diff --git a/src/t8_cmesh/t8_cmesh_internal/t8_cmesh_stash.h b/src/t8_cmesh/t8_cmesh_internal/t8_cmesh_stash.h index 5838b246b7..60b0f2cb52 100644 --- a/src/t8_cmesh/t8_cmesh_internal/t8_cmesh_stash.h +++ b/src/t8_cmesh/t8_cmesh_internal/t8_cmesh_stash.h @@ -28,7 +28,7 @@ #define T8_CMESH_STASH_H #include -#include +#include /** * Opaque pointer to a stash data structure. diff --git a/src/t8_cmesh/t8_cmesh_internal/t8_cmesh_types.h b/src/t8_cmesh/t8_cmesh_internal/t8_cmesh_types.h index 701cb9c5a3..b7e47b1c41 100644 --- a/src/t8_cmesh/t8_cmesh_internal/t8_cmesh_types.h +++ b/src/t8_cmesh/t8_cmesh_internal/t8_cmesh_types.h @@ -28,12 +28,12 @@ #define T8_CMESH_TYPES_H #include -#include +#include #include #include #include #include -#include "t8_element.h" +#include /** Opaque pointer to a t8_part_tree */ typedef struct t8_part_tree *t8_part_tree_t; diff --git a/src/t8_cmesh/t8_cmesh_io/t8_cmesh_netcdf.c b/src/t8_cmesh/t8_cmesh_io/t8_cmesh_netcdf.c index 64314f9ffc..2f58fc1729 100644 --- a/src/t8_cmesh/t8_cmesh_io/t8_cmesh_netcdf.c +++ b/src/t8_cmesh/t8_cmesh_io/t8_cmesh_netcdf.c @@ -37,7 +37,7 @@ These functions write a file in the netCDF-format which represents the given 2D- #if T8_ENABLE_NETCDF_PAR #include #endif -#include +#include #include #include #include diff --git a/src/t8_cmesh/t8_cmesh_io/t8_cmesh_netcdf.h b/src/t8_cmesh/t8_cmesh_io/t8_cmesh_netcdf.h index 38b88a4e0c..23caf3f006 100644 --- a/src/t8_cmesh/t8_cmesh_io/t8_cmesh_netcdf.h +++ b/src/t8_cmesh/t8_cmesh_io/t8_cmesh_netcdf.h @@ -28,7 +28,7 @@ #define T8_CMESH_NETCDF_H #include -#include +#include T8_EXTERN_C_BEGIN (); diff --git a/src/t8_cmesh/t8_cmesh_io/t8_cmesh_readmshfile.cxx b/src/t8_cmesh/t8_cmesh_io/t8_cmesh_readmshfile.cxx index 2221692a62..bddabfda0d 100644 --- a/src/t8_cmesh/t8_cmesh_io/t8_cmesh_readmshfile.cxx +++ b/src/t8_cmesh/t8_cmesh_io/t8_cmesh_readmshfile.cxx @@ -24,7 +24,7 @@ * Implements functions declared in \ref t8_cmesh_readmshfile.h. */ -#include +#include #include #include #include diff --git a/src/t8_cmesh/t8_cmesh_io/t8_cmesh_readmshfile.h b/src/t8_cmesh/t8_cmesh_io/t8_cmesh_readmshfile.h index 4153728ef9..8ddc369498 100644 --- a/src/t8_cmesh/t8_cmesh_io/t8_cmesh_readmshfile.h +++ b/src/t8_cmesh/t8_cmesh_io/t8_cmesh_readmshfile.h @@ -29,7 +29,7 @@ #define T8_CMESH_READMSHFILE_H #include -#include +#include #include /** The supported .msh file versions. diff --git a/src/t8_cmesh/t8_cmesh_io/t8_cmesh_save.cxx b/src/t8_cmesh/t8_cmesh_io/t8_cmesh_save.cxx index 20f481a6cc..4ce6fbfc74 100644 --- a/src/t8_cmesh/t8_cmesh_io/t8_cmesh_save.cxx +++ b/src/t8_cmesh/t8_cmesh_io/t8_cmesh_save.cxx @@ -27,8 +27,8 @@ * TODO: document this file */ -#include -#include +#include +#include #include #include #include diff --git a/src/t8_cmesh/t8_cmesh_io/t8_cmesh_tetgen.h b/src/t8_cmesh/t8_cmesh_io/t8_cmesh_tetgen.h index 93082ae012..e8328bb3e8 100644 --- a/src/t8_cmesh/t8_cmesh_io/t8_cmesh_tetgen.h +++ b/src/t8_cmesh/t8_cmesh_io/t8_cmesh_tetgen.h @@ -29,7 +29,7 @@ #define T8_CMESH_TETGEN_H #include -#include +#include #include #include #include diff --git a/src/t8_cmesh/t8_cmesh_io/t8_cmesh_triangle.h b/src/t8_cmesh/t8_cmesh_io/t8_cmesh_triangle.h index 277218214a..5400d1e421 100644 --- a/src/t8_cmesh/t8_cmesh_io/t8_cmesh_triangle.h +++ b/src/t8_cmesh/t8_cmesh_io/t8_cmesh_triangle.h @@ -29,7 +29,7 @@ #define T8_CMESH_TRIANGLE_H #include -#include +#include #include /* put typedefs here */ diff --git a/src/t8_data/t8_containers.h b/src/t8_data/t8_containers.h index efa2ff6d6b..3663914440 100644 --- a/src/t8_data/t8_containers.h +++ b/src/t8_data/t8_containers.h @@ -29,7 +29,7 @@ #define T8_CONTAINERS_H #include -#include +#include #include /** The t8_element_array_t is an array to store t8_element_t * of a given diff --git a/src/t8_data/t8_element_array_iterator.hxx b/src/t8_data/t8_element_array_iterator.hxx index 069bfaa47e..e792d24b8d 100644 --- a/src/t8_data/t8_element_array_iterator.hxx +++ b/src/t8_data/t8_element_array_iterator.hxx @@ -29,7 +29,7 @@ #define T8_ELEMENT_ARRAY_ITERATOR_HXX #include -#include +#include #include #include diff --git a/src/t8_eclass.c b/src/t8_element/t8_eclass.c similarity index 99% rename from src/t8_eclass.c rename to src/t8_element/t8_eclass.c index 160bbd8aa4..32211e8e41 100644 --- a/src/t8_eclass.c +++ b/src/t8_element/t8_eclass.c @@ -25,7 +25,7 @@ */ #define KEEP_ECLASS_VALUE_DEFINITIONS -#include +#include #undef KEEP_ECLASS_VALUE_DEFINITIONS const int t8_eclass_to_dimension[T8_ECLASS_COUNT] = T8_ECLASS_TO_DIMENSION_VALUES; diff --git a/src/t8_eclass.h b/src/t8_element/t8_eclass.h similarity index 100% rename from src/t8_eclass.h rename to src/t8_element/t8_eclass.h diff --git a/src/t8_element.cxx b/src/t8_element/t8_element.cxx similarity index 98% rename from src/t8_element.cxx rename to src/t8_element/t8_element.cxx index 54e63589dc..58657dbaea 100644 --- a/src/t8_element.cxx +++ b/src/t8_element/t8_element.cxx @@ -20,7 +20,7 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include +#include /* We want to export the whole implementation to be callable from "C" */ T8_EXTERN_C_BEGIN (); diff --git a/src/t8_element.h b/src/t8_element/t8_element.h similarity index 96% rename from src/t8_element.h rename to src/t8_element/t8_element.h index 59e0870b5e..8813ac079b 100644 --- a/src/t8_element.h +++ b/src/t8_element/t8_element.h @@ -29,8 +29,8 @@ #define T8_ELEMENT_H #include -#include -#include +#include +#include /** We want to export the whole implementation to be callable from "C". */ T8_EXTERN_C_BEGIN (); diff --git a/src/t8_element_shape.c b/src/t8_element/t8_element_shape.c similarity index 98% rename from src/t8_element_shape.c rename to src/t8_element/t8_element_shape.c index a9cf4f0a68..acc64a43aa 100644 --- a/src/t8_element_shape.c +++ b/src/t8_element/t8_element_shape.c @@ -20,7 +20,7 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include +#include const int t8_element_shape_max_num_corner[T8_ECLASS_MAX_DIM + 1] = { 0, 2, 4, 8 }; diff --git a/src/t8_element_shape.h b/src/t8_element/t8_element_shape.h similarity index 99% rename from src/t8_element_shape.h rename to src/t8_element/t8_element_shape.h index 59abca1c38..8323e0a814 100644 --- a/src/t8_element_shape.h +++ b/src/t8_element/t8_element_shape.h @@ -28,7 +28,7 @@ #define T8_ELEMENT_SHAPE_H #include -#include +#include /** We want to export the whole implementation to be callable from "C". */ T8_EXTERN_C_BEGIN (); diff --git a/src/t8_forest/t8_forest.cxx b/src/t8_forest/t8_forest.cxx index e882a6f831..3069e78046 100644 --- a/src/t8_forest/t8_forest.cxx +++ b/src/t8_forest/t8_forest.cxx @@ -25,7 +25,7 @@ */ #include -#include +#include #include #include #include diff --git a/src/t8_forest/t8_forest_general.h b/src/t8_forest/t8_forest_general.h index a6d171d187..77d3dad9f1 100644 --- a/src/t8_forest/t8_forest_general.h +++ b/src/t8_forest/t8_forest_general.h @@ -30,7 +30,7 @@ #define T8_FOREST_GENERAL_H #include -#include +#include #include /** Opaque pointer to a forest implementation. */ diff --git a/src/t8_forest/t8_forest_io.h b/src/t8_forest/t8_forest_io.h index d03b744202..f38458d12f 100644 --- a/src/t8_forest/t8_forest_io.h +++ b/src/t8_forest/t8_forest_io.h @@ -29,7 +29,7 @@ #ifndef T8_FOREST_IO_H #define T8_FOREST_IO_H -#include +#include T8_EXTERN_C_BEGIN (); /** TODO: implement */ diff --git a/src/t8_forest/t8_forest_netcdf.cxx b/src/t8_forest/t8_forest_netcdf.cxx index 7b8f3f9230..40c4fef0ca 100644 --- a/src/t8_forest/t8_forest_netcdf.cxx +++ b/src/t8_forest/t8_forest_netcdf.cxx @@ -53,7 +53,7 @@ #include #include #include -#include +#include #include /** We want to export the whole implementation to be callable from "C". */ diff --git a/src/t8_forest/t8_forest_partition_for_coarsening.cxx b/src/t8_forest/t8_forest_partition_for_coarsening.cxx index 1708b9050b..7de25a24c3 100644 --- a/src/t8_forest/t8_forest_partition_for_coarsening.cxx +++ b/src/t8_forest/t8_forest_partition_for_coarsening.cxx @@ -31,9 +31,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include diff --git a/src/t8_forest/t8_forest_pfc_helper.cxx b/src/t8_forest/t8_forest_pfc_helper.cxx index 580cf9c5ee..93b62f4538 100644 --- a/src/t8_forest/t8_forest_pfc_helper.cxx +++ b/src/t8_forest/t8_forest_pfc_helper.cxx @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include t8_locidx_t diff --git a/src/t8_forest/t8_forest_pfc_helper.hxx b/src/t8_forest/t8_forest_pfc_helper.hxx index 09ec4d2ca2..0c6c2f8024 100644 --- a/src/t8_forest/t8_forest_pfc_helper.hxx +++ b/src/t8_forest/t8_forest_pfc_helper.hxx @@ -29,7 +29,7 @@ #include #include -#include +#include /** Determine the sibling with the biggest difference in IDs (in the given direction). * diff --git a/src/t8_forest/t8_forest_pfc_message.hxx b/src/t8_forest/t8_forest_pfc_message.hxx index 46ab106521..868aae6d24 100644 --- a/src/t8_forest/t8_forest_pfc_message.hxx +++ b/src/t8_forest/t8_forest_pfc_message.hxx @@ -30,7 +30,7 @@ #define T8_FOREST_PFC_MESSAGE_H #include -#include +#include #include #include #include diff --git a/src/t8_forest/t8_forest_types.h b/src/t8_forest/t8_forest_types.h index 852a06db93..a6fbc712a6 100644 --- a/src/t8_forest/t8_forest_types.h +++ b/src/t8_forest/t8_forest_types.h @@ -29,9 +29,9 @@ #include #include -#include +#include #include -#include +#include #include #include #include diff --git a/src/t8_geometry/t8_geometry.h b/src/t8_geometry/t8_geometry.h index 9f4f6888b0..d0da4659c2 100644 --- a/src/t8_geometry/t8_geometry.h +++ b/src/t8_geometry/t8_geometry.h @@ -29,7 +29,7 @@ #define T8_GEOMETRY_H #include -#include +#include /** This enumeration contains all possible geometries. */ typedef enum t8_geometry_type { diff --git a/src/t8_geometry/t8_geometry_helpers.c b/src/t8_geometry/t8_geometry_helpers.c index 4fc1e59132..6a3ecc6efd 100644 --- a/src/t8_geometry/t8_geometry_helpers.c +++ b/src/t8_geometry/t8_geometry_helpers.c @@ -25,7 +25,7 @@ */ #include -#include +#include #include #include diff --git a/src/t8_geometry/t8_geometry_implementations/t8_geometry_cad.cxx b/src/t8_geometry/t8_geometry_implementations/t8_geometry_cad.cxx index 158c112c04..7c65d5e4fd 100644 --- a/src/t8_geometry/t8_geometry_implementations/t8_geometry_cad.cxx +++ b/src/t8_geometry/t8_geometry_implementations/t8_geometry_cad.cxx @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/t8_geometry/t8_geometry_implementations/t8_geometry_lagrange.cxx b/src/t8_geometry/t8_geometry_implementations/t8_geometry_lagrange.cxx index d0a73b547e..3cf44c3c12 100644 --- a/src/t8_geometry/t8_geometry_implementations/t8_geometry_lagrange.cxx +++ b/src/t8_geometry/t8_geometry_implementations/t8_geometry_lagrange.cxx @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/t8_mat.h b/src/t8_helper_functions/t8_mat.h similarity index 100% rename from src/t8_mat.h rename to src/t8_helper_functions/t8_mat.h diff --git a/src/t8_refcount.c b/src/t8_helper_functions/t8_refcount.c similarity index 96% rename from src/t8_refcount.c rename to src/t8_helper_functions/t8_refcount.c index fb61f8171e..6f0deda235 100644 --- a/src/t8_refcount.c +++ b/src/t8_helper_functions/t8_refcount.c @@ -24,7 +24,7 @@ * Implements reference counting functions declared in \ref t8_refcount.h. */ -#include +#include void t8_refcount_init (t8_refcount_t *rc) diff --git a/src/t8_refcount.h b/src/t8_helper_functions/t8_refcount.h similarity index 100% rename from src/t8_refcount.h rename to src/t8_helper_functions/t8_refcount.h diff --git a/src/t8_version.c b/src/t8_misc/t8_version.c similarity index 97% rename from src/t8_version.c rename to src/t8_misc/t8_version.c index f35589f5a4..0c19db489e 100644 --- a/src/t8_version.c +++ b/src/t8_misc/t8_version.c @@ -24,7 +24,7 @@ * Implements functions declared in \ref t8_version.h. */ -#include +#include const char * t8_get_package_string () diff --git a/src/t8_version.h b/src/t8_misc/t8_version.h similarity index 100% rename from src/t8_version.h rename to src/t8_misc/t8_version.h diff --git a/src/t8_windows.h b/src/t8_misc/t8_windows.h similarity index 100% rename from src/t8_windows.h rename to src/t8_misc/t8_windows.h diff --git a/src/t8_with_macro_error.h b/src/t8_misc/t8_with_macro_error.h similarity index 100% rename from src/t8_with_macro_error.h rename to src/t8_misc/t8_with_macro_error.h diff --git a/src/t8_forest_netcdf.h b/src/t8_netcdf/t8_forest_netcdf.h similarity index 99% rename from src/t8_forest_netcdf.h rename to src/t8_netcdf/t8_forest_netcdf.h index 884e7b6c0b..38d71e9775 100644 --- a/src/t8_forest_netcdf.h +++ b/src/t8_netcdf/t8_forest_netcdf.h @@ -28,7 +28,7 @@ #define T8_FOREST_NETCDF_H #include -#include +#include /** We want to export the whole implementation to be callable from "C". */ T8_EXTERN_C_BEGIN (); diff --git a/src/t8_netcdf.c b/src/t8_netcdf/t8_netcdf.c similarity index 98% rename from src/t8_netcdf.c rename to src/t8_netcdf/t8_netcdf.c index 2b5c74fa23..ea0c78e103 100644 --- a/src/t8_netcdf.c +++ b/src/t8_netcdf/t8_netcdf.c @@ -21,7 +21,7 @@ */ #include -#include +#include /* Create an extern NetCDF variable */ t8_netcdf_variable_t * diff --git a/src/t8_netcdf.h b/src/t8_netcdf/t8_netcdf.h similarity index 100% rename from src/t8_netcdf.h rename to src/t8_netcdf/t8_netcdf.h diff --git a/src/t8_schemes/t8_default/t8_default_c_interface.h b/src/t8_schemes/t8_default/t8_default_c_interface.h index 0de15119ae..701b830f05 100644 --- a/src/t8_schemes/t8_default/t8_default_c_interface.h +++ b/src/t8_schemes/t8_default/t8_default_c_interface.h @@ -27,7 +27,7 @@ #ifndef T8_DEFAULT_C_INTERFACE_H #define T8_DEFAULT_C_INTERFACE_H -#include +#include T8_EXTERN_C_BEGIN (); diff --git a/src/t8_schemes/t8_default/t8_default_common/t8_default_common.hxx b/src/t8_schemes/t8_default/t8_default_common/t8_default_common.hxx index f1f8146ff2..9cd1a2281e 100644 --- a/src/t8_schemes/t8_default/t8_default_common/t8_default_common.hxx +++ b/src/t8_schemes/t8_default/t8_default_common/t8_default_common.hxx @@ -27,7 +27,7 @@ #ifndef T8_DEFAULT_COMMON_HXX #define T8_DEFAULT_COMMON_HXX -#include +#include #include #include #include diff --git a/src/t8_schemes/t8_default/t8_default_hex/t8_default_hex.hxx b/src/t8_schemes/t8_default/t8_default_hex/t8_default_hex.hxx index 9c6052012c..c24f60b53b 100644 --- a/src/t8_schemes/t8_default/t8_default_hex/t8_default_hex.hxx +++ b/src/t8_schemes/t8_default/t8_default_hex/t8_default_hex.hxx @@ -27,7 +27,7 @@ #define T8_DEFAULT_HEX_HXX #include -#include +#include #include #include #include diff --git a/src/t8_schemes/t8_default/t8_default_hex/t8_dhex_bits.h b/src/t8_schemes/t8_default/t8_default_hex/t8_dhex_bits.h index 92c5ec8cec..476313f1c1 100644 --- a/src/t8_schemes/t8_default/t8_default_hex/t8_dhex_bits.h +++ b/src/t8_schemes/t8_default/t8_default_hex/t8_dhex_bits.h @@ -27,7 +27,7 @@ #ifndef T8_DHEX_BITS_H #define T8_DHEX_BITS_H -#include +#include #include T8_EXTERN_C_BEGIN (); diff --git a/src/t8_schemes/t8_default/t8_default_line/t8_default_line.hxx b/src/t8_schemes/t8_default/t8_default_line/t8_default_line.hxx index 8732d7e542..26122929e5 100644 --- a/src/t8_schemes/t8_default/t8_default_line/t8_default_line.hxx +++ b/src/t8_schemes/t8_default/t8_default_line/t8_default_line.hxx @@ -29,7 +29,7 @@ #ifndef T8_DEFAULT_LINES_HXX #define T8_DEFAULT_LINES_HXX -#include +#include #include #include diff --git a/src/t8_schemes/t8_default/t8_default_line/t8_dline_bits.h b/src/t8_schemes/t8_default/t8_default_line/t8_dline_bits.h index d2da50557d..f7dbeef411 100644 --- a/src/t8_schemes/t8_default/t8_default_line/t8_dline_bits.h +++ b/src/t8_schemes/t8_default/t8_default_line/t8_dline_bits.h @@ -27,7 +27,7 @@ #ifndef T8_DLINE_BITS_H #define T8_DLINE_BITS_H -#include +#include #include #include diff --git a/src/t8_schemes/t8_default/t8_default_prism/t8_default_prism.hxx b/src/t8_schemes/t8_default/t8_default_prism/t8_default_prism.hxx index f07417b7b8..e7079f3cb3 100644 --- a/src/t8_schemes/t8_default/t8_default_prism/t8_default_prism.hxx +++ b/src/t8_schemes/t8_default/t8_default_prism/t8_default_prism.hxx @@ -29,7 +29,7 @@ #ifndef T8_DEFAULT_PRISM_HXX #define T8_DEFAULT_PRISM_HXX -#include +#include #include #include #include diff --git a/src/t8_schemes/t8_default/t8_default_prism/t8_dprism_bits.h b/src/t8_schemes/t8_default/t8_default_prism/t8_dprism_bits.h index 60726cf5d2..24a19f7e8d 100644 --- a/src/t8_schemes/t8_default/t8_default_prism/t8_dprism_bits.h +++ b/src/t8_schemes/t8_default/t8_default_prism/t8_dprism_bits.h @@ -27,7 +27,7 @@ #ifndef T8_DPRISM_BITS_H #define T8_DPRISM_BITS_H -#include +#include #include T8_EXTERN_C_BEGIN (); diff --git a/src/t8_schemes/t8_default/t8_default_pyramid/t8_default_pyramid.hxx b/src/t8_schemes/t8_default/t8_default_pyramid/t8_default_pyramid.hxx index b60b9015ec..f8d81486a8 100644 --- a/src/t8_schemes/t8_default/t8_default_pyramid/t8_default_pyramid.hxx +++ b/src/t8_schemes/t8_default/t8_default_pyramid/t8_default_pyramid.hxx @@ -29,7 +29,7 @@ #ifndef T8_DEFAULT_PYRAMID_HXX #define T8_DEFAULT_PYRAMID_HXX -#include +#include #include #include diff --git a/src/t8_schemes/t8_default/t8_default_pyramid/t8_dpyramid_bits.h b/src/t8_schemes/t8_default/t8_default_pyramid/t8_dpyramid_bits.h index 411355bbff..61251e1557 100644 --- a/src/t8_schemes/t8_default/t8_default_pyramid/t8_dpyramid_bits.h +++ b/src/t8_schemes/t8_default/t8_default_pyramid/t8_dpyramid_bits.h @@ -27,7 +27,7 @@ #ifndef T8_DPYRAMID_BITS_H #define T8_DPYRAMID_BITS_H -#include "t8_element.h" +#include #include "t8_dpyramid.h" T8_EXTERN_C_BEGIN (); diff --git a/src/t8_schemes/t8_default/t8_default_quad/t8_default_quad.hxx b/src/t8_schemes/t8_default/t8_default_quad/t8_default_quad.hxx index a9f199ee9f..a6e107417c 100644 --- a/src/t8_schemes/t8_default/t8_default_quad/t8_default_quad.hxx +++ b/src/t8_schemes/t8_default/t8_default_quad/t8_default_quad.hxx @@ -32,7 +32,7 @@ #define T8_DEFAULT_QUAD_HXX #include -#include +#include #include #include diff --git a/src/t8_schemes/t8_default/t8_default_quad/t8_default_quad_bits.hxx b/src/t8_schemes/t8_default/t8_default_quad/t8_default_quad_bits.hxx index b51c4bebbf..7f63f0813e 100644 --- a/src/t8_schemes/t8_default/t8_default_quad/t8_default_quad_bits.hxx +++ b/src/t8_schemes/t8_default/t8_default_quad/t8_default_quad_bits.hxx @@ -27,7 +27,7 @@ #ifndef T8_DQUAD_BITS_H #define T8_DQUAD_BITS_H -#include +#include #include T8_EXTERN_C_BEGIN (); diff --git a/src/t8_schemes/t8_default/t8_default_tet/t8_default_tet.hxx b/src/t8_schemes/t8_default/t8_default_tet/t8_default_tet.hxx index e5223e7261..cde4d5fdbd 100644 --- a/src/t8_schemes/t8_default/t8_default_tet/t8_default_tet.hxx +++ b/src/t8_schemes/t8_default/t8_default_tet/t8_default_tet.hxx @@ -29,7 +29,7 @@ #ifndef T8_DEFAULT_TET_HXX #define T8_DEFAULT_TET_HXX -#include +#include #include #include #include diff --git a/src/t8_schemes/t8_default/t8_default_tet/t8_dtet_bits.h b/src/t8_schemes/t8_default/t8_default_tet/t8_dtet_bits.h index 6a707982ac..b5b8e84ecd 100644 --- a/src/t8_schemes/t8_default/t8_default_tet/t8_dtet_bits.h +++ b/src/t8_schemes/t8_default/t8_default_tet/t8_dtet_bits.h @@ -30,7 +30,7 @@ #ifndef T8_DTET_BITS_H #define T8_DTET_BITS_H -#include +#include #include T8_EXTERN_C_BEGIN (); diff --git a/src/t8_schemes/t8_default/t8_default_tet/t8_dtet_connectivity.h b/src/t8_schemes/t8_default/t8_default_tet/t8_dtet_connectivity.h index 9a203dc9b6..a9fd2ef836 100644 --- a/src/t8_schemes/t8_default/t8_default_tet/t8_dtet_connectivity.h +++ b/src/t8_schemes/t8_default/t8_default_tet/t8_dtet_connectivity.h @@ -28,7 +28,7 @@ #define T8_DTET_CONNECTIVITY_H #include -#include +#include T8_EXTERN_C_BEGIN (); diff --git a/src/t8_schemes/t8_default/t8_default_tri/t8_default_tri.hxx b/src/t8_schemes/t8_default/t8_default_tri/t8_default_tri.hxx index cb346c612f..5181ab6fe0 100644 --- a/src/t8_schemes/t8_default/t8_default_tri/t8_default_tri.hxx +++ b/src/t8_schemes/t8_default/t8_default_tri/t8_default_tri.hxx @@ -29,7 +29,7 @@ #ifndef T8_DEFAULT_TRI_HXX #define T8_DEFAULT_TRI_HXX -#include +#include #include #include #include diff --git a/src/t8_schemes/t8_default/t8_default_tri/t8_dtri_bits.h b/src/t8_schemes/t8_default/t8_default_tri/t8_dtri_bits.h index da3296991c..fa6f5b2f0b 100644 --- a/src/t8_schemes/t8_default/t8_default_tri/t8_dtri_bits.h +++ b/src/t8_schemes/t8_default/t8_default_tri/t8_dtri_bits.h @@ -27,7 +27,7 @@ #ifndef T8_DTRI_BITS_H #define T8_DTRI_BITS_H -#include +#include #include T8_EXTERN_C_BEGIN (); diff --git a/src/t8_schemes/t8_default/t8_default_tri/t8_dtri_connectivity.h b/src/t8_schemes/t8_default/t8_default_tri/t8_dtri_connectivity.h index 06182dda1e..dd923ac718 100644 --- a/src/t8_schemes/t8_default/t8_default_tri/t8_dtri_connectivity.h +++ b/src/t8_schemes/t8_default/t8_default_tri/t8_dtri_connectivity.h @@ -27,7 +27,7 @@ #define T8_DTRI_CONNECTIVITY_H #include -#include +#include T8_EXTERN_C_BEGIN (); diff --git a/src/t8_schemes/t8_default/t8_default_vertex/t8_default_vertex.hxx b/src/t8_schemes/t8_default/t8_default_vertex/t8_default_vertex.hxx index 987d993b40..894c7a5b66 100644 --- a/src/t8_schemes/t8_default/t8_default_vertex/t8_default_vertex.hxx +++ b/src/t8_schemes/t8_default/t8_default_vertex/t8_default_vertex.hxx @@ -27,7 +27,7 @@ #ifndef T8_DEFAULT_VERTEX_HXX #define T8_DEFAULT_VERTEX_HXX -#include +#include #include #include diff --git a/src/t8_schemes/t8_scheme.cxx b/src/t8_schemes/t8_scheme.cxx index 6f909ff635..d4a92da3c6 100644 --- a/src/t8_schemes/t8_scheme.cxx +++ b/src/t8_schemes/t8_scheme.cxx @@ -24,7 +24,7 @@ * Implements functions declared in \ref t8_scheme.h. */ -#include +#include #include #include #include diff --git a/src/t8_schemes/t8_scheme.h b/src/t8_schemes/t8_scheme.h index 3b36bc4f4a..0c3d16ef49 100644 --- a/src/t8_schemes/t8_scheme.h +++ b/src/t8_schemes/t8_scheme.h @@ -29,7 +29,7 @@ #define T8_SCHEME_H #include -#include +#include /** The scheme holds implementations for one or more element classes. * Opaque pointer for C interface. diff --git a/src/t8_schemes/t8_scheme.hxx b/src/t8_schemes/t8_scheme.hxx index fd398584a7..09c6917797 100644 --- a/src/t8_schemes/t8_scheme.hxx +++ b/src/t8_schemes/t8_scheme.hxx @@ -30,8 +30,8 @@ #include #include -#include -#include +#include +#include #include #include #include diff --git a/src/t8_schemes/t8_scheme_helpers.hxx b/src/t8_schemes/t8_scheme_helpers.hxx index 4bcfc652c6..23cec657f5 100644 --- a/src/t8_schemes/t8_scheme_helpers.hxx +++ b/src/t8_schemes/t8_scheme_helpers.hxx @@ -27,9 +27,9 @@ #ifndef T8_SCHEME_HELPERS_HXX #define T8_SCHEME_HELPERS_HXX -#include +#include #include -#include +#include /** * Class which provides helper functions and default implementations for different schemes. diff --git a/src/t8_schemes/t8_standalone/t8_standalone_implementation.hxx b/src/t8_schemes/t8_standalone/t8_standalone_implementation.hxx index 5338e72625..aa0d52cfbe 100644 --- a/src/t8_schemes/t8_standalone/t8_standalone_implementation.hxx +++ b/src/t8_schemes/t8_standalone/t8_standalone_implementation.hxx @@ -28,7 +28,7 @@ #define T8_STANDALONE_IMPLEMENTATION_HXX #include -#include +#include #include #include #include diff --git a/src/t8_vtk.c b/src/t8_vtk/t8_vtk.c similarity index 99% rename from src/t8_vtk.c rename to src/t8_vtk/t8_vtk.c index 065ab5e9ae..cc542a8a45 100644 --- a/src/t8_vtk.c +++ b/src/t8_vtk/t8_vtk.c @@ -20,7 +20,7 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include +#include /* Writes the pvtu header file that links to the processor local files. * This function should only be called by one process. diff --git a/src/t8_vtk.h b/src/t8_vtk/t8_vtk.h similarity index 100% rename from src/t8_vtk.h rename to src/t8_vtk/t8_vtk.h diff --git a/src/t8_vtk/t8_vtk_types.h b/src/t8_vtk/t8_vtk_types.h index 429f0af1bb..9c21f4a993 100644 --- a/src/t8_vtk/t8_vtk_types.h +++ b/src/t8_vtk/t8_vtk_types.h @@ -28,7 +28,7 @@ #ifndef T8_VTK_TYPES #define T8_VTK_TYPES -#include +#include /** * Translator between vtk-type of elements and t8code-elements. diff --git a/src/t8_vtk/t8_vtk_write_ASCII.cxx b/src/t8_vtk/t8_vtk_write_ASCII.cxx index 14f02d8da5..c088904948 100644 --- a/src/t8_vtk/t8_vtk_write_ASCII.cxx +++ b/src/t8_vtk/t8_vtk_write_ASCII.cxx @@ -22,7 +22,7 @@ #include "t8_vtk/t8_vtk_write_ASCII.hxx" #include "t8_vtk/t8_vtk_writer_helper.hxx" -#include +#include #include #include #include "t8_forest/t8_forest_types.h" diff --git a/src/t8_vtk/t8_vtk_writer.h b/src/t8_vtk/t8_vtk_writer.h index 4b8d47a884..824fe73a6f 100644 --- a/src/t8_vtk/t8_vtk_writer.h +++ b/src/t8_vtk/t8_vtk_writer.h @@ -29,7 +29,7 @@ #define T8_VTK_WRITER_C_INTERFACE_H #include -#include +#include #include #if T8_ENABLE_VTK diff --git a/src/t8_vtk/t8_vtk_writer.hxx b/src/t8_vtk/t8_vtk_writer.hxx index 2e8c1b8aa0..03327900bf 100644 --- a/src/t8_vtk/t8_vtk_writer.hxx +++ b/src/t8_vtk/t8_vtk_writer.hxx @@ -38,7 +38,7 @@ #include "t8_vtk/t8_vtk_write_ASCII.hxx" #include -#include +#include #include #if T8_ENABLE_VTK diff --git a/test/t8_cmesh/t8_gtest_cmesh_readmshfile.cxx b/test/t8_cmesh/t8_gtest_cmesh_readmshfile.cxx index 0d14982baa..05d9af2fac 100644 --- a/test/t8_cmesh/t8_gtest_cmesh_readmshfile.cxx +++ b/test/t8_cmesh/t8_gtest_cmesh_readmshfile.cxx @@ -23,7 +23,7 @@ #include #include /* Needed to check for file access */ #include -#include +#include #include #include #include diff --git a/test/t8_cmesh/t8_gtest_cmesh_set_join_by_vertices.cxx b/test/t8_cmesh/t8_gtest_cmesh_set_join_by_vertices.cxx index eeeae6e902..72e1eb04d9 100644 --- a/test/t8_cmesh/t8_gtest_cmesh_set_join_by_vertices.cxx +++ b/test/t8_cmesh/t8_gtest_cmesh_set_join_by_vertices.cxx @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include #include diff --git a/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_new_bigmesh_param.hxx b/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_new_bigmesh_param.hxx index 6e5e1b59d5..c15a1ea4da 100644 --- a/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_new_bigmesh_param.hxx +++ b/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_new_bigmesh_param.hxx @@ -26,7 +26,7 @@ #include "test/t8_cmesh_generator/t8_gtest_cmesh_cartestian_product.hxx" #include "test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_params.hxx" #include "t8_cmesh/t8_cmesh_examples.h" -#include +#include namespace new_bigmesh { diff --git a/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_new_empty.hxx b/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_new_empty.hxx index 11273d995a..0e88034d0f 100644 --- a/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_new_empty.hxx +++ b/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_new_empty.hxx @@ -26,7 +26,7 @@ #include #include #include -#include +#include namespace new_empty { diff --git a/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_new_from_class_param.hxx b/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_new_from_class_param.hxx index 7c0b30f15d..914e9587c9 100644 --- a/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_new_from_class_param.hxx +++ b/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_new_from_class_param.hxx @@ -23,7 +23,7 @@ #include "test/t8_cmesh_generator/t8_gtest_cmesh_cartestian_product.hxx" #include "test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_params.hxx" #include -#include +#include #ifndef T8_CMESH_NEW_FROM_CLASS_PARAM #define T8_CMESH_NEW_FROM_CLASS_PARAM diff --git a/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_new_hypercube_param.hxx b/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_new_hypercube_param.hxx index 4569d98561..41dc577e7b 100644 --- a/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_new_hypercube_param.hxx +++ b/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_new_hypercube_param.hxx @@ -23,7 +23,7 @@ #ifndef T8_CMESH_NEW_HYPERCUBE_PARAM_HXX #define T8_CMESH_NEW_HYPERCUBE_PARAM_HXX -#include +#include #include "test/t8_cmesh_generator/t8_gtest_cmesh_cartestian_product.hxx" #include "test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_params.hxx" #include diff --git a/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_new_periodic.hxx b/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_new_periodic.hxx index e57aed1d13..98ca867c23 100644 --- a/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_new_periodic.hxx +++ b/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_new_periodic.hxx @@ -26,7 +26,7 @@ #include #include #include -#include +#include namespace new_periodic { diff --git a/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_params.hxx b/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_params.hxx index 92fd2bfd1d..022f32495f 100644 --- a/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_params.hxx +++ b/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_params.hxx @@ -26,7 +26,7 @@ #ifndef T8_CMESH_PARAMS_HXX #define T8_CMESH_PARAMS_HXX -#include +#include #include #include #include diff --git a/test/t8_forest/t8_gtest_balance.cxx b/test/t8_forest/t8_gtest_balance.cxx index 464ef97ff9..081938f66a 100644 --- a/test/t8_forest/t8_gtest_balance.cxx +++ b/test/t8_forest/t8_gtest_balance.cxx @@ -29,7 +29,7 @@ #include #include -#include +#include #include #include #include diff --git a/test/t8_forest/t8_gtest_element_is_leaf.cxx b/test/t8_forest/t8_gtest_element_is_leaf.cxx index f19af2371c..80362020e8 100644 --- a/test/t8_forest/t8_gtest_element_is_leaf.cxx +++ b/test/t8_forest/t8_gtest_element_is_leaf.cxx @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include #include diff --git a/test/t8_forest/t8_gtest_element_volume.cxx b/test/t8_forest/t8_gtest_element_volume.cxx index 43efbf5b01..0a5415dea8 100644 --- a/test/t8_forest/t8_gtest_element_volume.cxx +++ b/test/t8_forest/t8_gtest_element_volume.cxx @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include #include diff --git a/test/t8_forest/t8_gtest_find_owner.cxx b/test/t8_forest/t8_gtest_find_owner.cxx index c2a3acc84f..b6c42013dd 100644 --- a/test/t8_forest/t8_gtest_find_owner.cxx +++ b/test/t8_forest/t8_gtest_find_owner.cxx @@ -21,7 +21,7 @@ */ #include -#include +#include #include #include #include diff --git a/test/t8_forest/t8_gtest_forest_commit.cxx b/test/t8_forest/t8_gtest_forest_commit.cxx index 7234ecc6db..779bb957ef 100644 --- a/test/t8_forest/t8_gtest_forest_commit.cxx +++ b/test/t8_forest/t8_gtest_forest_commit.cxx @@ -21,7 +21,7 @@ */ #include -#include +#include #include #include #include diff --git a/test/t8_forest/t8_gtest_forest_face_normal.cxx b/test/t8_forest/t8_gtest_forest_face_normal.cxx index 13f6d1a4a8..03747f6542 100644 --- a/test/t8_forest/t8_gtest_forest_face_normal.cxx +++ b/test/t8_forest/t8_gtest_forest_face_normal.cxx @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include #include diff --git a/test/t8_forest/t8_gtest_ghost_and_owner.cxx b/test/t8_forest/t8_gtest_ghost_and_owner.cxx index 69dd9eae61..ea225f3069 100644 --- a/test/t8_forest/t8_gtest_ghost_and_owner.cxx +++ b/test/t8_forest/t8_gtest_ghost_and_owner.cxx @@ -21,7 +21,7 @@ */ #include -#include +#include #include #include #include diff --git a/test/t8_forest/t8_gtest_ghost_delete.cxx b/test/t8_forest/t8_gtest_ghost_delete.cxx index ea7e37ce71..535c3ddad7 100644 --- a/test/t8_forest/t8_gtest_ghost_delete.cxx +++ b/test/t8_forest/t8_gtest_ghost_delete.cxx @@ -21,7 +21,7 @@ */ #include -#include +#include #include #include #include diff --git a/test/t8_forest/t8_gtest_ghost_exchange.cxx b/test/t8_forest/t8_gtest_ghost_exchange.cxx index 4c05fe6db8..2a426bbc0b 100644 --- a/test/t8_forest/t8_gtest_ghost_exchange.cxx +++ b/test/t8_forest/t8_gtest_ghost_exchange.cxx @@ -21,7 +21,7 @@ */ #include -#include +#include #include #include #include diff --git a/test/t8_forest/t8_gtest_half_neighbors.cxx b/test/t8_forest/t8_gtest_half_neighbors.cxx index 835c0229f3..a151c5ec3a 100644 --- a/test/t8_forest/t8_gtest_half_neighbors.cxx +++ b/test/t8_forest/t8_gtest_half_neighbors.cxx @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include #include diff --git a/test/t8_forest/t8_gtest_search.cxx b/test/t8_forest/t8_gtest_search.cxx index 214021dec6..c460049c28 100644 --- a/test/t8_forest/t8_gtest_search.cxx +++ b/test/t8_forest/t8_gtest_search.cxx @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include #include diff --git a/test/t8_forest/t8_gtest_transform.cxx b/test/t8_forest/t8_gtest_transform.cxx index 66593080a7..9c2eeb4f40 100644 --- a/test/t8_forest/t8_gtest_transform.cxx +++ b/test/t8_forest/t8_gtest_transform.cxx @@ -30,7 +30,7 @@ #include #include -#include +#include #include #include #include diff --git a/test/t8_geometry/t8_geometry_implementations/t8_gtest_geometry_cad.cxx b/test/t8_geometry/t8_geometry_implementations/t8_gtest_geometry_cad.cxx index c3f8584e57..e920c36ceb 100644 --- a/test/t8_geometry/t8_geometry_implementations/t8_gtest_geometry_cad.cxx +++ b/test/t8_geometry/t8_geometry_implementations/t8_gtest_geometry_cad.cxx @@ -23,13 +23,13 @@ #include #include #include -#include +#include #include #include #include #include #include -#include +#include #include #include @@ -48,7 +48,7 @@ #include #include #include -#include +#include #include diff --git a/test/t8_geometry/t8_geometry_implementations/t8_gtest_geometry_lagrange.cxx b/test/t8_geometry/t8_geometry_implementations/t8_gtest_geometry_lagrange.cxx index 778df8c415..2c65833ddf 100644 --- a/test/t8_geometry/t8_geometry_implementations/t8_gtest_geometry_lagrange.cxx +++ b/test/t8_geometry/t8_geometry_implementations/t8_gtest_geometry_lagrange.cxx @@ -32,7 +32,7 @@ #include #include -#include +#include #include #include #include diff --git a/test/t8_geometry/t8_geometry_implementations/t8_gtest_geometry_linear.cxx b/test/t8_geometry/t8_geometry_implementations/t8_gtest_geometry_linear.cxx index a0546cfaaf..5ddc1e6e8e 100644 --- a/test/t8_geometry/t8_geometry_implementations/t8_gtest_geometry_linear.cxx +++ b/test/t8_geometry/t8_geometry_implementations/t8_gtest_geometry_linear.cxx @@ -27,13 +27,13 @@ #include #include #include -#include +#include #include #include #include #include #include -#include +#include #include struct geometry_test: public testing::TestWithParam> diff --git a/test/t8_geometry/t8_gtest_geometry_handling.cxx b/test/t8_geometry/t8_gtest_geometry_handling.cxx index 42bd429659..3de42e9cdb 100644 --- a/test/t8_geometry/t8_gtest_geometry_handling.cxx +++ b/test/t8_geometry/t8_gtest_geometry_handling.cxx @@ -25,7 +25,7 @@ */ #include -#include +#include #include #include #include diff --git a/test/t8_geometry/t8_gtest_geometry_negative_volume.cxx b/test/t8_geometry/t8_gtest_geometry_negative_volume.cxx index 1b218bff12..1c32b1b883 100644 --- a/test/t8_geometry/t8_gtest_geometry_negative_volume.cxx +++ b/test/t8_geometry/t8_gtest_geometry_negative_volume.cxx @@ -26,7 +26,7 @@ */ #include -#include +#include #include #include #include diff --git a/test/t8_geometry/t8_gtest_point_inside.cxx b/test/t8_geometry/t8_gtest_point_inside.cxx index d7f80d64b3..49626a7bb1 100644 --- a/test/t8_geometry/t8_gtest_point_inside.cxx +++ b/test/t8_geometry/t8_gtest_point_inside.cxx @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/test/t8_gtest_eclass.cxx b/test/t8_gtest_eclass.cxx index 31f112cf55..88c8c9d299 100644 --- a/test/t8_gtest_eclass.cxx +++ b/test/t8_gtest_eclass.cxx @@ -21,7 +21,7 @@ */ #include -#include +#include #include #include #include diff --git a/test/t8_gtest_macros.hxx b/test/t8_gtest_macros.hxx index 6b8cfd7a7e..bab19ba983 100644 --- a/test/t8_gtest_macros.hxx +++ b/test/t8_gtest_macros.hxx @@ -28,7 +28,7 @@ #define T8_GTEST_MACROS_HXX #include -#include +#include #include #include #include diff --git a/test/t8_gtest_mat.cxx b/test/t8_gtest_mat.cxx index fa6b3c5654..895cae3c5d 100644 --- a/test/t8_gtest_mat.cxx +++ b/test/t8_gtest_mat.cxx @@ -23,7 +23,7 @@ /* In this file we collect tests for the routines in `t8_mat.h`. */ #include -#include +#include #include /* Test the `t8_mat_mult_vec` function. Here we also test the rotation matrices diff --git a/test/t8_gtest_memory_macros.hxx b/test/t8_gtest_memory_macros.hxx index 7b0b170f8d..50fad7bd59 100644 --- a/test/t8_gtest_memory_macros.hxx +++ b/test/t8_gtest_memory_macros.hxx @@ -26,7 +26,7 @@ #ifndef T8_GTEST_MEMORY_MACROS_HXX #define T8_GTEST_MEMORY_MACROS_HXX -#include +#include #include #include #include diff --git a/test/t8_gtest_refcount.cxx b/test/t8_gtest_refcount.cxx index 09ef36559d..e0d3f0d31e 100644 --- a/test/t8_gtest_refcount.cxx +++ b/test/t8_gtest_refcount.cxx @@ -21,7 +21,7 @@ */ #include -#include +#include TEST (t8_gtest_refcount, Init) { diff --git a/test/t8_gtest_version.cxx b/test/t8_gtest_version.cxx index 5331f76b99..462fd9d200 100644 --- a/test/t8_gtest_version.cxx +++ b/test/t8_gtest_version.cxx @@ -21,7 +21,7 @@ */ #include -#include +#include /* The following three tests check whether t8code computes the correct * version. diff --git a/test/t8_schemes/t8_gtest_ancestor.cxx b/test/t8_schemes/t8_gtest_ancestor.cxx index 5b48eb596d..a712356530 100644 --- a/test/t8_schemes/t8_gtest_ancestor.cxx +++ b/test/t8_schemes/t8_gtest_ancestor.cxx @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include diff --git a/test/t8_schemes/t8_gtest_ancestor_id.cxx b/test/t8_schemes/t8_gtest_ancestor_id.cxx index 7a0c01a92a..c902f64b2e 100644 --- a/test/t8_schemes/t8_gtest_ancestor_id.cxx +++ b/test/t8_schemes/t8_gtest_ancestor_id.cxx @@ -27,7 +27,7 @@ */ #include -#include +#include #include #include #include "t8_gtest_dfs_base.hxx" diff --git a/test/t8_schemes/t8_gtest_bfs_base.hxx b/test/t8_schemes/t8_gtest_bfs_base.hxx index 49de65b599..f3354aa35a 100644 --- a/test/t8_schemes/t8_gtest_bfs_base.hxx +++ b/test/t8_schemes/t8_gtest_bfs_base.hxx @@ -29,7 +29,7 @@ #define T8_GTEST_BFS_BASE_HXX #include -#include +#include #include #include diff --git a/test/t8_schemes/t8_gtest_boundary_extrude.cxx b/test/t8_schemes/t8_gtest_boundary_extrude.cxx index eacd6bff2e..fcc844c1ff 100644 --- a/test/t8_schemes/t8_gtest_boundary_extrude.cxx +++ b/test/t8_schemes/t8_gtest_boundary_extrude.cxx @@ -21,7 +21,7 @@ */ #include -#include +#include #include #include #include diff --git a/test/t8_schemes/t8_gtest_child_parent_face.cxx b/test/t8_schemes/t8_gtest_child_parent_face.cxx index ad5785e30e..8f68acdc58 100644 --- a/test/t8_schemes/t8_gtest_child_parent_face.cxx +++ b/test/t8_schemes/t8_gtest_child_parent_face.cxx @@ -21,7 +21,7 @@ */ #include -#include +#include #include #include #include "t8_gtest_dfs_base.hxx" diff --git a/test/t8_schemes/t8_gtest_descendant.cxx b/test/t8_schemes/t8_gtest_descendant.cxx index 8fb0604c77..e732e3c717 100644 --- a/test/t8_schemes/t8_gtest_descendant.cxx +++ b/test/t8_schemes/t8_gtest_descendant.cxx @@ -21,7 +21,7 @@ */ #include -#include +#include #include #include #include diff --git a/test/t8_schemes/t8_gtest_dfs_base.hxx b/test/t8_schemes/t8_gtest_dfs_base.hxx index 156ddfb358..685253dc8a 100644 --- a/test/t8_schemes/t8_gtest_dfs_base.hxx +++ b/test/t8_schemes/t8_gtest_dfs_base.hxx @@ -24,7 +24,7 @@ #define T8_GTEST_SCHEME_HELPER_H #include -#include +#include #include struct TestDFS: public testing::TestWithParam> diff --git a/test/t8_schemes/t8_gtest_element_ref_coords.cxx b/test/t8_schemes/t8_gtest_element_ref_coords.cxx index 97ee0f62d4..b69656ab47 100644 --- a/test/t8_schemes/t8_gtest_element_ref_coords.cxx +++ b/test/t8_schemes/t8_gtest_element_ref_coords.cxx @@ -26,7 +26,7 @@ */ #include -#include +#include #include #include #include diff --git a/test/t8_schemes/t8_gtest_elements_are_family.cxx b/test/t8_schemes/t8_gtest_elements_are_family.cxx index 365b645edd..f3134de935 100644 --- a/test/t8_schemes/t8_gtest_elements_are_family.cxx +++ b/test/t8_schemes/t8_gtest_elements_are_family.cxx @@ -21,7 +21,7 @@ */ #include -#include +#include #include #include #include "t8_gtest_dfs_base.hxx" diff --git a/test/t8_schemes/t8_gtest_equal.cxx b/test/t8_schemes/t8_gtest_equal.cxx index fdf98b39ba..9985bdb00e 100644 --- a/test/t8_schemes/t8_gtest_equal.cxx +++ b/test/t8_schemes/t8_gtest_equal.cxx @@ -21,7 +21,7 @@ */ #include -#include +#include #include #include #include diff --git a/test/t8_schemes/t8_gtest_face_corner.cxx b/test/t8_schemes/t8_gtest_face_corner.cxx index 3d17d6ba01..bf111a901d 100644 --- a/test/t8_schemes/t8_gtest_face_corner.cxx +++ b/test/t8_schemes/t8_gtest_face_corner.cxx @@ -21,7 +21,7 @@ */ #include -#include +#include #include #include #include diff --git a/test/t8_schemes/t8_gtest_face_descendant.cxx b/test/t8_schemes/t8_gtest_face_descendant.cxx index 32c3db6f20..bf6a6b9545 100644 --- a/test/t8_schemes/t8_gtest_face_descendant.cxx +++ b/test/t8_schemes/t8_gtest_face_descendant.cxx @@ -21,7 +21,7 @@ */ #include -#include +#include #include #include #include diff --git a/test/t8_schemes/t8_gtest_face_neigh.cxx b/test/t8_schemes/t8_gtest_face_neigh.cxx index 875b9e536a..d2a0002fc5 100644 --- a/test/t8_schemes/t8_gtest_face_neigh.cxx +++ b/test/t8_schemes/t8_gtest_face_neigh.cxx @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include diff --git a/test/t8_schemes/t8_gtest_find_parent.cxx b/test/t8_schemes/t8_gtest_find_parent.cxx index 6f58b165e5..ad898e2b73 100644 --- a/test/t8_schemes/t8_gtest_find_parent.cxx +++ b/test/t8_schemes/t8_gtest_find_parent.cxx @@ -21,7 +21,7 @@ */ #include -#include +#include #include #include #include "t8_gtest_dfs_base.hxx" diff --git a/test/t8_schemes/t8_gtest_get_linear_id.cxx b/test/t8_schemes/t8_gtest_get_linear_id.cxx index 62764c3924..b9ad4e3d20 100644 --- a/test/t8_schemes/t8_gtest_get_linear_id.cxx +++ b/test/t8_schemes/t8_gtest_get_linear_id.cxx @@ -21,7 +21,7 @@ */ #include -#include +#include #include #include #include diff --git a/test/t8_schemes/t8_gtest_input_equal_output.cxx b/test/t8_schemes/t8_gtest_input_equal_output.cxx index 7738482073..d25bf9ca5d 100644 --- a/test/t8_schemes/t8_gtest_input_equal_output.cxx +++ b/test/t8_schemes/t8_gtest_input_equal_output.cxx @@ -21,7 +21,7 @@ */ #include -#include +#include #include #include #include diff --git a/test/t8_schemes/t8_gtest_nca.cxx b/test/t8_schemes/t8_gtest_nca.cxx index 252911581a..8cc65c5a9b 100644 --- a/test/t8_schemes/t8_gtest_nca.cxx +++ b/test/t8_schemes/t8_gtest_nca.cxx @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include diff --git a/test/t8_schemes/t8_gtest_pack_unpack.cxx b/test/t8_schemes/t8_gtest_pack_unpack.cxx index 0a70d5b383..3a1345b17c 100644 --- a/test/t8_schemes/t8_gtest_pack_unpack.cxx +++ b/test/t8_schemes/t8_gtest_pack_unpack.cxx @@ -21,7 +21,7 @@ */ #include -#include +#include #include #include #include diff --git a/test/t8_schemes/t8_gtest_root.cxx b/test/t8_schemes/t8_gtest_root.cxx index 41711c24bd..ceacfd88e0 100644 --- a/test/t8_schemes/t8_gtest_root.cxx +++ b/test/t8_schemes/t8_gtest_root.cxx @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include diff --git a/test/t8_schemes/t8_gtest_set_linear_id.cxx b/test/t8_schemes/t8_gtest_set_linear_id.cxx index 38fb7bd583..64ce416a63 100644 --- a/test/t8_schemes/t8_gtest_set_linear_id.cxx +++ b/test/t8_schemes/t8_gtest_set_linear_id.cxx @@ -21,7 +21,7 @@ */ #include -#include +#include #include #include #include diff --git a/test/t8_schemes/t8_gtest_successor.cxx b/test/t8_schemes/t8_gtest_successor.cxx index 34a6e7eb33..a1b002ed1f 100644 --- a/test/t8_schemes/t8_gtest_successor.cxx +++ b/test/t8_schemes/t8_gtest_successor.cxx @@ -21,7 +21,7 @@ */ #include -#include +#include #include #include #include diff --git a/tutorials/general/t8_step7_interpolation.cxx b/tutorials/general/t8_step7_interpolation.cxx index 14a6618018..f8b040fb47 100644 --- a/tutorials/general/t8_step7_interpolation.cxx +++ b/tutorials/general/t8_step7_interpolation.cxx @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include #include From 553e3c5d949147dcfae003a9f6e315125e0f07cc Mon Sep 17 00:00:00 2001 From: Thomas Spenke Date: Tue, 3 Feb 2026 12:36:49 +0100 Subject: [PATCH 2/7] Fix paths in CMakeLists.txt --- src/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6634dab60c..a221404d1d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -57,14 +57,14 @@ if( T8CODE_ENABLE_NETCDF ) T8_ENABLE_NETCDF=1 $<$,$>:T8_ENABLE_NETCDF_PAR=1> ) target_sources( T8 PRIVATE - t8_netcdf.c + t8_netcdf/t8_netcdf.c t8_cmesh/t8_cmesh_io/t8_cmesh_netcdf.c t8_forest/t8_forest_netcdf.cxx ) install( FILES t8_cmesh/t8_cmesh_io/t8_cmesh_netcdf.h - t8_forest_netcdf.h - t8_netcdf.h + t8_netcdf/t8_forest_netcdf.h + t8_netcdf/t8_netcdf.h TYPE INCLUDE ) endif() From b19ee3c945a0904ae1ed49b869ea96cf8c0268d4 Mon Sep 17 00:00:00 2001 From: Thomas Spenke Date: Tue, 3 Feb 2026 12:48:48 +0100 Subject: [PATCH 3/7] Fix more paths --- example/IO/forest/netcdf/t8_write_forest_netcdf.cxx | 2 +- src/t8_cmesh/t8_cmesh_io/t8_cmesh_readmshfile.cxx | 2 +- src/t8_cmesh/t8_cmesh_io/t8_cmesh_triangle.cxx | 2 +- src/t8_forest/t8_forest_netcdf.cxx | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/example/IO/forest/netcdf/t8_write_forest_netcdf.cxx b/example/IO/forest/netcdf/t8_write_forest_netcdf.cxx index db609b8b71..d891318af8 100644 --- a/example/IO/forest/netcdf/t8_write_forest_netcdf.cxx +++ b/example/IO/forest/netcdf/t8_write_forest_netcdf.cxx @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include /* In this example is the use of the netcdf feature exemplary displayed. diff --git a/src/t8_cmesh/t8_cmesh_io/t8_cmesh_readmshfile.cxx b/src/t8_cmesh/t8_cmesh_io/t8_cmesh_readmshfile.cxx index bddabfda0d..5c2c7253fc 100644 --- a/src/t8_cmesh/t8_cmesh_io/t8_cmesh_readmshfile.cxx +++ b/src/t8_cmesh/t8_cmesh_io/t8_cmesh_readmshfile.cxx @@ -40,7 +40,7 @@ #include #ifdef _WIN32 -#include "t8_windows.h" +#include #endif /** The supported number of gmsh tree classes. diff --git a/src/t8_cmesh/t8_cmesh_io/t8_cmesh_triangle.cxx b/src/t8_cmesh/t8_cmesh_io/t8_cmesh_triangle.cxx index ae82acf419..916f6d4af3 100644 --- a/src/t8_cmesh/t8_cmesh_io/t8_cmesh_triangle.cxx +++ b/src/t8_cmesh/t8_cmesh_io/t8_cmesh_triangle.cxx @@ -28,7 +28,7 @@ #include #ifdef _WIN32 -#include "t8_windows.h" +#include #endif /* TODO: if partitioned then only add the needed face-connections to join faces diff --git a/src/t8_forest/t8_forest_netcdf.cxx b/src/t8_forest/t8_forest_netcdf.cxx index 40c4fef0ca..1106f245df 100644 --- a/src/t8_forest/t8_forest_netcdf.cxx +++ b/src/t8_forest/t8_forest_netcdf.cxx @@ -52,7 +52,7 @@ #endif #include #include -#include +#include #include #include From add6e3ec1d6325b9c0557e436cc0c97f298e74b6 Mon Sep 17 00:00:00 2001 From: Thomas Spenke Date: Wed, 4 Feb 2026 09:10:10 +0100 Subject: [PATCH 4/7] Moved eclass into own subfolder src/t8_eclass --- benchmarks/t8_time_fractal.cxx | 2 +- benchmarks/t8_time_set_join_by_vertices.cxx | 2 +- example/IO/cmesh/netcdf/t8_write_cmesh_netcdf.cxx | 2 +- example/IO/forest/netcdf/t8_write_forest_netcdf.cxx | 2 +- example/cmesh/t8_cmesh_set_join_by_vertices.cxx | 2 +- example/forest/t8_test_face_iterate.cxx | 2 +- example/forest/t8_test_ghost.cxx | 2 +- mesh_handle/element.hxx | 2 +- src/CMakeLists.txt | 2 +- src/t8_cmesh/t8_cmesh.cxx | 2 +- src/t8_cmesh/t8_cmesh.h | 2 +- src/t8_cmesh/t8_cmesh_examples.cxx | 2 +- src/t8_cmesh/t8_cmesh_helpers.cxx | 2 +- src/t8_cmesh/t8_cmesh_helpers.h | 2 +- src/t8_cmesh/t8_cmesh_internal/t8_cmesh_stash.c | 2 +- src/t8_cmesh/t8_cmesh_internal/t8_cmesh_stash.h | 2 +- src/t8_cmesh/t8_cmesh_io/t8_cmesh_readmshfile.cxx | 2 +- src/t8_cmesh/t8_cmesh_io/t8_cmesh_readmshfile.h | 2 +- src/t8_cmesh/t8_cmesh_io/t8_cmesh_save.cxx | 2 +- src/t8_cmesh/t8_cmesh_io/t8_cmesh_tetgen.h | 2 +- src/t8_cmesh/t8_cmesh_io/t8_cmesh_triangle.h | 2 +- src/{t8_element => t8_eclass}/t8_eclass.c | 2 +- src/{t8_element => t8_eclass}/t8_eclass.h | 0 src/t8_element/t8_element.h | 2 +- src/t8_element/t8_element_shape.h | 2 +- src/t8_forest/t8_forest_partition_for_coarsening.cxx | 2 +- src/t8_forest/t8_forest_pfc_helper.hxx | 2 +- src/t8_geometry/t8_geometry_helpers.c | 2 +- src/t8_geometry/t8_geometry_implementations/t8_geometry_cad.cxx | 2 +- .../t8_geometry_implementations/t8_geometry_lagrange.cxx | 2 +- src/t8_schemes/t8_default/t8_default_tet/t8_dtet_connectivity.h | 2 +- src/t8_schemes/t8_default/t8_default_tri/t8_dtri_connectivity.h | 2 +- src/t8_schemes/t8_scheme.hxx | 2 +- src/t8_schemes/t8_scheme_helpers.hxx | 2 +- src/t8_schemes/t8_standalone/t8_standalone_implementation.hxx | 2 +- src/t8_vtk/t8_vtk_types.h | 2 +- test/t8_cmesh/t8_gtest_cmesh_readmshfile.cxx | 2 +- test/t8_cmesh/t8_gtest_cmesh_set_join_by_vertices.cxx | 2 +- .../t8_cmesh_new_bigmesh_param.hxx | 2 +- .../t8_cmesh_parameterized_examples/t8_cmesh_new_empty.hxx | 2 +- .../t8_cmesh_new_from_class_param.hxx | 2 +- .../t8_cmesh_new_hypercube_param.hxx | 2 +- .../t8_cmesh_parameterized_examples/t8_cmesh_new_periodic.hxx | 2 +- .../t8_cmesh_parameterized_examples/t8_cmesh_params.hxx | 2 +- test/t8_forest/t8_gtest_balance.cxx | 2 +- test/t8_forest/t8_gtest_element_is_leaf.cxx | 2 +- test/t8_forest/t8_gtest_element_volume.cxx | 2 +- test/t8_forest/t8_gtest_find_owner.cxx | 2 +- test/t8_forest/t8_gtest_forest_commit.cxx | 2 +- test/t8_forest/t8_gtest_forest_face_normal.cxx | 2 +- test/t8_forest/t8_gtest_ghost_and_owner.cxx | 2 +- test/t8_forest/t8_gtest_ghost_delete.cxx | 2 +- test/t8_forest/t8_gtest_ghost_exchange.cxx | 2 +- test/t8_forest/t8_gtest_half_neighbors.cxx | 2 +- test/t8_forest/t8_gtest_search.cxx | 2 +- test/t8_forest/t8_gtest_transform.cxx | 2 +- .../t8_geometry_implementations/t8_gtest_geometry_lagrange.cxx | 2 +- .../t8_geometry_implementations/t8_gtest_geometry_linear.cxx | 2 +- test/t8_geometry/t8_gtest_geometry_handling.cxx | 2 +- test/t8_geometry/t8_gtest_geometry_negative_volume.cxx | 2 +- test/t8_geometry/t8_gtest_point_inside.cxx | 2 +- test/t8_gtest_eclass.cxx | 2 +- test/t8_gtest_macros.hxx | 2 +- test/t8_gtest_memory_macros.hxx | 2 +- test/t8_schemes/t8_gtest_ancestor.cxx | 2 +- test/t8_schemes/t8_gtest_ancestor_id.cxx | 2 +- test/t8_schemes/t8_gtest_bfs_base.hxx | 2 +- test/t8_schemes/t8_gtest_boundary_extrude.cxx | 2 +- test/t8_schemes/t8_gtest_child_parent_face.cxx | 2 +- test/t8_schemes/t8_gtest_descendant.cxx | 2 +- test/t8_schemes/t8_gtest_dfs_base.hxx | 2 +- test/t8_schemes/t8_gtest_element_ref_coords.cxx | 2 +- test/t8_schemes/t8_gtest_elements_are_family.cxx | 2 +- test/t8_schemes/t8_gtest_equal.cxx | 2 +- test/t8_schemes/t8_gtest_face_corner.cxx | 2 +- test/t8_schemes/t8_gtest_face_descendant.cxx | 2 +- test/t8_schemes/t8_gtest_face_neigh.cxx | 2 +- test/t8_schemes/t8_gtest_find_parent.cxx | 2 +- test/t8_schemes/t8_gtest_get_linear_id.cxx | 2 +- test/t8_schemes/t8_gtest_input_equal_output.cxx | 2 +- test/t8_schemes/t8_gtest_nca.cxx | 2 +- test/t8_schemes/t8_gtest_pack_unpack.cxx | 2 +- test/t8_schemes/t8_gtest_root.cxx | 2 +- test/t8_schemes/t8_gtest_set_linear_id.cxx | 2 +- test/t8_schemes/t8_gtest_successor.cxx | 2 +- tutorials/general/t8_step7_interpolation.cxx | 2 +- 86 files changed, 85 insertions(+), 85 deletions(-) rename src/{t8_element => t8_eclass}/t8_eclass.c (99%) rename src/{t8_element => t8_eclass}/t8_eclass.h (100%) diff --git a/benchmarks/t8_time_fractal.cxx b/benchmarks/t8_time_fractal.cxx index 359b4c46d9..b3d4b7caf2 100644 --- a/benchmarks/t8_time_fractal.cxx +++ b/benchmarks/t8_time_fractal.cxx @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/benchmarks/t8_time_set_join_by_vertices.cxx b/benchmarks/t8_time_set_join_by_vertices.cxx index 210f4fd931..b36714b631 100644 --- a/benchmarks/t8_time_set_join_by_vertices.cxx +++ b/benchmarks/t8_time_set_join_by_vertices.cxx @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include #include diff --git a/example/IO/cmesh/netcdf/t8_write_cmesh_netcdf.cxx b/example/IO/cmesh/netcdf/t8_write_cmesh_netcdf.cxx index a258cf82f6..2a6e8681c8 100644 --- a/example/IO/cmesh/netcdf/t8_write_cmesh_netcdf.cxx +++ b/example/IO/cmesh/netcdf/t8_write_cmesh_netcdf.cxx @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include void diff --git a/example/IO/forest/netcdf/t8_write_forest_netcdf.cxx b/example/IO/forest/netcdf/t8_write_forest_netcdf.cxx index d891318af8..08ce69e2b2 100644 --- a/example/IO/forest/netcdf/t8_write_forest_netcdf.cxx +++ b/example/IO/forest/netcdf/t8_write_forest_netcdf.cxx @@ -29,7 +29,7 @@ #define NC_INDEPENDENT 0 #define NC_COLLECTIVE 1 #endif -#include +#include #include #include #include diff --git a/example/cmesh/t8_cmesh_set_join_by_vertices.cxx b/example/cmesh/t8_cmesh_set_join_by_vertices.cxx index e9672ee5b6..9ee2e87fba 100644 --- a/example/cmesh/t8_cmesh_set_join_by_vertices.cxx +++ b/example/cmesh/t8_cmesh_set_join_by_vertices.cxx @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include #include diff --git a/example/forest/t8_test_face_iterate.cxx b/example/forest/t8_test_face_iterate.cxx index bbd811a12b..fe51e449c3 100644 --- a/example/forest/t8_test_face_iterate.cxx +++ b/example/forest/t8_test_face_iterate.cxx @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/example/forest/t8_test_ghost.cxx b/example/forest/t8_test_ghost.cxx index a2b4d19015..ec58ef3392 100644 --- a/example/forest/t8_test_ghost.cxx +++ b/example/forest/t8_test_ghost.cxx @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include #include diff --git a/mesh_handle/element.hxx b/mesh_handle/element.hxx index 17c5c0ebe3..b71c2236f2 100644 --- a/mesh_handle/element.hxx +++ b/mesh_handle/element.hxx @@ -28,7 +28,7 @@ along with t8code; if not, write to the Free Software Foundation, Inc., #include #include -#include +#include #include #include #include diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a221404d1d..727d98dd10 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -168,7 +168,7 @@ target_sources( T8 PRIVATE t8_cmesh/t8_cmesh_io/t8_cmesh_triangle.cxx t8_data/t8_shmem.c t8_data/t8_containers.cxx - t8_element/t8_eclass.c + t8_eclass/t8_eclass.c t8_element/t8_element_shape.c t8_element/t8_element.cxx t8_forest/t8_forest_adapt.cxx diff --git a/src/t8_cmesh/t8_cmesh.cxx b/src/t8_cmesh/t8_cmesh.cxx index 7ba197679d..51e156c008 100644 --- a/src/t8_cmesh/t8_cmesh.cxx +++ b/src/t8_cmesh/t8_cmesh.cxx @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/t8_cmesh/t8_cmesh.h b/src/t8_cmesh/t8_cmesh.h index dc2bff8979..d012465056 100644 --- a/src/t8_cmesh/t8_cmesh.h +++ b/src/t8_cmesh/t8_cmesh.h @@ -47,7 +47,7 @@ typedef struct t8_cmesh *t8_cmesh_t; * Actually, we need eclass in the type definition in cmesh.c. * So we might as well use tree-related virtual functions there too. */ -#include +#include /* TODO: make it legal to call cmesh_set functions multiple times, * just overwrite the previous setting if no inconsistency can occur. diff --git a/src/t8_cmesh/t8_cmesh_examples.cxx b/src/t8_cmesh/t8_cmesh_examples.cxx index 59075daa33..276fb6ff3a 100644 --- a/src/t8_cmesh/t8_cmesh_examples.cxx +++ b/src/t8_cmesh/t8_cmesh_examples.cxx @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include #include /* default refinement scheme. */ diff --git a/src/t8_cmesh/t8_cmesh_helpers.cxx b/src/t8_cmesh/t8_cmesh_helpers.cxx index 3ab6760e21..495b740a65 100644 --- a/src/t8_cmesh/t8_cmesh_helpers.cxx +++ b/src/t8_cmesh/t8_cmesh_helpers.cxx @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/t8_cmesh/t8_cmesh_helpers.h b/src/t8_cmesh/t8_cmesh_helpers.h index d37ecb890f..37dbc2783b 100644 --- a/src/t8_cmesh/t8_cmesh_helpers.h +++ b/src/t8_cmesh/t8_cmesh_helpers.h @@ -30,7 +30,7 @@ #include #include -#include +#include T8_EXTERN_C_BEGIN (); diff --git a/src/t8_cmesh/t8_cmesh_internal/t8_cmesh_stash.c b/src/t8_cmesh/t8_cmesh_internal/t8_cmesh_stash.c index 538b1be412..9cd9a8a535 100644 --- a/src/t8_cmesh/t8_cmesh_internal/t8_cmesh_stash.c +++ b/src/t8_cmesh/t8_cmesh_internal/t8_cmesh_stash.c @@ -25,7 +25,7 @@ */ #include -#include +#include #include void diff --git a/src/t8_cmesh/t8_cmesh_internal/t8_cmesh_stash.h b/src/t8_cmesh/t8_cmesh_internal/t8_cmesh_stash.h index 60b0f2cb52..f3883244c6 100644 --- a/src/t8_cmesh/t8_cmesh_internal/t8_cmesh_stash.h +++ b/src/t8_cmesh/t8_cmesh_internal/t8_cmesh_stash.h @@ -28,7 +28,7 @@ #define T8_CMESH_STASH_H #include -#include +#include /** * Opaque pointer to a stash data structure. diff --git a/src/t8_cmesh/t8_cmesh_io/t8_cmesh_readmshfile.cxx b/src/t8_cmesh/t8_cmesh_io/t8_cmesh_readmshfile.cxx index 5c2c7253fc..2cf852be73 100644 --- a/src/t8_cmesh/t8_cmesh_io/t8_cmesh_readmshfile.cxx +++ b/src/t8_cmesh/t8_cmesh_io/t8_cmesh_readmshfile.cxx @@ -24,7 +24,7 @@ * Implements functions declared in \ref t8_cmesh_readmshfile.h. */ -#include +#include #include #include #include diff --git a/src/t8_cmesh/t8_cmesh_io/t8_cmesh_readmshfile.h b/src/t8_cmesh/t8_cmesh_io/t8_cmesh_readmshfile.h index 8ddc369498..639bb6a3ee 100644 --- a/src/t8_cmesh/t8_cmesh_io/t8_cmesh_readmshfile.h +++ b/src/t8_cmesh/t8_cmesh_io/t8_cmesh_readmshfile.h @@ -29,7 +29,7 @@ #define T8_CMESH_READMSHFILE_H #include -#include +#include #include /** The supported .msh file versions. diff --git a/src/t8_cmesh/t8_cmesh_io/t8_cmesh_save.cxx b/src/t8_cmesh/t8_cmesh_io/t8_cmesh_save.cxx index 4ce6fbfc74..a5e22fcb12 100644 --- a/src/t8_cmesh/t8_cmesh_io/t8_cmesh_save.cxx +++ b/src/t8_cmesh/t8_cmesh_io/t8_cmesh_save.cxx @@ -28,7 +28,7 @@ */ #include -#include +#include #include #include #include diff --git a/src/t8_cmesh/t8_cmesh_io/t8_cmesh_tetgen.h b/src/t8_cmesh/t8_cmesh_io/t8_cmesh_tetgen.h index e8328bb3e8..a8310c0b1c 100644 --- a/src/t8_cmesh/t8_cmesh_io/t8_cmesh_tetgen.h +++ b/src/t8_cmesh/t8_cmesh_io/t8_cmesh_tetgen.h @@ -29,7 +29,7 @@ #define T8_CMESH_TETGEN_H #include -#include +#include #include #include #include diff --git a/src/t8_cmesh/t8_cmesh_io/t8_cmesh_triangle.h b/src/t8_cmesh/t8_cmesh_io/t8_cmesh_triangle.h index 5400d1e421..962cda6b0c 100644 --- a/src/t8_cmesh/t8_cmesh_io/t8_cmesh_triangle.h +++ b/src/t8_cmesh/t8_cmesh_io/t8_cmesh_triangle.h @@ -29,7 +29,7 @@ #define T8_CMESH_TRIANGLE_H #include -#include +#include #include /* put typedefs here */ diff --git a/src/t8_element/t8_eclass.c b/src/t8_eclass/t8_eclass.c similarity index 99% rename from src/t8_element/t8_eclass.c rename to src/t8_eclass/t8_eclass.c index 32211e8e41..813d2c0494 100644 --- a/src/t8_element/t8_eclass.c +++ b/src/t8_eclass/t8_eclass.c @@ -25,7 +25,7 @@ */ #define KEEP_ECLASS_VALUE_DEFINITIONS -#include +#include #undef KEEP_ECLASS_VALUE_DEFINITIONS const int t8_eclass_to_dimension[T8_ECLASS_COUNT] = T8_ECLASS_TO_DIMENSION_VALUES; diff --git a/src/t8_element/t8_eclass.h b/src/t8_eclass/t8_eclass.h similarity index 100% rename from src/t8_element/t8_eclass.h rename to src/t8_eclass/t8_eclass.h diff --git a/src/t8_element/t8_element.h b/src/t8_element/t8_element.h index 8813ac079b..0995c74dec 100644 --- a/src/t8_element/t8_element.h +++ b/src/t8_element/t8_element.h @@ -29,7 +29,7 @@ #define T8_ELEMENT_H #include -#include +#include #include /** We want to export the whole implementation to be callable from "C". */ diff --git a/src/t8_element/t8_element_shape.h b/src/t8_element/t8_element_shape.h index 8323e0a814..4486afd2df 100644 --- a/src/t8_element/t8_element_shape.h +++ b/src/t8_element/t8_element_shape.h @@ -28,7 +28,7 @@ #define T8_ELEMENT_SHAPE_H #include -#include +#include /** We want to export the whole implementation to be callable from "C". */ T8_EXTERN_C_BEGIN (); diff --git a/src/t8_forest/t8_forest_partition_for_coarsening.cxx b/src/t8_forest/t8_forest_partition_for_coarsening.cxx index 7de25a24c3..986d81aaef 100644 --- a/src/t8_forest/t8_forest_partition_for_coarsening.cxx +++ b/src/t8_forest/t8_forest_partition_for_coarsening.cxx @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/t8_forest/t8_forest_pfc_helper.hxx b/src/t8_forest/t8_forest_pfc_helper.hxx index 0c6c2f8024..0c3ab21db2 100644 --- a/src/t8_forest/t8_forest_pfc_helper.hxx +++ b/src/t8_forest/t8_forest_pfc_helper.hxx @@ -29,7 +29,7 @@ #include #include -#include +#include /** Determine the sibling with the biggest difference in IDs (in the given direction). * diff --git a/src/t8_geometry/t8_geometry_helpers.c b/src/t8_geometry/t8_geometry_helpers.c index 6a3ecc6efd..23235bbdf2 100644 --- a/src/t8_geometry/t8_geometry_helpers.c +++ b/src/t8_geometry/t8_geometry_helpers.c @@ -25,7 +25,7 @@ */ #include -#include +#include #include #include diff --git a/src/t8_geometry/t8_geometry_implementations/t8_geometry_cad.cxx b/src/t8_geometry/t8_geometry_implementations/t8_geometry_cad.cxx index 7c65d5e4fd..935fe73614 100644 --- a/src/t8_geometry/t8_geometry_implementations/t8_geometry_cad.cxx +++ b/src/t8_geometry/t8_geometry_implementations/t8_geometry_cad.cxx @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/t8_geometry/t8_geometry_implementations/t8_geometry_lagrange.cxx b/src/t8_geometry/t8_geometry_implementations/t8_geometry_lagrange.cxx index 3cf44c3c12..1bc5be6d09 100644 --- a/src/t8_geometry/t8_geometry_implementations/t8_geometry_lagrange.cxx +++ b/src/t8_geometry/t8_geometry_implementations/t8_geometry_lagrange.cxx @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/t8_schemes/t8_default/t8_default_tet/t8_dtet_connectivity.h b/src/t8_schemes/t8_default/t8_default_tet/t8_dtet_connectivity.h index a9fd2ef836..dfac92ba99 100644 --- a/src/t8_schemes/t8_default/t8_default_tet/t8_dtet_connectivity.h +++ b/src/t8_schemes/t8_default/t8_default_tet/t8_dtet_connectivity.h @@ -28,7 +28,7 @@ #define T8_DTET_CONNECTIVITY_H #include -#include +#include T8_EXTERN_C_BEGIN (); diff --git a/src/t8_schemes/t8_default/t8_default_tri/t8_dtri_connectivity.h b/src/t8_schemes/t8_default/t8_default_tri/t8_dtri_connectivity.h index dd923ac718..5961ce5194 100644 --- a/src/t8_schemes/t8_default/t8_default_tri/t8_dtri_connectivity.h +++ b/src/t8_schemes/t8_default/t8_default_tri/t8_dtri_connectivity.h @@ -27,7 +27,7 @@ #define T8_DTRI_CONNECTIVITY_H #include -#include +#include T8_EXTERN_C_BEGIN (); diff --git a/src/t8_schemes/t8_scheme.hxx b/src/t8_schemes/t8_scheme.hxx index 09c6917797..a6cbc3fb4c 100644 --- a/src/t8_schemes/t8_scheme.hxx +++ b/src/t8_schemes/t8_scheme.hxx @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/t8_schemes/t8_scheme_helpers.hxx b/src/t8_schemes/t8_scheme_helpers.hxx index 23cec657f5..87bbc6e56e 100644 --- a/src/t8_schemes/t8_scheme_helpers.hxx +++ b/src/t8_schemes/t8_scheme_helpers.hxx @@ -29,7 +29,7 @@ #include #include -#include +#include /** * Class which provides helper functions and default implementations for different schemes. diff --git a/src/t8_schemes/t8_standalone/t8_standalone_implementation.hxx b/src/t8_schemes/t8_standalone/t8_standalone_implementation.hxx index aa0d52cfbe..ea573238d4 100644 --- a/src/t8_schemes/t8_standalone/t8_standalone_implementation.hxx +++ b/src/t8_schemes/t8_standalone/t8_standalone_implementation.hxx @@ -28,7 +28,7 @@ #define T8_STANDALONE_IMPLEMENTATION_HXX #include -#include +#include #include #include #include diff --git a/src/t8_vtk/t8_vtk_types.h b/src/t8_vtk/t8_vtk_types.h index 9c21f4a993..9e8ede013f 100644 --- a/src/t8_vtk/t8_vtk_types.h +++ b/src/t8_vtk/t8_vtk_types.h @@ -28,7 +28,7 @@ #ifndef T8_VTK_TYPES #define T8_VTK_TYPES -#include +#include /** * Translator between vtk-type of elements and t8code-elements. diff --git a/test/t8_cmesh/t8_gtest_cmesh_readmshfile.cxx b/test/t8_cmesh/t8_gtest_cmesh_readmshfile.cxx index 05d9af2fac..b983413a37 100644 --- a/test/t8_cmesh/t8_gtest_cmesh_readmshfile.cxx +++ b/test/t8_cmesh/t8_gtest_cmesh_readmshfile.cxx @@ -23,7 +23,7 @@ #include #include /* Needed to check for file access */ #include -#include +#include #include #include #include diff --git a/test/t8_cmesh/t8_gtest_cmesh_set_join_by_vertices.cxx b/test/t8_cmesh/t8_gtest_cmesh_set_join_by_vertices.cxx index 72e1eb04d9..8632e4ef44 100644 --- a/test/t8_cmesh/t8_gtest_cmesh_set_join_by_vertices.cxx +++ b/test/t8_cmesh/t8_gtest_cmesh_set_join_by_vertices.cxx @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include #include diff --git a/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_new_bigmesh_param.hxx b/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_new_bigmesh_param.hxx index c15a1ea4da..33b0e76e9b 100644 --- a/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_new_bigmesh_param.hxx +++ b/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_new_bigmesh_param.hxx @@ -26,7 +26,7 @@ #include "test/t8_cmesh_generator/t8_gtest_cmesh_cartestian_product.hxx" #include "test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_params.hxx" #include "t8_cmesh/t8_cmesh_examples.h" -#include +#include namespace new_bigmesh { diff --git a/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_new_empty.hxx b/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_new_empty.hxx index 0e88034d0f..d78b4c4c98 100644 --- a/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_new_empty.hxx +++ b/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_new_empty.hxx @@ -26,7 +26,7 @@ #include #include #include -#include +#include namespace new_empty { diff --git a/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_new_from_class_param.hxx b/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_new_from_class_param.hxx index 914e9587c9..80e38134fc 100644 --- a/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_new_from_class_param.hxx +++ b/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_new_from_class_param.hxx @@ -23,7 +23,7 @@ #include "test/t8_cmesh_generator/t8_gtest_cmesh_cartestian_product.hxx" #include "test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_params.hxx" #include -#include +#include #ifndef T8_CMESH_NEW_FROM_CLASS_PARAM #define T8_CMESH_NEW_FROM_CLASS_PARAM diff --git a/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_new_hypercube_param.hxx b/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_new_hypercube_param.hxx index 41dc577e7b..0b7e113cff 100644 --- a/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_new_hypercube_param.hxx +++ b/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_new_hypercube_param.hxx @@ -23,7 +23,7 @@ #ifndef T8_CMESH_NEW_HYPERCUBE_PARAM_HXX #define T8_CMESH_NEW_HYPERCUBE_PARAM_HXX -#include +#include #include "test/t8_cmesh_generator/t8_gtest_cmesh_cartestian_product.hxx" #include "test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_params.hxx" #include diff --git a/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_new_periodic.hxx b/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_new_periodic.hxx index 98ca867c23..f74a61800a 100644 --- a/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_new_periodic.hxx +++ b/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_new_periodic.hxx @@ -26,7 +26,7 @@ #include #include #include -#include +#include namespace new_periodic { diff --git a/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_params.hxx b/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_params.hxx index 022f32495f..235879ddc9 100644 --- a/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_params.hxx +++ b/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_params.hxx @@ -26,7 +26,7 @@ #ifndef T8_CMESH_PARAMS_HXX #define T8_CMESH_PARAMS_HXX -#include +#include #include #include #include diff --git a/test/t8_forest/t8_gtest_balance.cxx b/test/t8_forest/t8_gtest_balance.cxx index 081938f66a..422abc87bc 100644 --- a/test/t8_forest/t8_gtest_balance.cxx +++ b/test/t8_forest/t8_gtest_balance.cxx @@ -29,7 +29,7 @@ #include #include -#include +#include #include #include #include diff --git a/test/t8_forest/t8_gtest_element_is_leaf.cxx b/test/t8_forest/t8_gtest_element_is_leaf.cxx index 80362020e8..8d5164daa1 100644 --- a/test/t8_forest/t8_gtest_element_is_leaf.cxx +++ b/test/t8_forest/t8_gtest_element_is_leaf.cxx @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include #include diff --git a/test/t8_forest/t8_gtest_element_volume.cxx b/test/t8_forest/t8_gtest_element_volume.cxx index 0a5415dea8..e93eb0d6e2 100644 --- a/test/t8_forest/t8_gtest_element_volume.cxx +++ b/test/t8_forest/t8_gtest_element_volume.cxx @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include #include diff --git a/test/t8_forest/t8_gtest_find_owner.cxx b/test/t8_forest/t8_gtest_find_owner.cxx index b6c42013dd..59c0ed43a1 100644 --- a/test/t8_forest/t8_gtest_find_owner.cxx +++ b/test/t8_forest/t8_gtest_find_owner.cxx @@ -21,7 +21,7 @@ */ #include -#include +#include #include #include #include diff --git a/test/t8_forest/t8_gtest_forest_commit.cxx b/test/t8_forest/t8_gtest_forest_commit.cxx index 779bb957ef..6f16ad23df 100644 --- a/test/t8_forest/t8_gtest_forest_commit.cxx +++ b/test/t8_forest/t8_gtest_forest_commit.cxx @@ -21,7 +21,7 @@ */ #include -#include +#include #include #include #include diff --git a/test/t8_forest/t8_gtest_forest_face_normal.cxx b/test/t8_forest/t8_gtest_forest_face_normal.cxx index 03747f6542..e48c7d8efe 100644 --- a/test/t8_forest/t8_gtest_forest_face_normal.cxx +++ b/test/t8_forest/t8_gtest_forest_face_normal.cxx @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include #include diff --git a/test/t8_forest/t8_gtest_ghost_and_owner.cxx b/test/t8_forest/t8_gtest_ghost_and_owner.cxx index ea225f3069..71a045190c 100644 --- a/test/t8_forest/t8_gtest_ghost_and_owner.cxx +++ b/test/t8_forest/t8_gtest_ghost_and_owner.cxx @@ -21,7 +21,7 @@ */ #include -#include +#include #include #include #include diff --git a/test/t8_forest/t8_gtest_ghost_delete.cxx b/test/t8_forest/t8_gtest_ghost_delete.cxx index 535c3ddad7..65a8e01e75 100644 --- a/test/t8_forest/t8_gtest_ghost_delete.cxx +++ b/test/t8_forest/t8_gtest_ghost_delete.cxx @@ -21,7 +21,7 @@ */ #include -#include +#include #include #include #include diff --git a/test/t8_forest/t8_gtest_ghost_exchange.cxx b/test/t8_forest/t8_gtest_ghost_exchange.cxx index 2a426bbc0b..2286603032 100644 --- a/test/t8_forest/t8_gtest_ghost_exchange.cxx +++ b/test/t8_forest/t8_gtest_ghost_exchange.cxx @@ -21,7 +21,7 @@ */ #include -#include +#include #include #include #include diff --git a/test/t8_forest/t8_gtest_half_neighbors.cxx b/test/t8_forest/t8_gtest_half_neighbors.cxx index ebd133b9a9..b40fe34212 100644 --- a/test/t8_forest/t8_gtest_half_neighbors.cxx +++ b/test/t8_forest/t8_gtest_half_neighbors.cxx @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include #include diff --git a/test/t8_forest/t8_gtest_search.cxx b/test/t8_forest/t8_gtest_search.cxx index c460049c28..1a454d21d4 100644 --- a/test/t8_forest/t8_gtest_search.cxx +++ b/test/t8_forest/t8_gtest_search.cxx @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include #include diff --git a/test/t8_forest/t8_gtest_transform.cxx b/test/t8_forest/t8_gtest_transform.cxx index 9c2eeb4f40..e949869782 100644 --- a/test/t8_forest/t8_gtest_transform.cxx +++ b/test/t8_forest/t8_gtest_transform.cxx @@ -30,7 +30,7 @@ #include #include -#include +#include #include #include #include diff --git a/test/t8_geometry/t8_geometry_implementations/t8_gtest_geometry_lagrange.cxx b/test/t8_geometry/t8_geometry_implementations/t8_gtest_geometry_lagrange.cxx index 2c65833ddf..a0ada582c8 100644 --- a/test/t8_geometry/t8_geometry_implementations/t8_gtest_geometry_lagrange.cxx +++ b/test/t8_geometry/t8_geometry_implementations/t8_gtest_geometry_lagrange.cxx @@ -32,7 +32,7 @@ #include #include -#include +#include #include #include #include diff --git a/test/t8_geometry/t8_geometry_implementations/t8_gtest_geometry_linear.cxx b/test/t8_geometry/t8_geometry_implementations/t8_gtest_geometry_linear.cxx index 5ddc1e6e8e..a602e27cff 100644 --- a/test/t8_geometry/t8_geometry_implementations/t8_gtest_geometry_linear.cxx +++ b/test/t8_geometry/t8_geometry_implementations/t8_gtest_geometry_linear.cxx @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/test/t8_geometry/t8_gtest_geometry_handling.cxx b/test/t8_geometry/t8_gtest_geometry_handling.cxx index 3de42e9cdb..0617cc049f 100644 --- a/test/t8_geometry/t8_gtest_geometry_handling.cxx +++ b/test/t8_geometry/t8_gtest_geometry_handling.cxx @@ -25,7 +25,7 @@ */ #include -#include +#include #include #include #include diff --git a/test/t8_geometry/t8_gtest_geometry_negative_volume.cxx b/test/t8_geometry/t8_gtest_geometry_negative_volume.cxx index 1c32b1b883..bc8a09b109 100644 --- a/test/t8_geometry/t8_gtest_geometry_negative_volume.cxx +++ b/test/t8_geometry/t8_gtest_geometry_negative_volume.cxx @@ -26,7 +26,7 @@ */ #include -#include +#include #include #include #include diff --git a/test/t8_geometry/t8_gtest_point_inside.cxx b/test/t8_geometry/t8_gtest_point_inside.cxx index 49626a7bb1..40e05ea735 100644 --- a/test/t8_geometry/t8_gtest_point_inside.cxx +++ b/test/t8_geometry/t8_gtest_point_inside.cxx @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/test/t8_gtest_eclass.cxx b/test/t8_gtest_eclass.cxx index 88c8c9d299..2e2703bf61 100644 --- a/test/t8_gtest_eclass.cxx +++ b/test/t8_gtest_eclass.cxx @@ -21,7 +21,7 @@ */ #include -#include +#include #include #include #include diff --git a/test/t8_gtest_macros.hxx b/test/t8_gtest_macros.hxx index bab19ba983..5e5de3fb7e 100644 --- a/test/t8_gtest_macros.hxx +++ b/test/t8_gtest_macros.hxx @@ -28,7 +28,7 @@ #define T8_GTEST_MACROS_HXX #include -#include +#include #include #include #include diff --git a/test/t8_gtest_memory_macros.hxx b/test/t8_gtest_memory_macros.hxx index 50fad7bd59..bb69f6e0ce 100644 --- a/test/t8_gtest_memory_macros.hxx +++ b/test/t8_gtest_memory_macros.hxx @@ -26,7 +26,7 @@ #ifndef T8_GTEST_MEMORY_MACROS_HXX #define T8_GTEST_MEMORY_MACROS_HXX -#include +#include #include #include #include diff --git a/test/t8_schemes/t8_gtest_ancestor.cxx b/test/t8_schemes/t8_gtest_ancestor.cxx index a712356530..4d45a8a817 100644 --- a/test/t8_schemes/t8_gtest_ancestor.cxx +++ b/test/t8_schemes/t8_gtest_ancestor.cxx @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include diff --git a/test/t8_schemes/t8_gtest_ancestor_id.cxx b/test/t8_schemes/t8_gtest_ancestor_id.cxx index c902f64b2e..9e36fc13fa 100644 --- a/test/t8_schemes/t8_gtest_ancestor_id.cxx +++ b/test/t8_schemes/t8_gtest_ancestor_id.cxx @@ -27,7 +27,7 @@ */ #include -#include +#include #include #include #include "t8_gtest_dfs_base.hxx" diff --git a/test/t8_schemes/t8_gtest_bfs_base.hxx b/test/t8_schemes/t8_gtest_bfs_base.hxx index f3354aa35a..26b501964d 100644 --- a/test/t8_schemes/t8_gtest_bfs_base.hxx +++ b/test/t8_schemes/t8_gtest_bfs_base.hxx @@ -29,7 +29,7 @@ #define T8_GTEST_BFS_BASE_HXX #include -#include +#include #include #include diff --git a/test/t8_schemes/t8_gtest_boundary_extrude.cxx b/test/t8_schemes/t8_gtest_boundary_extrude.cxx index fcc844c1ff..4b6abe640b 100644 --- a/test/t8_schemes/t8_gtest_boundary_extrude.cxx +++ b/test/t8_schemes/t8_gtest_boundary_extrude.cxx @@ -21,7 +21,7 @@ */ #include -#include +#include #include #include #include diff --git a/test/t8_schemes/t8_gtest_child_parent_face.cxx b/test/t8_schemes/t8_gtest_child_parent_face.cxx index 8f68acdc58..1f6805f435 100644 --- a/test/t8_schemes/t8_gtest_child_parent_face.cxx +++ b/test/t8_schemes/t8_gtest_child_parent_face.cxx @@ -21,7 +21,7 @@ */ #include -#include +#include #include #include #include "t8_gtest_dfs_base.hxx" diff --git a/test/t8_schemes/t8_gtest_descendant.cxx b/test/t8_schemes/t8_gtest_descendant.cxx index e732e3c717..5c5a611825 100644 --- a/test/t8_schemes/t8_gtest_descendant.cxx +++ b/test/t8_schemes/t8_gtest_descendant.cxx @@ -21,7 +21,7 @@ */ #include -#include +#include #include #include #include diff --git a/test/t8_schemes/t8_gtest_dfs_base.hxx b/test/t8_schemes/t8_gtest_dfs_base.hxx index 685253dc8a..f4dc2221ac 100644 --- a/test/t8_schemes/t8_gtest_dfs_base.hxx +++ b/test/t8_schemes/t8_gtest_dfs_base.hxx @@ -24,7 +24,7 @@ #define T8_GTEST_SCHEME_HELPER_H #include -#include +#include #include struct TestDFS: public testing::TestWithParam> diff --git a/test/t8_schemes/t8_gtest_element_ref_coords.cxx b/test/t8_schemes/t8_gtest_element_ref_coords.cxx index b69656ab47..deecc3894d 100644 --- a/test/t8_schemes/t8_gtest_element_ref_coords.cxx +++ b/test/t8_schemes/t8_gtest_element_ref_coords.cxx @@ -26,7 +26,7 @@ */ #include -#include +#include #include #include #include diff --git a/test/t8_schemes/t8_gtest_elements_are_family.cxx b/test/t8_schemes/t8_gtest_elements_are_family.cxx index f3134de935..e0d3a5f876 100644 --- a/test/t8_schemes/t8_gtest_elements_are_family.cxx +++ b/test/t8_schemes/t8_gtest_elements_are_family.cxx @@ -21,7 +21,7 @@ */ #include -#include +#include #include #include #include "t8_gtest_dfs_base.hxx" diff --git a/test/t8_schemes/t8_gtest_equal.cxx b/test/t8_schemes/t8_gtest_equal.cxx index 9985bdb00e..731f32b447 100644 --- a/test/t8_schemes/t8_gtest_equal.cxx +++ b/test/t8_schemes/t8_gtest_equal.cxx @@ -21,7 +21,7 @@ */ #include -#include +#include #include #include #include diff --git a/test/t8_schemes/t8_gtest_face_corner.cxx b/test/t8_schemes/t8_gtest_face_corner.cxx index bf111a901d..bb6cfc36fb 100644 --- a/test/t8_schemes/t8_gtest_face_corner.cxx +++ b/test/t8_schemes/t8_gtest_face_corner.cxx @@ -21,7 +21,7 @@ */ #include -#include +#include #include #include #include diff --git a/test/t8_schemes/t8_gtest_face_descendant.cxx b/test/t8_schemes/t8_gtest_face_descendant.cxx index bf6a6b9545..b3d7d1aa94 100644 --- a/test/t8_schemes/t8_gtest_face_descendant.cxx +++ b/test/t8_schemes/t8_gtest_face_descendant.cxx @@ -21,7 +21,7 @@ */ #include -#include +#include #include #include #include diff --git a/test/t8_schemes/t8_gtest_face_neigh.cxx b/test/t8_schemes/t8_gtest_face_neigh.cxx index d2a0002fc5..e1f3c81b6e 100644 --- a/test/t8_schemes/t8_gtest_face_neigh.cxx +++ b/test/t8_schemes/t8_gtest_face_neigh.cxx @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include diff --git a/test/t8_schemes/t8_gtest_find_parent.cxx b/test/t8_schemes/t8_gtest_find_parent.cxx index ad898e2b73..d92c163170 100644 --- a/test/t8_schemes/t8_gtest_find_parent.cxx +++ b/test/t8_schemes/t8_gtest_find_parent.cxx @@ -21,7 +21,7 @@ */ #include -#include +#include #include #include #include "t8_gtest_dfs_base.hxx" diff --git a/test/t8_schemes/t8_gtest_get_linear_id.cxx b/test/t8_schemes/t8_gtest_get_linear_id.cxx index b9ad4e3d20..5bd386daf0 100644 --- a/test/t8_schemes/t8_gtest_get_linear_id.cxx +++ b/test/t8_schemes/t8_gtest_get_linear_id.cxx @@ -21,7 +21,7 @@ */ #include -#include +#include #include #include #include diff --git a/test/t8_schemes/t8_gtest_input_equal_output.cxx b/test/t8_schemes/t8_gtest_input_equal_output.cxx index d25bf9ca5d..7bf52f04d5 100644 --- a/test/t8_schemes/t8_gtest_input_equal_output.cxx +++ b/test/t8_schemes/t8_gtest_input_equal_output.cxx @@ -21,7 +21,7 @@ */ #include -#include +#include #include #include #include diff --git a/test/t8_schemes/t8_gtest_nca.cxx b/test/t8_schemes/t8_gtest_nca.cxx index 8cc65c5a9b..5465c879bb 100644 --- a/test/t8_schemes/t8_gtest_nca.cxx +++ b/test/t8_schemes/t8_gtest_nca.cxx @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include diff --git a/test/t8_schemes/t8_gtest_pack_unpack.cxx b/test/t8_schemes/t8_gtest_pack_unpack.cxx index 3a1345b17c..33fcbdde1c 100644 --- a/test/t8_schemes/t8_gtest_pack_unpack.cxx +++ b/test/t8_schemes/t8_gtest_pack_unpack.cxx @@ -21,7 +21,7 @@ */ #include -#include +#include #include #include #include diff --git a/test/t8_schemes/t8_gtest_root.cxx b/test/t8_schemes/t8_gtest_root.cxx index ceacfd88e0..bbc04b12c0 100644 --- a/test/t8_schemes/t8_gtest_root.cxx +++ b/test/t8_schemes/t8_gtest_root.cxx @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include diff --git a/test/t8_schemes/t8_gtest_set_linear_id.cxx b/test/t8_schemes/t8_gtest_set_linear_id.cxx index 64ce416a63..c0b61b09b9 100644 --- a/test/t8_schemes/t8_gtest_set_linear_id.cxx +++ b/test/t8_schemes/t8_gtest_set_linear_id.cxx @@ -21,7 +21,7 @@ */ #include -#include +#include #include #include #include diff --git a/test/t8_schemes/t8_gtest_successor.cxx b/test/t8_schemes/t8_gtest_successor.cxx index a1b002ed1f..b184a4019b 100644 --- a/test/t8_schemes/t8_gtest_successor.cxx +++ b/test/t8_schemes/t8_gtest_successor.cxx @@ -21,7 +21,7 @@ */ #include -#include +#include #include #include #include diff --git a/tutorials/general/t8_step7_interpolation.cxx b/tutorials/general/t8_step7_interpolation.cxx index f8b040fb47..ba1f8512cf 100644 --- a/tutorials/general/t8_step7_interpolation.cxx +++ b/tutorials/general/t8_step7_interpolation.cxx @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include #include From d19d8edaa221816c501adfb4107ce157c1f02205 Mon Sep 17 00:00:00 2001 From: Thomas Spenke Date: Wed, 4 Feb 2026 10:53:25 +0100 Subject: [PATCH 5/7] Removed left-over files not properly deleted in previous merge --- .../IO/cmesh/netcdf/t8_write_cmesh_netcdf.cxx | 149 --- .../forest/netcdf/t8_write_forest_netcdf.cxx | 468 -------- src/t8_cmesh/t8_cmesh_io/t8_cmesh_netcdf.c | 922 -------------- src/t8_cmesh/t8_cmesh_io/t8_cmesh_netcdf.h | 50 - src/t8_forest/t8_forest_netcdf.cxx | 1067 ----------------- src/t8_netcdf/t8_forest_netcdf.h | 70 -- src/t8_netcdf/t8_netcdf.c | 69 -- src/t8_netcdf/t8_netcdf.h | 107 -- 8 files changed, 2902 deletions(-) delete mode 100644 example/IO/cmesh/netcdf/t8_write_cmesh_netcdf.cxx delete mode 100644 example/IO/forest/netcdf/t8_write_forest_netcdf.cxx delete mode 100644 src/t8_cmesh/t8_cmesh_io/t8_cmesh_netcdf.c delete mode 100644 src/t8_cmesh/t8_cmesh_io/t8_cmesh_netcdf.h delete mode 100644 src/t8_forest/t8_forest_netcdf.cxx delete mode 100644 src/t8_netcdf/t8_forest_netcdf.h delete mode 100644 src/t8_netcdf/t8_netcdf.c delete mode 100644 src/t8_netcdf/t8_netcdf.h diff --git a/example/IO/cmesh/netcdf/t8_write_cmesh_netcdf.cxx b/example/IO/cmesh/netcdf/t8_write_cmesh_netcdf.cxx deleted file mode 100644 index 2a6e8681c8..0000000000 --- a/example/IO/cmesh/netcdf/t8_write_cmesh_netcdf.cxx +++ /dev/null @@ -1,149 +0,0 @@ -/* - This file is part of t8code. - t8code is a C library to manage a collection (a forest) of multiple - connected adaptive space-trees of general element types in parallel. - - Copyright (C) 2015 the developers - - t8code is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - t8code is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with t8code; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ -/* - In this example, the use of functions in order to write out a cmesh in the netCDF format is exemplarily displayed. - Additionally to the UGRID representation of the cmesh, element-wise user-defined variables are created and also written to the netCDF file. - */ - -#include -#include -/* Standard netcdf error function */ -#define ERRCODE 2 -#define ERR(e) \ - { \ - t8_global_productionf ("Error: %s\n", nc_strerror (e)); \ - exit (ERRCODE); \ - } -#include -#include -#include -#include -#include -#include - -void -t8_example_netcdf_write_cmesh (sc_MPI_Comm comm) -{ - t8_cmesh_t cmesh; - t8_nc_int32_t *var_rank; - sc_array_t *var_ranks; - sc_array_t *var_random_values; - double *random_values; - t8_netcdf_variable_t *ext_var_mpirank; - t8_netcdf_variable_t *ext_var_random_values; - int mpiret; - int mpirank; - int j; - - /* Receive the process-local MPI rank */ - mpiret = sc_MPI_Comm_rank (comm, &mpirank); - SC_CHECK_MPI (mpiret); - - /* Construct a hybrid cmesh */ - cmesh = t8_cmesh_new_hypercube_hybrid (comm, 1, 0); - - /* Number of process-local elements */ - t8_global_productionf ("Number of local trees on process %d : %d\n", mpirank, t8_cmesh_get_num_local_trees (cmesh)); - - /* *Example user-defined NetCDF variable, mpirank* */ - /* Allocate the data which lays on the several processes */ - - /* Those user-defined variables are currently only meant to maintain a single value per (process-local) element */ - var_rank = T8_ALLOC (t8_nc_int32_t, t8_cmesh_get_num_local_trees (cmesh)); - /* Write out the mpirank of each (process-local) element */ - for (j = 0; j < t8_cmesh_get_num_local_trees (cmesh); j++) { - var_rank[j] = mpirank; - } - - /* Create a new sc_array_t which provides the data for the NetCDF variables, in this case the mpirank each element lays on */ - var_ranks = sc_array_new_data (var_rank, sizeof (t8_nc_int32_t), t8_cmesh_get_num_local_trees (cmesh)); - - /* Create an integer NetCDF variable; parameters are (name of the variable, descriptive long name of the variable, description of the data's unit, pointer to sc_array_t which provides the data) */ - ext_var_mpirank = t8_netcdf_create_integer_var ("mpirank", "Mpirank which the element lays on", "integer", var_ranks); - - /* *Example user-defined NetCDF variable, random values* */ - /* Create random values */ - random_values = T8_ALLOC (double, t8_cmesh_get_num_local_trees (cmesh)); - - for (j = 0; j < t8_cmesh_get_num_local_trees (cmesh); j++) { - random_values[j] = rand () / (double) rand (); - } - /* Create a new sc_array_t which provides the data for the NetCDF variables, in this case just random values */ - var_random_values = sc_array_new_data (random_values, sizeof (double), t8_cmesh_get_num_local_trees (cmesh)); - - /* Create a double NetCDF variable; parameters are (name of the variable, descriptive long name of the variable, description of the data's unit (i.e. degrees Celsius), pointer to sc_array_t which provides the data) */ - ext_var_random_values - = t8_netcdf_create_double_var ("random_values", "Random values in [0,10)", "double", var_random_values); - - /* Create an array of pointers to extern NetCDF-variables, further extern NetCDF-Variables could be created and appended to the array */ - t8_netcdf_variable_t *ext_vars[2] = { ext_var_mpirank, ext_var_random_values }; - - /* Name of the NetCDF-File */ - const char *mesh_name = "T8_Example_NetCDF_Cmesh"; - - /* Write the cmesh to NetCDF */ - t8_cmesh_write_netcdf (cmesh, mesh_name, "Example 3D parallel cmesh", 3, 2, ext_vars, comm); - - t8_global_productionf ("NetCDF output of the cmesh has been written.\n"); - - /* Destroy the cmesh */ - t8_cmesh_destroy (&cmesh); - - /* Free the allocated memory of the extern NetCDF-variables which was created by calling the 'destroy' function */ - t8_netcdf_variable_destroy (ext_var_mpirank); - t8_netcdf_variable_destroy (ext_var_random_values); - - /* Destroy the allocated sc_array_t */ - sc_array_destroy (var_ranks); - sc_array_destroy (var_random_values); - - /* Free the data of the user-defined variable */ - T8_FREE (var_rank); - T8_FREE (random_values); -} - -int -main (int argc, char **argv) -{ - int mpiret; - - /* Initialize MPI */ - mpiret = sc_MPI_Init (&argc, &argv); - SC_CHECK_MPI (mpiret); - - /* Initialize sc */ - sc_init (sc_MPI_COMM_WORLD, 1, 1, NULL, SC_LP_ESSENTIAL); - /* Initialize t8code */ - t8_init (SC_LP_PRODUCTION); - - /* An example function that outputs a cmesh in NetCDF-Format */ - t8_example_netcdf_write_cmesh (sc_MPI_COMM_WORLD); - - /* Finalize sc */ - sc_finalize (); - - /* Finalize MPI */ - mpiret = sc_MPI_Finalize (); - SC_CHECK_MPI (mpiret); - - return 0; -} diff --git a/example/IO/forest/netcdf/t8_write_forest_netcdf.cxx b/example/IO/forest/netcdf/t8_write_forest_netcdf.cxx deleted file mode 100644 index 08ce69e2b2..0000000000 --- a/example/IO/forest/netcdf/t8_write_forest_netcdf.cxx +++ /dev/null @@ -1,468 +0,0 @@ -/* - This file is part of t8code. - t8code is a C library to manage a collection (a forest) of multiple - connected adaptive space-trees of general element types in parallel. - - Copyright (C) 2015 the developers - - t8code is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - t8code is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with t8code; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#include -#include -#if T8_ENABLE_NETCDF_PAR -#include -#else -/* Normally defined in 'netcdf_par.h' */ -#define NC_INDEPENDENT 0 -#define NC_COLLECTIVE 1 -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* In this example is the use of the netcdf feature exemplary displayed. -* We show how to write out a forest in the netCDF format and how to create additional (integer/double) netCDF variables which hold element data. -* There are mainly two functions implemented in 'src/t8_forest_netcdf.cxx' which allow the creation of netCDF file containing the data for a forest in the style of the UGRID conventions. -* The first function is: 't8_forest_write_netcdf_ext()'; it allows to choose which variable storage and access scheme should be used (e.g. {NC_CONTIGUOUS; NC_CHUNKED}x{NC_INDEPENDENT; NC_COLLECTIVE}). -* The second function is: 't8_forest_write_netcdf()' uses default values (NC_CONTIGUOUS, NC_INDEPENDENT). -* If the extended function is used and NC_CHUNKED is chosen: Currently, the chunksize which is chosen is the netCDF default (this means -> nc_def_var_chunking(..., NULL) receives a NULL-pointer as the 'size_t* chunksizesp' parameter) -*/ -T8_EXTERN_C_BEGIN (); - -/** An example struct which holds the information about the adaption process. -* \note A detailed description of the adaption process is found in step 3 of the tutorial located in 't8code/example/tutorials'. -*/ -struct t8_example_netcdf_adapt_data -{ - t8_3D_point midpoint; /* Midpoint of a sphere */ - double refine_if_inside_radius; /* refine all elements inside this radius from the sphere's midpoint */ - double coarsen_if_outside_radius; /* coarsen all element families outside of this radius from the sphere's midpoint */ -}; - -/** This functions describe an adapt_function, an adapt_function describes the refinement/coarsening rules for a forest -* \note If an element is inside a given radius from the midpoint of the hypercube, this element is refined. If a family of elements is outside a given radius from the midpoint of the hypercube, it is coarsened. -* \note A detailed description of the adaption process is found in step 3 of the tutorial located in 't8code/example/tutorials'. -*/ -int -t8_example_netcdf_adapt_fn (t8_forest_t forest, t8_forest_t forest_from, t8_locidx_t which_tree, - [[maybe_unused]] const t8_eclass_t tree_class, [[maybe_unused]] t8_locidx_t lelement_id, - [[maybe_unused]] const t8_scheme *scheme, const int is_family, - [[maybe_unused]] const int num_elements, t8_element_t *elements[]) -{ - t8_3D_point element_centroid; - double distance; - - /* Retrieve the adapt_data which holds the information regarding the adaption process of a forest */ - const struct t8_example_netcdf_adapt_data *adapt_data - = (const struct t8_example_netcdf_adapt_data *) t8_forest_get_user_data (forest); - - /* Compute the element's centroid */ - t8_forest_element_centroid (forest_from, which_tree, elements[0], element_centroid.data ()); - - /* Compute the distance from the element's midpoint to the midpoint of the centered sphere inside the hypercube */ - distance = t8_dist (element_centroid, adapt_data->midpoint); - - /* Decide whether the element (or its family) has to be refined or coarsened */ - if (distance < adapt_data->refine_if_inside_radius) { - /* positive return value means, that this element is going to be refined */ - return 1; - } - else if (is_family && distance > adapt_data->coarsen_if_outside_radius) { - /* The elements family is going to be coarsened (this is only possible if all elements of this family are process-local) */ - /* returning a negative value means coarsening */ - return -1; - } - else { - /* In this case the element remains the same and is neither refined nor coarsened */ - /* This is implied by a return value of zero */ - return 0; - } -} - -/** This functions performs the adaption process of a forest and returns the adapted forest -* \param [in] forest The forest which ought to be adapted -* \param [out] forest_adapt The adapted forest -* \note A detailed description of the adaption process is found in step 3 of the tutorial located in 't8code/example/tutorials'. -*/ -t8_forest_t -t8_example_netcdf_adapt (t8_forest_t forest) -{ - t8_forest_t forest_adapt; - - /* The adapt data which controls which elements will be refined or coarsened based on the given radii */ - struct t8_example_netcdf_adapt_data adapt_data = { - t8_3D_point ({ 0.5, 0.5, 0.5 }), /* Midpoints of the sphere. */ - 0.2, /* Refine if inside this radius. */ - 0.4 /* Coarsen if outside this radius. */ - }; - - /* Create the adapted forest with the given adapt_function. */ - forest_adapt = t8_forest_new_adapt (forest, t8_example_netcdf_adapt_fn, 0, 0, &adapt_data); - - return forest_adapt; -} - -/** Function that times the duration of writing out the netCDF File, given a specific variable storage and access pattern -* \param [in] forest The forest to save in a netCDF file (using UGRID conventions). -* \param [in] comm The MPI communicator to use. -* \param [in] netcdf_var_storage_mode Choose if chunked or contiguous storage should be used (possible Options: NC_CONTIGUOUS, NC_CHUNKED). -* \param [in] netcdf_var_mpi_access Choose if the netCDF write operations should be performed independently or collectively by the MPI ranks (possible Options: NC_INDEPENDENT, NC_COLLECTIVE). -* \param [in] title Hold the title of the netCDF file which is stored inside the netCDF file as a global attribute. -* \param [in] num_additional_vars The number of additional user-variables to write out. -* \param [in] ext_vars A pointer to an array which holds \a num_additional_vars which should be written out in addition to the 'forest NetCDF variables' -* \note It is assumed that each user-variable in \a ext_vars holds one value for each element in the mesh/forest. If no additional variables should be written in the netCDF file, set \a num_additional_vars equal to zero and pass a NULL-pointer as \a ext_vars. -*/ -static void -t8_example_time_netcdf_writing_operation ([[maybe_unused]] t8_forest_t forest, [[maybe_unused]] sc_MPI_Comm comm, - [[maybe_unused]] int netcdf_var_storage_mode, - [[maybe_unused]] int netcdf_var_mpi_access, - [[maybe_unused]] const char *title, [[maybe_unused]] int num_additional_vars, - [[maybe_unused]] t8_netcdf_variable_t *ext_vars[]) -{ -#if T8_ENABLE_NETCDF_PAR - double start_time, end_time, duration, global; - int retval; - - /* Start timing */ - sc_MPI_Barrier (comm); - start_time = sc_MPI_Wtime (); - - /* Write out the forest in netCDF format using the extended function which allows to set a specific variable storage and access pattern. */ - t8_forest_write_netcdf_ext (forest, title, "Performance Test: uniformly refined Forest", 3, num_additional_vars, - ext_vars, comm, netcdf_var_storage_mode, netcdf_var_mpi_access); - - /* End timing */ - sc_MPI_Barrier (comm); - end_time = sc_MPI_Wtime (); - duration = end_time - start_time; - retval = sc_MPI_Reduce (&duration, &global, 1, sc_MPI_DOUBLE, sc_MPI_MAX, 0, comm); - SC_CHECK_MPI (retval); - - t8_global_productionf ("The time elapsed to write the netCDF-4 File is: %f\n\n", global); -#endif -} - -/** Function that stores the given (uniform) forest in a netCDF-4 File using the different netCDF variable storage and mpi-access patterns (four files are going to be put out (each combination of {NC_CONTIGUOUS; NC_CHUNKED}x{NC_INDEPENDENT; NC_COLLECTIVE})). -* \param [in] comm The MPI communicator to use. -* \param [in] forest_refinement_level The refinement level of the forest. -* \param [in] adapt_forest A flag whether an adapt step should be performed (=1) or not (=0). -* \param [in] with_additional_data If two additional variables (one based on MPI_rank and one with random values) should be written to the netCDF File, choose 1. If no additional variables should be written choose 0. -*/ -void -t8_example_compare_performance_netcdf_var_properties (sc_MPI_Comm comm, int forest_refinement_level, int adapt_forest, - int with_additional_data) -{ - t8_cmesh_t cmesh; - t8_forest_t forest; - const t8_scheme *default_scheme = t8_scheme_new_default (); - t8_gloidx_t num_elements; - t8_nc_int64_t *var_rank; - double *random_values; - sc_array_t *var_ranks; - sc_array_t *var_random_values; - t8_netcdf_variable_t *ext_var_mpirank; - t8_netcdf_variable_t *ext_var_random_values; - t8_netcdf_variable_t **ext_vars = new t8_netcdf_variable_t *[2]; - int num_additional_vars = 0; - int j; - int retval; - int mpirank; - - /* Receive the process-local MPI rank */ - retval = sc_MPI_Comm_rank (comm, &mpirank); - SC_CHECK_MPI (retval); - - /* Construct a 3D hybrid hypercube as a cmesh */ - cmesh = t8_cmesh_new_hypercube_hybrid (comm, 1, 0); - - /* Build a (partitioned) uniform forest */ - forest = t8_forest_new_uniform (cmesh, default_scheme, forest_refinement_level, 0, comm); - - /* If the adapt_forest flag is set, the forest will be adapted */ - if (adapt_forest) { - forest = t8_example_netcdf_adapt (forest); - } - num_elements = t8_forest_get_local_num_leaf_elements (forest); - t8_productionf ("Number of process-local elements: %" T8_GLOIDX_FORMAT "\n", num_elements); - - /* If additional data should be written to the netCDF file, the two variables are created in the following section */ - if (with_additional_data) { - /* Get the number of process-local elements */ - num_elements = t8_forest_get_local_num_leaf_elements (forest); - /** Create an integer netCDF variables **/ - /* Create an 64-bit Integer variable (j* MPI_Rank) which holds the rank each element lays on multiplied with j */ - var_rank = T8_ALLOC (t8_nc_int64_t, num_elements); - /* Write out the mpirank of each (process-local) element */ - for (j = 0; j < num_elements; ++j) { - var_rank[j] = mpirank * j; - } - /* Create a new sc_array_t which provides the data for the NetCDF variables */ - var_ranks = sc_array_new_data (var_rank, sizeof (t8_nc_int64_t), num_elements); - /* Create the 64-bit integer NetCDF variable; parameters are (name of the variable, descriptive long name of the variable, description of the data's unit, pointer to sc_array_t which provides the data) */ - ext_var_mpirank = t8_netcdf_create_integer_var ( - "mpirank", "Mpirank which the element lays on multiplied by its process-local id", "integer", var_ranks); - - /** Create a double netCDF variable **/ - /* Create a random value variable */ - random_values = T8_ALLOC (double, num_elements); - - for (j = 0; j < num_elements; ++j) { - random_values[j] = rand () / (double) rand (); - } - /* Create a new sc_array_t which provides the data for the NetCDF variables, in this case just random values */ - var_random_values = sc_array_new_data (random_values, sizeof (double), num_elements); - - /* Create the double NetCDF variable; parameters are (name of the variable, descriptive long name of the variable, description of the data's unit (i.e. degrees Celsius), pointer to sc_array_t which provides the data) */ - ext_var_random_values - = t8_netcdf_create_double_var ("random_values", "Random values in [0,10)", "double", var_random_values); - - /* Safe the created netCDF variables within an array */ - ext_vars[0] = ext_var_mpirank; - ext_vars[1] = ext_var_random_values; - - num_additional_vars = 2; - } - - t8_global_productionf ("The uniformly refined forest (refinement level = %d) has %" T8_GLOIDX_FORMAT - " global elements.\n", - forest_refinement_level, t8_forest_get_global_num_leaf_elements (forest)); - - t8_global_productionf ( - "The different netCDF variable storage patterns and mpi variable access patterns are getting tested/timed...\n"); - - /* First Case */ -#if T8_ENABLE_NETCDF_PAR - t8_global_productionf ("Variable-Storage: NC_CHUNKED, Variable-Access: NC_COLLECTIVE:\n"); -#endif - t8_example_time_netcdf_writing_operation (forest, comm, NC_CHUNKED, NC_COLLECTIVE, - "T8_Example_NetCDF_Performance_Chunked_Collective", num_additional_vars, - ext_vars); - - /* Second Case */ -#if T8_ENABLE_NETCDF_PAR - t8_global_productionf ("Variable-Storage: NC_CHUNKED, Variable-Access: NC_INDEPENDENT:\n"); -#endif - t8_example_time_netcdf_writing_operation (forest, comm, NC_CHUNKED, NC_INDEPENDENT, - "T8_Example_NetCDF_Performance_Chunked_Independent", num_additional_vars, - ext_vars); - - /* Third Case */ -#if T8_ENABLE_NETCDF_PAR - t8_global_productionf ("Variable-Storage: NC_CONTIGUOUS, Variable-Access: NC_COLLECTIVE:\n"); -#endif - t8_example_time_netcdf_writing_operation (forest, comm, NC_CONTIGUOUS, NC_COLLECTIVE, - "T8_Example_NetCDF_Performance_Contiguous_Collective", num_additional_vars, - ext_vars); - - /* Fourth Case */ -#if T8_ENABLE_NETCDF_PAR - t8_global_productionf ("Variable-Storage: NC_CONTIGUOUS, Variable-Access: NC_INDEPENDENT:\n"); -#endif - t8_example_time_netcdf_writing_operation (forest, comm, NC_CONTIGUOUS, NC_INDEPENDENT, - "T8_Example_NetCDF_Performance_Contiguous_Independent", num_additional_vars, - ext_vars); - - /* Free allocated memory */ - if (with_additional_data) { - /* Free the allocated array of pointers to extern NetCDF-variables */ - delete[] ext_vars; - - /* Free the allocated memory of the extern NetCDF-variables which was created by calling the 'destroy' function */ - t8_netcdf_variable_destroy (ext_var_mpirank); - t8_netcdf_variable_destroy (ext_var_random_values); - - /* Destroy the allocated sc_array_t */ - sc_array_destroy (var_ranks); - sc_array_destroy (var_random_values); - - /* Free the data of the user-defined variable */ - T8_FREE (var_rank); - T8_FREE (random_values); - } - - /* Destroy the forest */ - t8_forest_unref (&forest); - -#if !T8_ENABLE_NETCDF_PAR - t8_global_productionf ("In order to execute the function 't8_example_compare_performance_netcdf_var_properties' " - "properly, parallel netCDF routines have to be accessible.\n"); -#endif -} - -/** An example functions that writes out a netCDF-4 File containing the information of the forest and some user-defined/random-value variables -* \param [in] comm The MPI communicator to use. -* \param [in] forest_refinement_level The initial refinement level of the forest. -* \param [in] adapt_forest A flag whether an adapt step should be performed (=1) or not (=0). -* \note The creation of additional user-defined variables (besides the ones needed by the forest) is done with the 'specialized' routines 't8_netcdf_create_integer_var(...)' and 't8_netcdf_create_double_var '. But there is also a general routine (in which the variable type can be stated explicitly as a parameter), this routine is called ' -*/ -void -t8_example_netcdf_write_forest (sc_MPI_Comm comm, int forest_refinement_level, int adapt_forest) -{ - t8_cmesh_t cmesh; - t8_forest_t forest; - const t8_scheme *default_scheme = t8_scheme_new_default (); - t8_gloidx_t num_elements; - t8_nc_int32_t *var_rank; - double *random_values; - sc_array_t *var_ranks; - sc_array_t *var_random_values; - t8_netcdf_variable_t *ext_var_mpirank; - t8_netcdf_variable_t *ext_var_random_values; - int j; - int mpirank; - int retval; - - /* Initial refinement level of the uniform forest */ - int level = forest_refinement_level; - /* Receive the process local MPI rank */ - retval = sc_MPI_Comm_rank (comm, &mpirank); - SC_CHECK_MPI (retval); - - /* Construct a cube coarse mesh */ - /* Construct a 3D hybrid hypercube as a cmesh */ - cmesh = t8_cmesh_new_hypercube_hybrid (comm, 1, 0); - - t8_global_productionf ("New cmesh was created\n"); - - /* Build a (partitioned) uniform forest */ - forest = t8_forest_new_uniform (cmesh, default_scheme, level, 0, comm); - - t8_global_productionf ("New forest was created\n"); - - /* Eventually, adapt the forest (based on the flag adapt_forest) */ - if (adapt_forest) { - /** \note The forest is not repartitioned after the adapt-step. - * Therefore, the workload may not be evenly distributed among the processes. - * (in step 4 of the tutorial, there is more information about partitioning and balancing of a forest) - */ - forest = t8_example_netcdf_adapt (forest); - t8_global_productionf ("The forest was adapted\n"); - } - - /* Print out the number of local elements of each process */ - num_elements = t8_forest_get_local_num_leaf_elements (forest); - t8_debugf ("[t8] Rank %d has %" T8_GLOIDX_FORMAT " elements\n", mpirank, num_elements); - - /* *Example user-defined NetCDF variable* */ - /* Currently, integer (32bit, 64bit) and double NetCDF variables are possible */ - - /* Allocate the data which lays on the several processes */ - /* Those user-defined variables are currently only meant to maintain a single value per (process-local) element */ - var_rank = T8_ALLOC (t8_nc_int32_t, num_elements); - - /* Write out the mpirank of each (process-local) element multiplied by the local element index */ - for (j = 0; j < num_elements; j++) { - var_rank[j] = mpirank * j; - } - /* Create a new sc_array_t which provides the data for the NetCDF variables, in this case the mpirank each element lays on */ - var_ranks = sc_array_new_data (var_rank, sizeof (t8_nc_int32_t), num_elements); - - /* Create the integer NetCDF variable; parameters are (name of the variable, descriptive long name of the variable, description of the data's unit, pointer to sc_array_t which provides the data) */ - ext_var_mpirank = t8_netcdf_create_integer_var ( - "mult_mpirank", "Mpirank which the element lays on multiplied by its process-local id", "integer", var_ranks); - - /* *Example user-defined NetCDF variable, random values* */ - /* Create random values */ - random_values = T8_ALLOC (double, num_elements); - - for (j = 0; j < num_elements; j++) { - random_values[j] = rand () / (double) rand (); - } - /* Create a new sc_array_t which provides the data for the NetCDF variables, in this case just random values */ - var_random_values = sc_array_new_data (random_values, sizeof (double), num_elements); - - /* Create the double NetCDF variable; parameters are (name of the variable, descriptive long name of the variable, description of the data's unit (i.e. degrees Celsius), pointer to sc_array_t which provides the data) */ - ext_var_random_values - = t8_netcdf_create_double_var ("random_values", "Random values in [0,10)", "double", var_random_values); - - /* Create an array of pointers to extern NetCDF-variables, further extern NetCDF-Variables could be created and appended to the array */ - t8_netcdf_variable_t **ext_vars = new t8_netcdf_variable_t *[2]; - ext_vars[0] = ext_var_mpirank; - ext_vars[1] = ext_var_random_values; - - /* Write the forest to NetCDF */ - t8_forest_write_netcdf (forest, "T8_Example_NetCDF_Forest_With_Add_Vars", "Example Uniform Forest", 3, 2, ext_vars, - comm); - - t8_global_productionf ("The forest has been written to a netCDF file\n"); - - /* Destroy the forest */ - t8_forest_unref (&forest); - - /* Free the allocated array of pointers to extern NetCDF-variables */ - delete[] ext_vars; - - /* Free the allocated memory of the extern NetCDF-variables which was created by calling the 'destroy' function */ - t8_netcdf_variable_destroy (ext_var_mpirank); - t8_netcdf_variable_destroy (ext_var_random_values); - - /* Destroy the allocated sc_array_t */ - sc_array_destroy (var_ranks); - sc_array_destroy (var_random_values); - - /* Free the data of the user-defined variable */ - T8_FREE (var_rank); - T8_FREE (random_values); -} - -int -main (int argc, char **argv) -{ - int mpiret; - - /* The initial refinement level for the uniform forest which will be written out in a netCDF File */ - int forest_initial_refinement_level = 4; - /* A flag which controls if the uniform forest should be adapted before it is written out in a netCDF File. Yes, adapt the forest -> 1; No -> 0 */ - int adapt_forest = 1; - /* A flag whether two additional netCDF variables (integer and double) should be written out within the timing-function 't8_example_compare_performance_netcdf_var_properties()'. Yes -> 1; No -> 0 */ - int timing_with_additional_netcdf_variables = 1; - - /* Initialize MPI */ - mpiret = sc_MPI_Init (&argc, &argv); - SC_CHECK_MPI (mpiret); - - /* Initialize sc */ - sc_init (sc_MPI_COMM_WORLD, 1, 1, NULL, SC_LP_ESSENTIAL); - /* Initialize t8code */ - t8_init (SC_LP_PRODUCTION); - - /* Call to an example function which writes out a forest in NetCDF-Format */ - t8_example_netcdf_write_forest (sc_MPI_COMM_WORLD, forest_initial_refinement_level, adapt_forest); - - /** This functions times the different performances of the available variable storage and mpi access patterns. - * \note In Case of NC_CHUNKED the netCDF default Chunking behaviour is chosen. - */ - t8_example_compare_performance_netcdf_var_properties (sc_MPI_COMM_WORLD, forest_initial_refinement_level, - adapt_forest, timing_with_additional_netcdf_variables); - - /* Finalize sc */ - sc_finalize (); - - /* Finalize MPI */ - mpiret = sc_MPI_Finalize (); - SC_CHECK_MPI (mpiret); - - return 0; -} - -T8_EXTERN_C_END (); diff --git a/src/t8_cmesh/t8_cmesh_io/t8_cmesh_netcdf.c b/src/t8_cmesh/t8_cmesh_io/t8_cmesh_netcdf.c deleted file mode 100644 index 2f58fc1729..0000000000 --- a/src/t8_cmesh/t8_cmesh_io/t8_cmesh_netcdf.c +++ /dev/null @@ -1,922 +0,0 @@ -/* - This file is part of t8code. - t8code is a C library to manage a collection (a forest) of multiple - connected adaptive space-trees of general element classes in parallel. - - Copyright (C) 2015 the developers - - t8code is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - t8code is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with t8code; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -/* -Description: -These functions write a file in the netCDF-format which represents the given 2D- or 3D-cmesh -*/ - -#include -#include -/* Standard netcdf error function */ -#define ERRCODE 2 -#define ERR(e) \ - { \ - t8_global_productionf ("Error: %s\n", nc_strerror (e)); \ - exit (ERRCODE); \ - } -#if T8_ENABLE_NETCDF_PAR -#include -#endif -#include -#include -#include -#include -#include - -/** - * - * Contains all Variables used in order to work with the NetCDF-File - * -*/ -typedef struct -{ - char *filename; /**< The name of the NetCDF-File to be read */ - const char *filetitle; /**< The title of the NetCDF-File */ - int dim; /**< The dimension of the cmesh (2D or 3D) */ - t8_gloidx_t nMesh_elem; /**< The number of elements in the cmesh */ - t8_gloidx_t nMesh_node; /**< The number of nodes in the cmesh */ - int nMaxMesh_elem_nodes; /**< The maximum number of nodes per element in the cmesh */ - t8_gloidx_t nMesh_local_node; /**< The number of local nodes in the cmesh */ - /* Declaring NetCDF-dimension ids */ - int nMesh_elem_dimid; /**< The NetCDF-dimension id for the number of elements */ - int nMaxMesh_elem_nodes_dimid; /**< The NetCDF-dimension id for the maximum number of nodes per element */ - int nMesh_node_dimid; /**< The NetCDF-dimension id for the number of nodes */ - /* Declaring NetCDF-variables ids */ - int ncid; /**< The NetCDF-file id */ - int var_elem_tree_id; /**< The NetCDF-variable id for the element tree id */ - int var_elem_types_id; /**< The NetCDF-variable id for the element types */ - int var_elem_nodes_id; /**< The NetCDF-variable id for the element nodes */ - int var_mesh_id; /**< The NetCDF-variable id for the mesh */ - int var_node_x_id; /**< The NetCDF-variable id for the x-coordinates of the nodes */ - int var_node_y_id; /**< The NetCDF-variable id for the y-coordinates of the nodes */ - int var_node_z_id; /**< The NetCDF-variable id for the z-coordinates of the nodes */ - int dimids[2]; /**< contains two NetCDF-dimensions in order to declare two-dimensional NetCDF-variables */ - /* Variables used for default NetCDF purposes */ - t8_nc_int32_t fillvalue32; /**< The fill value for 32-bit integer variables */ - t8_nc_int64_t fillvalue64; /**< The fill value for 64-bit integer variables */ - t8_nc_int32_t start_index; /**< The start index for NetCDF-variables */ - const char *convention; /**< The NetCDF-convention used (e.g., "UGRID") */ - int netcdf_var_storage_mode; /**< The storage mode for NetCDF-variables (e.g., "chunked") */ - int netcdf_mpi_access; /**< The MPI-access mode for NetCDF (e.g., "MPI-IO") */ - /* Stores the old NetCDF-FillMode if it gets changed */ - int old_fill_mode; /**< The old NetCDF-FillMode if it gets changed */ - -} t8_cmesh_netcdf_context_t; - -/** - * \struct t8_cmesh_netcdf_ugrid_namespace_t - * Contains the Definitions for the NetCDF-dimensions/-variables/-attributes (vary whether a 2D or 3D Mesh will be outputted) -*/ -typedef struct -{ - const char *mesh; /**< The name of the mesh */ - const char *dim_nMesh_node; /**< The name of the dimension for the number of nodes in the mesh*/ - const char *dim_nMesh_elem; /**< The name of the dimension for the number of elements in the mesh */ - const char - *dim_nMaxMesh_elem_nodes; /**< The name of the dimension for the maximum number of nodes per element in the mesh */ - const char *var_Mesh_node_x; /**< The name of the variable for the x-coordinates of the nodes in the mesh*/ - const char *var_Mesh_node_y; /**< The name of the variable for the y-coordinates of the nodes in the mesh*/ - const char *var_Mesh_node_z; /**< The name of the variable for the z-coordinates of the nodes in the mesh*/ - const char *var_Mesh_elem_types; /**< The name of the variable for the element types in the mesh */ - const char *var_Mesh_elem_tree_id; /**< The name of the variable for the element tree id in the mesh */ - const char *var_Mesh_elem_node; /**< The name of the variable for the element nodes in the mesh */ - const char *att_elem_shape_type; /**< The name of the attribute for the element shape type */ - const char *att_elem_node_connectivity; /**< The name of the attribute for the element node connectivity */ - const char *att_elem_tree_id; /**< The name of the attribute for the element tree id */ - const char *att_elem_node; /**< The name of the attribute for the element nodes */ -} t8_cmesh_netcdf_ugrid_namespace_t; - -/* The UGRID conventions are applied for dimension and variable descriptions */ -static void -t8_cmesh_init_ugrid_namespace_context (t8_cmesh_netcdf_ugrid_namespace_t *namespace_conv, const int dim) -{ - if (dim == 2) { - namespace_conv->mesh = "Mesh2"; - namespace_conv->dim_nMesh_node = "nMesh2_node"; - namespace_conv->dim_nMesh_elem = "nMesh2_face"; - namespace_conv->dim_nMaxMesh_elem_nodes = "nMaxMesh2_face_nodes"; - namespace_conv->var_Mesh_node_x = "Mesh2_node_x"; - namespace_conv->var_Mesh_node_y = "Mesh2_node_y"; - namespace_conv->var_Mesh_node_z = "Mesh2_node_z"; - namespace_conv->var_Mesh_elem_types = "Mesh2_face_types"; - namespace_conv->var_Mesh_elem_tree_id = "Mesh2_face_tree_id"; - namespace_conv->var_Mesh_elem_node = "Mesh2_face_nodes"; - namespace_conv->att_elem_shape_type = "face_shape_type"; - namespace_conv->att_elem_node_connectivity = "face_node_connectivity"; - namespace_conv->att_elem_tree_id = "face_tree_id"; - namespace_conv->att_elem_node = "Mesh2_node_x Mesh2_node_y Mesh2_node_z"; - } - else if (dim == 3) { - namespace_conv->mesh = "Mesh3D"; - namespace_conv->dim_nMesh_node = "nMesh3D_node"; - namespace_conv->dim_nMesh_elem = "nMesh3D_vol"; - namespace_conv->dim_nMaxMesh_elem_nodes = "nMaxMesh3D_vol_nodes"; - namespace_conv->var_Mesh_node_x = "Mesh3D_node_x"; - namespace_conv->var_Mesh_node_y = "Mesh3D_node_y"; - namespace_conv->var_Mesh_node_z = "Mesh3D_node_z"; - namespace_conv->var_Mesh_elem_types = "Mesh3D_vol_types"; - namespace_conv->var_Mesh_elem_tree_id = "Mesh3D_vol_tree_id"; - namespace_conv->var_Mesh_elem_node = "Mesh3D_vol_nodes"; - namespace_conv->att_elem_shape_type = "volume_shape_type"; - namespace_conv->att_elem_node_connectivity = "volume_node_connectivity"; - namespace_conv->att_elem_tree_id = "volume_tree_id"; - namespace_conv->att_elem_node = "Mesh3D_node_x Mesh3D_node_y Mesh3D_node_z"; - } -} - -/* Define NetCDF-coordinate-dimension */ -static void -t8_cmesh_write_netcdf_coordinate_dimension (t8_cmesh_netcdf_context_t *context, - t8_cmesh_netcdf_ugrid_namespace_t *namespace_context) -{ - /* Define dimension: number of nodes */ - int retval; - if ((retval = nc_def_dim (context->ncid, namespace_context->dim_nMesh_node, context->nMesh_node, - &context->nMesh_node_dimid))) { - ERR (retval); - } -} - -/* Define NetCDF-coordinate-variables */ -static void -t8_cmesh_write_netcdf_coordinate_variables (t8_cmesh_netcdf_context_t *context, - t8_cmesh_netcdf_ugrid_namespace_t *namespace_context) -{ - /* Define the Mesh_node_x variable. */ - int retval; - if ((retval = nc_def_var (context->ncid, namespace_context->var_Mesh_node_x, NC_DOUBLE, 1, &context->nMesh_node_dimid, - &context->var_node_x_id))) { - ERR (retval); - } - /* Define whether contiguous or chunked storage is used for the variable */ - if ((retval = nc_def_var_chunking (context->ncid, context->var_node_x_id, context->netcdf_var_storage_mode, NULL))) { - ERR (retval); - } - /* Define whether an independent or collective variable access is used */ -#if T8_ENABLE_NETCDF_PAR - if ((retval = nc_var_par_access (context->ncid, context->var_node_x_id, context->netcdf_mpi_access))) { - ERR (retval); - } -#endif - /* Define standard_name attribute. */ - const char *standard_node_x = "Longitude"; - if ((retval = nc_put_att_text (context->ncid, context->var_node_x_id, "standard_name", strlen (standard_node_x), - standard_node_x))) { - ERR (retval); - } - /* Define long_name attribute. */ - const char *long_node_x = "Longitude of mesh nodes"; - if ((retval - = nc_put_att_text (context->ncid, context->var_node_x_id, "long_name", strlen (long_node_x), long_node_x))) { - ERR (retval); - } - /* Define units attribute. */ - const char *units_node_x = "degrees_east"; - if ((retval - = nc_put_att_text (context->ncid, context->var_node_x_id, "units", strlen (units_node_x), units_node_x))) { - ERR (retval); - } - - /*********************************************/ - - /* Define the Mesh_node_y variable. */ - if ((retval = nc_def_var (context->ncid, namespace_context->var_Mesh_node_y, NC_DOUBLE, 1, &context->nMesh_node_dimid, - &context->var_node_y_id))) { - ERR (retval); - } - /* Define whether contiguous or chunked storage is used for the variable */ - if ((retval = nc_def_var_chunking (context->ncid, context->var_node_y_id, context->netcdf_var_storage_mode, NULL))) { - ERR (retval); - } - /* Define whether an independent or collective variable access is used */ -#if T8_ENABLE_NETCDF_PAR - if ((retval = nc_var_par_access (context->ncid, context->var_node_y_id, context->netcdf_mpi_access))) { - ERR (retval); - } -#endif - /* Define standard_name attribute. */ - const char *standard_node_y = "Latitude"; - if ((retval = nc_put_att_text (context->ncid, context->var_node_y_id, "standard_name", strlen (standard_node_y), - standard_node_y))) { - ERR (retval); - } - /* Define long_name attribute. */ - const char *long_node_y = "Latitude of mesh nodes"; - if ((retval - = nc_put_att_text (context->ncid, context->var_node_y_id, "long_name", strlen (long_node_y), long_node_y))) { - ERR (retval); - } - /* Define units attribute. */ - const char *units_node_y = "degrees_north"; - if ((retval - = nc_put_att_text (context->ncid, context->var_node_y_id, "units", strlen (units_node_y), units_node_y))) { - ERR (retval); - } - - /*********************************************/ - - /* Define the Mesh_node_z variable. */ - if ((retval = nc_def_var (context->ncid, namespace_context->var_Mesh_node_z, NC_DOUBLE, 1, &context->nMesh_node_dimid, - &context->var_node_z_id))) { - ERR (retval); - } - /* Define whether contiguous or chunked storage is used for the variable */ - if ((retval = nc_def_var_chunking (context->ncid, context->var_node_z_id, context->netcdf_var_storage_mode, NULL))) { - ERR (retval); - } - /* Define whether an independent or collective variable access is used */ -#if T8_ENABLE_NETCDF_PAR - if ((retval = nc_var_par_access (context->ncid, context->var_node_z_id, context->netcdf_mpi_access))) { - ERR (retval); - } -#endif - /* Define standard_name attribute. */ - const char *standard_node_z = "Height"; - if ((retval = nc_put_att_text (context->ncid, context->var_node_z_id, "standard_name", strlen (standard_node_z), - standard_node_z))) { - ERR (retval); - } - /* Define long_name attribute. */ - const char *long_node_z = "Elevation of mesh nodes"; - if ((retval - = nc_put_att_text (context->ncid, context->var_node_z_id, "long_name", strlen (long_node_z), long_node_z))) { - ERR (retval); - } - /* Define units attribute. */ - const char *units_node_z = "m"; - if ((retval - = nc_put_att_text (context->ncid, context->var_node_z_id, "units", strlen (units_node_z), units_node_z))) { - ERR (retval); - } -} - -/* Define NetCDF-dimensions */ -static void -t8_cmesh_write_netcdf_dimensions (t8_cmesh_netcdf_context_t *context, - t8_cmesh_netcdf_ugrid_namespace_t *namespace_context) -{ - /* *Define dimensions in the NetCDF file.* */ - - /* Return value in order to check NetCDF commands */ - int retval; - /* Define dimension: number of elements */ - if ((retval = nc_def_dim (context->ncid, namespace_context->dim_nMesh_elem, context->nMesh_elem, - &context->nMesh_elem_dimid))) { - ERR (retval); - } - - /* Define dimension: maximum node number per element */ - if ((retval = nc_def_dim (context->ncid, namespace_context->dim_nMaxMesh_elem_nodes, context->nMaxMesh_elem_nodes, - &context->nMaxMesh_elem_nodes_dimid))) { - ERR (retval); - } - - /* Store the ID of the dimensions. */ - context->dimids[0] = context->nMesh_elem_dimid; - context->dimids[1] = context->nMaxMesh_elem_nodes_dimid; - - t8_debugf ("First NetCDF-dimensions were defined.\n"); -} - -/* Define NetCDF-variables */ -static void -t8_cmesh_write_netcdf_variables (t8_cmesh_netcdf_context_t *context, - t8_cmesh_netcdf_ugrid_namespace_t *namespace_context) -{ - /* *Define variables in the NetCDF file.* */ - - /* Return value in order to check NetCDF commands */ - int retval; - - /* Define a general describing Mesh-variable */ - if ((retval = nc_def_var (context->ncid, namespace_context->mesh, NC_INT, 0, 0, &context->var_mesh_id))) { - ERR (retval); - } - - /* Define cf_role attribute */ - const char *role_mesh = "mesh_topology"; - if ((retval = nc_put_att_text (context->ncid, context->var_mesh_id, "cf_role", strlen (role_mesh), role_mesh))) { - ERR (retval); - } - - /* Define long_name attribute. */ - const char *long_mesh = "Topology data of unstructured tree-based mesh"; - if ((retval = nc_put_att_text (context->ncid, context->var_mesh_id, "long_name", strlen (long_mesh), long_mesh))) { - ERR (retval); - } - - /* Define topology_dimension attribute */ - if ((retval = nc_put_att_int (context->ncid, context->var_mesh_id, "topology_dimension", NC_INT, 1, &context->dim))) { - ERR (retval); - } - - /* Define node_coordinates attribute */ - if ((retval = nc_put_att_text (context->ncid, context->var_mesh_id, "node_coordinates", - strlen (namespace_context->att_elem_node), namespace_context->att_elem_node))) { - ERR (retval); - } - /* Define elem_shape_type attribute */ - if ((retval - = nc_put_att_text (context->ncid, context->var_mesh_id, namespace_context->att_elem_shape_type, - strlen (namespace_context->var_Mesh_elem_types), namespace_context->var_Mesh_elem_types))) { - ERR (retval); - } - /* Define elem_node_connectivity attribute */ - if ((retval - = nc_put_att_text (context->ncid, context->var_mesh_id, namespace_context->att_elem_node_connectivity, - strlen (namespace_context->var_Mesh_elem_node), namespace_context->var_Mesh_elem_node))) { - ERR (retval); - } - /* Define elem_tree_id attribute */ - if ((retval = nc_put_att_text (context->ncid, context->var_mesh_id, namespace_context->att_elem_tree_id, - strlen (namespace_context->var_Mesh_elem_tree_id), - namespace_context->var_Mesh_elem_tree_id))) { - ERR (retval); - } - /*************************************************************************/ - - /* Define the element-type variable in the NetCDF-file. */ - if ((retval = nc_def_var (context->ncid, namespace_context->var_Mesh_elem_types, NC_INT, 1, - &context->nMesh_elem_dimid, &context->var_elem_types_id))) { - ERR (retval); - } - /* Define whether contiguous or chunked storage is used for the variable */ - if ((retval - = nc_def_var_chunking (context->ncid, context->var_elem_types_id, context->netcdf_var_storage_mode, NULL))) { - ERR (retval); - } - /* Define whether an independent or collective variable access is used */ -#if T8_ENABLE_NETCDF_PAR - if ((retval = nc_var_par_access (context->ncid, context->var_elem_types_id, context->netcdf_mpi_access))) { - ERR (retval); - } -#endif - /* Define cf_role attribute */ - if ((retval - = nc_put_att_text (context->ncid, context->var_elem_types_id, "cf_role", - strlen (namespace_context->att_elem_shape_type), namespace_context->att_elem_shape_type))) { - ERR (retval); - } - /* Define long_name attribute. */ - const char *long_elem_types = "Specifies the shape of the elements"; - if ((retval = nc_put_att_text (context->ncid, context->var_elem_types_id, "long_name", strlen (long_elem_types), - long_elem_types))) { - ERR (retval); - } - /* Define _FillValue attribute */ - if ((retval - = nc_put_att_int (context->ncid, context->var_elem_types_id, "_FillValue", NC_INT, 1, &context->fillvalue32))) { - ERR (retval); - } - /* Define start_index attribute. */ - if ((retval - = nc_put_att_int (context->ncid, context->var_elem_types_id, "start_index", NC_INT, 1, &context->start_index))) { - ERR (retval); - } - - /*************************************************************************/ - - /* Define the element-tree_id variable. */ - if ((retval = nc_def_var (context->ncid, namespace_context->var_Mesh_elem_tree_id, NC_INT64, 1, - &context->nMesh_elem_dimid, &context->var_elem_tree_id))) { - ERR (retval); - } - /* Define whether contiguous or chunked storage is used for the variable */ - if ((retval - = nc_def_var_chunking (context->ncid, context->var_elem_tree_id, context->netcdf_var_storage_mode, NULL))) { - ERR (retval); - } - /* Define whether an independent or collective variable access is used */ -#if T8_ENABLE_NETCDF_PAR - if ((retval = nc_var_par_access (context->ncid, context->var_elem_tree_id, context->netcdf_mpi_access))) { - ERR (retval); - } -#endif - /* Define cf_role attribute */ - if ((retval = nc_put_att_text (context->ncid, context->var_elem_tree_id, "cf_role", - strlen (namespace_context->att_elem_tree_id), namespace_context->att_elem_tree_id))) { - ERR (retval); - } - /* Define long_name attribute. */ - const char *long_elem_prop = "Lists each elements tree_id"; - if ((retval = nc_put_att_text (context->ncid, context->var_elem_tree_id, "long_name", strlen (long_elem_prop), - long_elem_prop))) { - ERR (retval); - } - /* Define _FillValue attribute */ - if ((retval = nc_put_att_long (context->ncid, context->var_elem_tree_id, "_FillValue", NC_INT64, 1, - &context->fillvalue64))) { - ERR (retval); - } - /* Define start_index attribute. */ - if ((retval - = nc_put_att_int (context->ncid, context->var_elem_tree_id, "start_index", NC_INT, 1, &context->start_index))) { - ERR (retval); - } - - /*************************************************************************/ - - /* Define the element-nodes variable. */ - if ((retval = nc_def_var (context->ncid, namespace_context->var_Mesh_elem_node, NC_INT64, 2, context->dimids, - &context->var_elem_nodes_id))) { - ERR (retval); - } - /* Define whether contiguous or chunked storage is used for the variable */ - if ((retval - = nc_def_var_chunking (context->ncid, context->var_elem_nodes_id, context->netcdf_var_storage_mode, NULL))) { - ERR (retval); - } - /* Define whether an independent or collective variable access is used */ -#if T8_ENABLE_NETCDF_PAR - if ((retval = nc_var_par_access (context->ncid, context->var_elem_nodes_id, context->netcdf_mpi_access))) { - ERR (retval); - } -#endif - /* Define cf_role attribute */ - if ((retval = nc_put_att_text (context->ncid, context->var_elem_nodes_id, "cf_role", - strlen (namespace_context->att_elem_node_connectivity), - namespace_context->att_elem_node_connectivity))) { - ERR (retval); - } - /* Define long_name attribute. */ - const char *long_elem_nodes = "Lists the corresponding nodes to each element"; - if ((retval = nc_put_att_text (context->ncid, context->var_elem_nodes_id, "long_name", strlen (long_elem_nodes), - long_elem_nodes))) { - ERR (retval); - } - /* Define _FillValue attribute */ - if ((retval = nc_put_att_long (context->ncid, context->var_elem_nodes_id, "_FillValue", NC_INT64, 1, - &context->fillvalue64))) { - ERR (retval); - } - /* Define start_index attribute. */ - if ((retval - = nc_put_att_int (context->ncid, context->var_elem_nodes_id, "start_index", NC_INT, 1, &context->start_index))) { - ERR (retval); - } -} - -/* Declare the user-defined elementwise NetCDF-variables which were passed to function. */ -static void -t8_cmesh_write_user_netcdf_vars (t8_cmesh_netcdf_context_t *context, - __attribute__ ((unused)) t8_cmesh_netcdf_ugrid_namespace_t *namespace_context, - int num_extern_netcdf_vars, t8_netcdf_variable_t *ext_variables[], sc_MPI_Comm comm) -{ - /* Check whether user-defined variables should be written */ - if (num_extern_netcdf_vars > 0 && ext_variables != NULL) { - int retval, i; - int mpirank, mpisize; - - retval = sc_MPI_Comm_size (comm, &mpisize); - SC_CHECK_MPI (retval); - retval = sc_MPI_Comm_rank (comm, &mpirank); - SC_CHECK_MPI (retval); - - /* Iterate over the amount of user-defined variables */ - for (i = 0; i < num_extern_netcdf_vars; ++i) { - /* Check the variable data type */ - switch (ext_variables[i]->datatype) { - case T8_NETCDF_INT: - /* A netCDF 32bit integer variable will be declared */ - if ((retval = nc_def_var (context->ncid, ext_variables[i]->variable_name, NC_INT, 1, &context->nMesh_elem_dimid, - &(ext_variables[i]->var_user_dimid)))) { - ERR (retval); - } - break; - case T8_NETCDF_INT64: - /* A netCDF 64bit integer variable will be declared */ - if ((retval = nc_def_var (context->ncid, ext_variables[i]->variable_name, NC_INT64, 1, - &context->nMesh_elem_dimid, &(ext_variables[i]->var_user_dimid)))) { - ERR (retval); - } - break; - case T8_NETCDF_DOUBLE: - /* A netCDF Double-Variable will be declared */ - if ((retval = nc_def_var (context->ncid, ext_variables[i]->variable_name, NC_DOUBLE, 1, - &context->nMesh_elem_dimid, &(ext_variables[i]->var_user_dimid)))) { - ERR (retval); - break; - } - - /* Define whether contiguous or chunked storage is used for the variable */ - if ((retval = nc_def_var_chunking (context->ncid, ext_variables[i]->var_user_dimid, - context->netcdf_var_storage_mode, NULL))) { - ERR (retval); - } - /* Define whether an independent or collective variable access is used */ -#if T8_ENABLE_NETCDF_PAR - if ((retval - = nc_var_par_access (context->ncid, ext_variables[i]->var_user_dimid, context->netcdf_mpi_access))) { - ERR (retval); - } -#endif - } - - /* Attach the user-defined 'long_name' attribute to the variable */ - if ((retval - = nc_put_att_text (context->ncid, (ext_variables[i]->var_user_dimid), "long_name", - strlen (ext_variables[i]->variable_long_name), ext_variables[i]->variable_long_name))) { - ERR (retval); - } - /* Attach the user-defined 'units' attribute to the variable */ - if ((retval = nc_put_att_text (context->ncid, (ext_variables[i]->var_user_dimid), "units", - strlen (ext_variables[i]->variable_units), ext_variables[i]->variable_units))) { - ERR (retval); - } - } - } -} - -/* Write NetCDF-coordinate data */ -static void -t8_cmesh_write_netcdf_coordinate_data (t8_cmesh_t cmesh, t8_cmesh_netcdf_context_t *context, sc_MPI_Comm comm) -{ - double *vertices; - t8_eclass_t tree_class; - t8_locidx_t num_local_trees; - t8_locidx_t ltree_id = 0; - t8_gloidx_t local_tree_offset; - t8_gloidx_t num_it = 0; - int retval; - int mpirank, mpisize; - size_t num_elements; - size_t num_max_nodes_per_elem; - size_t num_nodes; - t8_nc_int64_t *Mesh_elem_nodes; - double *Mesh_node_x; - double *Mesh_node_y; - double *Mesh_node_z; - size_t start_ptr; - size_t count_ptr; - int i, j; - - retval = sc_MPI_Comm_size (comm, &mpisize); - SC_CHECK_MPI (retval); - retval = sc_MPI_Comm_rank (comm, &mpirank); - SC_CHECK_MPI (retval); - - /* Get number of local trees. */ - num_local_trees = t8_cmesh_get_num_local_trees (cmesh); - - /* Allocate the Variable-data that will be put out in the NetCDF variables */ - num_elements = (size_t) num_local_trees; - num_max_nodes_per_elem = (size_t) (context->nMaxMesh_elem_nodes); - num_nodes = (size_t) (context->nMesh_local_node); - Mesh_elem_nodes = T8_ALLOC (t8_nc_int64_t, num_elements * num_max_nodes_per_elem); - Mesh_node_x = T8_ALLOC (double, num_nodes); - Mesh_node_y = T8_ALLOC (double, num_nodes); - Mesh_node_z = T8_ALLOC (double, num_nodes); - - /* Check if pointers are not NULL. */ - T8_ASSERT (Mesh_node_x != NULL && Mesh_node_y != NULL && Mesh_node_z != NULL && Mesh_elem_nodes != NULL); - - /* Iterate over all local trees. */ - /* Corners should be stored in the same order as in a vtk-file (read that somewehere on a netcdf page). */ - local_tree_offset = t8_cmesh_get_first_treeid (cmesh); - for (ltree_id = 0; ltree_id < num_local_trees; ++ltree_id) { - tree_class = t8_cmesh_get_tree_class (cmesh, ltree_id); - vertices = t8_cmesh_get_tree_vertices (cmesh, ltree_id); - i = 0; - for (; i < t8_eclass_num_vertices[tree_class]; i++) { - /* Stores the x-, y- and z- coordinate of the nodes */ - Mesh_node_x[num_it] = vertices[3 * (t8_eclass_t8_to_vtk_corner_number[tree_class][i])]; - Mesh_node_y[num_it] = vertices[3 * (t8_eclass_t8_to_vtk_corner_number[tree_class][i]) + 1]; - Mesh_node_z[num_it] = vertices[3 * (t8_eclass_t8_to_vtk_corner_number[tree_class][i]) + 2]; - /* Stores the the nodes which correspond to this element. */ - Mesh_elem_nodes[(ltree_id) *context->nMaxMesh_elem_nodes + i] = local_tree_offset + num_it; - num_it++; - } - for (; i < context->nMaxMesh_elem_nodes; i++) { - /* Pre-fills the the elements corresponding nodes, if it is an element having less than nMaxMesh_elem_nodes. */ - Mesh_elem_nodes[(ltree_id) * (context->nMaxMesh_elem_nodes) + i] = -1; - } - } - - /* Write the data into the NetCDF coordinate variables. */ - /* Fill the 'Mesh_elem_node'-variable. */ - - /* Allocate memory for node offsets */ - t8_gloidx_t *node_offset[mpisize]; - - retval = sc_MPI_Allgather (&context->nMesh_local_node, 1, T8_MPI_GLOIDX, node_offset, 1, T8_MPI_GLOIDX, comm); - SC_CHECK_MPI (retval); - - /* Define a (2D) NetCDF-Hyperslab for filling the variable */ - const size_t start_ptr_var[2] = { local_tree_offset, 0 }; - const size_t count_ptr_var[2] = { num_local_trees, context->nMaxMesh_elem_nodes }; - if ((retval = nc_put_vara_long (context->ncid, context->var_elem_nodes_id, start_ptr_var, count_ptr_var, - &Mesh_elem_nodes[0]))) { - ERR (retval); - } - - /* Counters which imply the position in the NetCDF-variable where the data will be written, */ - start_ptr = 0; - for (j = 0; j < mpirank; ++j) { - start_ptr += (size_t) node_offset[j]; - } - count_ptr = (size_t) context->nMesh_local_node; - /* Write the x-coordinate data */ - if ((retval = nc_put_vara_double (context->ncid, context->var_node_x_id, &start_ptr, &count_ptr, &Mesh_node_x[0]))) { - ERR (retval); - } - /* Write the y-coordinate data */ - if ((retval = nc_put_vara_double (context->ncid, context->var_node_y_id, &start_ptr, &count_ptr, &Mesh_node_y[0]))) { - ERR (retval); - } - /* Write the z-coordinate data */ - if ((retval = nc_put_vara_double (context->ncid, context->var_node_z_id, &start_ptr, &count_ptr, &Mesh_node_z[0]))) { - ERR (retval); - } - - /* Free the allocated memory */ - T8_FREE (Mesh_node_x); - T8_FREE (Mesh_node_y); - T8_FREE (Mesh_node_z); - T8_FREE (Mesh_elem_nodes); -} - -static void -t8_cmesh_write_netcdf_data (t8_cmesh_t cmesh, t8_cmesh_netcdf_context_t *context, sc_MPI_Comm comm) -{ - t8_eclass_t tree_class; - t8_gloidx_t gtree_id; - t8_locidx_t num_local_trees; - t8_locidx_t ltree_id = 0; - t8_nc_int64_t *Mesh_elem_tree_id; - t8_nc_int32_t *Mesh_elem_types; - t8_gloidx_t num; - t8_gloidx_t num_nodes; - size_t start_ptr; - size_t count_ptr; - int retval; - - /* Get number of local trees. */ - num_local_trees = t8_cmesh_get_num_local_trees (cmesh); - - /* Declare variables with their proper dimensions. */ - Mesh_elem_types = T8_ALLOC (t8_nc_int32_t, num_local_trees); - Mesh_elem_tree_id = T8_ALLOC (t8_nc_int64_t, num_local_trees); - - /* Check if pointers are not NULL. */ - T8_ASSERT (Mesh_elem_types != NULL && Mesh_elem_tree_id != NULL); - - /* Determine the number of nodes. */ - num = 0; - for (ltree_id = 0; ltree_id < num_local_trees; ++ltree_id) { - tree_class = t8_cmesh_get_tree_class (cmesh, ltree_id); - num += t8_eclass_num_vertices[tree_class]; - /* Store the element class of the cmesh-element at the global_id position. */ - gtree_id = t8_cmesh_get_global_id (cmesh, ltree_id); - /* Getting the integer element class (in vtk_type), might not be conform with UGRID? */ - Mesh_elem_types[ltree_id] = t8_eclass_vtk_type[tree_class]; - /* The number trees equals the number of elements in the cmesh. */ - Mesh_elem_tree_id[ltree_id] = gtree_id; - } - - /* Write the data in the corresponding NetCDF-variable. */ - /* Fill the 'Mesh_elem_types'-variable. */ - /* Define the pointer where to write the data an how much entries */ - start_ptr = (size_t) t8_cmesh_get_first_treeid (cmesh); - count_ptr = (size_t) num_local_trees; - if ((retval - = nc_put_vara_int (context->ncid, context->var_elem_types_id, &start_ptr, &count_ptr, &Mesh_elem_types[0]))) { - ERR (retval); - } - if ((retval - = nc_put_vara_long (context->ncid, context->var_elem_tree_id, &start_ptr, &count_ptr, &Mesh_elem_tree_id[0]))) { - ERR (retval); - } - - /* Free the allocated memory */ - T8_FREE (Mesh_elem_types); - T8_FREE (Mesh_elem_tree_id); - - /* After counting the number of nodes, the NetCDF-dimension 'nMesh_node' can be created => Store the 'nMesh_node' dimension */ - context->nMesh_local_node = num; - retval = sc_MPI_Allreduce (&num, &num_nodes, 1, T8_MPI_GLOIDX, sc_MPI_SUM, comm); - SC_CHECK_MPI (retval); - context->nMesh_node = num_nodes; -} - -/* Function that writes user-defined data to user-defined variables, if some were passed */ -/* It is only possible to write exactly one value per element per variable */ -static void -t8_cmesh_write_user_netcdf_data (t8_cmesh_t cmesh, t8_cmesh_netcdf_context_t *context, int num_extern_netcdf_vars, - t8_netcdf_variable_t *ext_variables[], __attribute__ ((unused)) sc_MPI_Comm comm) -{ - if (num_extern_netcdf_vars > 0 && ext_variables != NULL) { - int retval, i; - size_t start_ptr; - size_t count_ptr; - - /* Counters which imply the position in the NetCDF-variable where the data will be written, */ - start_ptr = (size_t) t8_cmesh_get_first_treeid (cmesh); - count_ptr = (size_t) t8_cmesh_get_num_local_trees (cmesh); - /* Iterate over the amount of user-defined variables */ - for (i = 0; i < num_extern_netcdf_vars; ++i) { - /* Check if exactly one value per element is given */ - T8_ASSERT (count_ptr == ext_variables[i]->var_user_data->elem_count); - /* Check the variable data type */ - switch (ext_variables[i]->datatype) { - case T8_NETCDF_INT: - /* NetCDF 32bit integer data will be written */ - if ((retval = nc_put_vara_int (context->ncid, ext_variables[i]->var_user_dimid, &start_ptr, &count_ptr, - (t8_nc_int32_t *) sc_array_index (ext_variables[i]->var_user_data, 0)))) { - ERR (retval); - } - break; - case T8_NETCDF_INT64: - /* NetCDF 64bit integer data will be written */ - if ((retval = nc_put_vara_long (context->ncid, ext_variables[i]->var_user_dimid, &start_ptr, &count_ptr, - (t8_nc_int64_t *) sc_array_index (ext_variables[i]->var_user_data, 0)))) { - ERR (retval); - } - break; - case T8_NETCDF_DOUBLE: - /* NetCDF double data will be written */ - if ((retval = nc_put_vara_double (context->ncid, ext_variables[i]->var_user_dimid, &start_ptr, &count_ptr, - (double *) sc_array_index (ext_variables[i]->var_user_data, 0)))) { - ERR (retval); - } - break; - } - } - } -} - -/* Function that creates the NetCDF-File and fills it */ -static void -t8_cmesh_write_netcdf_file (t8_cmesh_t cmesh, t8_cmesh_netcdf_context_t *context, - t8_cmesh_netcdf_ugrid_namespace_t *namespace_context, int num_extern_netcdf_vars, - t8_netcdf_variable_t *ext_variables[], sc_MPI_Comm comm) -{ - int retval; - t8_gloidx_t num_global_trees; - - /* Check if the cmesh was committed. */ - T8_ASSERT (t8_cmesh_is_committed (cmesh)); - - /* Global number of trees - equals the number of elements in a cmesh. */ - num_global_trees = t8_cmesh_get_num_trees (cmesh); - - /* Store the number of elements in the NetCDF-Context */ - context->nMesh_elem = num_global_trees; - - /* Create the NetCDF file, the NC_CLOBBER parameter tells netCDF to overwrite this file, if it already exists. Leaves the file in 'define-mode'. */ - /* Since NetCDF version 4.6.2 NC_MPIIO seems to be redundant/not necessary */ -#if T8_ENABLE_NETCDF_PAR - if ((retval = nc_create_par (context->filename, NC_CLOBBER | NC_NETCDF4 | NC_MPIIO, comm, sc_MPI_INFO_NULL, - &context->ncid))) { - ERR (retval); - } -#else - if ((retval = nc_create (context->filename, NC_CLOBBER | NC_NETCDF4, &context->ncid))) { - ERR (retval); - } -#endif - t8_debugf ("NetCDf-file has been created.\n"); - - /* Define the first NetCDF-dimensions (nMesh_node is not known yet) */ - t8_cmesh_write_netcdf_dimensions (context, namespace_context); - - /* Define NetCDF-variables */ - t8_cmesh_write_netcdf_variables (context, namespace_context); - - /* Disable the default fill-value-mode. */ - if ((retval = nc_set_fill (context->ncid, NC_NOFILL, &context->old_fill_mode))) { - ERR (retval); - } - - /* *Define global attributes* */ - - /* Define title attribute */ - if ((retval = nc_put_att_text (context->ncid, NC_GLOBAL, "title", strlen (context->filetitle), context->filetitle))) { - ERR (retval); - } - /* Define convention attribute */ - if ((retval - = nc_put_att_text (context->ncid, NC_GLOBAL, "convention", strlen (context->convention), context->convention))) { - ERR (retval); - } - - /* End define-mode. NetCDF-file enters data-mode. */ - if ((retval = nc_enddef (context->ncid))) { - ERR (retval); - } - - /* Fill the already defined NetCDF-variables and calculate the 'nMesh_node' (global number of nodes) -dimension */ - t8_cmesh_write_netcdf_data (cmesh, context, comm); - - /* Leave the NetCDF-data-mode and re-enter the define-mode. */ - if ((retval = nc_redef (context->ncid))) { - ERR (retval); - } - - /* Define the NetCDF-dimension 'nMesh_node' */ - t8_cmesh_write_netcdf_coordinate_dimension (context, namespace_context); - - /* Define the NetCDF-coordinate variables */ - t8_cmesh_write_netcdf_coordinate_variables (context, namespace_context); - - /* Eventuallay declare user-defined elementwise NetCDF-variables, if some were passed */ - t8_cmesh_write_user_netcdf_vars (context, namespace_context, num_extern_netcdf_vars, ext_variables, comm); - - /* Disable the default fill-value-mode. */ - if ((retval = nc_set_fill (context->ncid, NC_NOFILL, &context->old_fill_mode))) { - ERR (retval); - } - - /* End define-mode. NetCDF-file enters data-mode. */ - if ((retval = nc_enddef (context->ncid))) { - ERR (retval); - } - /* Write the NetCDF-coordinate variable data */ - t8_cmesh_write_netcdf_coordinate_data (cmesh, context, comm); - - /* Eventually write user-defined variable data */ - t8_cmesh_write_user_netcdf_data (cmesh, context, num_extern_netcdf_vars, ext_variables, comm); - - /* All data has been written to the NetCDF-file, therefore, close the file. */ - if ((retval = nc_close (context->ncid))) { - ERR (retval); - } - t8_debugf ("The NetCDF-File has been written and closed.\n"); -} - -/* Function that gets called if a cmesh should be written in NetCDF-Format */ -void -t8_cmesh_write_netcdf (t8_cmesh_t cmesh, const char *file_prefix, const char *file_title, int dim, - int num_extern_netcdf_vars, t8_netcdf_variable_t *ext_variables[], sc_MPI_Comm comm) -{ - t8_cmesh_netcdf_context_t context; - /* Check whether pointers are not NULL */ - T8_ASSERT (file_title != NULL); - T8_ASSERT (file_prefix != NULL); - char file_name[BUFSIZ]; - int retval; - int mpirank, mpisize; - - /* Size of the communicator */ - retval = sc_MPI_Comm_size (comm, &mpisize); - SC_CHECK_MPI (retval); - /* Get the rank of the process */ - retval = sc_MPI_Comm_rank (comm, &mpirank); - SC_CHECK_MPI (retval); - - /* Prevent the single file to be overwritten if more processes are involved */ - if (mpisize > 1) { - /* Create the NetCDF-Filename for each process */ - snprintf (file_name, BUFSIZ, "%s_rank_%d.nc", file_prefix, mpirank); - } - else { - /* Create the NetCDF-Filename */ - snprintf (file_name, BUFSIZ, "%s.nc", file_prefix); - } - - /* Initialize first variables for NetCDF purposes. */ - context.filename = file_name; - context.filetitle = file_title; - context.dim = dim; - context.fillvalue32 = -1; - context.fillvalue64 = -1; - context.start_index = 0; - context.convention = "UGRID v1.0"; - /* Set the netCDF per variable storage and mpi-access patterns (only if parallel netCDF routines are accessible) */ -#if T8_ENABLE_NETCDF_PAR - context.netcdf_var_storage_mode = NC_CONTIGUOUS; - context.netcdf_mpi_access = NC_INDEPENDENT; -#endif - /* Get the max number of corners for elements in a specific dimension */ - context.nMaxMesh_elem_nodes = t8_element_shape_max_num_corner[dim]; - t8_cmesh_netcdf_ugrid_namespace_t namespace_context; - t8_cmesh_init_ugrid_namespace_context (&namespace_context, dim); - /* Check the dimension of the cmesh (only 2D and 3D are supported) */ - if (dim < 2 || dim > 3) { - t8_global_errorf ("Only writing 2D and 3D netCDF cmesh data is supported.\n"); - } - else { - t8_debugf ("Writing a %dD cmesh to netCDF.\n", dim); - /* Actually writing the NetCDF dimensions, variables and data */ - t8_cmesh_write_netcdf_file (cmesh, &context, &namespace_context, num_extern_netcdf_vars, ext_variables, comm); - } -} diff --git a/src/t8_cmesh/t8_cmesh_io/t8_cmesh_netcdf.h b/src/t8_cmesh/t8_cmesh_io/t8_cmesh_netcdf.h deleted file mode 100644 index 23caf3f006..0000000000 --- a/src/t8_cmesh/t8_cmesh_io/t8_cmesh_netcdf.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - This file is part of t8code. - t8code is a C library to manage a collection (a forest) of multiple - connected adaptive space-trees of general element classes in parallel. - - Copyright (C) 2015 the developers - - t8code is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - t8code is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with t8code; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -/** \file t8_cmesh_netcdf.h - * The Header-File providing a function to write out a cmesh in a NetCDF-4 file. - */ - -#ifndef T8_CMESH_NETCDF_H -#define T8_CMESH_NETCDF_H - -#include -#include - -T8_EXTERN_C_BEGIN (); - -/** Creates a netCDF-4 file containing the (geometrical) information about the given cmesh and additional elementwise data variables - * \param [in] cmesh A cmesh. - * \param [in] file_prefix A string which holds the file's name (output file will be 'file_prefix.nc'). - * \param [in] file_title A string to caption the NetCDF-File. - * \param [in] dim The Dimension of the cmesh (2D or 3D). - * \param [in] num_extern_netcdf_vars The number of extern user-defined variables which hold elementwise data (if none, set it to 0). - * \param [in] variables An array of pointers of the herein before mentioned user-defined variables (if none, set it to NULL). - * \param [in] comm The sc_MPI_Communicator to use. - */ -void -t8_cmesh_write_netcdf (t8_cmesh_t cmesh, const char *file_prefix, const char *file_title, int dim, - int num_extern_netcdf_vars, t8_netcdf_variable_t *variables[], sc_MPI_Comm comm); - -T8_EXTERN_C_END (); - -#endif /* !T8_CMESH_NETCDF_H */ diff --git a/src/t8_forest/t8_forest_netcdf.cxx b/src/t8_forest/t8_forest_netcdf.cxx deleted file mode 100644 index 1106f245df..0000000000 --- a/src/t8_forest/t8_forest_netcdf.cxx +++ /dev/null @@ -1,1067 +0,0 @@ -/* - This file is part of t8code. - t8code is a C library to manage a collection (a forest) of multiple - connected adaptive space-trees of general element classes in parallel. - - Copyright (C) 2015 the developers - - t8code is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - t8code is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with t8code; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -/** \file t8_forest_netcdf.cxx - * Implements functions declared in \ref t8_forest_netcdf.h. - * These functions write a file in the NetCDF-format which represents the given 2D- or 3D-forest - */ - -#include -#include -/** Standard netcdf error code */ -#define ERRCODE 2 -/** Standard netcdf error function */ -#define ERR(e) \ - { \ - t8_global_productionf ("Error: %s\n", nc_strerror (e)); \ - exit (ERRCODE); \ - } -#ifndef NC_CONTIGUOUS -/** Storage mode for netcdf variables. */ -#define NC_CONTIGUOUS 1 -#endif -#if T8_ENABLE_NETCDF_PAR -#include -#else -/* Macros usually defined in 'netcdf_par.h' */ -#ifndef NC_INDEPENDENT -#define NC_INDEPENDENT 0 -#endif -#ifndef NC_COLLECTIVE -#define NC_COLLECTIVE 1 -#endif -#endif -#include -#include -#include -#include -#include - -/** We want to export the whole implementation to be callable from "C". */ -T8_EXTERN_C_BEGIN (); - -/** - * This struct contains all Variables used in order to work with the NetCDF-File - */ -typedef struct -{ - const char *filename; /**< The file name.*/ - const char *filetitle; /**< The file title.*/ - int dim; /**< The number of spatial dimensions. */ - t8_gloidx_t nMesh_elem; /**< The number of mesh elements. */ - t8_gloidx_t nMesh_node; /**< The number of mesh nodes. */ - t8_gloidx_t nMesh_local_node; /**< The number of local nodes in the cmesh */ - int nMaxMesh_elem_nodes; /**< The maximum number of nodes per element */ - /* Declaring NetCDF-dimension ids */ - int nMesh_elem_dimid; /**< The NetCDF-dimension id for the number of elements */ - int nMaxMesh_elem_nodes_dimid; /**< The NetCDF-dimension id for the maximum number of nodes per element */ - int nMesh_node_dimid; /**< The NetCDF-dimension id for the number of nodes */ - /* Declaring NetCDF-variables ids */ - int ncid; /**< The NetCDF-file id */ - int var_elem_tree_id; /**< The NetCDF-variable id for the element tree id */ - int var_elem_types_id; /**< The NetCDF-variable id for the element types */ - int var_elem_nodes_id; /**< The NetCDF-variable id for the element nodes */ - int var_mesh_id; /**< The NetCDF-variable id for the mesh */ - int var_node_x_id; /**< The NetCDF-variable id for the x-coordinates of the nodes */ - int var_node_y_id; /**< The NetCDF-variable id for the y-coordinates of the nodes */ - int var_node_z_id; /**< The NetCDF-variable id for the z-coordinates of the nodes */ - int dimids[2]; /**< contains two NetCDF-dimensions in order to declare two-dimensional NetCDF-variables */ - /* Variables used for default NetCDF purposes */ - t8_nc_int32_t fillvalue32; /**< The fill value for 32-bit integer variables */ - t8_nc_int64_t fillvalue64; /**< The fill value for 64-bit integer variables */ - t8_nc_int32_t start_index; /**< The start index for NetCDF-variables */ - const char *convention; /**< The NetCDF-convention used (e.g., "UGRID") */ - int netcdf_var_storage_mode; /**< The storage mode for NetCDF-variables (e.g., "chunked") */ - int netcdf_mpi_access; /**< The MPI-access mode for NetCDF (e.g., "MPI-IO") */ - /* Stores the old NetCDF-FillMode if it gets changed */ - int old_fill_mode; /**< The old NetCDF-FillMode if it gets changed */ - -} t8_forest_netcdf_context_t; - -/** - * This struct contains the Definitions for the NetCDF-dimensions/-variables/-attributes - * (vary whether a 2D or 3D Mesh will be outputted) - * */ -typedef struct -{ - const char *mesh; /**< The name of the mesh */ - const char *dim_nMesh_node; /**< The name of the dimension for the number of nodes in the mesh*/ - const char *dim_nMesh_elem; /**< The name of the dimension for the number of elements in the mesh */ - const char - *dim_nMaxMesh_elem_nodes; /**< The name of the dimension for the maximum number of nodes per element in the mesh */ - const char *var_Mesh_node_x; /**< The name of the variable for the x-coordinates of the nodes in the mesh*/ - const char *var_Mesh_node_y; /**< The name of the variable for the y-coordinates of the nodes in the mesh*/ - const char *var_Mesh_node_z; /**< The name of the variable for the z-coordinates of the nodes in the mesh*/ - const char *var_Mesh_elem_types; /**< The name of the variable for the element types in the mesh */ - const char *var_Mesh_elem_tree_id; /**< The name of the variable for the element tree id in the mesh */ - const char *var_Mesh_elem_node; /**< The name of the variable for the element nodes in the mesh */ - const char *att_elem_shape_type; /**< The name of the attribute for the element shape type */ - const char *att_elem_node_connectivity; /**< The name of the attribute for the element node connectivity */ - const char *att_elem_tree_id; /**< The name of the attribute for the element tree id */ - const char *att_elem_node; /**< The name of the attribute for the element nodes */ -} t8_forest_netcdf_ugrid_namespace_t; - -/** The UGRID conventions are applied for dimension and variable descriptions */ -static void -t8_forest_init_ugrid_namespace_context (t8_forest_netcdf_ugrid_namespace_t *namespace_conv, int dim) -{ - if (dim == 2) { - /* UGRID 2D Grid name conventions */ - namespace_conv->mesh = "Mesh2"; - namespace_conv->dim_nMesh_node = "nMesh2_node"; - namespace_conv->dim_nMesh_elem = "nMesh2_face"; - namespace_conv->dim_nMaxMesh_elem_nodes = "nMaxMesh2_face_nodes"; - namespace_conv->var_Mesh_node_x = "Mesh2_node_x"; - namespace_conv->var_Mesh_node_y = "Mesh2_node_y"; - namespace_conv->var_Mesh_node_z = "Mesh2_node_z"; - namespace_conv->var_Mesh_elem_types = "Mesh2_face_types"; - namespace_conv->var_Mesh_elem_tree_id = "Mesh2_face_tree_id"; - namespace_conv->var_Mesh_elem_node = "Mesh2_face_nodes"; - namespace_conv->att_elem_shape_type = "face_shape_type"; - namespace_conv->att_elem_node_connectivity = "face_node_connectivity"; - namespace_conv->att_elem_tree_id = "face_tree_id"; - namespace_conv->att_elem_node = "Mesh2_node_x Mesh2_node_y Mesh2_node_z"; - } - else if (dim == 3) { - /* UGRID 3D name conventions */ - namespace_conv->mesh = "Mesh3D"; - namespace_conv->dim_nMesh_node = "nMesh3D_node"; - namespace_conv->dim_nMesh_elem = "nMesh3D_vol"; - namespace_conv->dim_nMaxMesh_elem_nodes = "nMaxMesh3D_vol_nodes"; - namespace_conv->var_Mesh_node_x = "Mesh3D_node_x"; - namespace_conv->var_Mesh_node_y = "Mesh3D_node_y"; - namespace_conv->var_Mesh_node_z = "Mesh3D_node_z"; - namespace_conv->var_Mesh_elem_types = "Mesh3D_vol_types"; - namespace_conv->var_Mesh_elem_tree_id = "Mesh3D_vol_tree_id"; - namespace_conv->var_Mesh_elem_node = "Mesh3D_vol_nodes"; - namespace_conv->att_elem_shape_type = "volume_shape_type"; - namespace_conv->att_elem_node_connectivity = "volume_node_connectivity"; - namespace_conv->att_elem_tree_id = "volume_tree_id"; - namespace_conv->att_elem_node = "Mesh3D_node_x Mesh3D_node_y Mesh3D_node_z"; - } -} - -/** Define NetCDF-dimensions */ -static void -t8_forest_write_netcdf_dimensions ([[maybe_unused]] t8_forest_netcdf_context_t *context, - [[maybe_unused]] t8_forest_netcdf_ugrid_namespace_t *namespace_context) -{ - /* *Define dimensions in the NetCDF file.* */ - - /* Return value in order to check NetCDF commands */ - int retval; - /* Define dimension: number of elements */ - if ((retval = nc_def_dim (context->ncid, namespace_context->dim_nMesh_elem, context->nMesh_elem, - &context->nMesh_elem_dimid))) { - ERR (retval); - } - - /* Define dimension: maximum node number per element */ - if ((retval = nc_def_dim (context->ncid, namespace_context->dim_nMaxMesh_elem_nodes, context->nMaxMesh_elem_nodes, - &context->nMaxMesh_elem_nodes_dimid))) { - ERR (retval); - } - - /* Store the ID of the dimensions. */ - context->dimids[0] = context->nMesh_elem_dimid; - context->dimids[1] = context->nMaxMesh_elem_nodes_dimid; - - t8_debugf ("First NetCDF-dimensions were defined.\n"); -} - -/** Define NetCDF-variables */ -static void -t8_forest_write_netcdf_variables ([[maybe_unused]] t8_forest_netcdf_context_t *context, - [[maybe_unused]] t8_forest_netcdf_ugrid_namespace_t *namespace_context) -{ - /* *Define variables in the NetCDF file.* */ - - /* Return value in order to check NetCDF commands */ - int retval; - - /* Define a general describing Mesh-variable */ - if ((retval = nc_def_var (context->ncid, namespace_context->mesh, NC_INT, 0, 0, &context->var_mesh_id))) { - ERR (retval); - } - - /* Define cf_role attribute */ - const char *role_mesh = "mesh_topology"; - if ((retval = nc_put_att_text (context->ncid, context->var_mesh_id, "cf_role", strlen (role_mesh), role_mesh))) { - ERR (retval); - } - - /* Define long_name attribute. */ - const char *long_mesh = "Topology data of unstructured tree-based mesh"; - if ((retval = nc_put_att_text (context->ncid, context->var_mesh_id, "long_name", strlen (long_mesh), long_mesh))) { - ERR (retval); - } - - /* Define topology_dimension attribute */ - if ((retval = nc_put_att_int (context->ncid, context->var_mesh_id, "topology_dimension", NC_INT, 1, &context->dim))) { - ERR (retval); - } - - /* Define node_coordinates attribute */ - if ((retval = nc_put_att_text (context->ncid, context->var_mesh_id, "node_coordinates", - strlen (namespace_context->att_elem_node), namespace_context->att_elem_node))) { - ERR (retval); - } - /* Define elem_shape_type attribute */ - if ((retval - = nc_put_att_text (context->ncid, context->var_mesh_id, namespace_context->att_elem_shape_type, - strlen (namespace_context->var_Mesh_elem_types), namespace_context->var_Mesh_elem_types))) { - ERR (retval); - } - /* Define elem_node_connectivity attribute */ - if ((retval - = nc_put_att_text (context->ncid, context->var_mesh_id, namespace_context->att_elem_node_connectivity, - strlen (namespace_context->var_Mesh_elem_node), namespace_context->var_Mesh_elem_node))) { - ERR (retval); - } - /* Define elem_tree_id attribute */ - if ((retval = nc_put_att_text (context->ncid, context->var_mesh_id, namespace_context->att_elem_tree_id, - strlen (namespace_context->var_Mesh_elem_tree_id), - namespace_context->var_Mesh_elem_tree_id))) { - ERR (retval); - } - /*************************************************************************/ - - /* Define the element-type variable in the NetCDF-file. */ - if ((retval = nc_def_var (context->ncid, namespace_context->var_Mesh_elem_types, NC_INT, 1, - &context->nMesh_elem_dimid, &context->var_elem_types_id))) { - ERR (retval); - } - /* Define whether a contiguous or chunked storage is used for the variable */ - if ((retval - = nc_def_var_chunking (context->ncid, context->var_elem_types_id, context->netcdf_var_storage_mode, NULL))) { - ERR (retval); - } - /* Define whether an independent or collective variable access is used */ -#if T8_ENABLE_NETCDF_PAR - if ((retval = nc_var_par_access (context->ncid, context->var_elem_types_id, context->netcdf_mpi_access))) { - ERR (retval); - } -#endif - /* Define cf_role attribute */ - if ((retval - = nc_put_att_text (context->ncid, context->var_elem_types_id, "cf_role", - strlen (namespace_context->att_elem_shape_type), namespace_context->att_elem_shape_type))) { - ERR (retval); - } - /* Define long_name attribute. */ - const char *long_elem_types = "Specifies the shape of the elements"; - if ((retval = nc_put_att_text (context->ncid, context->var_elem_types_id, "long_name", strlen (long_elem_types), - long_elem_types))) { - ERR (retval); - } - /* Define _FillValue attribute */ - if ((retval - = nc_put_att_int (context->ncid, context->var_elem_types_id, "_FillValue", NC_INT, 1, &context->fillvalue32))) { - ERR (retval); - } - /* Define start_index attribute. */ - if ((retval - = nc_put_att_int (context->ncid, context->var_elem_types_id, "start_index", NC_INT, 1, &context->start_index))) { - ERR (retval); - } - - /*************************************************************************/ - - /* Define the element-tree_id variable. */ - if ((retval = nc_def_var (context->ncid, namespace_context->var_Mesh_elem_tree_id, NC_INT64, 1, - &context->nMesh_elem_dimid, &context->var_elem_tree_id))) { - ERR (retval); - } - /* Define whether a contiguous or chunked storage is used for the variable */ - if ((retval - = nc_def_var_chunking (context->ncid, context->var_elem_tree_id, context->netcdf_var_storage_mode, NULL))) { - ERR (retval); - } - /* Define whether an independent or collective variable access is used */ -#if T8_ENABLE_NETCDF_PAR - if ((retval = nc_var_par_access (context->ncid, context->var_elem_tree_id, context->netcdf_mpi_access))) { - ERR (retval); - } -#endif - /* Define cf_role attribute */ - if ((retval = nc_put_att_text (context->ncid, context->var_elem_tree_id, "cf_role", - strlen (namespace_context->att_elem_tree_id), namespace_context->att_elem_tree_id))) { - ERR (retval); - } - /* Define long_name attribute. */ - const char *long_elem_prop = "Lists each elements tree_id"; - if ((retval = nc_put_att_text (context->ncid, context->var_elem_tree_id, "long_name", strlen (long_elem_prop), - long_elem_prop))) { - ERR (retval); - } - /* Define _FillValue attribute */ - if ((retval = nc_put_att_long (context->ncid, context->var_elem_tree_id, "_FillValue", NC_INT64, 1, - &context->fillvalue64))) { - ERR (retval); - } - /* Define start_index attribute. */ - if ((retval - = nc_put_att_int (context->ncid, context->var_elem_tree_id, "start_index", NC_INT, 1, &context->start_index))) { - ERR (retval); - } - - /*************************************************************************/ - - /* Define the element-nodes variable. */ - if ((retval = nc_def_var (context->ncid, namespace_context->var_Mesh_elem_node, NC_INT64, 2, context->dimids, - &context->var_elem_nodes_id))) { - ERR (retval); - } - /* Define whether a contiguous or chunked storage is used for the variable */ - if ((retval - = nc_def_var_chunking (context->ncid, context->var_elem_nodes_id, context->netcdf_var_storage_mode, NULL))) { - ERR (retval); - } - /* Define whether an independent or collective variable access is used */ -#if T8_ENABLE_NETCDF_PAR - if ((retval = nc_var_par_access (context->ncid, context->var_elem_nodes_id, context->netcdf_mpi_access))) { - ERR (retval); - } -#endif - /* Define cf_role attribute */ - if ((retval = nc_put_att_text (context->ncid, context->var_elem_nodes_id, "cf_role", - strlen (namespace_context->att_elem_node_connectivity), - namespace_context->att_elem_node_connectivity))) { - ERR (retval); - } - /* Define long_name attribute. */ - const char *long_elem_nodes = "Lists the corresponding nodes to each element"; - if ((retval = nc_put_att_text (context->ncid, context->var_elem_nodes_id, "long_name", strlen (long_elem_nodes), - long_elem_nodes))) { - ERR (retval); - } - /* Define _FillValue attribute */ - if ((retval = nc_put_att_long (context->ncid, context->var_elem_nodes_id, "_FillValue", NC_INT64, 1, - &context->fillvalue64))) { - ERR (retval); - } - /* Define start_index attribute. */ - if ((retval - = nc_put_att_int (context->ncid, context->var_elem_nodes_id, "start_index", NC_INT, 1, &context->start_index))) { - ERR (retval); - } -} - -/** - * Fill the already defined NetCDF-variables and calculate the 'nMesh_node' (global number of nodes) -dimension - * - * \param[in] forest The forest. - * \param[in,out] context Data required to work with the NetCDF file. - * \param[in] comm The MPI communicator. -*/ -static void -t8_forest_write_netcdf_data ([[maybe_unused]] t8_forest_t forest, [[maybe_unused]] t8_forest_netcdf_context_t *context, - [[maybe_unused]] sc_MPI_Comm comm) -{ - t8_eclass_t tree_class; - t8_locidx_t num_local_trees; - t8_locidx_t num_local_elements; - t8_locidx_t ltree_id; - t8_locidx_t local_elem_id; - t8_locidx_t num_local_tree_elem; - t8_element_shape_t element_shape; - t8_locidx_t local_tree_offset; - t8_gloidx_t first_local_elem_id; - t8_gloidx_t num_local_nodes; - t8_gloidx_t num_nodes; - int *Mesh_elem_types; - t8_nc_int64_t *Mesh_elem_tree_id; - size_t start_ptr; - size_t count_ptr; - int retval; - const t8_scheme *scheme = t8_forest_get_scheme (forest); - - /* Get the first local element id in a forest (function is collective) */ - first_local_elem_id = t8_forest_get_first_local_leaf_element_id (forest); - - /* Get number of local trees. */ - num_local_trees = t8_forest_get_num_local_trees (forest); - - /* Ger number of local elements */ - num_local_elements = t8_forest_get_local_num_leaf_elements (forest); - - /* Declare variables with their proper dimensions. */ - Mesh_elem_types = T8_ALLOC (int, num_local_elements); - Mesh_elem_tree_id = T8_ALLOC (t8_nc_int64_t, num_local_elements); - - /* Check if pointers are not NULL. */ - T8_ASSERT (Mesh_elem_types != NULL && Mesh_elem_tree_id != NULL); - - /* Counts the number of nodes */ - num_local_nodes = 0; - /* Iterate over all local trees and their respective elements */ - for (ltree_id = 0; ltree_id < num_local_trees; ltree_id++) { - num_local_tree_elem = t8_forest_get_tree_num_leaf_elements (forest, ltree_id); - tree_class = t8_forest_get_tree_class (forest, ltree_id); - /* Computing the local tree offset */ - local_tree_offset = t8_forest_get_tree_element_offset (forest, ltree_id); - /* Iterate over all local elements in the local tree */ - for (local_elem_id = 0; local_elem_id < num_local_tree_elem; local_elem_id++) { - /* Get the local element in the local tree */ - const t8_element_t *element = t8_forest_get_leaf_element_in_tree (forest, ltree_id, local_elem_id); - /* Determine the element shape */ - element_shape = scheme->element_get_shape (tree_class, element); - /* Store the type of the element in its global index position */ - Mesh_elem_types[(local_tree_offset + local_elem_id)] = t8_element_shape_vtk_type (element_shape); - /* Store the elements tree_id in its global index position */ - Mesh_elem_tree_id[(local_tree_offset + local_elem_id)] = t8_forest_global_tree_id (forest, ltree_id); - /* Adding the number of corners of this elements shape to the counter */ - num_local_nodes += t8_element_shape_num_vertices (element_shape); - } - } - /* Write the data in the corresponding NetCDF-variable. */ - /* Fill the 'Mesh_elem_types'-variable. */ - start_ptr = (size_t) first_local_elem_id; - count_ptr = (size_t) num_local_elements; - if ((retval - = nc_put_vara_int (context->ncid, context->var_elem_types_id, &start_ptr, &count_ptr, &Mesh_elem_types[0]))) { - ERR (retval); - } - /* Fill the 'Mesh_elem_tree_id'-variable. */ - if ((retval - = nc_put_vara_long (context->ncid, context->var_elem_tree_id, &start_ptr, &count_ptr, &Mesh_elem_tree_id[0]))) { - ERR (retval); - } - /* Free the allocated memory */ - T8_FREE (Mesh_elem_types); - T8_FREE (Mesh_elem_tree_id); - - /* Store the number of local nodes */ - context->nMesh_local_node = num_local_nodes; - /* Gather the number of all global nodes */ - retval = sc_MPI_Allreduce (&num_local_nodes, &num_nodes, 1, T8_MPI_GLOIDX, sc_MPI_SUM, comm); - SC_CHECK_MPI (retval); - - /* After counting the number of nodes, the NetCDF-dimension 'nMesh_node' can be created => Store the 'nMesh_node' dimension */ - context->nMesh_node = num_nodes; -} - -/* Define NetCDF-coordinate-dimension */ -static void -t8_forest_write_netcdf_coordinate_dimension ([[maybe_unused]] t8_forest_netcdf_context_t *context, - [[maybe_unused]] t8_forest_netcdf_ugrid_namespace_t *namespace_context) -{ - /* Define dimension: number of nodes */ - int retval; - if ((retval = nc_def_dim (context->ncid, namespace_context->dim_nMesh_node, context->nMesh_node, - &context->nMesh_node_dimid))) { - ERR (retval); - } -} - -/** Define NetCDF-coordinate-variables */ -static void -t8_forest_write_netcdf_coordinate_variables ([[maybe_unused]] t8_forest_netcdf_context_t *context, - [[maybe_unused]] t8_forest_netcdf_ugrid_namespace_t *namespace_context) -{ - /* Define the Mesh_node_x variable. */ - int retval; - if ((retval = nc_def_var (context->ncid, namespace_context->var_Mesh_node_x, NC_DOUBLE, 1, &context->nMesh_node_dimid, - &context->var_node_x_id))) { - ERR (retval); - } - /* Define whether contiguous or chunked storage is used for the variable */ - if ((retval = nc_def_var_chunking (context->ncid, context->var_node_x_id, context->netcdf_var_storage_mode, NULL))) { - ERR (retval); - } - /* Define whether an independent or collective variable access is used */ -#if T8_ENABLE_NETCDF_PAR - if ((retval = nc_var_par_access (context->ncid, context->var_node_x_id, context->netcdf_mpi_access))) { - ERR (retval); - } -#endif - /* Define standard_name attribute. */ - const char *standard_node_x = "Longitude"; - if ((retval = nc_put_att_text (context->ncid, context->var_node_x_id, "standard_name", strlen (standard_node_x), - standard_node_x))) { - ERR (retval); - } - /* Define long_name attribute. */ - const char *long_node_x = "Longitude of mesh nodes"; - if ((retval - = nc_put_att_text (context->ncid, context->var_node_x_id, "long_name", strlen (long_node_x), long_node_x))) { - ERR (retval); - } - /* Define units attribute. */ - const char *units_node_x = "degrees_east"; - if ((retval - = nc_put_att_text (context->ncid, context->var_node_x_id, "units", strlen (units_node_x), units_node_x))) { - ERR (retval); - } - - /*********************************************/ - - /* Define the Mesh_node_y variable. */ - if ((retval = nc_def_var (context->ncid, namespace_context->var_Mesh_node_y, NC_DOUBLE, 1, &context->nMesh_node_dimid, - &context->var_node_y_id))) { - ERR (retval); - } - /* Define whether contiguous or chunked storage is used for the variable */ - if ((retval = nc_def_var_chunking (context->ncid, context->var_node_y_id, context->netcdf_var_storage_mode, NULL))) { - ERR (retval); - } - /* Define whether an independent or collective variable access is used */ -#if T8_ENABLE_NETCDF_PAR - if ((retval = nc_var_par_access (context->ncid, context->var_node_y_id, context->netcdf_mpi_access))) { - ERR (retval); - } -#endif - /* Define standard_name attribute. */ - const char *standard_node_y = "Latitude"; - if ((retval = nc_put_att_text (context->ncid, context->var_node_y_id, "standard_name", strlen (standard_node_y), - standard_node_y))) { - ERR (retval); - } - /* Define long_name attribute. */ - const char *long_node_y = "Latitude of mesh nodes"; - if ((retval - = nc_put_att_text (context->ncid, context->var_node_y_id, "long_name", strlen (long_node_y), long_node_y))) { - ERR (retval); - } - /* Define units attribute. */ - const char *units_node_y = "degrees_north"; - if ((retval - = nc_put_att_text (context->ncid, context->var_node_y_id, "units", strlen (units_node_y), units_node_y))) { - ERR (retval); - } - - /*********************************************/ - - /* Define the Mesh_node_z variable. */ - if ((retval = nc_def_var (context->ncid, namespace_context->var_Mesh_node_z, NC_DOUBLE, 1, &context->nMesh_node_dimid, - &context->var_node_z_id))) { - ERR (retval); - } - /* Define whether contiguous or chunked storage is used for the variable */ - if ((retval = nc_def_var_chunking (context->ncid, context->var_node_z_id, context->netcdf_var_storage_mode, NULL))) { - ERR (retval); - } - /* Define whether an independent or collective variable access is used */ -#if T8_ENABLE_NETCDF_PAR - if ((retval = nc_var_par_access (context->ncid, context->var_node_z_id, context->netcdf_mpi_access))) { - ERR (retval); - } -#endif - /* Define standard_name attribute. */ - const char *standard_node_z = "Height"; - if ((retval = nc_put_att_text (context->ncid, context->var_node_z_id, "standard_name", strlen (standard_node_z), - standard_node_z))) { - ERR (retval); - } - /* Define long_name attribute. */ - const char *long_node_z = "Elevation of mesh nodes"; - if ((retval - = nc_put_att_text (context->ncid, context->var_node_z_id, "long_name", strlen (long_node_z), long_node_z))) { - ERR (retval); - } - /* Define units attribute. */ - const char *units_node_z = "m"; - if ((retval - = nc_put_att_text (context->ncid, context->var_node_z_id, "units", strlen (units_node_z), units_node_z))) { - ERR (retval); - } -} - -/** Declare the user-defined elementwise NetCDF-variables which were passed to function. */ -static void -t8_forest_write_user_netcdf_vars ([[maybe_unused]] t8_forest_netcdf_context_t *context, - [[maybe_unused]] t8_forest_netcdf_ugrid_namespace_t *namespace_context, - [[maybe_unused]] int num_extern_netcdf_vars, - [[maybe_unused]] t8_netcdf_variable_t *ext_variables[], - [[maybe_unused]] sc_MPI_Comm comm) -{ - /* Check whether user-defined variables should be written */ - if (num_extern_netcdf_vars > 0 && ext_variables != NULL) { - int retval, i; - int mpirank, mpisize; - - retval = sc_MPI_Comm_size (comm, &mpisize); - SC_CHECK_MPI (retval); - retval = sc_MPI_Comm_rank (comm, &mpirank); - SC_CHECK_MPI (retval); - - /* Iterate over the amount of user-defined variables */ - for (i = 0; i < num_extern_netcdf_vars; i++) { - /* Check the variable data type */ - switch (ext_variables[i]->datatype) { - case T8_NETCDF_INT: - /* A netCDF 32bit integer variable will be declared */ - if ((retval = nc_def_var (context->ncid, ext_variables[i]->variable_name, NC_INT, 1, &context->nMesh_elem_dimid, - &(ext_variables[i]->var_user_dimid)))) { - ERR (retval); - } - break; - case T8_NETCDF_INT64: - /* A netCDF 64bit integer variable will be declared */ - if ((retval = nc_def_var (context->ncid, ext_variables[i]->variable_name, NC_INT64, 1, - &context->nMesh_elem_dimid, &(ext_variables[i]->var_user_dimid)))) { - ERR (retval); - } - break; - case T8_NETCDF_DOUBLE: - /* A netCDF Double-Variable will be declared */ - if ((retval = nc_def_var (context->ncid, ext_variables[i]->variable_name, NC_DOUBLE, 1, - &context->nMesh_elem_dimid, &(ext_variables[i]->var_user_dimid)))) { - ERR (retval); - break; - } - - /* Define whether contiguous or chunked storage is used for the variable */ - if ((retval = nc_def_var_chunking (context->ncid, ext_variables[i]->var_user_dimid, - context->netcdf_var_storage_mode, NULL))) { - ERR (retval); - } - /* Define whether an independent or collective variable access is used */ -#if T8_ENABLE_NETCDF_PAR - if ((retval - = nc_var_par_access (context->ncid, ext_variables[i]->var_user_dimid, context->netcdf_mpi_access))) { - ERR (retval); - } -#endif - } - /* Attach the user-defined 'long_name' attribute to the variable */ - if ((retval - = nc_put_att_text (context->ncid, (ext_variables[i]->var_user_dimid), "long_name", - strlen (ext_variables[i]->variable_long_name), ext_variables[i]->variable_long_name))) { - ERR (retval); - } - - /* Attach the user-defined 'units' attribute to the variable */ - if ((retval = nc_put_att_text (context->ncid, (ext_variables[i]->var_user_dimid), "units", - strlen (ext_variables[i]->variable_units), ext_variables[i]->variable_units))) { - ERR (retval); - } - } - } -} - -/** Write the netCDF coordinate data to he file */ -static void -t8_forest_write_netcdf_coordinate_data ([[maybe_unused]] t8_forest_t forest, - [[maybe_unused]] t8_forest_netcdf_context_t *context, - [[maybe_unused]] sc_MPI_Comm comm) -{ - double vertex_coords[3]; - t8_eclass_t tree_class; - t8_locidx_t num_local_trees; - t8_locidx_t ltree_id = 0; - t8_locidx_t num_local_elements; - t8_locidx_t num_local_tree_elem; - t8_locidx_t local_elem_id; - t8_locidx_t local_tree_offset; - t8_element_shape_t element_shape; - t8_gloidx_t first_local_elem_id; - size_t num_elements; - size_t num_max_nodes_per_elem; - size_t num_nodes; - t8_nc_int64_t *Mesh_elem_nodes; - double *Mesh_node_x; - double *Mesh_node_y; - double *Mesh_node_z; - t8_gloidx_t *node_offset; - t8_gloidx_t num_it = 0; - int retval; - int mpisize, mpirank; - size_t start_ptr = 0; - size_t count_ptr; - int i; - int number_nodes; - - /* Get the first local element id in a forest (function is collective) */ - first_local_elem_id = t8_forest_get_first_local_leaf_element_id (forest); - - /* Get the size of the MPI_Comm and the process local rank */ - retval = sc_MPI_Comm_size (comm, &mpisize); - SC_CHECK_MPI (retval); - retval = sc_MPI_Comm_rank (comm, &mpirank); - SC_CHECK_MPI (retval); - - /* Get number of local trees. */ - num_local_trees = t8_forest_get_num_local_trees (forest); - - /* Ger number of local elements */ - num_local_elements = t8_forest_get_local_num_leaf_elements (forest); - - /* Allocate memory for node offsets */ - node_offset = T8_ALLOC (t8_gloidx_t, mpisize); - - /* Get the number of all nodes local to each rank */ - retval = sc_MPI_Allgather (&context->nMesh_local_node, 1, T8_MPI_GLOIDX, node_offset, 1, T8_MPI_GLOIDX, comm); - SC_CHECK_MPI (retval); - /*Calculate the global number of element nodes in the previous trees */ - for (int j = 0; j < mpirank; j++) { - start_ptr += (size_t) node_offset[j]; - } - - /* Allocate the Variable-data that will be put out in the NetCDF variables */ - num_elements = (size_t) num_local_elements; - num_max_nodes_per_elem = (size_t) (context->nMaxMesh_elem_nodes); - num_nodes = (size_t) (context->nMesh_local_node); - - Mesh_elem_nodes = T8_ALLOC (t8_nc_int64_t, num_elements * num_max_nodes_per_elem); - Mesh_node_x = T8_ALLOC (double, num_nodes); - Mesh_node_y = T8_ALLOC (double, num_nodes); - Mesh_node_z = T8_ALLOC (double, num_nodes); - - /* Check if pointers are not NULL. */ - T8_ASSERT (Mesh_node_x != NULL && Mesh_node_y != NULL && Mesh_node_z != NULL && Mesh_elem_nodes != NULL); - const t8_scheme *scheme = t8_forest_get_scheme (forest); - /* Iterate over all local trees. */ - /* Corners should be stored in the same order as in a vtk-file (read that somewehere on a netcdf page). */ - for (ltree_id = 0; ltree_id < num_local_trees; ltree_id++) { - num_local_tree_elem = t8_forest_get_tree_num_leaf_elements (forest, ltree_id); - tree_class = t8_forest_get_tree_class (forest, ltree_id); - /* Computing the local tree offset */ - local_tree_offset = t8_forest_get_tree_element_offset (forest, ltree_id); - - for (local_elem_id = 0; local_elem_id < num_local_tree_elem; local_elem_id++) { - /* Get the local element in the local tree */ - const t8_element_t *element = t8_forest_get_leaf_element_in_tree (forest, ltree_id, local_elem_id); - /* Determine the element shape */ - element_shape = scheme->element_get_shape (tree_class, element); - /* Get the number of nodes for this elements shape */ - number_nodes = t8_element_shape_num_vertices (element_shape); - i = 0; - for (; i < number_nodes; i++) { - t8_forest_element_coordinate (forest, ltree_id, element, - t8_element_shape_t8_to_vtk_corner_number ((int) element_shape, i), vertex_coords); - /* Stores the x-, y- and z- coordinate of the nodes */ - Mesh_node_x[num_it] = vertex_coords[0]; - Mesh_node_y[num_it] = vertex_coords[1]; - Mesh_node_z[num_it] = vertex_coords[2]; - /* Stores the the nodes which correspond to this element. */ - Mesh_elem_nodes[(local_tree_offset + local_elem_id) * (context->nMaxMesh_elem_nodes) + i] - = ((t8_gloidx_t) start_ptr) + num_it; - num_it++; - } - for (; i < context->nMaxMesh_elem_nodes; i++) { - /* Fill the elements corresponding nodes, which remain empty, if it is an element having less than nMaxMesh_elem_nodes. */ - Mesh_elem_nodes[(local_tree_offset + local_elem_id) * (context->nMaxMesh_elem_nodes) + i] - = context->fillvalue64; - } - } - } - - /* *Write the data into the NetCDF coordinate variables.* */ - - /* Define a (2D) NetCDF-Hyperslab for filling the variable */ - const size_t start_ptr_var[2] = { (size_t) first_local_elem_id, 0 }; - const size_t count_ptr_var[2] = { num_elements, (size_t) context->nMaxMesh_elem_nodes }; - /* Fill the 'Mesh_elem_node'-variable. */ - if ((retval = nc_put_vara_long (context->ncid, context->var_elem_nodes_id, start_ptr_var, count_ptr_var, - &Mesh_elem_nodes[0]))) { - ERR (retval); - } - - /* Fill the space coordinate variables */ - count_ptr = (size_t) context->nMesh_local_node; - /* Fill the 'Mesh_node_x'-variable. */ - if ((retval = nc_put_vara_double (context->ncid, context->var_node_x_id, &start_ptr, &count_ptr, &Mesh_node_x[0]))) { - ERR (retval); - } - /* Fill the 'Mesh_node_y'-variable. */ - if ((retval = nc_put_vara_double (context->ncid, context->var_node_y_id, &start_ptr, &count_ptr, &Mesh_node_y[0]))) { - ERR (retval); - } - /* Fill the 'Mesh_node_z'-variable. */ - if ((retval = nc_put_vara_double (context->ncid, context->var_node_z_id, &start_ptr, &count_ptr, &Mesh_node_z[0]))) { - ERR (retval); - } - - /* Free the allocated memory */ - T8_FREE (node_offset); - T8_FREE (Mesh_node_x); - T8_FREE (Mesh_node_y); - T8_FREE (Mesh_node_z); - T8_FREE (Mesh_elem_nodes); -} - -/** - * Function that writes user-defined data to user-defined variables, if some were passed */ -/* It is only possible to write exactly one value per element per variable -*/ -static void -t8_forest_write_user_netcdf_data ([[maybe_unused]] t8_forest_t forest, - [[maybe_unused]] t8_forest_netcdf_context_t *context, - [[maybe_unused]] int num_extern_netcdf_vars, - [[maybe_unused]] t8_netcdf_variable_t *ext_variables[], - [[maybe_unused]] sc_MPI_Comm comm) -{ - if (num_extern_netcdf_vars > 0 && ext_variables != NULL) { - int retval; - size_t start_ptr; - size_t count_ptr; - int i; - - /* Counters which imply the position in the NetCDF-variable where the data will be written, */ - start_ptr = (size_t) t8_forest_get_first_local_leaf_element_id (forest); - count_ptr = (size_t) t8_forest_get_local_num_leaf_elements (forest); - - /* Iterate over the amount of user-defined variables */ - for (i = 0; i < num_extern_netcdf_vars; i++) { - - /* Check if exactly one value per element is given */ - T8_ASSERT (count_ptr == ext_variables[i]->var_user_data->elem_count); - - /* Check the variable data type */ - switch (ext_variables[i]->datatype) { - case T8_NETCDF_INT: - /* NetCDF 32bit integer data will be written */ - if ((retval = nc_put_vara_int (context->ncid, ext_variables[i]->var_user_dimid, &start_ptr, &count_ptr, - (t8_nc_int32_t *) sc_array_index (ext_variables[i]->var_user_data, 0)))) { - ERR (retval); - } - break; - case T8_NETCDF_INT64: - /* NetCDF 64bit integer data will be written */ - if ((retval = nc_put_vara_long (context->ncid, ext_variables[i]->var_user_dimid, &start_ptr, &count_ptr, - (t8_nc_int64_t *) sc_array_index (ext_variables[i]->var_user_data, 0)))) { - ERR (retval); - } - break; - case T8_NETCDF_DOUBLE: - /* NetCDF double data will be written */ - if ((retval = nc_put_vara_double (context->ncid, ext_variables[i]->var_user_dimid, &start_ptr, &count_ptr, - (double *) sc_array_index (ext_variables[i]->var_user_data, 0)))) { - ERR (retval); - } - break; - } - } - } -} - -/** Function that creates the NetCDF-File and fills it */ -static void -t8_forest_write_netcdf_file (t8_forest_t forest, t8_forest_netcdf_context_t *context, - t8_forest_netcdf_ugrid_namespace_t *namespace_context, int num_extern_netcdf_vars, - t8_netcdf_variable_t *ext_variables[], sc_MPI_Comm comm) -{ - int retval; - t8_gloidx_t num_glo_elem; - - /* Check if the forest was committed. */ - T8_ASSERT (t8_forest_is_committed (forest)); - - /* Get the number of global elements in the forest. */ - num_glo_elem = t8_forest_get_global_num_leaf_elements (forest); - - /* Assign global number of elements. */ - context->nMesh_elem = num_glo_elem; - - /* Create a parallel NetCDF-File (NetCDF-4/HDF5 file) */ - /* NC_MPIIO seems to be redundant since NetCDF version 4.6.2 */ -#if T8_ENABLE_NETCDF_PAR - if ((retval = nc_create_par (context->filename, NC_CLOBBER | NC_NETCDF4 | NC_MPIIO, comm, sc_MPI_INFO_NULL, - &context->ncid))) { - ERR (retval); - } - t8_debugf ("A parallel netCDf-file has been created.\n"); -#else - if ((retval = nc_create (context->filename, NC_CLOBBER | NC_NETCDF4, &context->ncid))) { - ERR (retval); - t8_debugf ("A serial netCDf-file has been created.\n"); - } -#endif - - /* Define the first NetCDF-dimensions (nMesh_node is not known yet) */ - t8_forest_write_netcdf_dimensions (context, namespace_context); - - /* Define NetCDF-variables */ - t8_forest_write_netcdf_variables (context, namespace_context); - - /* Disable the default fill-value-mode. */ - if ((retval = nc_set_fill (context->ncid, NC_NOFILL, &context->old_fill_mode))) { - ERR (retval); - } - - /* *Define global attributes* */ - - /* Define title attribute */ - if ((retval = nc_put_att_text (context->ncid, NC_GLOBAL, "title", strlen (context->filetitle), context->filetitle))) { - ERR (retval); - } - /* Define convention attribute */ - if ((retval - = nc_put_att_text (context->ncid, NC_GLOBAL, "convention", strlen (context->convention), context->convention))) { - ERR (retval); - } - - /* End define-mode. NetCDF-file enters data-mode. */ - if ((retval = nc_enddef (context->ncid))) { - ERR (retval); - } - - /* Fill the already defined NetCDF-variables and calculate the 'nMesh_node' (global number of nodes) -dimension */ - t8_forest_write_netcdf_data (forest, context, comm); - - /* Leave the NetCDF-data-mode and re-enter the define-mode. */ - if ((retval = nc_redef (context->ncid))) { - ERR (retval); - } - - /* Define the NetCDF-dimension 'nMesh_node' */ - t8_forest_write_netcdf_coordinate_dimension (context, namespace_context); - - /* Define the NetCDF-coordinate variables */ - t8_forest_write_netcdf_coordinate_variables (context, namespace_context); - - /* Eventuallay declare user-defined elementwise NetCDF-variables, if some were passed */ - t8_forest_write_user_netcdf_vars (context, namespace_context, num_extern_netcdf_vars, ext_variables, comm); - - /* Disable the default fill-value-mode. */ - if ((retval = nc_set_fill (context->ncid, NC_NOFILL, &context->old_fill_mode))) { - ERR (retval); - } - - /* End define-mode. NetCDF-file enters data-mode. */ - if ((retval = nc_enddef (context->ncid))) { - ERR (retval); - } - - /* Write the NetCDF-coordinate variable data */ - t8_forest_write_netcdf_coordinate_data (forest, context, comm); - - /* Eventually write user-defined variable data */ - t8_forest_write_user_netcdf_data (forest, context, num_extern_netcdf_vars, ext_variables, comm); - - /* All data has been written to the NetCDF-file, therefore, close the file. */ - if ((retval = nc_close (context->ncid))) { - ERR (retval); - } - t8_debugf ("The NetCDF-File has been written and closed.\n"); -} - -/** Function that gets called if a forest should be written in NetCDF-Format. This function is somehow an extended version which allows the user to decide if contiguous or chunked storage should used and whether the MPI ranks write independently or collectively. */ -void -t8_forest_write_netcdf_ext (t8_forest_t forest, const char *file_prefix, const char *file_title, int dim, - int num_extern_netcdf_vars, t8_netcdf_variable_t *ext_variables[], sc_MPI_Comm comm, - [[maybe_unused]] int netcdf_var_storage_mode, [[maybe_unused]] int netcdf_mpi_access) -{ - t8_forest_netcdf_context_t context; - /* Check whether pointers are not NULL */ - T8_ASSERT (file_title != NULL); - T8_ASSERT (file_prefix != NULL); - char file_name[BUFSIZ]; - - /* Create the NetCDF-Filename */ - snprintf (file_name, BUFSIZ, "%s.nc", file_prefix); - -#if !T8_ENABLE_NETCDF_PAR - /* In case of a parallel configuration without parallel netCDF routines */ - int retval; - int mpirank, mpisize; - /* Size of the communicator */ - retval = sc_MPI_Comm_size (comm, &mpisize); - SC_CHECK_MPI (retval); - /* Get the rank of the process */ - retval = sc_MPI_Comm_rank (comm, &mpirank); - SC_CHECK_MPI (retval); - - /** \note This prevents the single file to be overwritten if more processes are involved, - * in a configuration which does not feature parallel netCDF routines! - * Otherwise, if several processes try to write in the same file, - * the result will be an HDF-5 error. Now, each process will create its own - * file. Each of these files will be as big as if all processes would have written into the same file, - * but in each file is only the process-local data defined. - * (-> storage requirement is the #ranks-fold storage requirement of a serial or parallel netCDF run) - * - * \note Therefore, it is advisable to either run the whole program with only one MPI rank or - * make use of a parallel netCDF/HDF-5 configuration - */ - if (mpisize > 1) { - /* Create the NetCDF-Filename for each process */ - snprintf (file_name, BUFSIZ, "%s_rank_%d.nc", file_prefix, mpirank); - t8_global_productionf ( - "Note: The program is executed in parallel, but the netCDF Usage is serial.\nThis is not advisable, you may want " - "to either execute the program with only one MPI rank or use a parallel netCDF/HDF-5 configuration\n"); - } -#endif - - /* Initialize first variables for netCDF purposes. */ - /* Therefore, create a 'context' and initialize it with given properties */ - context.filename = file_name; - context.filetitle = file_title; - context.dim = dim; - context.nMaxMesh_elem_nodes = t8_element_shape_max_num_corner[dim]; - context.fillvalue32 = -1; - context.fillvalue64 = -1; - context.start_index = 0; - context.convention = "UGRID v1.0"; - - /* Check the given 'netcdf_storage_mode' */ - if (netcdf_var_storage_mode != NC_CONTIGUOUS && netcdf_var_storage_mode != NC_CHUNKED) { - t8_global_productionf ("Illegal input parameter for the storage-mode (NC_CONTIGUOUS or NC_CHUNKED) was " - "given.\nTherefore, NC_CONTIGUOUS will be used as the default value.\n"); - context.netcdf_var_storage_mode = NC_CONTIGUOUS; - } - else { - context.netcdf_var_storage_mode = netcdf_var_storage_mode; - } -#if T8_ENABLE_NETCDF_PAR - /* Check the given 'netcdf_mpi_access' */ - if (netcdf_mpi_access != NC_INDEPENDENT && netcdf_mpi_access != NC_COLLECTIVE) { - t8_global_productionf ("Illegal input parameter for the variable-mpi-access (NC_INDEPENDENT or NC_COLLECTIVE) was " - "given.\nTherefore, NC_INDEPENDENT will be used as the default value.\n"); - context.netcdf_mpi_access = NC_INDEPENDENT; - } - else { - context.netcdf_mpi_access = netcdf_mpi_access; - } -#endif - - /* Create and initialize the 'namespace_context' which holds the names of the variables, they vary depending on the given dimension */ - t8_forest_netcdf_ugrid_namespace_t namespace_context; - t8_forest_init_ugrid_namespace_context (&namespace_context, dim); - - /* Check the dimension of the forest (only 2D and 3D are supported) */ - if (dim < 2 || dim > 3) { - t8_global_errorf ("Only writing 2D and 3D netCDF forest data is supported.\n"); - } - else { - t8_debugf ("Writing a %dD forest to netCDF.\n", dim); - t8_forest_write_netcdf_file (forest, &context, &namespace_context, num_extern_netcdf_vars, ext_variables, comm); - } -} - -/** Function which writes out the forest in the netCDF format, this function calls the extended method with given default values (e.g. NC_CONTIGUOUS and NC_INDEPENDENT) for storage and MPI access for variables */ -void -t8_forest_write_netcdf (t8_forest_t forest, const char *file_prefix, const char *file_title, int dim, - int num_extern_netcdf_vars, t8_netcdf_variable_t *ext_variables[], sc_MPI_Comm comm) -{ - /* Choose NC_CONTIGUOUS as default storage pattern, this is equal to 1 (defined in 'netcdf.h') */ - int netcdf_var_storage_mode = NC_CONTIGUOUS; - - /* Choose NC_INDEPENDENT as default variable access, this is equal to 0 (defined in 'netcdf_par.h') */ - int netcdf_mpi_access = NC_INDEPENDENT; - - t8_forest_write_netcdf_ext (forest, file_prefix, file_title, dim, num_extern_netcdf_vars, ext_variables, comm, - netcdf_var_storage_mode, netcdf_mpi_access); -} - -/** End of code that is callable from "C".*/ -T8_EXTERN_C_END (); diff --git a/src/t8_netcdf/t8_forest_netcdf.h b/src/t8_netcdf/t8_forest_netcdf.h deleted file mode 100644 index 38d71e9775..0000000000 --- a/src/t8_netcdf/t8_forest_netcdf.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - This file is part of t8code. - t8code is a C library to manage a collection (a forest) of multiple - connected adaptive space-trees of general element classes in parallel. - - Copyright (C) 2015 the developers - - t8code is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - t8code is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with t8code; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -/** \file t8_forest_netcdf.h - * The Header-File providing a function to write out a forest in a NetCDF-4 file. - */ - -#ifndef T8_FOREST_NETCDF_H -#define T8_FOREST_NETCDF_H - -#include -#include - -/** We want to export the whole implementation to be callable from "C". */ -T8_EXTERN_C_BEGIN (); - -/** Creates a netCDF-4 file containing the (geometrical) information about the given forest mesh and additional elementwise data variables - * This functions calls 't8_forest_write_netcdf_ext()' with default values for 'netcdf_var_storage_mode' (NC_CONTIGUOUS) and 'netcdf_var_mpi_access' (NC_INDEPENDENT). - * \param [in] forest A forest. - * \param [in] file_prefix A string which holds the file's name (output file will be 'file_prefix.nc'). - * \param [in] file_title A string to caption the NetCDF-File. - * \param [in] dim The Dimension of the forest mesh (2D or 3D). - * \param [in] num_extern_netcdf_vars The number of extern user-defined variables which hold elementwise data (if none, set it to 0). - * \param [in] ext_variables An array of pointers of the herein before mentioned user-defined variables (if none, set it to NULL). - * \param [in] comm The sc_MPI_Communicator to use. - */ -void -t8_forest_write_netcdf (t8_forest_t forest, const char *file_prefix, const char *file_title, int dim, - int num_extern_netcdf_vars, t8_netcdf_variable_t *ext_variables[], sc_MPI_Comm comm); - -/** Creates a netCDF-4 file containing the (geometrical) information about the given forest mesh and additional elementwise data variables - * \param [in] forest A forest. - * \param [in] file_prefix A string which holds the file's name (output file will be 'file_prefix.nc'). - * \param [in] file_title A string to caption the NetCDF-File. - * \param [in] dim The Dimension of the forest mesh (2D or 3D). - * \param [in] num_extern_netcdf_vars The number of extern user-defined variables which hold elementwise data (if none, set it to 0). - * \param [in] ext_variables An array of pointers of the herein before mentioned user-defined variables (if none, set it to NULL). - * \param [in] comm The sc_MPI_Communicator to use. - * \param [in] netcdf_var_storage_mode This defines whether the variables in the netCDF-4 File are stored contiguously (NC_CONTIGUOUS) or in chunks (NC_CHUNKED (in this case netCDF's default chunking scheme is used)). - * \param [in] netcdf_mpi_access This defines whether the mpi processes are writing the variables' data collectively or independently. - * \note Only use this extended version of \ref t8_forest_write_netcdf if you know exactly what you are doing. In all other cases, we recommend using \ref t8_forest_write_netcdf instead. - */ -void -t8_forest_write_netcdf_ext (t8_forest_t forest, const char *file_prefix, const char *file_title, int dim, - int num_extern_netcdf_vars, t8_netcdf_variable_t *ext_variables[], sc_MPI_Comm comm, - int netcdf_var_storage_mode, int netcdf_mpi_access); - -/** End of code that is callable from "C".*/ -T8_EXTERN_C_END (); - -#endif /* !T8_FOREST_NETCDF_H */ diff --git a/src/t8_netcdf/t8_netcdf.c b/src/t8_netcdf/t8_netcdf.c deleted file mode 100644 index ea0c78e103..0000000000 --- a/src/t8_netcdf/t8_netcdf.c +++ /dev/null @@ -1,69 +0,0 @@ -/* - This file is part of t8code. - t8code is a C library to manage a collection (a forest) of multiple - connected adaptive space-trees of general element classes in parallel. - - Copyright (C) 2015 the developers - - t8code is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - t8code is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with t8code; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#include -#include - -/* Create an extern NetCDF variable */ -t8_netcdf_variable_t * -t8_netcdf_create_var (t8_netcdf_variable_type_t var_type, const char *var_name, const char *var_long_name, - const char *var_unit, sc_array_t *var_data) -{ - T8_ASSERT ((var_type == T8_NETCDF_INT && var_data->elem_size == 4) - || (var_type == T8_NETCDF_INT64 && var_data->elem_size == 8) - || (var_type == T8_NETCDF_DOUBLE && var_data->elem_size == 8)); - t8_netcdf_variable_t *netcdf_variable = T8_ALLOC (t8_netcdf_variable_t, 1); - netcdf_variable->datatype = var_type; - netcdf_variable->variable_name = var_name; - netcdf_variable->variable_long_name = var_long_name; - netcdf_variable->variable_units = var_unit; - netcdf_variable->var_user_data = var_data; - return netcdf_variable; -} - -/* Create an extern NetCDF integer variable */ -t8_netcdf_variable_t * -t8_netcdf_create_integer_var (const char *var_name, const char *var_long_name, const char *var_unit, - sc_array_t *var_data) -{ - t8_netcdf_variable_type_t var_type; - /* Check whether 32-bit (4-byte) integer or 64-bit integer data should be written */ - var_type = (var_data->elem_size > 4) ? T8_NETCDF_INT64 : T8_NETCDF_INT; - return t8_netcdf_create_var (var_type, var_name, var_long_name, var_unit, var_data); -} - -/* Create an extern NetCDF double variable */ -t8_netcdf_variable_t * -t8_netcdf_create_double_var (const char *var_name, const char *var_long_name, const char *var_unit, - sc_array_t *var_data) -{ - - return t8_netcdf_create_var (T8_NETCDF_DOUBLE, var_name, var_long_name, var_unit, var_data); -} - -/* Free the memory of the allocated NetCDF variable */ -void -t8_netcdf_variable_destroy (t8_netcdf_variable_t *var_destroy) -{ - T8_ASSERT (var_destroy != NULL); - T8_FREE (var_destroy); -} diff --git a/src/t8_netcdf/t8_netcdf.h b/src/t8_netcdf/t8_netcdf.h deleted file mode 100644 index 1adf520492..0000000000 --- a/src/t8_netcdf/t8_netcdf.h +++ /dev/null @@ -1,107 +0,0 @@ -/* - This file is part of t8code. - t8code is a C library to manage a collection (a forest) of multiple - connected adaptive space-trees of general element classes in parallel. - - Copyright (C) 2015 the developers - - t8code is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - t8code is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with t8code; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -/** \file t8_netcdf.h - * This Header-File holds two typedef integer datatypes for the data of NetCDF integer variables, as well as a struct and functions to create extern elementwise data-variables which should be written additionally to a Forest or Cmesh NetCDF-File. - */ - -#ifndef T8_NETCDF_H -#define T8_NETCDF_H - -#include - -T8_EXTERN_C_BEGIN (); - -/** Datatype for 64 bit NetCDF Data */ -typedef int64_t t8_nc_int64_t; - -/** Datatype for 32 bit NetCDF Data */ -typedef int32_t t8_nc_int32_t; - -/** This enumeration contains all possible netCDF variable datatypes (int, int64, double). */ -typedef enum t8_netcdf_variable_type { - /** Symbolizes netCDF variable datatype which holds 32-bit integer data */ - T8_NETCDF_INT = 0, - /** Symbolizes netCDF variable datatype which holds 64-bit integer data */ - T8_NETCDF_INT64 = 1, - /** Symbolizes netCDF variable datatype which holds double data */ - T8_NETCDF_DOUBLE = 2 -} t8_netcdf_variable_type_t; - -/** Struct for elementwise data variable for a NetCDF file */ -typedef struct -{ - /** short name of the variable*/ - const char *variable_name; - /** long name of the variable*/ - const char *variable_long_name; - /** unit of the variable*/ - const char *variable_units; - /** datatype of the variable*/ - t8_netcdf_variable_type_t datatype; - /** The unique identifier netCDF assigns to this variable once it is defined in the file*/ - int var_user_dimid; - /** user data for the variable*/ - sc_array_t *var_user_data; -} t8_netcdf_variable_t; - -/** Create an extern double variable which additionally should be put out to the NetCDF File - * \param [in] var_type Defines the datatype of the variable, either T8_NETCDF_INT, T8_NETCDF_INT64 or T8_NETCDF_DOUBLE. - * \param [in] var_name A String which will be the name of the created variable. - * \param [in] var_long_name A string describing the variable a bit more and what it is about. - * \param [in] var_unit The units in which the data is provided. - * \param [in] var_data A sc_array_t holding the elementwise data of the variable. - */ -t8_netcdf_variable_t * -t8_netcdf_create_var (t8_netcdf_variable_type_t var_type, const char *var_name, const char *var_long_name, - const char *var_unit, sc_array_t *var_data); - -/** Create an extern integer variable which additionally should be put out to the NetCDF File (The distinction if it will be a NC_INT or NC_INT64 variable is based on the elementsize of the given sc_array_t) - * \param [in] var_name A String which will be the name of the created variable. - * \param [in] var_long_name A string describing the variable a bit more and what it is about. - * \param [in] var_unit The units in which the data is provided. - * \param [in] var_data A sc_array_t holding the elementwise data of the variable. - */ -t8_netcdf_variable_t * -t8_netcdf_create_integer_var (const char *var_name, const char *var_long_name, const char *var_unit, - sc_array_t *var_data); - -/** Create an extern double variable which additionally should be put out to the NetCDF File - * \param [in] var_name A String which will be the name of the created variable. - * \param [in] var_long_name A string describing the variable a bit more and what it is about. - * \param [in] var_unit The units in which the data is provided. - * \param [in] var_data A sc_array_t holding the elementwise data of the variable. - */ -t8_netcdf_variable_t * -t8_netcdf_create_double_var (const char *var_name, const char *var_long_name, const char *var_unit, - sc_array_t *var_data); - -/** Free the allocated memory of the a t8_netcdf_variable_t - * \param [in] var_destroy A t8_netcdf_t variable whose allocated memory should be freed. - */ -/* Free the allocated NetCDF variable */ -void -t8_netcdf_variable_destroy (t8_netcdf_variable_t *var_destroy); - -T8_EXTERN_C_END (); - -#endif /* T8_NETCDF_H */ From 6a3107ad826518185baab8ad29d66fa6abd50dd6 Mon Sep 17 00:00:00 2001 From: Thomas Spenke Date: Thu, 5 Feb 2026 16:55:16 +0100 Subject: [PATCH 6/7] Adjusted src/CMakeLists.txt --- src/CMakeLists.txt | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2435aa4917..f70145269a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -241,6 +241,7 @@ install( FILES install( DIRECTORY t8_helper_functions DESTINATION PRIVATE_HEADER FILES_MATCHING + PATTERN "*.h" PATTERN "*.hxx" ) install( DIRECTORY t8_cmesh @@ -258,6 +259,18 @@ install( DIRECTORY t8_data PATTERN "*.h" PATTERN "*.hxx" ) +install( DIRECTORY t8_eclass + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.h" + PATTERN "*.hxx" +) +install( DIRECTORY t8_element + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.h" + PATTERN "*.hxx" +) install( DIRECTORY t8_forest DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} FILES_MATCHING @@ -275,12 +288,24 @@ install( DIRECTORY t8_geometry PATTERN "t8_geometry/t8_geometry_implementations/t8_geometry_cad.h" EXCLUDE PATTERN "t8_geometry/t8_geometry_implementations/t8_geometry_cad.hxx" EXCLUDE ) +install( DIRECTORY t8_misc + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.h" + PATTERN "*.hxx" +) install( DIRECTORY t8_schemes DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} FILES_MATCHING PATTERN "*.h" PATTERN "*.hxx" ) +install( DIRECTORY t8_types + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.hxx" + PATTERN "*.h" +) install( DIRECTORY t8_vtk DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} FILES_MATCHING @@ -292,12 +317,6 @@ install( DIRECTORY t8_vtk PATTERN "t8_vtk/t8_vtk_write_ASCII.hxx" EXCLUDE PATTERN "t8_vtk/t8_vtk_writer_helper.hxx" EXCLUDE ) -install( DIRECTORY t8_types - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - FILES_MATCHING - PATTERN "*.hxx" - PATTERN "*.h" -) install( TARGETS T8 EXPORT ${PROJECT_NAME}-targets From f895fd7fc4a5080487290002647c1203b78dde22 Mon Sep 17 00:00:00 2001 From: Thomas Spenke Date: Thu, 5 Feb 2026 17:03:46 +0100 Subject: [PATCH 7/7] Fix typo accidentally reintroduced in merge --- .../t8_cmesh_new_hypercube_param.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_new_hypercube_param.hxx b/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_new_hypercube_param.hxx index 0b7e113cff..d9eeb065c0 100644 --- a/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_new_hypercube_param.hxx +++ b/test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_new_hypercube_param.hxx @@ -24,7 +24,7 @@ #define T8_CMESH_NEW_HYPERCUBE_PARAM_HXX #include -#include "test/t8_cmesh_generator/t8_gtest_cmesh_cartestian_product.hxx" +#include "test/t8_cmesh_generator/t8_gtest_cmesh_cartesian_product.hxx" #include "test/t8_cmesh_generator/t8_cmesh_parameterized_examples/t8_cmesh_params.hxx" #include