Skip to content

Commit deae66e

Browse files
tretre91tpadioleauscience-enthusiast
authored
Add 3D Splines (with periodic or greville boundary conditions) (#925)
* Add a 3D spline builder for the periodic case * Changes to the derivs domain - rename some of the type aliases - use only one deriv dimension in the derivs_domain type aliases - enable the greville tests - lower the norm threshold for the triple derivative to 1e-10 * Reword the FIXMEs in the 3D test * Fix a typo * Format the splines CMakeLists.txt * Add missing doc comments and add unused annotations to the derivs parameters * Declare new header files to CMake * Increase timeout * Modify 3D error bound computation * Slightly increase tolerance --------- Co-authored-by: Thomas Padioleau <thomas.padioleau@cea.fr> Co-authored-by: Hariprasad Kannan <3788945+science-enthusiast@users.noreply.github.com>
1 parent 1196fd6 commit deae66e

File tree

9 files changed

+4245
-2
lines changed

9 files changed

+4245
-2
lines changed

.github/workflows/tests-ubuntu.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ jobs:
345345
cmake --build build
346346
if [ 'xcpu' = 'x${{matrix.backend.name}}' ]
347347
then
348-
ctest --test-dir build --output-on-failure --timeout 10 --output-junit tests.xml
348+
ctest --test-dir build --output-on-failure --timeout 20 --output-junit tests.xml
349349
cp build/tests.xml .
350350
./build/examples/characteristics_advection
351351
./build/examples/game_of_life
@@ -454,7 +454,7 @@ jobs:
454454
. /src/sanitizer_env.sh
455455
fi
456456
457-
ctest --test-dir build --output-on-failure --timeout 10 --output-junit tests.xml
457+
ctest --test-dir build --output-on-failure --timeout 20 --output-junit tests.xml
458458
cp build/tests.xml .
459459
./build/examples/characteristics_advection
460460
./build/examples/game_of_life

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,10 @@ if("${DDC_BUILD_KERNELS_SPLINES}")
282282
include/ddc/kernels/splines/spline_boundary_conditions.hpp
283283
include/ddc/kernels/splines/spline_builder.hpp
284284
include/ddc/kernels/splines/spline_builder_2d.hpp
285+
include/ddc/kernels/splines/spline_builder_3d.hpp
285286
include/ddc/kernels/splines/spline_evaluator.hpp
286287
include/ddc/kernels/splines/spline_evaluator_2d.hpp
288+
include/ddc/kernels/splines/spline_evaluator_3d.hpp
287289
include/ddc/kernels/splines/spline_traits.hpp
288290
include/ddc/kernels/splines/splines_linear_problem.hpp
289291
include/ddc/kernels/splines/splines_linear_problem_2x2_blocks.hpp

include/ddc/kernels/splines.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@
1818
#include "splines/spline_boundary_conditions.hpp"
1919
#include "splines/spline_builder.hpp"
2020
#include "splines/spline_builder_2d.hpp"
21+
#include "splines/spline_builder_3d.hpp"
2122
#include "splines/spline_evaluator.hpp"
2223
#include "splines/spline_evaluator_2d.hpp"
24+
#include "splines/spline_evaluator_3d.hpp"
2325
#include "splines/spline_traits.hpp"
2426
#include "splines/splines_linear_problem.hpp"
2527
#include "splines/splines_linear_problem_2x2_blocks.hpp"

include/ddc/kernels/splines/spline_builder_3d.hpp

Lines changed: 708 additions & 0 deletions
Large diffs are not rendered by default.

include/ddc/kernels/splines/spline_evaluator_3d.hpp

Lines changed: 2425 additions & 0 deletions
Large diffs are not rendered by default.

tests/splines/CMakeLists.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,26 @@ foreach(BC "BC_PERIODIC" "BC_GREVILLE" "BC_HERMITE")
144144
endforeach()
145145
endforeach()
146146

147+
foreach(BC "BC_PERIODIC" "BC_GREVILLE") # "BC_HERMITE")
148+
foreach(EVALUATOR "EVALUATOR_POLYNOMIAL")
149+
foreach(DEGREE RANGE "${DDC_SPLINES_TEST_DEGREE_MIN}" "${DDC_SPLINES_TEST_DEGREE_MAX}")
150+
foreach(BSPLINES_TYPE "BSPLINES_TYPE_UNIFORM" "BSPLINES_TYPE_NON_UNIFORM")
151+
set(test_name
152+
"3d_splines_tests_BATCHED_DEGREE_${DEGREE}_${BSPLINES_TYPE}_${EVALUATOR}_${BC}"
153+
)
154+
add_executable("${test_name}" ../main.cpp batched_3d_spline_builder.cpp)
155+
target_compile_definitions(
156+
"${test_name}"
157+
PUBLIC -DDEGREE=${DEGREE} -D${BSPLINES_TYPE} -D${EVALUATOR} -D${BC}
158+
)
159+
target_compile_features("${test_name}" PUBLIC cxx_std_17)
160+
target_link_libraries("${test_name}" PUBLIC DDC::core DDC::splines GTest::gtest)
161+
gtest_discover_tests("${test_name}" DISCOVERY_MODE PRE_TEST)
162+
endforeach()
163+
endforeach()
164+
endforeach()
165+
endforeach()
166+
147167
foreach(SOLVER "GINKGO" "LAPACK")
148168
foreach(BC "BC_PERIODIC" "BC_GREVILLE" "BC_HERMITE")
149169
foreach(DEGREE_X RANGE "${DDC_SPLINES_TEST_DEGREE_MIN}" "${DDC_SPLINES_TEST_DEGREE_MAX}")

0 commit comments

Comments
 (0)