feat(beam-reference-qualification): correlate Abaqus beam results

This commit is contained in:
KOKO\Mimi
2026-08-03 01:45:30 +09:00
parent b68f6ee143
commit 675379779f
21 changed files with 962 additions and 119 deletions
+60
View File
@@ -240,6 +240,66 @@ TEST(ComparisonMetric, RejectsComponentCountMismatch) {
report.failures, "validation.component_count_mismatch"));
}
TEST(CorrelationMetric, ComputesComponentWiseRmseAndRelativeL2) {
const std::vector<fesa::ComparisonSample> inputs{
sample(
fesa::ReferenceQuantity::displacement,
{"Part-1-1", 101, std::nullopt},
{3.0, 0.0, 0.0, 0.0, 0.0, 0.0},
{0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
{0.0, 1.0e-9}),
sample(
fesa::ReferenceQuantity::displacement,
{"Part-1-1", 102, std::nullopt},
{4.0, 0.0, 0.0, 0.0, 0.0, 0.0},
{0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
{0.0, 1.0e-9}),
};
const auto report = fesa::correlate_samples(inputs);
ASSERT_TRUE(report.evaluable);
ASSERT_TRUE(report.failures.empty());
ASSERT_EQ(report.metrics.size(), 6U);
EXPECT_EQ(report.metrics[0].quantity, fesa::ReferenceQuantity::displacement);
EXPECT_EQ(report.metrics[0].component_index, 0U);
EXPECT_EQ(report.metrics[0].value_count, 2U);
EXPECT_DOUBLE_EQ(
report.metrics[0].root_mean_square_error,
std::sqrt(12.5));
EXPECT_DOUBLE_EQ(report.metrics[0].relative_l2_error, 1.0);
EXPECT_DOUBLE_EQ(report.metrics[1].root_mean_square_error, 0.0);
EXPECT_DOUBLE_EQ(report.metrics[1].relative_l2_error, 0.0);
}
TEST(CorrelationMetric, UsesAbsoluteScaleNormForNearZeroReference) {
const std::vector<fesa::ComparisonSample> inputs{
sample(
fesa::ReferenceQuantity::reaction,
{"Part-1-1", 101, std::nullopt},
{0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
{3.0e-9, 0.0, 0.0, 0.0, 0.0, 0.0},
{0.0, 1.0e-9}),
sample(
fesa::ReferenceQuantity::reaction,
{"Part-1-1", 102, std::nullopt},
{0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
{4.0e-9, 0.0, 0.0, 0.0, 0.0, 0.0},
{0.0, 1.0e-9}),
};
const auto report = fesa::correlate_samples(inputs);
ASSERT_TRUE(report.evaluable);
ASSERT_EQ(report.metrics.size(), 6U);
EXPECT_DOUBLE_EQ(
report.metrics[0].root_mean_square_error,
std::sqrt(12.5) * 1.0e-9);
EXPECT_DOUBLE_EQ(
report.metrics[0].relative_l2_error,
5.0 / std::sqrt(2.0));
}
TEST(EntityMatching, MatchesNodalResultByInstanceAndExternalLabel) {
const auto frame = result_frame();
const std::array reference{0.0, 0.0, 0.0, 0.0, 0.0, 0.0};