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

Method addReactor

src/zeroD/ReactorNet.cpp:337–365  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

335}
336
337void ReactorNet::addReactor(Reactor& r)
338{
339 warn_deprecated("ReactorNet::addReactor",
340 "To be removed after Cantera 3.2. Replaceable by reactor net "
341 "instantiation with contents.");
342 for (auto current : m_reactors) {
343 if (current->isOde() != r.isOde()) {
344 throw CanteraError("ReactorNet::addReactor",
345 "Cannot mix Reactor types using both ODEs and DAEs ({} and {})",
346 current->type(), r.type());
347 }
348 if (current->timeIsIndependent() != r.timeIsIndependent()) {
349 throw CanteraError("ReactorNet::addReactor",
350 "Cannot mix Reactor types using time and space as independent variables"
351 "\n({} and {})", current->type(), r.type());
352 }
353 }
354 m_timeIsIndependent = r.timeIsIndependent();
355 r.setNetwork(this);
356 m_reactors.push_back(&r);
357 if (!m_integ) {
358 m_integ.reset(newIntegrator(r.isOde() ? "CVODE" : "IDA"));
359 // use backward differencing, with a full Jacobian computed
360 // numerically, and use a Newton linear iterator
361 m_integ->setMethod(BDF_Method);
362 m_integ->setLinearSolverType("DENSE");
363 }
364 updateNames(r);
365}
366
367void ReactorNet::addReactor(shared_ptr<ReactorBase> reactor)
368{

Callers 1

reactornet_addreactorFunction · 0.80

Calls 11

CanteraErrorClass · 0.85
newIntegratorFunction · 0.85
setNetworkMethod · 0.80
warn_deprecatedFunction · 0.50
isOdeMethod · 0.45
typeMethod · 0.45
timeIsIndependentMethod · 0.45
resetMethod · 0.45
setMethodMethod · 0.45
setLinearSolverTypeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected