Changeset 0efd21
- Timestamp:
- Sep 30, 2016, 3:51:37 PM (9 years ago)
- Branches:
- Fix_ParseParticles_split_forward_backward_Actions
- Parents:
- 4d1aef
- git-author:
- Frederik Heber <heber@…> (09/27/16 14:37:40)
- git-committer:
- Frederik Heber <heber@…> (09/30/16 15:51:37)
- Files:
-
- 5 added
- 1 deleted
- 8 edited
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified doc/userguide/userguide.xml ¶
r4d1aef r0efd21 2057 2057 the final one containing the optimized structure.</para> 2058 2058 </section> 2059 <section xml:id="dynamics.step- world-time">2060 <title xml:id="dynamics.step- world-time.title">Step forward and backward through world time</title>2059 <section xml:id="dynamics.step-forward"> 2060 <title xml:id="dynamics.step-forward.title">Step forward through world time</title> 2061 2061 <para>Some MacroActions are applied for a number of steps and need to 2062 2062 increment the current world time, e.g. molecule dynamics or structure 2063 2063 optimization. To this end, we may call upon 2064 2064 </para> 2065 <programlisting>... --step-world-time 1</programlisting> 2066 <para>Note that the argument gives the number of steps to step forward 2067 and may be any integer. Hence, we may also step backwards.</para> 2065 <programlisting>... --step-forward 1</programlisting> 2066 <note>Instead of "1" any number of steps may be given.</note> 2067 </section> 2068 <section xml:id="dynamics.step-backward"> 2069 <title xml:id="dynamics.step-backward.title">Step backward through world time</title> 2070 <para>Reverse to stepping forward through the world time, we also 2071 may step backward 2072 </para> 2073 <programlisting>... --step-backward 1</programlisting> 2068 2074 </section> 2069 2075 <section xml:id="dynamics.set-world-time"> -
TabularUnified src/Actions/FragmentationAction/MolecularDynamicsAction.cpp ¶
r4d1aef r0efd21 63 63 // forces are set according to summed fragmentary contributions. This is much cleaner. 64 64 prototype_actions.addAction(AR.getActionByName(std::string("verlet-integration")).clone()); 65 prototype_actions.addAction(AR.getActionByName(std::string("step- world-time")).clone());65 prototype_actions.addAction(AR.getActionByName(std::string("step-forward")).clone()); 66 66 prototype_actions.addAction(AR.getActionByName(std::string("output")).clone()); 67 67 prototype_actions.addAction(AR.getActionByName(std::string("clear-fragment-results")).clone()); -
TabularUnified src/Actions/FragmentationAction/StructuralOptimizationAction.cpp ¶
r4d1aef r0efd21 70 70 prototype_actions.addAction(AR.getActionByName(std::string("analyse-fragment-results")).clone()); 71 71 prototype_actions.addAction(AR.getActionByName(std::string("force-annealing")).clone()); 72 prototype_actions.addAction(AR.getActionByName(std::string("step- world-time")).clone());72 prototype_actions.addAction(AR.getActionByName(std::string("step-forward")).clone()); 73 73 prototype_actions.addAction(AR.getActionByName(std::string("output")).clone()); 74 74 prototype_actions.addAction(AR.getActionByName(std::string("clear-fragment-results")).clone()); -
TabularUnified src/Actions/GlobalListOfActions.hpp ¶
r4d1aef r0efd21 162 162 (WorldSetDefaultName) \ 163 163 (WorldSetWorldTime) \ 164 (WorldStepWorldTime) 164 (WorldStepBackwardWorldTime) \ 165 (WorldStepForwardWorldTime) 165 166 166 167 // extend list of actions in case levmar is available -
TabularUnified src/Actions/Makefile.am ¶
r4d1aef r0efd21 606 606 Actions/WorldAction/SetDefaultNameAction.cpp \ 607 607 Actions/WorldAction/SetWorldTimeAction.cpp \ 608 Actions/WorldAction/StepWorldTimeAction.cpp 608 Actions/WorldAction/StepBackwardWorldTimeAction.cpp \ 609 Actions/WorldAction/StepForwardWorldTimeAction.cpp 609 610 WORLDACTIONHEADER = \ 610 611 Actions/WorldAction/AddEmptyBoundaryAction.hpp \ … … 621 622 Actions/WorldAction/SetDefaultNameAction.hpp \ 622 623 Actions/WorldAction/SetWorldTimeAction.hpp \ 623 Actions/WorldAction/StepWorldTimeAction.hpp 624 Actions/WorldAction/StepBackwardWorldTimeAction.hpp \ 625 Actions/WorldAction/StepForwardWorldTimeAction.hpp 624 626 WORLDACTIONDEFS = \ 625 627 Actions/WorldAction/AddEmptyBoundaryAction.def \ … … 636 638 Actions/WorldAction/SetDefaultNameAction.def \ 637 639 Actions/WorldAction/SetWorldTimeAction.def \ 638 Actions/WorldAction/StepWorldTimeAction.def 640 Actions/WorldAction/StepBackwardWorldTimeAction.def \ 641 Actions/WorldAction/StepForwardWorldTimeAction.def 639 642 640 643 #ACTIONPYTHONSOURCE_WITHDIR = $(ACTIONPROTOTYPESSOURCE:Action.cpp=Action.python.cpp) -
TabularUnified src/Actions/WorldAction/StepBackwardWorldTimeAction.def ¶
r4d1aef r0efd21 1 1 /* 2 * Step WorldTimeAction.def2 * StepBackwardWorldTimeAction.def 3 3 * 4 4 * Created on: Sep 27, 2016 … … 8 8 // all includes and backward declarations necessary for non-integral types below 9 9 10 11 #include "Parameters/Validators/ DummyValidator.hpp"10 #include <limits> 11 #include "Parameters/Validators/RangeValidator.hpp" 12 12 13 13 // i.e. there is an integer with variable name Z that can be found in 14 14 // ValueStorage by the token "Z" -> first column: int, Z, "Z" 15 15 // "undefine" if no parameters are required, use (NOPARAM_DEFAULT) for each (undefined) default value 16 #define paramtypes ( int)17 #define paramtokens ("step- world-time")18 #define paramdescriptions ("how many steps to take forward orbackward")19 # undef paramdefaults20 #define paramreferences (steps )16 #define paramtypes (unsigned int) 17 #define paramtokens ("step-backward") 18 #define paramdescriptions ("how many steps to take backward") 19 #define paramdefaults (PARAM_DEFAULT(1)) 20 #define paramreferences (steps_backward) 21 21 #define paramvalids \ 22 ( DummyValidator< int >())22 (RangeValidator<unsigned int>(1, std::numeric_limits<unsigned int>::max())) 23 23 24 24 #define statetypes (unsigned int) … … 28 28 #define CATEGORY World 29 29 #define MENUNAME "world" 30 #define MENUPOSITION 1 231 #define ACTIONNAME Step WorldTime32 #define TOKEN "step- world-time"30 #define MENUPOSITION 13 31 #define ACTIONNAME StepBackwardWorldTime 32 #define TOKEN "step-backward" 33 33 34 34 35 35 // finally the information stored in the ActionTrait specialization 36 #define DESCRIPTION "step forward orbackward a certain amount of steps in world time"36 #define DESCRIPTION "step backward a certain amount of steps in world time" 37 37 #undef SHORTFORM -
TabularUnified src/Actions/WorldAction/StepForwardWorldTimeAction.cpp ¶
r4d1aef r0efd21 22 22 23 23 /* 24 * Step WorldTimeAction.cpp24 * StepForwardWorldTimeAction.cpp 25 25 * 26 26 * Created on: Sep 27, 2016 … … 43 43 #include <string> 44 44 45 #include "Actions/WorldAction/Step WorldTimeAction.hpp"45 #include "Actions/WorldAction/StepForwardWorldTimeAction.hpp" 46 46 47 47 using namespace MoleCuilder; 48 48 49 49 // and construct the stuff 50 #include "Step WorldTimeAction.def"50 #include "StepForwardWorldTimeAction.def" 51 51 #include "Action_impl_pre.hpp" 52 52 /** =========== define the function ====================== */ 53 ActionState::ptr WorldStep WorldTimeAction::performCall() {53 ActionState::ptr WorldStepForwardWorldTimeAction::performCall() { 54 54 // create undo state 55 55 int oldtime; 56 56 oldtime = WorldTime::getTime(); 57 WorldStep WorldTimeState *UndoState = new WorldStepWorldTimeState(oldtime, params);57 WorldStepForwardWorldTimeState *UndoState = new WorldStepForwardWorldTimeState(oldtime, params); 58 58 59 if ((oldtime + params.steps.get()) < 0) { 60 ELOG(1, "Cannot step back before time step #0."); 61 return Action::failure; 62 } 63 World::getInstance().setTime(oldtime+params.steps.get()); 59 World::getInstance().setTime(oldtime+params.steps_forward.get()); 64 60 LOG(0, "Current time step is now: " << WorldTime::getTime() << "."); 65 61 return ActionState::ptr(UndoState); 66 62 } 67 63 68 ActionState::ptr WorldStep WorldTimeAction::performUndo(ActionState::ptr _state) {69 WorldStep WorldTimeState *state = assert_cast<WorldStepWorldTimeState*>(_state.get());64 ActionState::ptr WorldStepForwardWorldTimeAction::performUndo(ActionState::ptr _state) { 65 WorldStepForwardWorldTimeState *state = assert_cast<WorldStepForwardWorldTimeState*>(_state.get()); 70 66 71 67 World::getInstance().setTime(state->oldtime); … … 75 71 } 76 72 77 ActionState::ptr WorldStep WorldTimeAction::performRedo(ActionState::ptr _state){78 WorldStep WorldTimeState *state = assert_cast<WorldStepWorldTimeState*>(_state.get());73 ActionState::ptr WorldStepForwardWorldTimeAction::performRedo(ActionState::ptr _state){ 74 WorldStepForwardWorldTimeState *state = assert_cast<WorldStepForwardWorldTimeState*>(_state.get()); 79 75 80 World::getInstance().setTime(state->oldtime+state->params.steps .get());76 World::getInstance().setTime(state->oldtime+state->params.steps_forward.get()); 81 77 LOG(0, "Current time step is now: " << WorldTime::getTime() << "."); 82 78 … … 84 80 } 85 81 86 bool WorldStep WorldTimeAction::canUndo() {82 bool WorldStepForwardWorldTimeAction::canUndo() { 87 83 return true; 88 84 } 89 85 90 bool WorldStep WorldTimeAction::shouldUndo() {86 bool WorldStepForwardWorldTimeAction::shouldUndo() { 91 87 return true; 92 88 } -
TabularUnified tests/Python/AllActions/options.dat ¶
r4d1aef r0efd21 225 225 skiplines "2" 226 226 start-step "0" 227 step-world-time "1" 227 step-backward "1" 228 step-forward "1" 228 229 steps "5" 229 230 store-grids "0" -
TabularUnified tests/regression/Makefile.am ¶
r4d1aef r0efd21 243 243 $(srcdir)/WorldTime/testsuite-worldtime.at \ 244 244 $(srcdir)/WorldTime/SetWorldTime/testsuite-worldtime-set-world-time.at \ 245 $(srcdir)/WorldTime/StepWorldTime/testsuite-worldtime-step-world-time.at 245 $(srcdir)/WorldTime/StepWorldTime/testsuite-worldtime-step-backward.at \ 246 $(srcdir)/WorldTime/StepWorldTime/testsuite-worldtime-step-forward.at 246 247 247 248 max_jobs = 4 -
TabularUnified tests/regression/WorldTime/StepWorldTime/testsuite-worldtime-step-backward.at ¶
r4d1aef r0efd21 18 18 ### step through world time 19 19 20 AT_SETUP([Worldtime - stepping ])21 AT_KEYWORDS([worldtime step- world-timeset-world-time])20 AT_SETUP([Worldtime - stepping backward]) 21 AT_KEYWORDS([worldtime step-backward set-world-time]) 22 22 23 AT_CHECK([../../molecuilder --step-world-time 1], 0, [stdout], [stderr]) 24 AT_CHECK([fgrep "Current time step is now: 1" stdout], 0, [ignore], [ignore]) 25 AT_CHECK([../../molecuilder --set-world-time 4 --step-world-time -2], 0, [stdout], [stderr]) 23 AT_CHECK([../../molecuilder --set-world-time 4 --step-backward 2], 0, [stdout], [stderr]) 26 24 AT_CHECK([fgrep "Current time step is now: 2" stdout], 0, [ignore], [ignore]) 25 # test default 26 AT_CHECK([../../molecuilder --set-world-time 1 --step-backward], 0, [stdout], [stderr]) 27 AT_CHECK([fgrep "Current time step is now: 0" stdout], 0, [ignore], [ignore]) 27 28 # stepping back too far fails 28 AT_CHECK([../../molecuilder --set-world-time 1 --step- world-time -2], 5, [stdout], [stderr])29 AT_CHECK([../../molecuilder --set-world-time 1 --step-backward 2], 5, [stdout], [stderr]) 29 30 30 31 AT_CLEANUP 31 32 32 33 33 AT_SETUP([Worldtime - stepping with Undo])34 AT_KEYWORDS([worldtime step- world-timeset-world-time undo])34 AT_SETUP([Worldtime - stepping backward with Undo]) 35 AT_KEYWORDS([worldtime step-backward set-world-time undo]) 35 36 36 AT_CHECK([../../molecuilder --set-world-time 2 --step- world-time -1 --undo], 0, [stdout], [stderr])37 AT_CHECK([../../molecuilder --set-world-time 2 --step-backward 1 --undo], 0, [stdout], [stderr]) 37 38 AT_CHECK([fgrep "Current time step is now again: 2" stdout], 0, [ignore], [ignore]) 38 39 39 40 AT_CLEANUP 40 41 41 AT_SETUP([Worldtime - stepping with Redo])42 AT_KEYWORDS([worldtime step- world-timeset-world-time undo redo])42 AT_SETUP([Worldtime - stepping backward with Redo]) 43 AT_KEYWORDS([worldtime step-backward set-world-time undo redo]) 43 44 44 AT_CHECK([../../molecuilder --set-world-time 2 --step- world-time -1 --undo --redo], 0, [stdout], [stderr])45 AT_CHECK([../../molecuilder --set-world-time 2 --step-backward 1 --undo --redo], 0, [stdout], [stderr]) 45 46 AT_CHECK([fgrep "Current time step is now: 1" stdout], 0, [ignore], [ignore]) 46 47 -
TabularUnified tests/regression/WorldTime/testsuite-worldtime.at ¶
r4d1aef r0efd21 22 22 23 23 # stepping 24 m4_include([WorldTime/StepWorldTime/testsuite-worldtime-step-world-time.at]) 24 m4_include([WorldTime/StepWorldTime/testsuite-worldtime-step-forward.at]) 25 m4_include([WorldTime/StepWorldTime/testsuite-worldtime-step-backward.at])
Note:
See TracChangeset
for help on using the changeset viewer.