Changeset 72e40d0 for src/Actions


Ignore:
Timestamp:
Oct 20, 2016, 8:54:48 PM (8 years ago)
Author:
Frederik Heber <heber@…>
Branches:
Action_Thermostats, Add_AtomRandomPerturbation, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_StructOpt_integration_tests, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_ChronosMutex, Fix_ForceAnnealing, Fix_ParseParticles, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, GeometryObjects, Gui_displays_atomic_force_velocity, IndependentFragmentGrids_IntegrationTest, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, RotateToPrincipalAxisSystem_UndoRedo, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, ThirdParty_MPQC_rebuilt_buildsystem, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, Ubuntu_1604_changes, stable
Children:
d24750
Parents:
a1c8fa
git-author:
Frederik Heber <heber@…> (09/27/16 11:30:09)
git-committer:
Frederik Heber <heber@…> (10/20/16 20:54:48)
Message:

Added single action to step backward and forward through time.

Location:
src/Actions
Files:
3 added
5 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/FragmentationAction/MolecularDynamicsAction.cpp

    ra1c8fa r72e40d0  
    6363  // forces are set according to summed fragmentary contributions. This is much cleaner.
    6464  prototype_actions.addAction(AR.getActionByName(std::string("verlet-integration")).clone());
     65  prototype_actions.addAction(AR.getActionByName(std::string("step-world-time")).clone());
    6566  prototype_actions.addAction(AR.getActionByName(std::string("output")).clone());
    6667  prototype_actions.addAction(AR.getActionByName(std::string("clear-fragment-results")).clone());
  • src/Actions/FragmentationAction/StructuralOptimizationAction.cpp

    ra1c8fa r72e40d0  
    7070  prototype_actions.addAction(AR.getActionByName(std::string("analyse-fragment-results")).clone());
    7171  prototype_actions.addAction(AR.getActionByName(std::string("force-annealing")).clone());
     72  prototype_actions.addAction(AR.getActionByName(std::string("step-world-time")).clone());
    7273  prototype_actions.addAction(AR.getActionByName(std::string("output")).clone());
    7374  prototype_actions.addAction(AR.getActionByName(std::string("clear-fragment-results")).clone());
  • src/Actions/GlobalListOfActions.hpp

    ra1c8fa r72e40d0  
    161161  (WorldSetBoundaryConditions) \
    162162  (WorldSetDefaultName) \
    163   (WorldSetWorldTime)
     163  (WorldSetWorldTime) \
     164  (WorldStepWorldTime)
    164165
    165166// extend list of actions in case levmar is available
  • src/Actions/Makefile.am

    ra1c8fa r72e40d0  
    605605  Actions/WorldAction/SetBoundaryConditionsAction.cpp \
    606606  Actions/WorldAction/SetDefaultNameAction.cpp \
    607   Actions/WorldAction/SetWorldTimeAction.cpp
     607  Actions/WorldAction/SetWorldTimeAction.cpp \
     608  Actions/WorldAction/StepWorldTimeAction.cpp
    608609WORLDACTIONHEADER = \
    609610  Actions/WorldAction/AddEmptyBoundaryAction.hpp \
     
    619620  Actions/WorldAction/SetBoundaryConditionsAction.hpp \
    620621  Actions/WorldAction/SetDefaultNameAction.hpp \
    621   Actions/WorldAction/SetWorldTimeAction.hpp
     622  Actions/WorldAction/SetWorldTimeAction.hpp \
     623  Actions/WorldAction/StepWorldTimeAction.hpp
    622624WORLDACTIONDEFS = \
    623625  Actions/WorldAction/AddEmptyBoundaryAction.def \
     
    633635  Actions/WorldAction/SetBoundaryConditionsAction.def \
    634636  Actions/WorldAction/SetDefaultNameAction.def \
    635   Actions/WorldAction/SetWorldTimeAction.def
     637  Actions/WorldAction/SetWorldTimeAction.def \
     638  Actions/WorldAction/StepWorldTimeAction.def
    636639
    637640#ACTIONPYTHONSOURCE_WITHDIR = $(ACTIONPROTOTYPESSOURCE:Action.cpp=Action.python.cpp)
  • src/Actions/MoleculeAction/VerletIntegrationAction.cpp

    ra1c8fa r72e40d0  
    9898  Verlet(CurrentStep+1, 1, 0, params.FixedCenterOfMass.get());
    9999  LOG(0, "STATUS: Successfully performed updates on velocity and position.");
    100   // increment to next time step: re-creates bond graph
    101   World::getInstance().setTime(CurrentStep+1);
     100//  // increment to next time step: re-creates bond graph
     101//  World::getInstance().setTime(CurrentStep+1);
    102102
    103103  // create undo state for all selected atoms (redo info):
     
    131131  // go back one step
    132132  const size_t CurrentStep = WorldTime::getInstance().getTime();
    133   World::getInstance().setTime(CurrentStep-1);
     133//  World::getInstance().setTime(CurrentStep-1);
    134134
    135135  // remove current step for all modified atoms
    136   removeLastStep(getIdsFromAtomicInfo(state->UndoInfo), CurrentStep);
     136  removeLastStep(getIdsFromAtomicInfo(state->UndoInfo), CurrentStep+1);
    137137
    138138  // and set back the old step (forces have been changed)
     
    151151
    152152  // set stored new state
    153   size_t CurrentStep = WorldTime::getInstance().getTime()+1;
    154   addNewStep(state->UndoInfo, CurrentStep);
     153  size_t CurrentStep = WorldTime::getInstance().getTime();
     154  addNewStep(state->UndoInfo, CurrentStep+1);
    155155
    156156  // add a new time step
    157   World::getInstance().setTime(CurrentStep);
     157  World::getInstance().setTime(CurrentStep+1);
    158158
    159159  // and set positions of the new step
    160160  ResetAtomPosition(state->UndoInfo, state->UpdatedStep[PositionIndex]);
     161
     162  // step back to old time step
     163  World::getInstance().setTime(CurrentStep-1);
    161164
    162165  return ActionState::ptr(_state);
Note: See TracChangeset for help on using the changeset viewer.