#ifndef FESA_TESTS_REFERENCE_REFERENCE_COMPARISON_H_ #define FESA_TESTS_REFERENCE_REFERENCE_COMPARISON_H_ #include #include #include #include #include #include #include "fesa/core/status.h" namespace fesa::test { enum class ComparisonQuantity { kDisplacement, kReaction, kSectionResultant }; struct CanonicalComparisonRow { std::string model_id; std::string step_name; std::size_t frame_index; std::string instance_name; std::int64_t source_node_label; ComparisonQuantity quantity; std::string component; double value; std::string unit_dimension; std::string coordinate_system; std::string hdf5_dataset_path; }; struct RowDecision { CanonicalComparisonRow fesa; CanonicalComparisonRow reference; double absolute_error; double tolerance; bool passed; }; struct ComponentMetrics { ComparisonQuantity quantity; std::string component; double reference_scale; double maximum_absolute_error; double maximum_normalized_error; double rms_error; double norm_error; std::size_t worst_row; }; struct PhysicsEvidence { double free_residual_norm; std::array applied_force; std::array reaction_force; std::array applied_moment_about_origin; std::array reaction_moment_about_origin; bool endpoint_consistency_passed; }; struct ComparisonReport { std::vector rows; std::vector metrics; PhysicsEvidence physics_evidence; bool stress_comparison_applicable; std::string stress_comparison_reason; bool passed; }; // Test-only comparison support keeps Abaqus artifacts read-only and exposes no // backend handles to the implementation or downstream verification Steps. class ReferenceComparison { public: static Result Compare( const std::filesystem::path& results_hdf5, const std::filesystem::path& legacy_reference_directory); static Status WriteDeterministicJson( const ComparisonReport& report, const std::filesystem::path& output_json); }; } // namespace fesa::test #endif // FESA_TESTS_REFERENCE_REFERENCE_COMPARISON_H_