Skip to content

Commit 9b55ba0

Browse files
Merge branches 'bugfix-vtk_reader_data' and 'bugfix-vtk_reader_data' of github.com:DLR-AMR/t8code into bugfix-vtk_reader_data
2 parents 3264231 + 2e147f6 commit 9b55ba0

File tree

120 files changed

+962
-974
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+962
-974
lines changed

.github/workflows/check_indentation.yml

+2-5
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,11 @@ name: t8code indentation check
2727
# It is triggered for pull requests into main and develop and will also run once a day
2828
# on main.
2929
#
30-
# The script runs the scripts/check_if_all_files_indented.scp script of t8code.
30+
# The script runs the scripts/check_if_all_files_indented.sh script of t8code.
3131
# The output is uploaded as an artifact to the github page.
3232

3333
on:
3434
merge_group:
35-
push:
36-
branches:
37-
- main
3835
pull_request:
3936
workflow_dispatch: # Be able to trigger this manually on github.com
4037
# Run every night at 1:05
@@ -60,7 +57,7 @@ jobs:
6057
- name: Install indent
6158
run: pip install clang-format==17.0.1
6259
- name: Indentation check
63-
run: cd scripts/ && ./check_if_all_files_indented.scp &> >(tee -a indent_script_output.txt)
60+
run: cd scripts/ && ./check_if_all_files_indented.sh &> >(tee -a indent_script_output.txt)
6461
- name: Archive script output
6562
# Do this regardess of the result of the previous step.
6663
# We especially want to upload the result when the check fails.

.github/workflows/spell_check.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ name: spell_check
22

33
on:
44
merge_group:
5-
push:
6-
branches:
7-
- main
85
pull_request:
96
workflow_dispatch: # Be able to trigger this manually on github.com
107

@@ -20,7 +17,7 @@ jobs:
2017
- name: check macros
2118
run: |
2219
for file in $(git diff --name-only --diff-filter=A); do
23-
./scripts/check_macros.scp "$file" &>> check_macros.txt
20+
./scripts/check_macros.sh "$file" &>> check_macros.txt
2421
done
2522
- name: Archive script output
2623
if: failure()

.github/workflows/tests_cmake_testsuite.yml

+70-13
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,78 @@ name: t8code CMake testsuite
3232

3333
on:
3434
merge_group:
35-
push:
36-
branches:
37-
- main
3835
pull_request:
36+
types: [opened, synchronize, ready_for_review, reopened]
3937
workflow_dispatch: # Be able to trigger this manually on github.com
4038
# Run every night at 1:10
4139
schedule:
4240
- cron: '10 1 * * *'
4341

