Changeset 9f2071 for src


Ignore:
Timestamp:
Jun 21, 2017, 9:15:15 PM (8 years ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
Action_Thermostats, Add_AtomRandomPerturbation, Add_SelectAtomByNameAction, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_StructOpt_integration_tests, AutomationFragmentation_failures, Candidate_v1.6.1, ChangeBugEmailaddress, ChemicalSpaceEvaluator, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph_documentation, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, ForceAnnealing_oldresults, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, Gui_displays_atomic_force_velocity, IndependentFragmentGrids_IntegrationTest, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, StoppableMakroAction, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps
Children:
7294dc
Parents:
137845
git-author:
Frederik Heber <heber@…> (03/23/17 03:36:28)
git-committer:
Frederik Heber <frederik.heber@…> (06/21/17 21:15:15)
Message:

FIX: World::setTime() now correctly copies the current state to the next time step.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/World.cpp

    r137845 r9f2071  
    234234}
    235235
    236 void copyBondgraph(const unsigned int _srcstep, const unsigned int _deststep)
     236static void copyBondgraph(const unsigned int _srcstep, const unsigned int _deststep)
    237237{
    238238  // gather all bonds from _srcstep
     
    259259}
    260260
     261static void copyAtoms(const unsigned int _srcstep, const unsigned int _deststep)
     262{
     263  for (World::AtomIterator iter = World::getInstance().getAtomIter();
     264      iter != World::getInstance().atomEnd(); ++iter) {
     265    atom * const Walker = *iter;
     266    Walker->UpdateStep(_deststep);
     267    Walker->setPositionAtStep(_deststep, Walker->getPositionAtStep(_srcstep));
     268    Walker->setAtomicVelocityAtStep(_deststep, Walker->getAtomicVelocityAtStep(_srcstep));
     269    Walker->setAtomicForceAtStep(_deststep, Walker->getAtomicForceAtStep(_srcstep));
     270  }
     271}
     272
    261273void World::setTime(const unsigned int _step)
    262274{
     
    264276    const unsigned int oldstep = WorldTime::getTime();
    265277
     278    copyAtoms(oldstep, _step);
    266279    // 1. copy bond graph (such not each addBond causes GUI update)
    267280    if (!areBondsPresent(_step)) {
Note: See TracChangeset for help on using the changeset viewer.