Changeset 6145577 for src/Atom


Ignore:
Timestamp:
Apr 10, 2018, 6:43:12 AM (7 years ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
AutomationFragmentation_failures, Candidate_v1.6.1, ChemicalSpaceEvaluator, Enhanced_StructuralOptimization_continued, Exclude_Hydrogens_annealWithBondGraph, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_contraction-expansion, Gui_displays_atomic_force_velocity, PythonUI_with_named_parameters, StoppableMakroAction, TremoloParser_IncreasedPrecision
Children:
c87d6e
Parents:
8c6b68
git-author:
Frederik Heber <frederik.heber@…> (08/03/17 10:47:26)
git-committer:
Frederik Heber <frederik.heber@…> (04/10/18 06:43:12)
Message:

FIX: ForceAnnealingAction's Undo is again working.

  • AtomicInfo::setAtom() and SetAtomsFromAtomicInfo() now accept a time step. This allows to undo changes to the old state (where forces might have been passed to) and the current state (modified by time integration).
  • TESTFIX: ForceAnnealing's undo test.conf was no longer valid since the additional time stepping is extracted (and the tests were changed already). I.e. the extra trajectory step is because of step-world-time and not because of force-annealing. Hence, it should not be undone here.
Location:
src/Atom
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/Atom/AtomicInfo.cpp

    r8c6b68 r6145577  
    5858{}
    5959
    60 AtomicInfo::AtomicInfo(const atom &_atom) :
    61     Position(_atom.getPosition()),
     60AtomicInfo::AtomicInfo(const atom &_atom, unsigned int _step) :
     61    Position(_atom.getPositionAtStep(_step)),
    6262    Type(_atom.getType()),
    6363    charge(_atom.getCharge()),
    64     Velocity(_atom.getAtomicVelocity()),
    65     Force(_atom.getAtomicForce()),
     64    Velocity(_atom.getAtomicVelocityAtStep(_step)),
     65    Force(_atom.getAtomicForceAtStep(_step)),
    6666    FatherId(_atom.father->getId()),
    6767    MolId(0),
     
    101101
    102102
    103 bool AtomicInfo::setAtom(atom &_atom) const
     103bool AtomicInfo::setAtom(atom &_atom, const unsigned int _step) const
    104104{
    105   _atom.setPosition(Position);
     105  _atom.setPositionAtStep(_step, Position);
    106106  _atom.setType(Type);
    107107  _atom.setCharge(charge);
    108   _atom.setAtomicVelocity(Velocity);
    109   _atom.setAtomicForce(Force);
     108  _atom.setAtomicVelocityAtStep(_step, Velocity);
     109  _atom.setAtomicForceAtStep(_step, Force);
    110110
    111111  // set old id
  • src/Atom/AtomicInfo.hpp

    r8c6b68 r6145577  
    2020
    2121#include "Bond/BondInfo.hpp"
     22#include "WorldTime.hpp"
    2223
    2324class atom;
     
    3132public:
    3233  AtomicInfo();
    33   AtomicInfo(const atom &_atom);
     34  AtomicInfo(const atom &_atom, const unsigned int _step = WorldTime::getTime());
    3435  AtomicInfo(const AtomicInfo &_atominfo);
    3536  ~AtomicInfo();
    3637
    37   bool setAtom(atom &_atom) const;
     38  bool setAtom(atom &_atom, const unsigned int _step = WorldTime::getTime()) const;
    3839  atomId_t getId() const;
    3940
Note: See TracChangeset for help on using the changeset viewer.