/*------------------------------------------------------------------------- | The software accompanies the paper | | | | Classes and Objects of Chemical Thermodynamics in Object-Oriented | | Programming. 2. A Class of Chemical Species | | | | E.B. Rudnyi | | E-mail: rudnyi@comp.chem.msu.su | | Homepages: http://www.chem.msu.su/~rudnyi/welcome.html | | | | presented at Second Electronic Computational Chemistry Conference, | | November 1995, http://hackberry.chem.niu.edu/ECCC2/ | --------------------------------------------------------------------------*/ #include #include #include "species.h" #include "memtst.h" int main() { memory test; ifstream in("species.dat"); species a; while (in) { in >> a; cout << a << endl; cout << "massa is " << a.mass() << ", number of characters " << a.len() << endl; cout << "molecular formula "; for (int i = 0; i < a.nel(); i++) cout << a.el(i) << a.noa(i) << " "; cout << endl << endl; cout << "press RETURN to continue" << endl; cin.get(); double H0 = a(0., 0.); cout.precision(3); cout.setf(ios::fixed | ios::showpoint); cout << " T Cp F S H - H0" << endl; for (global::T = 500.; global::T < 10001.; global::T += 500.) cout << setw(10) << global::T << setw(10) << a.Cp() << setw(10) << -(a.mu() - H0)/global::T << setw(10) << a.S() << setw(10) << (a.H() - H0)/1000. << endl; cout << endl; if (in >> ws, in.peek() != EOF) { cout << "press RETURN to continue" << endl; cin.get(); } } return 0; }