| 233 | **************************************************************************/ |
| 234 | |
| 235 | int IdaSolver::run() { |
| 236 | TRACE("IDA IdaSolver::run()"); |
| 237 | |
| 238 | if (!initialised) { |
| 239 | throw BoutException("IdaSolver not initialised\n"); |
| 240 | } |
| 241 | |
| 242 | for (int i = 0; i < getNumberOutputSteps(); i++) { |
| 243 | |
| 244 | /// Run the solver for one output timestep |
| 245 | simtime = run(simtime + getOutputTimestep()); |
| 246 | |
| 247 | /// Check if the run succeeded |
| 248 | if (simtime < 0.0) { |
| 249 | // Step failed |
| 250 | throw BoutException("SUNDIALS IDA timestep failed\n"); |
| 251 | } |
| 252 | |
| 253 | if (call_monitors(simtime, i, getNumberOutputSteps())) { |
| 254 | // User signalled to quit |
| 255 | break; |
| 256 | } |
| 257 | } |
| 258 | |
| 259 | return 0; |
| 260 | } |
| 261 | |
| 262 | BoutReal IdaSolver::run(BoutReal tout) { |
| 263 | TRACE("Running solver: solver::run({:e})", tout); |