Files
FESADev/tests/reference/mitc4_drilling_reader.h
T

22 lines
821 B
C++

#ifndef FESA_TESTS_REFERENCE_MITC4_DRILLING_READER_H_
#define FESA_TESTS_REFERENCE_MITC4_DRILLING_READER_H_
#include "mitc4_drilling_report.h"
#include "io/hdf5/mitc4_drilling_diagnostics.h"
namespace fesa::test {
inline std::optional<Mitc4DrillingDiagnosticsReport> ReadMitc4DrillingReport(hid_t file) {
const auto stored = hdf5_internal::ReadDrillingDiagnostics(file);
if (!stored) return std::nullopt;
Mitc4DrillingDiagnosticsReport result{stored->formulation, stored->version, {}};
for (const auto& frame : stored->frames)
result.frames.push_back({frame.storage_step, frame.frame_index, frame.raw_equilibrium,
frame.drilling_moment, frame.equilibrium_with_drilling});
return result;
}
} // namespace fesa::test
#endif // FESA_TESTS_REFERENCE_MITC4_DRILLING_READER_H_