fix(equation-and-linear-solve): address review findings

This commit is contained in:
KOKO\Mimi
2026-07-31 16:36:07 +09:00
parent 2dd17be5d0
commit 741fc9eaea
12 changed files with 329 additions and 147 deletions
+17
View File
@@ -130,6 +130,16 @@ TEST(DofManager, NumbersOnlyFreeDofsAndReconstructsPrescribedValues) {
EXPECT_EQ(
dofs.equation({fesa::NodeId{20}, fesa::NodeDof::ux}),
std::optional<std::size_t>{10});
EXPECT_EQ(dofs.equation(std::size_t{0}), std::nullopt);
EXPECT_EQ(
dofs.prescribed_value(std::size_t{0}),
std::optional<double>{1.25});
EXPECT_EQ(
dofs.equation(std::size_t{1}),
std::optional<std::size_t>{0});
EXPECT_EQ(
dofs.prescribed_value(std::size_t{1}),
std::nullopt);
std::vector<double> reduced(dofs.free_equation_count());
for (std::size_t equation = 0; equation < reduced.size(); ++equation) {
@@ -190,6 +200,13 @@ TEST(DofManager, RejectsInvalidAddressesAndReducedVectorSize) {
static_cast<void>(
dofs.equation({fesa::NodeId{99}, fesa::NodeDof::ux})),
std::out_of_range);
EXPECT_THROW(
static_cast<void>(dofs.equation(dofs.full_dof_count())),
std::out_of_range);
EXPECT_THROW(
static_cast<void>(
dofs.prescribed_value(dofs.full_dof_count())),
std::out_of_range);
EXPECT_THROW(
static_cast<void>(
dofs.reconstruct_full(std::vector<double>(17, 0.0))),