feat(nonlinear-static-newton-raphson): step 11 - equilibrium-projection-and-reference-gate
This commit is contained in:
@@ -0,0 +1,129 @@
|
||||
#ifndef FESA_TESTS_REFERENCE_NONLINEAR_STATIC_REFERENCE_COMPARISON_H_
|
||||
#define FESA_TESTS_REFERENCE_NONLINEAR_STATIC_REFERENCE_COMPARISON_H_
|
||||
|
||||
#include <array>
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <filesystem>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "fesa/core/status.h"
|
||||
#include "reference_tolerance_policy.h"
|
||||
|
||||
namespace fesa::test {
|
||||
|
||||
struct NonlinearReferenceCase {
|
||||
std::string case_id;
|
||||
std::filesystem::path original_input_path;
|
||||
std::filesystem::path displacement_csv_path;
|
||||
std::filesystem::path reaction_csv_path;
|
||||
std::filesystem::path stress_inventory_path;
|
||||
std::filesystem::path execution_directory;
|
||||
};
|
||||
|
||||
struct ArtifactSnapshot {
|
||||
std::filesystem::path path;
|
||||
std::string sha256;
|
||||
std::uintmax_t byte_size;
|
||||
std::filesystem::file_time_type last_write_time;
|
||||
};
|
||||
|
||||
enum class NonlinearReferenceDisposition {
|
||||
kBlocking,
|
||||
kWarningOnly,
|
||||
kReviewOnly,
|
||||
kExcluded,
|
||||
};
|
||||
|
||||
struct NonlinearReferenceRowKey {
|
||||
std::string case_id;
|
||||
std::string accepted_state;
|
||||
std::string instance_name;
|
||||
std::int64_t source_node_label;
|
||||
std::string component;
|
||||
};
|
||||
|
||||
struct NonlinearReferenceFamilyReport {
|
||||
std::string family_identity;
|
||||
std::vector<std::string> components;
|
||||
NonlinearReferenceDisposition disposition;
|
||||
std::size_t row_count;
|
||||
ReferenceToleranceFamilyDecision tolerance;
|
||||
};
|
||||
|
||||
struct NonlinearReferencePrecheckFinding {
|
||||
std::string family_identity;
|
||||
NonlinearReferenceDisposition disposition;
|
||||
std::string diagnostic_code;
|
||||
std::vector<NonlinearReferenceRowKey> affected_keys;
|
||||
};
|
||||
|
||||
struct NonlinearInternalEquilibriumReport {
|
||||
std::string family_identity;
|
||||
std::size_t row_count;
|
||||
double numerator;
|
||||
double scale;
|
||||
std::optional<double> normalized_metric;
|
||||
bool passed;
|
||||
std::string diagnostic_code;
|
||||
};
|
||||
|
||||
struct ConstrainedReactionResultantReport {
|
||||
std::array<double, 3> force;
|
||||
std::array<double, 3> moment;
|
||||
};
|
||||
|
||||
NonlinearInternalEquilibriumReport EvaluateGlobalBalance(
|
||||
const std::string& family_identity, double numerator,
|
||||
double applied_scale, double reaction_scale);
|
||||
|
||||
struct GeneratedRunArtifacts {
|
||||
std::filesystem::path copied_input_path;
|
||||
std::filesystem::path generated_results_hdf5;
|
||||
std::filesystem::path generated_log_path;
|
||||
};
|
||||
|
||||
struct NonlinearReferenceComparisonReport {
|
||||
std::string case_id;
|
||||
std::filesystem::path original_input_path;
|
||||
std::filesystem::path copied_input_path;
|
||||
std::filesystem::path generated_results_hdf5;
|
||||
std::filesystem::path generated_log_path;
|
||||
std::vector<ArtifactSnapshot> pre_run_artifacts;
|
||||
std::vector<ArtifactSnapshot> post_run_artifacts;
|
||||
std::vector<NonlinearReferenceFamilyReport> families;
|
||||
bool blocking_passed;
|
||||
std::vector<NonlinearReferencePrecheckFinding> precheck_findings;
|
||||
std::vector<NonlinearInternalEquilibriumReport> internal_equilibrium;
|
||||
ConstrainedReactionResultantReport constrained_reaction_resultant;
|
||||
bool external_blocking_passed;
|
||||
bool internal_blocking_passed;
|
||||
};
|
||||
|
||||
enum class NonlinearReferenceClassification {
|
||||
kPassed,
|
||||
kFailed,
|
||||
kWarningOnlyDifferences,
|
||||
};
|
||||
|
||||
Result<std::vector<ArtifactSnapshot>> ArtifactCheck(
|
||||
const NonlinearReferenceCase& reference_case);
|
||||
Result<std::filesystem::path> CopyInputToExecutionDirectory(
|
||||
const NonlinearReferenceCase& reference_case);
|
||||
Result<GeneratedRunArtifacts> RunFesaApplicationOnCopiedInput(
|
||||
const NonlinearReferenceCase& reference_case,
|
||||
const std::filesystem::path& copied_input_path);
|
||||
Result<NonlinearReferenceComparisonReport> CompareHdf5ToReferenceCsv(
|
||||
const NonlinearReferenceCase& reference_case,
|
||||
const std::filesystem::path& hdf5_results_path);
|
||||
NonlinearReferenceClassification ClassifyReferenceComparison(
|
||||
const NonlinearReferenceComparisonReport& report);
|
||||
NonlinearReferenceComparisonReport BuildReferenceComparisonReport(
|
||||
const NonlinearReferenceCase& reference_case,
|
||||
const std::filesystem::path& hdf5_results_path);
|
||||
|
||||
} // namespace fesa::test
|
||||
|
||||
#endif // FESA_TESTS_REFERENCE_NONLINEAR_STATIC_REFERENCE_COMPARISON_H_
|
||||
Reference in New Issue
Block a user