feat: complete first MITC4 FEAST eigen implementation validation
This commit is contained in:
@@ -5,9 +5,12 @@
|
||||
|
||||
#include <atomic>
|
||||
#include <chrono>
|
||||
#include <cmath>
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
#include <limits>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "fesa/io/abaqus/input_reader.h"
|
||||
@@ -117,7 +120,32 @@ TEST(EigenReferenceComparison,
|
||||
auto reference_case = fesa::test::EigenReferenceCase{"x", inp, txt, h5};
|
||||
auto ok = fesa::test::EigenReferenceComparison::Compare(reference_case);
|
||||
ASSERT_TRUE(ok.HasValue());
|
||||
EXPECT_EQ(ok.Value().policy_id, "mitc4-eigen-first-implementation");
|
||||
EXPECT_DOUBLE_EQ(ok.Value().relative_rms_tolerance, 0.05);
|
||||
EXPECT_EQ(ok.Value().families.size(), 2U);
|
||||
// Only synthetic FESA output is changed; each TXT mode remains an independent
|
||||
// scalar family, including at both inclusive five-percent boundaries.
|
||||
for (const auto& sample :
|
||||
std::vector<std::pair<double, bool>>{
|
||||
{103.0, true}, {105.0, true}, {95.0, true},
|
||||
{std::nextafter(105.0, std::numeric_limits<double>::infinity()), false},
|
||||
{std::nextafter(95.0, 0.0), false}}) {
|
||||
SCOPED_TRACE(sample.first);
|
||||
f = H5Fopen(h5.string().c_str(), H5F_ACC_RDWR, H5P_DEFAULT);
|
||||
ds = H5Dopen2(f, "/steps/Step-1/eigen/modes", H5P_DEFAULT);
|
||||
t = H5Dget_type(ds);
|
||||
v[0].eigenvalue = sample.first;
|
||||
ASSERT_GE(H5Dwrite(ds, t, H5S_ALL, H5S_ALL, H5P_DEFAULT, v), 0);
|
||||
H5Tclose(t);
|
||||
H5Dclose(ds);
|
||||
H5Fclose(f);
|
||||
const auto comparison =
|
||||
fesa::test::EigenReferenceComparison::Compare(reference_case);
|
||||
ASSERT_TRUE(comparison.HasValue());
|
||||
EXPECT_EQ(comparison.Value().passed, sample.second);
|
||||
EXPECT_EQ(comparison.Value().families[0].rms_passed, sample.second);
|
||||
EXPECT_TRUE(comparison.Value().families[1].passed);
|
||||
}
|
||||
struct TextMutation {
|
||||
std::string text;
|
||||
std::string expected_code;
|
||||
|
||||
Reference in New Issue
Block a user