| 1293 | } |
| 1294 | |
| 1295 | void SolutionArray::append(const vector<double>& state, const AnyMap& extra) |
| 1296 | { |
| 1297 | if (apiNdim() > 1) { |
| 1298 | throw NotImplementedError("SolutionArray::append", |
| 1299 | "Unable to append multi-dimensional arrays."); |
| 1300 | } |
| 1301 | |
| 1302 | int pos = size(); |
| 1303 | resize(pos + 1); |
| 1304 | try { |
| 1305 | setState(pos, state); |
| 1306 | setAuxiliary(pos, extra); |
| 1307 | } catch (CanteraError& err) { |
| 1308 | // undo resize and rethrow error |
| 1309 | resize(pos); |
| 1310 | throw CanteraError("SolutionArray::append", err.getMessage()); |
| 1311 | } |
| 1312 | } |
| 1313 | |
| 1314 | void SolutionArray::save(const string& fname, const string& name, const string& sub, |
| 1315 | const string& desc, bool overwrite, int compression, |