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