Ignore:
Timestamp:
Jul 20, 2017, 9:38:38 AM (8 years ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
ForceAnnealing_with_BondGraph_continued
Children:
8270be
Parents:
44441a
git-author:
Frederik Heber <frederik.heber@…> (06/27/17 21:02:47)
git-committer:
Frederik Heber <frederik.heber@…> (07/20/17 09:38:38)
Message:

Sorting given selected atoms by ids in ForceAnnealing.

File:
1 edited

Legend:

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

    r44441a r1050ac  
    7171    return Action::failure;
    7272  }
     73  // first, we need to sort the mixin according to their ids (as selected atoms are sorted
     74  // according to their arbitrary address in memory)
     75  set.sortByIds();
     76
     77  // create undo state for all selected atoms (undo info)
     78  std::vector<AtomicInfo> UndoInfo;
     79  UndoInfo.reserve(set.size());
     80  {
     81    for (World::AtomSelectionConstIterator iter = World::getInstance().beginAtomSelection();
     82        iter != World::getInstance().endAtomSelection();
     83        ++iter)
     84      UndoInfo.push_back(AtomicInfo(*(iter->second)));
     85  }
     86
    7387  // we always operate relative to current time step, except on single debug output
    7488  size_t CurrentStep = WorldTime::getInstance().getTime();
     
    103117    else
    104118      LOG(2, "File " << params.forcesfile.get() << " found and parsed.");
    105   }
    106 
    107   // create undo state for all selected atoms (undo info)
    108   std::vector<AtomicInfo> UndoInfo;
    109   UndoInfo.reserve(set.size());
    110   {
    111     for (World::AtomSelectionConstIterator iter = World::getInstance().beginAtomSelection();
    112         iter != World::getInstance().endAtomSelection();
    113         ++iter)
    114       UndoInfo.push_back(AtomicInfo(*(iter->second)));
    115119  }
    116120
Note: See TracChangeset for help on using the changeset viewer.