diff --git a/include/teqp/algorithms/critical_tracing.hpp b/include/teqp/algorithms/critical_tracing.hpp index 8f6de7def0718c4e2bac1b4a21d1c61ddf418054..250917562ac3af2059a45e953df45c4947755317 100644 --- a/include/teqp/algorithms/critical_tracing.hpp +++ b/include/teqp/algorithms/critical_tracing.hpp @@ -23,6 +23,7 @@ struct TCABOptions { T_tol = 1e-6; ///< The tolerance on temperature to indicate that it is converged int small_T_count = 5; ///< How many small temperature steps indicates convergence int integration_order = 5; ///< + int max_step_count = 1000; }; template<typename Model, typename Scalar = double, typename VecType = Eigen::ArrayXd> @@ -399,7 +400,7 @@ struct CriticalTracing { int counter_T_converged = 0, retry_count = 0; ofs << "z0 / mole frac.,rho0 / mol/m^3,rho1 / mol/m^3,T / K,p / Pa,c,dt,condition(1),condition(2)" << std::endl; - for (auto iter = 0; iter < 1000; ++iter) { + for (auto iter = 0; iter < options.max_step_count; ++iter) { // Make T and rhovec references to the contents of x0 vector // The views are mutable (danger!) diff --git a/interface/pybind11_wrapper.cpp b/interface/pybind11_wrapper.cpp index 910b0b94cd77c4c50d0c7dd1f8e1e75d9a50700c..2d3fd3a65da2b32620a10999bab82b46ad2d0000 100644 --- a/interface/pybind11_wrapper.cpp +++ b/interface/pybind11_wrapper.cpp @@ -35,6 +35,7 @@ void init_teqp(py::module& m) { .def_readwrite("rel_err", &TCABOptions::rel_err) .def_readwrite("init_dt", &TCABOptions::init_dt) .def_readwrite("max_dt", &TCABOptions::max_dt) + .def_readwrite("max_step_count", &TCABOptions::max_step_count) .def_readwrite("integration_order", &TCABOptions::integration_order) ;