Ignore:
Timestamp:
Sep 13, 2017, 5:20:45 PM (8 years ago)
Author:
Frederik Heber <frederik.heber@…>
Children:
1db3520
Parents:
15acdb
Message:

ForceAnnealing returns whether to stop and ForceAnnealingAction stops MakroAction if inside such.

  • this is done by setting the MakroAction's loop variable to the current step which is now accessible.
  • ForceAnnealing currently has a fixed value of 1e-8 when the force components are below to stop annealing.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/MoleculeAction/ForceAnnealingAction.cpp

    r15acdb r1e4f0a  
    3535//#include "CodePatterns/MemDebug.hpp"
    3636
     37#include "Actions/ActionExceptions.hpp"
     38#include "Actions/MakroAction.hpp"
    3739#include "Actions/UndoRedoHelpers.hpp"
    3840#include "Atom/atom.hpp"
     
    126128  // perform optimization step
    127129  LOG(1, "Structural optimization.");
    128   optimizer(CurrentStep, 1, params.UseBondGraph.get());
     130  const bool StopStatus = optimizer(CurrentStep, 1, params.UseBondGraph.get());
    129131  STATUS("Successfully optimized structure by one step.");
     132
     133  if (StopStatus && ActionQueue::getInstance().isMakroAction()) {
     134    // send stop signal if we are taking part in MakroAction
     135    MakroAction * const makroaction =
     136        dynamic_cast<MakroAction *>(
     137            const_cast<Action *>(
     138                &ActionQueue::getInstance().getCurrentAction()));
     139    if (makroaction != NULL) {
     140      makroaction->setLoop(makroaction->getStep());
     141    } else {
     142      ELOG(2, "ActionQueue said we are inside process, but current Action is not a process?");
     143      // do nothing
     144    }
     145  }
    130146
    131147  std::vector<AtomicInfo> RedoInfo;
Note: See TracChangeset for help on using the changeset viewer.