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

Method addExtra

src/base/SolutionArray.cpp:602–626  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

600}
601
602void SolutionArray::addExtra(const string& name, bool back)
603{
604 if (m_extra->count(name)) {
605 throw CanteraError("SolutionArray::addExtra",
606 "Component '{}' already exists.", name);
607 }
608 (*m_extra)[name] = AnyValue();
609 if (back) {
610 if (m_order->size()) {
611 // add name at end of back components
612 m_order->emplace(m_order->begin()->first - 1, name);
613 } else {
614 // first name after state components
615 m_order->emplace(-1, name);
616 }
617 } else {
618 if (m_order->size()) {
619 // insert name at end of front components
620 m_order->emplace(m_order->rbegin()->first + 1, name);
621 } else {
622 // name in leading position
623 m_order->emplace(0, name);
624 }
625 }
626}
627
628vector<string> SolutionArray::listExtra(bool all) const
629{

Callers 2

TESTFunction · 0.80
asArrayMethod · 0.80

Calls 4

CanteraErrorClass · 0.85
AnyValueClass · 0.50
sizeMethod · 0.45
beginMethod · 0.45

Tested by 1

TESTFunction · 0.64