#include #include #include "ChemPlugin.h" int main(int argc, char** argv) { // Create and configure a ChemPlugin instance. ChemPlugin cp; cp.Config("Na+ = 1 mmol/kg; Cl- = 1 mmol/kg; pH = 3"); cp.Config("react 2 mmol NaOH; delxi = 0.1"); // Calculate initial conditions. cp.Initialize(); std::cout << "pH = " << cp.Report1("pH") << std::endl; // March forward in time. while (true) { double deltat = cp.ReportTimeStep(); if (cp.AdvanceTimeStep(deltat)) break; if (cp.AdvanceChemical()) break; std::cout << "pH = " << cp.Report1("pH") << std::endl; } // Any keystroke closes the console. std::cin.get(); return 0; }