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/molecule_geometry.cpp

    r8ffe32 r567b7f  
    200200    ptr = ptr->next;
    201201    for (int j=0;j<MDSteps;j++)
    202       Trajectories[ptr].R.at(j).Scale(factor);
     202      ptr->Trajectory.R.at(j).Scale(factor);
    203203    ptr->x.Scale(factor);
    204204  }
     
    215215    ptr = ptr->next;
    216216    for (int j=0;j<MDSteps;j++)
    217       Trajectories[ptr].R.at(j).Translate(trans);
     217      ptr->Trajectory.R.at(j).Translate(trans);
    218218    ptr->x.Translate(trans);
    219219  }
     
    438438    ptr->x.x[2] = -sin(alpha) * tmp + cos(alpha) * ptr->x.x[2];
    439439    for (int j=0;j<MDSteps;j++) {
    440       tmp = Trajectories[ptr].R.at(j).x[0];
    441       Trajectories[ptr].R.at(j).x[0] =  cos(alpha) * tmp + sin(alpha) * Trajectories[ptr].R.at(j).x[2];
    442       Trajectories[ptr].R.at(j).x[2] = -sin(alpha) * tmp + cos(alpha) * Trajectories[ptr].R.at(j).x[2];
     440      tmp = ptr->Trajectory.R.at(j).x[0];
     441      ptr->Trajectory.R.at(j).x[0] =  cos(alpha) * tmp + sin(alpha) * ptr->Trajectory.R.at(j).x[2];
     442      ptr->Trajectory.R.at(j).x[2] = -sin(alpha) * tmp + cos(alpha) * ptr->Trajectory.R.at(j).x[2];
    443443    }
    444444  }
     
    461461    ptr->x.x[2] = -sin(alpha) * tmp + cos(alpha) * ptr->x.x[2];
    462462    for (int j=0;j<MDSteps;j++) {
    463       tmp = Trajectories[ptr].R.at(j).x[1];
    464       Trajectories[ptr].R.at(j).x[1] =  cos(alpha) * tmp + sin(alpha) * Trajectories[ptr].R.at(j).x[2];
    465       Trajectories[ptr].R.at(j).x[2] = -sin(alpha) * tmp + cos(alpha) * Trajectories[ptr].R.at(j).x[2];
     463      tmp = ptr->Trajectory.R.at(j).x[1];
     464      ptr->Trajectory.R.at(j).x[1] =  cos(alpha) * tmp + sin(alpha) * ptr->Trajectory.R.at(j).x[2];
     465      ptr->Trajectory.R.at(j).x[2] = -sin(alpha) * tmp + cos(alpha) * ptr->Trajectory.R.at(j).x[2];
    466466    }
    467467  }
Note: See TracChangeset for help on using the changeset viewer.