27 std::unique_ptr<UserPunch>
const& user_punch,
28 bool const use_high_precision,
29 std::string
const& project_file_name)
35 std::vector<OutputItem> accepted_items{{
"pH",
ItemType::pH},
38 auto accepted_item = [](
auto const& item)
39 {
return OutputItem(item.name, item.item_type); };
40 std::transform(components.begin(), components.end(),
41 std::back_inserter(accepted_items), accepted_item);
42 std::transform(equilibrium_reactants.begin(), equilibrium_reactants.end(),
43 std::back_inserter(accepted_items), accepted_item);
44 for (
auto const& kinetic_reactant : kinetic_reactants)
46 if (kinetic_reactant.fix_amount)
50 accepted_items.emplace_back(kinetic_reactant.name,
51 kinetic_reactant.item_type);
56 auto const& secondary_variables = user_punch->secondary_variables;
57 accepted_items.reserve(accepted_items.size() +
58 secondary_variables.size());
59 std::transform(secondary_variables.begin(), secondary_variables.end(),
60 std::back_inserter(accepted_items), accepted_item);
66 auto const num_dropped_basic_items =
68 std::vector<int> dropped_item_ids(num_dropped_basic_items);
69 std::iota(dropped_item_ids.begin(), dropped_item_ids.end(), 0);
71 auto const num_dvalue_equilibrium_reactants = equilibrium_reactants.size();
72 auto const num_dvalue_kinetic_reactants = kinetic_reactants.size();
73 int const num_dvalue_items =
74 num_dvalue_equilibrium_reactants + num_dvalue_kinetic_reactants;
76 auto const num_basic_items =
78 auto const num_components = components.size();
79 auto dvalue_item_id = num_basic_items + num_components + 1;
80 for (
int i = 0; i < num_dvalue_items; ++i)
82 dropped_item_ids.push_back(dvalue_item_id);
86 return std::make_unique<Output>(std::move(basic_output_setups),
87 std::move(accepted_items),
88 std::move(dropped_item_ids));