//////////////////////////////////////////////////////////////////////////////// // // Atom.C: // //////////////////////////////////////////////////////////////////////////////// // $Id: Atom.C,v 1.3 2003-05-16 16:14:00 fgygi Exp $ #include "Atom.h" #include using namespace std; Atom::Atom (string newname, string newspecies, D3vector pos, D3vector vel) { name_ = newname; species_ = newspecies; position_ = pos; velocity_ = vel; } ostream& operator << ( ostream &os, Atom &a ) { os.setf(ios::left,ios::adjustfield); os << " \n" << " "; os.setf(ios::fixed,ios::floatfield); os.setf(ios::right,ios::adjustfield); os << setw(12) << setprecision(8) << a.position().x << " " << setw(12) << setprecision(8) << a.position().y << " " << setw(12) << setprecision(8) << a.position().z << " " << " \n" << " "; os.setf(ios::scientific,ios::floatfield); os << setw(13) << setprecision(6) << a.velocity().x << " " << setw(13) << setprecision(6) << a.velocity().y << " " << setw(13) << setprecision(6) << a.velocity().z << " \n " << endl; return os; }