Changeset 4b2adf for src/Actions


Ignore:
Timestamp:
Jun 20, 2018, 8:20:43 AM (7 years ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
AutomationFragmentation_failures, Candidate_v1.6.1, ChemicalSpaceEvaluator, Exclude_Hydrogens_annealWithBondGraph, ForceAnnealing_with_BondGraph_contraction-expansion, StoppableMakroAction
Children:
70caa3
Parents:
e3ce0e
git-author:
Frederik Heber <frederik.heber@…> (12/03/17 17:31:16)
git-committer:
Frederik Heber <frederik.heber@…> (06/20/18 08:20:43)
Message:

ForceAnnealiing now returns bool to indicate stop condition for MakroAction.

  • Introducing FORCE_THRESHOLD below which we always stop.
  • modified (simplified) bond side picking criterion.
  • added some explanations to annealWithBondgraph().
File:
1 edited

Legend:

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

    re3ce0e r4b2adf  
    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"
     
    120122  // perform optimization step
    121123  LOG(1, "Structural optimization.");
    122   optimizer(CurrentStep, 1, params.UseBondGraph.get());
     124  const bool StopStatus = optimizer(CurrentStep, 1, params.UseBondGraph.get());
    123125  STATUS("Successfully optimized structure by one step.");
     126
     127  if (StopStatus && ActionQueue::getInstance().isMakroAction()) {
     128    // send stop signal if we are taking part in MakroAction
     129    MakroAction * const makroaction =
     130        dynamic_cast<MakroAction *>(
     131            const_cast<Action *>(
     132                &ActionQueue::getInstance().getCurrentAction()));
     133    if (makroaction != NULL) {
     134      makroaction->setLoop(makroaction->getStep());
     135    } else {
     136      ELOG(2, "ActionQueue said we are inside process, but current Action is not a process?");
     137      // do nothing
     138    }
     139  }
    124140
    125141  std::vector< std::vector<AtomicInfo> > RedoInfo(2);
Note: See TracChangeset for help on using the changeset viewer.