feat: implement consistent-mass HHT shell dynamics

This commit is contained in:
KOKO\Mimi
2026-09-22 21:38:42 +09:00
parent fec8cf09c2
commit f0dc42a280
41 changed files with 9294 additions and 125 deletions
@@ -1,6 +1,7 @@
#ifndef FESA_ANALYSIS_NEWTON_ITERATION_LOG_H_
#define FESA_ANALYSIS_NEWTON_ITERATION_LOG_H_
#include <array>
#include <cstdint>
#include <filesystem>
#include <fstream>
@@ -49,6 +50,27 @@ struct NewtonIterationLogRecord {
bool combined_passed;
};
/// @brief Carries two-channel HHT endpoint convergence evidence.
/// @note Array entries are translation and rotation channels, respectively.
/// Corrections are dimensionless N2 metrics; rate corrections already include
/// h or h squared. Residual numerator and scale retain force/moment units.
struct DynamicNewtonIterationLogRecord {
std::uint32_t increment_index = 0U;
std::uint32_t iteration_index = 0U;
double time = 0.0;
std::string stage;
std::string outcome;
std::string failure_code;
std::array<double, 2U> residual_numerator{};
std::array<double, 2U> residual_scale{};
std::array<double, 2U> coordinate_correction{};
std::array<double, 2U> velocity_correction{};
std::array<double, 2U> acceleration_correction{};
std::array<double, 2U> algorithmic_correction{};
bool residual_pass = false;
bool correction_pass = false;
};
/// @brief Writes deterministic, line-oriented Newton iteration diagnostics.
/// @note A write, flush, or close failure permanently prevents a successful
/// log lifecycle for this writer instance.
@@ -66,6 +88,11 @@ class NewtonIterationLogWriter {
/// failure with code `log-output-failure`.
Status Write(const NewtonIterationLogRecord& record);
/// @brief Writes one complete HHT record using schema `hht-log-v1`.
/// @return Success after the complete line is written; invalid numeric
/// evidence or stream failure permanently fails this writer instance.
Status Write(const DynamicNewtonIterationLogRecord& record);
/// @brief Flushes every complete record written so far to the log.
/// @return Success after the stream flush, otherwise an output failure with
/// code `log-output-failure`.