From 954e523d8d8ccaa7a9d40102ec8b8e767315ba5e Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Thu, 29 Feb 2024 09:54:10 +0100 Subject: [PATCH] hdf5 --- src/hdf5.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/hdf5.cpp b/src/hdf5.cpp index e459eee138..4efed799a8 100644 --- a/src/hdf5.cpp +++ b/src/hdf5.cpp @@ -895,6 +895,16 @@ void writeSolverSettingsToHDF5( file.getId(), hdf5Location.c_str(), "check_sensi_steadystate_conv", &ibuffer, 1 ); + + ibuffer = static_cast(solver.getMaxNonlinIters()); + H5LTset_attribute_int( + file.getId(), hdf5Location.c_str(), "max_nonlin_iters", &ibuffer, 1 + ); + + ibuffer = static_cast(solver.getMaxConvFails()); + H5LTset_attribute_int( + file.getId(), hdf5Location.c_str(), "max_conv_fails", &ibuffer, 1 + ); } void readSolverSettingsFromHDF5( @@ -1106,6 +1116,18 @@ void readSolverSettingsFromHDF5( file, datasetPath, "check_sensi_steadystate_conv" )); } + + if (attributeExists(file, datasetPath, "max_nonlin_iters")) { + solver.setMaxNonlinIters( + getIntScalarAttribute(file, datasetPath, "max_nonlin_iters") + ); + } + + if (attributeExists(file, datasetPath, "max_conv_fails")) { + solver.setMaxConvFails( + getIntScalarAttribute(file, datasetPath, "max_conv_fails") + ); + } } void readSolverSettingsFromHDF5(