85 lines
2.0 KiB
C++
85 lines
2.0 KiB
C++
#ifndef FESA_TESTS_REFERENCE_MITC4_REFERENCE_COMPARISON_H_
|
|
#define FESA_TESTS_REFERENCE_MITC4_REFERENCE_COMPARISON_H_
|
|
|
|
#include <cstddef>
|
|
#include <cstdint>
|
|
#include <filesystem>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "fesa/core/status.h"
|
|
|
|
namespace fesa::test {
|
|
|
|
struct Mitc4ReferenceCase {
|
|
std::string case_id;
|
|
std::string expected_source_element_type;
|
|
std::filesystem::path input_path;
|
|
std::filesystem::path displacement_csv_path;
|
|
std::filesystem::path results_hdf5_path;
|
|
};
|
|
|
|
struct Mitc4RowDecision {
|
|
std::string case_id;
|
|
std::string instance_name;
|
|
std::int64_t source_node_label;
|
|
std::string component;
|
|
double fesa_value;
|
|
double reference_value;
|
|
double absolute_error;
|
|
double tolerance;
|
|
double normalized_error;
|
|
bool blocking;
|
|
bool within_tolerance;
|
|
};
|
|
|
|
struct Mitc4ComponentMetrics {
|
|
std::string component;
|
|
double reference_scale;
|
|
double tolerance;
|
|
double maximum_absolute_error;
|
|
double maximum_normalized_error;
|
|
double rms_error;
|
|
double vector_norm_error;
|
|
std::size_t worst_row;
|
|
};
|
|
|
|
struct Mitc4VectorMetrics {
|
|
std::string instance_name;
|
|
std::int64_t source_node_label;
|
|
double displacement_norm_error;
|
|
double rotation_norm_error;
|
|
};
|
|
|
|
struct Mitc4Warning {
|
|
std::string code;
|
|
std::size_t row;
|
|
std::string message;
|
|
};
|
|
|
|
struct Mitc4ComparisonReport {
|
|
std::string case_id;
|
|
std::string source_element_type;
|
|
std::string internal_formulation;
|
|
std::string integration_rule;
|
|
std::vector<Mitc4RowDecision> rows;
|
|
std::vector<Mitc4ComponentMetrics> metrics;
|
|
std::vector<Mitc4VectorMetrics> vector_metrics;
|
|
std::vector<Mitc4Warning> warnings;
|
|
std::size_t worst_row;
|
|
bool passed;
|
|
};
|
|
|
|
class Mitc4ReferenceComparison {
|
|
public:
|
|
static Result<Mitc4ComparisonReport> Compare(
|
|
const Mitc4ReferenceCase& reference_case);
|
|
static Status WriteDeterministicJson(
|
|
const Mitc4ComparisonReport& report,
|
|
const std::filesystem::path& output_json);
|
|
};
|
|
|
|
} // namespace fesa::test
|
|
|
|
#endif // FESA_TESTS_REFERENCE_MITC4_REFERENCE_COMPARISON_H_
|