Ignore:
Timestamp:
Oct 7, 2009, 1:11:28 PM (16 years ago)
Author:
Frederik Heber <heber@…>
Children:
0cd3b2
Parents:
8ffe32
git-author:
Frederik Heber <heber@…> (10/07/09 12:14:15)
git-committer:
Frederik Heber <heber@…> (10/07/09 13:11:28)
Message:

In molecule::OutputTrajectories() ActOnAllAtoms() with new function atom::OutputTrajectory() is used.

For this to work, I had to change the Trajectory struct that was so far included in molecule.hpp to be incorporated directly into the class atom.
NOTE: This incorporation is incomplete and a ticket (#34) has been filed to remind of this issue.
However, the trajectory is better suited to reside in atom anyway and was probably just put in molecule due to memory prejudices against STL vector<>.
Functions in molecule.cpp, config.cpp, molecule_geometry.cpp and molecule_dynamics.cpp were adapted (changed from Trajectories[atom *] to atom *->Trajectory).
And the atom pointer in the Trajectory structure was removed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/atom.hpp

    r8ffe32 r567b7f  
    1818
    1919#include <iostream>
     20#include <vector>
    2021
    2122#include "element.hpp"
     
    2829class atom : public TesselPoint {
    2930  public:
    30     Vector x;       //!< coordinate array of atom, giving position within cell
    31     Vector v;       //!< velocity array of atom
     31    struct
     32    {
     33      vector<Vector> R;  //!< position vector
     34      vector<Vector> U;  //!< velocity vector
     35      vector<Vector> F;  //!< last force vector
     36    } Trajectory;
     37
     38    Vector x;       //!< coordinate vector of atom, giving last position within cell
     39    Vector v;       //!< velocity vector of atom, giving last velocity within cell
     40    Vector F;       //!< Force vector of atom, giving last force within cell
    3241    element *type;  //!< pointing to element
    3342    atom *previous; //!< previous atom in molecule list
     
    5160  virtual ~atom();
    5261
    53   bool Output(int ElementNo, int AtomNo, ofstream *out, const char *comment = NULL) const;
    54   bool Output(int *ElementNo, int *AtomNo, ofstream *out, const char *comment = NULL);
     62  bool Output(ofstream *out, int ElementNo, int AtomNo, const char *comment = NULL) const;
     63  bool Output(ofstream *out, int *ElementNo, int *AtomNo, const char *comment = NULL);
    5564  bool OutputXYZLine(ofstream *out) const;
     65  bool OutputTrajectory(ofstream *out, int *ElementNo, int *AtomNo, int step) const;
    5666  void EqualsFather ( atom *ptr, atom **res );
    5767  void CorrectFather();
     
    6676};
    6777
     78
    6879ostream & operator << (ostream &ost, const atom &a);
    6980
Note: See TracChangeset for help on using the changeset viewer.