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

Method SolutionArray

src/base/SolutionArray.cpp:41–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39{
40
41SolutionArray::SolutionArray(const shared_ptr<Solution>& sol,
42 int size, const AnyMap& meta)
43 : m_sol(sol)
44 , m_size(size)
45 , m_dataSize(size)
46 , m_meta(meta)
47{
48 if (!m_sol || !m_sol->thermo()) {
49 throw CanteraError("SolutionArray::SolutionArray",
50 "Unable to create SolutionArray from invalid Solution object.");
51 }
52 m_stride = m_sol->thermo()->stateSize();
53 m_sol->thermo()->addSpeciesLock();
54 m_data = make_shared<vector<double>>(m_dataSize * m_stride, 0.);
55 m_extra = make_shared<map<string, AnyValue>>();
56 m_order = make_shared<map<int, string>>();
57 for (size_t i = 0; i < m_dataSize; ++i) {
58 m_active.push_back(static_cast<int>(i));
59 }
60 reset();
61 m_apiShape.resize(1);
62 m_apiShape[0] = static_cast<long>(m_dataSize);
63}
64
65SolutionArray::SolutionArray(const SolutionArray& other,
66 const vector<int>& selected)

Callers 15

piston.pyFile · 0.80
custom2.pyFile · 0.80
fuel_injection.pyFile · 0.80
integrate_reactorFunction · 0.80
custom.pyFile · 0.80
ic_engine.pyFile · 0.80
combustor.pyFile · 0.80
sensitivity1.pyFile · 0.80
pfr.pyFile · 0.80

Calls 10

CanteraErrorClass · 0.85
IndexErrorClass · 0.85
stateSizeMethod · 0.80
addSpeciesLockMethod · 0.80
thermoMethod · 0.45
resizeMethod · 0.45
sizeMethod · 0.45
clearMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by 15

test_passthroughMethod · 0.64
test_metaMethod · 0.64
test_get_stateMethod · 0.64
test_idealgas_gettersMethod · 0.64
test_properties_ndimMethod · 0.64
test_slicing_onedimMethod · 0.64
test_slicing_ndimMethod · 0.64
test_extra_no_shapeMethod · 0.64
test_extra_not_emptyMethod · 0.64