42+
# The CI pipeline should:
43+
# - fully run in the merge queue with the full test suite
44+
# - not run on draft PRs
45+
# - run on draft PRs, if the latest commit message contains '[run ci]'
46+
# - run on scheduled runs for the DLR-AMR/t8code repository
47+
# - run on all other pull request events
48+
# These conditions are checked in the fine_grained_trigger job. If it completes successfully, it triggers the preparation job,
49+
# which triggers the actual tests.
50+
# The job to build the tarball is only triggered on merge_group events for the DLR-AMR/t8code repository.
51+
4452
jobs:
53+
54+
fine_grained_trigger:
55+
runs-on: ubuntu-latest
56+
outputs:
57+
run_ci: ${{ steps.set_run_ci.outputs.RUN_CI }}
58+
steps:
59+
- uses: actions/checkout@v4
60+
with:
61+
repository: ${{ github.event.pull_request.head.repo.full_name }}
62+
ref: ${{ github.event.pull_request.head.ref }}
63+
fetch-depth: 0
64+
- name: set the run_ci variable for the testsute
65+
id: set_run_ci
66+
run: |
67+
if [[ "${{ github.event_name }}" == "schedule" && "${{ github.repository }}" == "DLR-AMR/t8code" ]]; then
68+
echo "Scheduled run for DLR-AMR/t8code, proceeding with CI."
69+
echo "RUN_CI=true" >> $GITHUB_OUTPUT
70+
exit 0
71+
elif [[ "${{ github.event_name }}" == "merge_group" ]]; then
72+
echo "Merge group event, proceeding with CI."
73+
echo "RUN_CI=true" >> $GITHUB_OUTPUT
74+
exit 0
75+
fi
76+
latest_commit_message=$(git log -1 --pretty=%B)
77+
echo "Latest commit message: $latest_commit_message"
78+
if [[ "${{ github.event_name }}" != "schedule" ]]; then
79+
if [[ "${{ github.event.pull_request.draft }}" == "false" ]]; then
80+
echo "Not a draft PR, proceeding with CI."
81+
echo "RUN_CI=true" >> $GITHUB_OUTPUT
82+
exit 0
83+
elif [[ "${{ github.event.pull_request.draft }}" == "true" && "$latest_commit_message" == *"[run ci]"* ]]; then
84+
echo "Draft PR with '[run ci]' in the latest commit message, proceeding with CI."
85+
echo "RUN_CI=true" >> $GITHUB_OUTPUT
86+
exit 0
87+
elif [[ "${{github.event.pull_request.ready_for_review}}" == "true" ]]; then
88+
echo "PR ready for review, proceeding with CI."
89+
echo "RUN_CI=true" >> $GITHUB_OUTPUT
90+
exit 0
91+
else
92+
echo "Draft PR without '[run ci]' in the latest commit message, skipping CI."
93+
echo "RUN_CI=false" >> $GITHUB_OUTPUT
94+
exit 0
95+
fi
96+
else
97+
echo "Conditions not met, skipping CI."
98+
echo "RUN_CI=false" >> $GITHUB_OUTPUT
99+
exit 0
100+
fi
101+
45102
# Preparation step for tests. Repo is cloned and sc + p4est are compiled with and without MPI.
46103
preparation:
47-
if: (github.event_name == 'schedule' && github.repository == 'DLR-AMR/t8code') || (github.event_name != 'schedule')
104+
needs: [fine_grained_trigger]
105+
secrets: inherit
106+
if: needs.fine_grained_trigger.outputs.run_ci == 'true'
48107
uses: ./.github/workflows/tests_cmake_preparation.yml
49108
strategy:
50109
fail-fast: false
@@ -60,7 +119,6 @@ jobs:
60119

61120
# Run parallel tests for sc and p4est with and without MPI
62121
sc_p4est_tests:
63-
if: ((github.event_name == 'schedule' && github.repository == 'DLR-AMR/t8code') || (github.event_name != 'schedule'))
64122
needs: preparation
65123
uses: ./.github/workflows/tests_cmake_sc_p4est.yml
66124
strategy:
@@ -75,7 +133,7 @@ jobs:
75133

76134
# Run t8code tests with and without MPI and in serial and debug mode
77135
t8code_tests:
78-
if: (github.event_name == 'schedule' && github.repository == 'DLR-AMR/t8code') || (github.event_name != 'schedule')
136+
needs: preparation
79137
uses: ./.github/workflows/tests_cmake_t8code.yml
80138
strategy:
81139
fail-fast: false
@@ -84,7 +142,6 @@ jobs:
84142
BUILD_TYPE: [Debug, Release]
85143
include:
86144
- MAKEFLAGS: -j4
87-
needs: preparation
88145
with:
89146
MAKEFLAGS: ${{ matrix.MAKEFLAGS }}
90147
MPI: ${{ matrix.MPI }}
@@ -93,7 +150,7 @@ jobs:
93150

94151
# Run t8code linkage tests with and without MPI and in serial and debug mode
95152
t8code_linkage_tests:
96-
if: (github.event_name == 'schedule' && github.repository == 'DLR-AMR/t8code') || (github.event_name != 'schedule')
153+
needs: preparation
97154
uses: ./.github/workflows/tests_cmake_t8code_linkage.yml
98155
strategy:
99156
fail-fast: false
@@ -102,7 +159,6 @@ jobs:
102159
BUILD_TYPE: [Debug, Release]
103160
include:
104161
- MAKEFLAGS: -j4
105-
needs: preparation
106162
with:
107163
MAKEFLAGS: ${{ matrix.MAKEFLAGS }}
108164
MPI: ${{ matrix.MPI }}
@@ -111,7 +167,7 @@ jobs:
111167

