MCPcopy Create free account
hub / github.com/Cantera/cantera / append

Method append

src/base/SolutionArray.cpp:1295–1312  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1293}
1294
1295void 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
1314void SolutionArray::save(const string& fname, const string& name, const string& sub,
1315 const string& desc, bool overwrite, int compression,

Callers 15

integrate_reactorFunction · 0.95
test_appendMethod · 0.95
test_append_failuresMethod · 0.95
test_slice_twiceMethod · 0.95
test_append_stateMethod · 0.95
test_restore_gasMethod · 0.95
test_ReactorMethod · 0.95
test_Reactor_2Method · 0.95

Calls 3

NotImplementedErrorClass · 0.85
CanteraErrorClass · 0.85
getMessageMethod · 0.45

Tested by 15

test_appendMethod · 0.76
test_append_failuresMethod · 0.76
test_slice_twiceMethod · 0.76
test_append_stateMethod · 0.76
test_restore_gasMethod · 0.76
test_ReactorMethod · 0.76
test_Reactor_2Method · 0.76