Candidate_v1.7.0
        stable
      
      
        
          | Last change
 on this file since e9f307 was             6145577, checked in by Frederik Heber <frederik.heber@…>, 8 years ago | 
        
          | 
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.
 | 
        
          | 
              
Property                 mode
 set to                 100644 | 
        
          | File size:
            1.1 KB | 
      
      
| Line |  | 
|---|
| 1 | /* | 
|---|
| 2 | * AtomicInfo.hpp | 
|---|
| 3 | * | 
|---|
| 4 | *  Created on: Aug 10, 2010 | 
|---|
| 5 | *      Author: heber | 
|---|
| 6 | */ | 
|---|
| 7 |  | 
|---|
| 8 | #ifndef ATOMICINFO_HPP_ | 
|---|
| 9 | #define ATOMICINFO_HPP_ | 
|---|
| 10 |  | 
|---|
| 11 | // include config.h | 
|---|
| 12 | #ifdef HAVE_CONFIG_H | 
|---|
| 13 | #include <config.h> | 
|---|
| 14 | #endif | 
|---|
| 15 |  | 
|---|
| 16 | #include "LinearAlgebra/Vector.hpp" | 
|---|
| 17 | #include "types.hpp" | 
|---|
| 18 |  | 
|---|
| 19 | #include <vector> | 
|---|
| 20 |  | 
|---|
| 21 | #include "Bond/BondInfo.hpp" | 
|---|
| 22 | #include "WorldTime.hpp" | 
|---|
| 23 |  | 
|---|
| 24 | class atom; | 
|---|
| 25 | class element; | 
|---|
| 26 | class molecule; | 
|---|
| 27 |  | 
|---|
| 28 | /** This is for storing and transfering the information contained within an atom. | 
|---|
| 29 | * This is needed for Undo/Redo operations of AtomActions. | 
|---|
| 30 | */ | 
|---|
| 31 | class AtomicInfo { | 
|---|
| 32 | public: | 
|---|
| 33 | AtomicInfo(); | 
|---|
| 34 | AtomicInfo(const atom &_atom, const unsigned int _step = WorldTime::getTime()); | 
|---|
| 35 | AtomicInfo(const AtomicInfo &_atominfo); | 
|---|
| 36 | ~AtomicInfo(); | 
|---|
| 37 |  | 
|---|
| 38 | bool setAtom(atom &_atom, const unsigned int _step = WorldTime::getTime()) const; | 
|---|
| 39 | atomId_t getId() const; | 
|---|
| 40 |  | 
|---|
| 41 | AtomicInfo& operator=(const AtomicInfo&); | 
|---|
| 42 |  | 
|---|
| 43 | private: | 
|---|
| 44 | Vector Position; | 
|---|
| 45 | const element * Type; | 
|---|
| 46 | double charge; | 
|---|
| 47 | Vector Velocity; | 
|---|
| 48 | Vector Force; | 
|---|
| 49 | atomId_t FatherId; | 
|---|
| 50 | moleculeId_t MolId; | 
|---|
| 51 | atomId_t Id; | 
|---|
| 52 | int Nr; | 
|---|
| 53 | std::vector<BondInfo> bonds; | 
|---|
| 54 | }; | 
|---|
| 55 |  | 
|---|
| 56 |  | 
|---|
| 57 | #endif /* ATOMICINFO_HPP_ */ | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.