From 059141a38e5c900d018c1f64981c7e52d32a9fec Mon Sep 17 00:00:00 2001 From: Randolph Settgast Date: Sat, 13 Sep 2025 10:10:21 +0900 Subject: [PATCH 01/12] update shiva hash --- src/discretization/fe/SEMKernels | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/discretization/fe/SEMKernels b/src/discretization/fe/SEMKernels index 7f749278..b068b5ff 160000 --- a/src/discretization/fe/SEMKernels +++ b/src/discretization/fe/SEMKernels @@ -1 +1 @@ -Subproject commit 7f74927826cf57d9ab35d76c150ec6340b7829c5 +Subproject commit b068b5ff6e819ced3786c7bc8fcfd2416a1cf4a2 From 81463ad74ac3389108048f73b165c4bb917b9442 Mon Sep 17 00:00:00 2001 From: Randolph Settgast Date: Sun, 14 Sep 2025 02:33:57 +0900 Subject: [PATCH 02/12] optional BLT and CAMP --- src/discretization/CMakeLists.txt | 3 ++- src/discretization/fe/SEMKernels | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/discretization/CMakeLists.txt b/src/discretization/CMakeLists.txt index ee4b1192..ab73a944 100644 --- a/src/discretization/CMakeLists.txt +++ b/src/discretization/CMakeLists.txt @@ -12,7 +12,8 @@ target_include_directories(discretization ) message(STATUS "Binary include dir: ${CMAKE_BINARY_DIR}/include") -include( fe/SEMKernels/src/Shiva/tpl/camp/extern/blt/SetupBLT.cmake ) +set( SHIVA_ENABLE_CAMP OFF CACHE BOOL "Disable CAMP support" FORCE ) +set( SHIVA_ENABLE_BLT OFF CACHE BOOL "Disable use of BLT" FORCE ) add_subdirectory( fe/SEMKernels ) add_dependencies( discretization finiteElements shiva) diff --git a/src/discretization/fe/SEMKernels b/src/discretization/fe/SEMKernels index b068b5ff..2747d6ce 160000 --- a/src/discretization/fe/SEMKernels +++ b/src/discretization/fe/SEMKernels @@ -1 +1 @@ -Subproject commit b068b5ff6e819ced3786c7bc8fcfd2416a1cf4a2 +Subproject commit 2747d6ce83b24a4340539f860fc4080c30dcb57d From f4c8d27b73914bb43c12d5257060c1e7b9613b13 Mon Sep 17 00:00:00 2001 From: Randolph Settgast Date: Sun, 14 Sep 2025 02:37:50 +0900 Subject: [PATCH 03/12] introduce ModelBuilderBase::MAX_ORDER to avoid non-standard variable size c-array --- src/model/api/include/builder.h | 2 ++ .../cartesian/include/cartesian_unstruct_builder.h | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/model/api/include/builder.h b/src/model/api/include/builder.h index 105d35bd..58e376e5 100644 --- a/src/model/api/include/builder.h +++ b/src/model/api/include/builder.h @@ -10,6 +10,8 @@ namespace model { ModelBuilderBase() = default; ~ModelBuilderBase() = default; + static constexpr int MAX_ORDER = 5; + std::unique_ptr> getModel() const; }; } diff --git a/src/model/impl/builder/cartesian/include/cartesian_unstruct_builder.h b/src/model/impl/builder/cartesian/include/cartesian_unstruct_builder.h index b439bc30..f3cc4076 100644 --- a/src/model/impl/builder/cartesian/include/cartesian_unstruct_builder.h +++ b/src/model/impl/builder/cartesian/include/cartesian_unstruct_builder.h @@ -10,6 +10,8 @@ namespace model { template class CartesianUnstructBuilder : ModelBuilderBase{ public: + using ModelBuilderBase::MAX_ORDER; + CartesianUnstructBuilder() { } CartesianUnstructBuilder (const CartesianParams & p) { @@ -105,7 +107,7 @@ namespace model { } void getCoordInOneDirection(const int& h, const int& n_element, float* coord) { - float xi[order_+1]; + float xi[MAX_ORDER+1]; switch (order_) { case 1: @@ -172,9 +174,9 @@ namespace model { nodes_coords_y_ = allocateVector(total_nodes, "nodes coords y"); nodes_coords_z_ = allocateVector(total_nodes, "nodes coords z"); - float coord_x[order_+1]; - float coord_y[order_+1]; - float coord_z[order_+1]; + float coord_x[MAX_ORDER+1]; + float coord_y[MAX_ORDER+1]; + float coord_z[MAX_ORDER+1]; auto hx = lx_ / ex_; auto hy = ly_ / ey_; From 0d021c8bfd15ab2f8c9c8d2bac4578690eb71c8b Mon Sep 17 00:00:00 2001 From: Randolph Settgast Date: Sun, 14 Sep 2025 03:24:06 +0900 Subject: [PATCH 04/12] change order to template argument for classic --- src/discretization/fe/SEMKernels | 2 +- src/solver/impl/include/SEMsolver.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/discretization/fe/SEMKernels b/src/discretization/fe/SEMKernels index 2747d6ce..4ccfe36b 160000 --- a/src/discretization/fe/SEMKernels +++ b/src/discretization/fe/SEMKernels @@ -1 +1 @@ -Subproject commit 2747d6ce83b24a4340539f860fc4080c30dcb57d +Subproject commit 4ccfe36b47e34ab4d8fb706b17dc3c28143b5232 diff --git a/src/solver/impl/include/SEMsolver.hpp b/src/solver/impl/include/SEMsolver.hpp index ec757871..47f31b79 100644 --- a/src/solver/impl/include/SEMsolver.hpp +++ b/src/solver/impl/include/SEMsolver.hpp @@ -72,7 +72,7 @@ class SEMsolver : public SolverBase * * @param mesh BaseMesh structure containing the domain information. */ - virtual void computeFEInit(model::ModelApi& mesh); + virtual void computeFEInit(model::ModelApi& mesh) override final; /** * @brief Compute one time step of the SEM wave equation solver. From 24bb1698c553cb03843215712981f186c76c2843 Mon Sep 17 00:00:00 2001 From: Randolph Settgast Date: Mon, 15 Sep 2025 01:56:57 -0700 Subject: [PATCH 05/12] revisions for changed interface for shiva --- src/discretization/CMakeLists.txt | 10 +++------- src/discretization/fe/SEMKernels | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/discretization/CMakeLists.txt b/src/discretization/CMakeLists.txt index ab73a944..4540f85a 100644 --- a/src/discretization/CMakeLists.txt +++ b/src/discretization/CMakeLists.txt @@ -12,13 +12,9 @@ target_include_directories(discretization ) message(STATUS "Binary include dir: ${CMAKE_BINARY_DIR}/include") -set( SHIVA_ENABLE_CAMP OFF CACHE BOOL "Disable CAMP support" FORCE ) -set( SHIVA_ENABLE_BLT OFF CACHE BOOL "Disable use of BLT" FORCE ) add_subdirectory( fe/SEMKernels ) -add_dependencies( discretization finiteElements shiva) +add_dependencies( discretization finiteElements ) -target_link_libraries(discretization - INTERFACE - proxy_utils -) \ No newline at end of file +target_link_libraries( discretization INTERFACE proxy_utils ) +target_link_libraries( discretization INTERFACE Shiva::shiva ) \ No newline at end of file diff --git a/src/discretization/fe/SEMKernels b/src/discretization/fe/SEMKernels index 4ccfe36b..3c22791f 160000 --- a/src/discretization/fe/SEMKernels +++ b/src/discretization/fe/SEMKernels @@ -1 +1 @@ -Subproject commit 4ccfe36b47e34ab4d8fb706b17dc3c28143b5232 +Subproject commit 3c22791fa727c94731b28a6097c62bf8d150ba6b From 0be840d4a40531a2e65d7d51f19e4a356f6e01bd Mon Sep 17 00:00:00 2001 From: Randolph R Settgast Date: Tue, 16 Sep 2025 08:35:55 -0500 Subject: [PATCH 06/12] some cmake changes --- src/discretization/CMakeLists.txt | 3 --- src/main/fe/CMakeLists.txt | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/discretization/CMakeLists.txt b/src/discretization/CMakeLists.txt index 4540f85a..968d4f4e 100644 --- a/src/discretization/CMakeLists.txt +++ b/src/discretization/CMakeLists.txt @@ -4,7 +4,6 @@ target_include_directories(discretization INTERFACE $ $ - $ $ # $ $ @@ -14,7 +13,5 @@ message(STATUS "Binary include dir: ${CMAKE_BINARY_DIR}/include") add_subdirectory( fe/SEMKernels ) -add_dependencies( discretization finiteElements ) - target_link_libraries( discretization INTERFACE proxy_utils ) target_link_libraries( discretization INTERFACE Shiva::shiva ) \ No newline at end of file diff --git a/src/main/fe/CMakeLists.txt b/src/main/fe/CMakeLists.txt index 6e8254b3..c60bc362 100644 --- a/src/main/fe/CMakeLists.txt +++ b/src/main/fe/CMakeLists.txt @@ -1,5 +1,7 @@ if(COMPILE_SEM) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) + add_executable(semproxy src/main.cpp src/SEMproxy.cpp From aeb15f4973830184a7971522b6c627b1dcbb2adf Mon Sep 17 00:00:00 2001 From: Randolph R Settgast Date: Thu, 25 Sep 2025 02:02:59 -0500 Subject: [PATCH 07/12] modify bechmark script --- scripts/run_semproxy_benchmark.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/run_semproxy_benchmark.sh b/scripts/run_semproxy_benchmark.sh index e8932a53..a269b5c6 100644 --- a/scripts/run_semproxy_benchmark.sh +++ b/scripts/run_semproxy_benchmark.sh @@ -20,7 +20,7 @@ Options (space-separated lists allowed; quoted): --ex "100" # values for --ex --ey "100" # values for --ey --ez "100" # values for --ez - --implem "classic" # {classic, optim, geos, shiva} + --implem "geos" # {classic, optim, geos, shiva} --mesh "cartesian" # {cartesian, ucartesian} -o|--order "1 2 3" # polynomial orders --bin PATH # path to semproxy (default: bin/semproxy) @@ -77,7 +77,9 @@ for order in $ORDERS; do --ex "$ex" --ey "$ey" --ez "$ez" --implem "$implem" --mesh "$mesh" - -o "$order" ) + -o "$order" + --timemax "1.5" + --dt "0.001" ) echo ">> ${cmd[*]}" if [[ "$DRY_RUN" -eq 1 ]]; then From bb9b8f92bb1492381861def2e1cada2c0f89cfff Mon Sep 17 00:00:00 2001 From: Randolph Settgast Date: Thu, 25 Sep 2025 00:30:01 -0700 Subject: [PATCH 08/12] add clang-format target --- src/CMakeLists.txt | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 170ef6c8..7de3ab45 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -6,4 +6,28 @@ add_subdirectory(main) if(ENABLE_PYWRAP) install_pyproxys_package(model solver) -endif() \ No newline at end of file +endif() + + +# Collect all sources +file(GLOB_RECURSE ALL_SOURCE_FILES + "${CMAKE_SOURCE_DIR}/src/*.cpp" + "${CMAKE_SOURCE_DIR}/src/*.hpp" + "${CMAKE_SOURCE_DIR}/src/*.cxx" + "${CMAKE_SOURCE_DIR}/src/*.hxx" + "${CMAKE_SOURCE_DIR}/src/*.cc" + "${CMAKE_SOURCE_DIR}/src/*.c" + "${CMAKE_SOURCE_DIR}/src/*.h" + "${CMAKE_SOURCE_DIR}/src/*.hh") + +# Example: filter out files whose path contains "thirdparty" or "external" +list(FILTER ALL_SOURCE_FILES EXCLUDE REGEX "thirdparty") +list(FILTER ALL_SOURCE_FILES EXCLUDE REGEX "external") + +# Make the format target +add_custom_target( apply_clang_format + COMMAND clang-format -i + -style=file:${CMAKE_SOURCE_DIR}/.clang-format + ${ALL_SOURCE_FILES} + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} +) From 6f32ddb5f11df98038c2e01c1abead0ad4f8ad4e Mon Sep 17 00:00:00 2001 From: Randolph Settgast Date: Thu, 25 Sep 2025 00:36:27 -0700 Subject: [PATCH 09/12] format --- src/CMakeLists.txt | 6 +++--- src/model/api/include/builder.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7de3ab45..a04d62d9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -20,9 +20,9 @@ file(GLOB_RECURSE ALL_SOURCE_FILES "${CMAKE_SOURCE_DIR}/src/*.h" "${CMAKE_SOURCE_DIR}/src/*.hh") -# Example: filter out files whose path contains "thirdparty" or "external" -list(FILTER ALL_SOURCE_FILES EXCLUDE REGEX "thirdparty") -list(FILTER ALL_SOURCE_FILES EXCLUDE REGEX "external") +# Example: filter out files whose path contains "Shiva" or "SEMKernels" +list(FILTER ALL_SOURCE_FILES EXCLUDE REGEX "Shiva") +list(FILTER ALL_SOURCE_FILES EXCLUDE REGEX "SEMKernels") # Make the format target add_custom_target( apply_clang_format diff --git a/src/model/api/include/builder.h b/src/model/api/include/builder.h index 23315aff..67978792 100644 --- a/src/model/api/include/builder.h +++ b/src/model/api/include/builder.h @@ -7,14 +7,14 @@ namespace model { template -class ModelBuilderBase -{ +class ModelBuilderBase { public: ModelBuilderBase() = default; ~ModelBuilderBase() = default; static constexpr int MAX_ORDER = 5; - virtual std::shared_ptr> getModel() const = 0; + virtual std::shared_ptr> + getModel() const = 0; }; } // namespace model From a87ecf69b8948d5ce4a09612c5f47f1a27b7ec59 Mon Sep 17 00:00:00 2001 From: Randolph Settgast Date: Thu, 25 Sep 2025 00:39:29 -0700 Subject: [PATCH 10/12] format --- src/model/api/include/builder.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/model/api/include/builder.h b/src/model/api/include/builder.h index 67978792..23315aff 100644 --- a/src/model/api/include/builder.h +++ b/src/model/api/include/builder.h @@ -7,14 +7,14 @@ namespace model { template -class ModelBuilderBase { +class ModelBuilderBase +{ public: ModelBuilderBase() = default; ~ModelBuilderBase() = default; static constexpr int MAX_ORDER = 5; - virtual std::shared_ptr> - getModel() const = 0; + virtual std::shared_ptr> getModel() const = 0; }; } // namespace model From d5063a4738efacb72842c65cf2cf988b6269c6db Mon Sep 17 00:00:00 2001 From: Randolph Settgast Date: Thu, 25 Sep 2025 21:30:43 -0700 Subject: [PATCH 11/12] clang-format 13 --- src/CMakeLists.txt | 12 ++++++++---- src/model/api/include/builder.h | 5 +++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a04d62d9..8b5415ca 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -25,9 +25,13 @@ list(FILTER ALL_SOURCE_FILES EXCLUDE REGEX "Shiva") list(FILTER ALL_SOURCE_FILES EXCLUDE REGEX "SEMKernels") # Make the format target +if( NOT CLANG_FORMAT_EXECUTABLE ) + set( CLANG_FORMAT_EXECUTABLE clang-format ) +endif() + +message( STATUS "Using clang-format executable: ${CLANG_FORMAT_EXECUTABLE}" ) + add_custom_target( apply_clang_format - COMMAND clang-format -i - -style=file:${CMAKE_SOURCE_DIR}/.clang-format - ${ALL_SOURCE_FILES} - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + COMMAND ${CLANG_FORMAT_EXECUTABLE} -i -style=file -fallback-style=none ${ALL_SOURCE_FILES} + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} ) diff --git a/src/model/api/include/builder.h b/src/model/api/include/builder.h index 23315aff..fc7a9454 100644 --- a/src/model/api/include/builder.h +++ b/src/model/api/include/builder.h @@ -9,12 +9,13 @@ namespace model template class ModelBuilderBase { -public: + public: ModelBuilderBase() = default; ~ModelBuilderBase() = default; static constexpr int MAX_ORDER = 5; - virtual std::shared_ptr> getModel() const = 0; + virtual std::shared_ptr> getModel() + const = 0; }; } // namespace model From f873d5a93746e6ed0d654aebbe96a1c2dbf5c4f0 Mon Sep 17 00:00:00 2001 From: Randolph Settgast Date: Thu, 25 Sep 2025 22:01:49 -0700 Subject: [PATCH 12/12] submodule update --- src/discretization/fe/SEMKernels | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/discretization/fe/SEMKernels b/src/discretization/fe/SEMKernels index 2a6b24d4..125d9aca 160000 --- a/src/discretization/fe/SEMKernels +++ b/src/discretization/fe/SEMKernels @@ -1 +1 @@ -Subproject commit 2a6b24d4bcdb1971eb827f72085a89c8f7b14e41 +Subproject commit 125d9aca4b8e78e153f447cd76fdfc946057fc50