Skip to content

Commit

Permalink
hdf5
Browse files Browse the repository at this point in the history
  • Loading branch information
dweindl committed Feb 29, 2024
1 parent 35d1d29 commit 954e523
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/hdf5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,16 @@ void writeSolverSettingsToHDF5(
file.getId(), hdf5Location.c_str(), "check_sensi_steadystate_conv",
&ibuffer, 1
);

ibuffer = static_cast<int>(solver.getMaxNonlinIters());
H5LTset_attribute_int(
file.getId(), hdf5Location.c_str(), "max_nonlin_iters", &ibuffer, 1
);

ibuffer = static_cast<int>(solver.getMaxConvFails());
H5LTset_attribute_int(
file.getId(), hdf5Location.c_str(), "max_conv_fails", &ibuffer, 1
);
}

void readSolverSettingsFromHDF5(
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 954e523

Please sign in to comment.