Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified src/atom.cpp

    r83f176 r97b825  
    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 
    81/** \file atom.cpp
    92 *
     
    114 *
    125 */
    13 
    14 // include config.h
    15 #ifdef HAVE_CONFIG_H
    16 #include <config.h>
    17 #endif
    186
    197#include "Helpers/MemDebug.hpp"
     
    180168bool atom::OutputArrayIndexed(ostream * const out,const enumeration<const element*> &elementLookup, int *AtomNo, const char *comment) const
    181169{
    182   AtomNo[getType()->getAtomicNumber()]++;  // increment number
     170  AtomNo[getType()->Z]++;  // increment number
    183171  if (out != NULL) {
    184172    const element *elemental = getType();
    185173    cout << "Looking for atom with element " << *elemental << endl;
    186174    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;
    188176    *out << at(0) << "\t" << at(1) << "\t" << at(2);
    189177    *out << "\t" << FixedIon;
     
    206194{
    207195  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;
    209197    return true;
    210198  } else
     
    221209bool atom::OutputTrajectory(ofstream * const out, const int *ElementNo, int *AtomNo, const int step) const
    222210{
    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;
    226214    *out << Trajectory.R.at(step)[0] << "\t" << Trajectory.R.at(step)[1] << "\t" << Trajectory.R.at(step)[2];
    227215    *out << "\t" << FixedIon;
     
    244232{
    245233  if (out != NULL) {
    246     *out << getType()->getSymbol() << "\t";
     234    *out << getType()->symbol << "\t";
    247235    *out << Trajectory.R.at(step)[0] << "\t";
    248236    *out << Trajectory.R.at(step)[1] << "\t";
     
    262250  Vector recentered(getPosition());
    263251  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;
    265253  if (AtomNo != NULL)
    266254    *AtomNo++;
     
    356344}
    357345
    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  */
    362346void atom::setMolecule(molecule *_mol){
    363347  // take this atom from the old molecule
     
    369353}
    370354
    371 /** Returns pointer to the molecule which atom belongs to.
    372  * \return containing molecule
    373  */
    374 molecule* atom::getMolecule() const {
     355molecule* atom::getMolecule(){
    375356  return mol;
    376357}
    377358
    378 /** Erases the atom in atom::mol's list of atoms and sets it to zero.
    379  */
    380359void atom::removeFromMolecule(){
    381360  if(mol){
Note: See TracChangeset for help on using the changeset viewer.