112168
# Run t8code linkage tests with and without MPI and in serial and debug mode
113169
t8code_api_tests:
114-
if: (github.event_name == 'schedule' && github.repository == 'DLR-AMR/t8code') || (github.event_name != 'schedule')
170+
needs: preparation
115171
uses: ./.github/workflows/tests_cmake_t8code_api.yml
116172
strategy:
117173
fail-fast: false
@@ -120,7 +176,6 @@ jobs:
120176
BUILD_TYPE: [Debug, Release]
121177
include:
122178
- MAKEFLAGS: -j4
123-
needs: preparation
124179
with:
125180
MAKEFLAGS: ${{ matrix.MAKEFLAGS }}
126181
MPI: ${{ matrix.MPI }}
@@ -129,7 +184,9 @@ jobs:
129184

130185
# Run t8code tests with shipped submodules. This test is only for the build system, so only one config is tested.
131186
t8code_w_shipped_submodules_tests:
132-
if: (github.event_name == 'schedule' && github.repository == 'DLR-AMR/t8code') || (github.event_name != 'schedule')
187+
needs: fine_grained_trigger
188+
secrets: inherit
189+
if: ${{ needs.fine_grained_trigger.outputs.run_ci == 'true' }}
133190
uses: ./.github/workflows/tests_cmake_t8code_w_shipped_submodules.yml
134191
with:
135192
MAKEFLAGS: -j4
@@ -138,7 +195,7 @@ jobs:
138195
TEST_LEVEL: ${{ github.event_name == 'pull_request' && 1 || 0 }} # Set TEST_LEVEL to 1 if the event is a PR, otherwise 0.
139196

140197
t8code_tarball:
141-
if: (github.event_name == 'schedule' && github.repository == 'DLR-AMR/t8code') || (github.event_name != 'schedule')
198+
if: github.event.pull_request.draft == false
142199
uses: ./.github/workflows/build_cmake_tarball.yml
143200
needs: [preparation, sc_p4est_tests, t8code_tests, t8code_linkage_tests, t8code_api_tests, t8code_w_shipped_submodules_tests]
144201
with:

.typos.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ eles = "eles"
33
packageid = "packageid"
44

55
[files]
6-
extend-exclude = ["scripts/t8indent", "thirdparty/", "t8code_logo.png", "cmake/FindOpenCASCADE.cmake"]
6+
extend-exclude = ["scripts/t8indent.sh", "thirdparty/", "t8code_logo.png", "cmake/FindOpenCASCADE.cmake"]

