Skip to content

Commit ec8aea9

Browse files
724: Establish common solver math layer (#727)
* 676: Decouple dense math utilities from FE * 724: Establish common solver math layer * 724: Align math namespace with component * 724: Simplify core exception references * 724: Update math documentation groups
1 parent 6901ebf commit ec8aea9

24 files changed

Lines changed: 201 additions & 204 deletions

‎Code/Source/solver/CMakeLists.txt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,15 +177,15 @@ if(ENABLE_COVERAGE)
177177
endif()
178178

179179
add_subdirectory(Core)
180+
add_subdirectory(common/math)
180181
add_subdirectory(FE/Common)
181-
add_subdirectory(FE/Math)
182182
add_subdirectory(FE/Quadrature)
183183
add_subdirectory(FE/Basis)
184184

185185
set(SVMP_ARCHITECTURE_TARGETS
186186
svmp_core
187187
svmp_fe_common
188-
svmp_fe_math
188+
svmp_math
189189
svmp_fe_basis
190190
svmp_fe_quadrature
191191
)

‎Code/Source/solver/FE/Basis/BasisFunction.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
#include "BasisExceptions.h"
88
#include "BasisTraits.h"
9-
#include "Math/Matrix.h"
10-
#include "Math/Vector.h"
9+
#include "math/Matrix.h"
10+
#include "math/Vector.h"
1111
#include "Types.h"
1212

1313
#include <cstddef>

‎Code/Source/solver/FE/Basis/CMakeLists.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ target_include_directories(svmp_fe_basis PUBLIC
1919

2020
target_link_libraries(svmp_fe_basis PUBLIC
2121
svmp_fe_common
22-
svmp_fe_math
22+
svmp_math
2323
svmp_fe_quadrature
2424
)

‎Code/Source/solver/FE/Basis/NodeOrderingConventions.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#define SVMP_FE_BASIS_NODEORDERINGCONVENTIONS_H
66

77
#include "BasisTraits.h"
8-
#include "Math/Vector.h"
8+
#include "math/Vector.h"
99
#include "Types.h"
1010

1111
#include <array>

‎Code/Source/solver/FE/Basis/SerendipityBasis.cpp‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33

44
#include "SerendipityBasis.h"
55
#include "NodeOrderingConventions.h"
6-
#include "Math/DenseLinearAlgebra.h"
6+
#include "Core/Exception.h"
7+
#include "math/DenseLinearAlgebra.h"
78

89
#include <algorithm>
910
#include <array>
@@ -195,21 +196,21 @@ std::vector<double> build_inverse_vandermonde(
195196
// too.
196197
const double norm_v = matrix_norm_inf(vandermonde, n);
197198

198-
// invert_dense_matrix raises a generic FEException if the Vandermonde is
199+
// invert_dense_matrix raises a generic CoreException if the Vandermonde is
199200
// exactly singular (a rank-deficient pivot). For a serendipity family that
200201
// means the node set is not unisolvent at this order -- a construction failure
201202
// in basis terms -- so translate it to BasisConstructionException, presenting
202203
// the singular and the ill-conditioned cases (below) as one catchable type in
203204
// one vocabulary. The matrix was just built n-by-n from n modes, so a
204-
// size-mismatch FEException cannot originate here; rank deficiency is the only
205-
// FEException this call can raise. (Defensive: the supported node sets are
205+
// size-mismatch CoreException cannot originate here; rank deficiency is the only
206+
// CoreException this call can raise. (Defensive: the supported node sets are
206207
// provably unisolvent, so this branch is not reachable for the shipped orders.)
207208
std::vector<double> inverse;
208209
try {
209210
inverse = math::invert_dense_matrix(
210211
std::move(vandermonde), n,
211212
"SerendipityBasis interpolation matrix for " + label);
212-
} catch (const FEException&) {
213+
} catch (const CoreException&) {
213214
svmp::raise<BasisConstructionException>("SerendipityBasis: " + label +
214215
" interpolation matrix is singular; the serendipity node set is not "
215216
"unisolvent at the requested order");

‎Code/Source/solver/FE/FE.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* This header intentionally contains no declarations. It gives Doxygen a
1212
* header-based home for the top-level FE group; submodule groups attach to it
1313
* from their own headers, including FE_Basis (Basis/BasisFunction.h),
14-
* FE_Common (Common/Types.h), FE_Math (Math/Vector.h), and FE_Quadrature
14+
* FE_Common (Common/Types.h), shared Math (math/Vector.h), and FE_Quadrature
1515
* (Quadrature/QuadratureRule.h).
1616
*/
1717

‎Code/Source/solver/FE/Math/CMakeLists.txt‎

Lines changed: 0 additions & 23 deletions
This file was deleted.

‎Code/Source/solver/FE/Quadrature/CMakeLists.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ target_include_directories(svmp_fe_quadrature PUBLIC
1818

1919
target_link_libraries(svmp_fe_quadrature PUBLIC
2020
svmp_fe_common
21-
svmp_fe_math
21+
svmp_math
2222
)

‎Code/Source/solver/FE/Quadrature/QuadratureRule.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
*/
4141

4242
#include "FE/Common/Types.h"
43-
#include "FE/Math/Vector.h"
43+
#include "math/Vector.h"
4444

4545
#include <cstddef>
4646
#include <span>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
file(GLOB_RECURSE SVMP_MATH_FILES CONFIGURE_DEPENDS
2+
"${CMAKE_CURRENT_SOURCE_DIR}/include/*.h"
3+
"${CMAKE_CURRENT_SOURCE_DIR}/include/*.hpp"
4+
"${CMAKE_CURRENT_SOURCE_DIR}/include/*.inl"
5+
"${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp"
6+
)
7+
8+
add_library(svmp_math OBJECT
9+
${SVMP_MATH_FILES}
10+
)
11+
12+
target_compile_features(svmp_math PUBLIC cxx_std_20)
13+
14+
target_include_directories(svmp_math PUBLIC
15+
${CMAKE_CURRENT_SOURCE_DIR}/include
16+
${SV_SOURCE_DIR}/ThirdParty/eigen/include
17+
${SV_SOURCE_DIR}/ThirdParty/eigen/include/eigen3
18+
)
19+
20+
target_link_libraries(svmp_math PUBLIC
21+
svmp_core
22+
)

0 commit comments

Comments
 (0)