Changes in src/atom.cpp [97b825:83f176]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/atom.cpp
r97b825 r83f176 1 /* 2 * Project: MoleCuilder 3 * Description: creates and alters molecular systems 4 * Copyright (C) 2010 University of Bonn. All rights reserved. 5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details. 6 */ 7 1 8 /** \file atom.cpp 2 9 * … … 4 11 * 5 12 */ 13 14 // include config.h 15 #ifdef HAVE_CONFIG_H 16 #include <config.h> 17 #endif 6 18 7 19 #include "Helpers/MemDebug.hpp" … … 168 180 bool atom::OutputArrayIndexed(ostream * const out,const enumeration<const element*> &elementLookup, int *AtomNo, const char *comment) const 169 181 { 170 AtomNo[getType()-> Z]++; // increment number182 AtomNo[getType()->getAtomicNumber()]++; // increment number 171 183 if (out != NULL) { 172 184 const element *elemental = getType(); 173 185 cout << "Looking for atom with element " << *elemental << endl; 174 186 ASSERT(elementLookup.there.find(elemental)!=elementLookup.there.end(),"Type of this atom was not in the formula upon enumeration"); 175 *out << "Ion_Type" << elementLookup.there.find(elemental)->second << "_" << AtomNo[elemental-> Z] << "\t" << fixed << setprecision(9) << showpoint;187 *out << "Ion_Type" << elementLookup.there.find(elemental)->second << "_" << AtomNo[elemental->getAtomicNumber()] << "\t" << fixed << setprecision(9) << showpoint; 176 188 *out << at(0) << "\t" << at(1) << "\t" << at(2); 177 189 *out << "\t" << FixedIon; … … 194 206 { 195 207 if (out != NULL) { 196 *out << getType()-> symbol<< "\t" << at(0) << "\t" << at(1) << "\t" << at(2) << "\t" << endl;208 *out << getType()->getSymbol() << "\t" << at(0) << "\t" << at(1) << "\t" << at(2) << "\t" << endl; 197 209 return true; 198 210 } else … … 209 221 bool atom::OutputTrajectory(ofstream * const out, const int *ElementNo, int *AtomNo, const int step) const 210 222 { 211 AtomNo[getType()-> Z]++;212 if (out != NULL) { 213 *out << "Ion_Type" << ElementNo[getType()-> Z] << "_" << AtomNo[getType()->Z] << "\t" << fixed << setprecision(9) << showpoint;223 AtomNo[getType()->getAtomicNumber()]++; 224 if (out != NULL) { 225 *out << "Ion_Type" << ElementNo[getType()->getAtomicNumber()] << "_" << AtomNo[getType()->getAtomicNumber()] << "\t" << fixed << setprecision(9) << showpoint; 214 226 *out << Trajectory.R.at(step)[0] << "\t" << Trajectory.R.at(step)[1] << "\t" << Trajectory.R.at(step)[2]; 215 227 *out << "\t" << FixedIon; … … 232 244 { 233 245 if (out != NULL) { 234 *out << getType()-> symbol<< "\t";246 *out << getType()->getSymbol() << "\t"; 235 247 *out << Trajectory.R.at(step)[0] << "\t"; 236 248 *out << Trajectory.R.at(step)[1] << "\t"; … … 250 262 Vector recentered(getPosition()); 251 263 recentered -= *center; 252 *out << "\t\t" << getType()-> symbol<< " [ " << recentered[0] << "\t" << recentered[1] << "\t" << recentered[2] << " ]" << endl;264 *out << "\t\t" << getType()->getSymbol() << " [ " << recentered[0] << "\t" << recentered[1] << "\t" << recentered[2] << " ]" << endl; 253 265 if (AtomNo != NULL) 254 266 *AtomNo++; … … 344 356 } 345 357 358 /** Makes the atom be contained in the new molecule \a *_mol. 359 * Uses atom::removeFromMolecule() to delist from old molecule. 360 * \param *_mol pointer to new molecule 361 */ 346 362 void atom::setMolecule(molecule *_mol){ 347 363 // take this atom from the old molecule … … 353 369 } 354 370 355 molecule* atom::getMolecule(){ 371 /** Returns pointer to the molecule which atom belongs to. 372 * \return containing molecule 373 */ 374 molecule* atom::getMolecule() const { 356 375 return mol; 357 376 } 358 377 378 /** Erases the atom in atom::mol's list of atoms and sets it to zero. 379 */ 359 380 void atom::removeFromMolecule(){ 360 381 if(mol){
Note:
See TracChangeset
for help on using the changeset viewer.