benchmarks/t8_time_forest_partition.cxx

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ t8_anchor_element (t8_forest_t forest, t8_locidx_t which_tree,
8585
* c_min, c_max. We refine the cells in the band c_min*E, c_max*E */
8686
static int
8787
t8_band_adapt (t8_forest_t forest, t8_forest_t forest_from, t8_locidx_t which_tree, t8_eclass_t tree_class,
88-
t8_locidx_t lelement_id, const t8_scheme *scheme, const int is_family, const int num_elements,
89-
t8_element_t *elements[])
88+
[[maybe_unused]] t8_locidx_t lelement_id, const t8_scheme *scheme, const int is_family,
89+
[[maybe_unused]] const int num_elements, t8_element_t *elements[])
9090
{
9191
int level, base_level, max_level;
9292
t8_3D_vec elem_midpoint;

benchmarks/t8_time_fractal.cxx

+31-17
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@
4545
*
4646
*/
4747
static int
48-
t8_adapt_menger_quad (t8_forest_t forest, t8_forest_t forest_from, t8_locidx_t which_tree, t8_eclass_t tree_class,
49-
t8_locidx_t lelement_id, const t8_scheme *scheme, const int is_family, const int num_elements,
48+
t8_adapt_menger_quad (t8_forest_t forest, [[maybe_unused]] t8_forest_t forest_from,
49+
[[maybe_unused]] t8_locidx_t which_tree, t8_eclass_t tree_class,
50+
[[maybe_unused]] t8_locidx_t lelement_id, const t8_scheme *scheme,
51+
[[maybe_unused]] const int is_family, [[maybe_unused]] const int num_elements,
5052
t8_element_t *elements[])
5153
{
5254
const int *adapt_data = (const int *) t8_forest_get_user_data (forest);
@@ -77,8 +79,10 @@ t8_adapt_menger_quad (t8_forest_t forest, t8_forest_t forest_from, t8_locidx_t w
7779
* of the mesh or leave it untouched. Refine the remaining elements.
7880
*/
7981
static int
80-
t8_adapt_sierpinski_tri (t8_forest_t forest, t8_forest_t forest_from, t8_locidx_t which_tree, t8_eclass_t tree_class,
81-
t8_locidx_t lelement_id, const t8_scheme *scheme, const int is_family, const int num_elements,
82+
t8_adapt_sierpinski_tri (t8_forest_t forest, [[maybe_unused]] t8_forest_t forest_from,
83+
[[maybe_unused]] t8_locidx_t which_tree, t8_eclass_t tree_class,
84+
[[maybe_unused]] t8_locidx_t lelement_id, const t8_scheme *scheme,
85+
[[maybe_unused]] const int is_family, [[maybe_unused]] const int num_elements,
8286
t8_element_t *elements[])
8387
{
8488
const int *adapt_data = (const int *) t8_forest_get_user_data (forest);
@@ -102,8 +106,10 @@ t8_adapt_sierpinski_tri (t8_forest_t forest, t8_forest_t forest_from, t8_locidx_
102106
* of the mesh or leave them untouched. Refine the remaining elements.
103107
*/
104108
static int
105-
t8_adapt_menger_hex (t8_forest_t forest, t8_forest_t forest_from, t8_locidx_t which_tree, t8_eclass_t tree_class,
106-
t8_locidx_t lelement_id, const t8_scheme *scheme, const int is_family, const int num_elements,
109+
t8_adapt_menger_hex (t8_forest_t forest, [[maybe_unused]] t8_forest_t forest_from,
110+
[[maybe_unused]] t8_locidx_t which_tree, t8_eclass_t tree_class,
111+
[[maybe_unused]] t8_locidx_t lelement_id, const t8_scheme *scheme,
112+
[[maybe_unused]] const int is_family, [[maybe_unused]] const int num_elements,
107113
t8_element_t *elements[])
108114
{
109115
const int *adapt_data = (const int *) t8_forest_get_user_data (forest);
@@ -151,8 +157,10 @@ t8_adapt_menger_hex (t8_forest_t forest, t8_forest_t forest_from, t8_locidx_t wh
151157
* of the mesh or leave it untouched. Refine the remaining elements.
152158
*/
153159
static int
154-
t8_adapt_sierpinski_tet (t8_forest_t forest, t8_forest_t forest_from, t8_locidx_t which_tree, t8_eclass_t tree_class,
155-
t8_locidx_t lelement_id, const t8_scheme *scheme, const int is_family, const int num_elements,
160+
t8_adapt_sierpinski_tet (t8_forest_t forest, [[maybe_unused]] t8_forest_t forest_from,
161+
[[maybe_unused]] t8_locidx_t which_tree, t8_eclass_t tree_class,
162+
[[maybe_unused]] t8_locidx_t lelement_id, const t8_scheme *scheme,
163+
[[maybe_unused]] const int is_family, [[maybe_unused]] const int num_elements,
156164
t8_element_t *elements[])
157165
{
158166
const int *adapt_data = (const int *) t8_forest_get_user_data (forest);
@@ -176,9 +184,11 @@ t8_adapt_sierpinski_tet (t8_forest_t forest, t8_forest_t forest_from, t8_locidx_
176184
* of the mesh or leave it untouched. Refine the remaining elements.
177185
*/
178186
static int
179-
t8_adapt_sierpinski_prism (t8_forest_t forest, t8_forest_t forest_from, t8_locidx_t which_tree, t8_eclass_t tree_class,
180-
t8_locidx_t lelement_id, const t8_scheme *scheme, const int is_family,
181-
const int num_elements, t8_element_t *elements[])
187+
t8_adapt_sierpinski_prism (t8_forest_t forest, [[maybe_unused]] t8_forest_t forest_from,
188+
[[maybe_unused]] t8_locidx_t which_tree, t8_eclass_t tree_class,
189+
[[maybe_unused]] t8_locidx_t lelement_id, const t8_scheme *scheme,
190+
[[maybe_unused]] const int is_family, [[maybe_unused]] const int num_elements,
191+
t8_element_t *elements[])
182192
{
183193
const int *adapt_data = (const int *) t8_forest_get_user_data (forest);
184194
const int level_max = adapt_data[0];
@@ -201,9 +211,11 @@ t8_adapt_sierpinski_prism (t8_forest_t forest, t8_forest_t forest_from, t8_locid
201211
* of the mesh or leave it untouched. Refine the remaining elements.
202212
*/
203213
static int
204-
t8_adapt_sierpinski_pyramid (t8_forest_t forest, t8_forest_t forest_from, t8_locidx_t which_tree,
205-
t8_eclass_t tree_class, t8_locidx_t lelement_id, const t8_scheme *scheme,
206-
const int is_family, const int num_elements, t8_element_t *elements[])
214+
t8_adapt_sierpinski_pyramid (t8_forest_t forest, [[maybe_unused]] t8_forest_t forest_from,
215+
[[maybe_unused]] t8_locidx_t which_tree, t8_eclass_t tree_class,
216+
[[maybe_unused]] t8_locidx_t lelement_id, const t8_scheme *scheme,
217+
[[maybe_unused]] const int is_family, [[maybe_unused]] const int num_elements,
218+
t8_element_t *elements[])
207219
{
208220
const int *adapt_data = (const int *) t8_forest_get_user_data (forest);
209221
const int level_max = adapt_data[0];
@@ -223,9 +235,11 @@ t8_adapt_sierpinski_pyramid (t8_forest_t forest, t8_forest_t forest_from, t8_loc
223235

224236
/* Coarse every family in the mesh. */
225237
static int
226-
t8_adapt_coarse (t8_forest_t forest, t8_forest_t forest_from, t8_locidx_t which_tree, t8_eclass_t tree_class,
227-
t8_locidx_t lelement_id, const t8_scheme *scheme, const int is_family, const int num_elements,
228-
t8_element_t *elements[])
238+
t8_adapt_coarse ([[maybe_unused]] t8_forest_t forest, [[maybe_unused]] t8_forest_t forest_from,
239+
[[maybe_unused]] t8_locidx_t which_tree, [[maybe_unused]] t8_eclass_t tree_class,
240+
[[maybe_unused]] t8_locidx_t lelement_id, [[maybe_unused]] const t8_scheme *scheme,
241+
const int is_family, [[maybe_unused]] const int num_elements,
242+
[[maybe_unused]] t8_element_t *elements[])
229243
{
230244
if (is_family) {
231245
return -1;

benchmarks/t8_time_prism_adapt.cxx

+11-7
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,11 @@
3535
#include <t8_cmesh/t8_cmesh_examples.h>
3636

3737
static int
38-
t8_basic_adapt_refine_type (t8_forest_t forest, t8_forest_t forest_from, t8_locidx_t which_tree, t8_eclass_t tree_class,
39-
t8_locidx_t lelement_id, const t8_scheme *scheme, const int is_family,
40-
const int num_elements, t8_element_t *elements[])
38+
t8_basic_adapt_refine_type (t8_forest_t forest, [[maybe_unused]] t8_forest_t forest_from,
39+
[[maybe_unused]] t8_locidx_t which_tree, t8_eclass_t tree_class,
40+
[[maybe_unused]] t8_locidx_t lelement_id, const t8_scheme *scheme,
41+
[[maybe_unused]] const int is_family, [[maybe_unused]] const int num_elements,
42+
t8_element_t *elements[])
4143
{
4244
int level;
4345
int type;
@@ -58,9 +60,11 @@ t8_basic_adapt_refine_type (t8_forest_t forest, t8_forest_t forest_from, t8_loci
5860
}
5961

6062
static int
61-
t8_basic_adapt_refine_tet (t8_forest_t forest, t8_forest_t forest_from, t8_locidx_t which_tree, t8_eclass_t tree_class,
62-
t8_locidx_t lelement_id, const t8_scheme *scheme, const int is_family,
63-
const int num_elements, t8_element_t *elements[])
63+
t8_basic_adapt_refine_tet (t8_forest_t forest, [[maybe_unused]] t8_forest_t forest_from,
64+
[[maybe_unused]] t8_locidx_t which_tree, t8_eclass_t tree_class,
65+
[[maybe_unused]] t8_locidx_t lelement_id, const t8_scheme *scheme,
66+
[[maybe_unused]] const int is_family, [[maybe_unused]] const int num_elements,
67+
t8_element_t *elements[])
6468
{
6569
int level;
6670
int type;
@@ -81,7 +85,7 @@ t8_basic_adapt_refine_tet (t8_forest_t forest, t8_forest_t forest_from, t8_locid
8185
}
8286

8387
static void
84-
t8_time_refine (int start_level, int end_level, int create_forest, int cube, int adapt, int do_balance,
88+
t8_time_refine (int start_level, int end_level, [[maybe_unused]] int create_forest, int cube, int adapt, int do_balance,
8589
t8_eclass_t eclass)
8690
{
8791
t8_forest_t forest, forest_adapt, forest_partition;

example/CMakeLists.txt

+6-3
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,18 @@ add_t8_example( NAME t8_example_geometries SOURCES geometry/t8_exam
5656
add_t8_example( NAME t8_cmesh_load_save SOURCES IO/cmesh/t8_cmesh_load_save.cxx )
5757
add_t8_example( NAME t8_read_msh_file SOURCES IO/cmesh/gmsh/t8_read_msh_file.cxx )
5858
add_t8_example( NAME t8_load_and_refine_square_w_hole SOURCES IO/cmesh/gmsh/t8_load_and_refine_square_w_hole.cxx )
59-
add_t8_example( NAME t8_write_cmesh_netcdf SOURCES IO/cmesh/netcdf/t8_write_cmesh_netcdf.cxx )
6059
add_t8_example( NAME t8_read_tetgen SOURCES IO/cmesh/tetgen/t8_read_tetgen_file.cxx )
6160
add_t8_example( NAME t8_time_tetgen SOURCES IO/cmesh/tetgen/t8_time_tetgen_file.cxx )
6261
add_t8_example( NAME t8_forest_tetgen SOURCES IO/cmesh/tetgen/t8_forest_from_tetgen.cxx )
6362
add_t8_example( NAME t8_read_triangle SOURCES IO/cmesh/triangle/t8_read_triangle_file.cxx )
6463
add_t8_example( NAME t8_cmesh_read_from_vtk SOURCES IO/cmesh/vtk/t8_cmesh_read_from_vtk.cxx )
6564

66-
add_t8_example( NAME t8_netcdf_compilation_status SOURCES IO/forest/netcdf/t8_netcdf_status.c )
67-
add_t8_example( NAME t8_write_forest_netcdf SOURCES IO/forest/netcdf/t8_write_forest_netcdf.cxx )
65+
if(T8CODE_ENABLE_NETCDF)
66+
add_t8_example( NAME t8_write_cmesh_netcdf SOURCES IO/cmesh/netcdf/t8_write_cmesh_netcdf.cxx )
67+
add_t8_example( NAME t8_netcdf_compilation_status SOURCES IO/forest/netcdf/t8_netcdf_status.c )
68+
add_t8_example( NAME t8_write_forest_netcdf SOURCES IO/forest/netcdf/t8_write_forest_netcdf.cxx )
69+
endif()
70+
6871
add_t8_example( NAME t8_gmsh_to_vtk SOURCES IO/forest/gmsh/t8_gmsh_to_vtk.cxx )
6972

7073
add_t8_example( NAME t8_example_spheres SOURCES remove/t8_example_spheres.cxx )

0 commit comments

Comments
 (0)