Changeset 95b64f for src


Ignore:
Timestamp:
Jul 3, 2017, 3:07:28 PM (7 years ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
Action_Thermostats, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_StructOpt_integration_tests, AutomationFragmentation_failures, Candidate_v1.6.1, ChemicalSpaceEvaluator, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, 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, Recreated_GuiChecks, StoppableMakroAction, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps
Children:
220d2c, efc80e
Parents:
3cfb31
git-author:
Frederik Heber <frederik.heber@…> (06/17/17 21:09:17)
git-committer:
Frederik Heber <frederik.heber@…> (07/03/17 15:07:28)
Message:

Implemented missing AtomInfo::setAtStep().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Atom/atom_atominfo.cpp

    r3cfb31 r95b64f  
    179179}
    180180
     181void AtomInfo::setAtStep(size_t i, unsigned int _step, const double value)
     182{
     183  OBSERVE;
     184  NOTIFY(AtomObservable::PositionChanged);
     185  VectorTrajectory_t::iterator iter = AtomicPosition.find(_step);
     186  if (iter !=  AtomicPosition.end()) {
     187    iter->second[i] = value;
     188  } else {
     189    Vector newPos;
     190    newPos[i] = value;
     191#ifndef NDEBUG
     192    std::pair<VectorTrajectory_t::iterator, bool> inserter =
     193#endif
     194        AtomicPosition.insert( std::make_pair(_step, newPos) );
     195    ASSERT( inserter.second,
     196        "AtomInfo::setAtStep() - time step "+toString(_step)
     197        +" present after all?");
     198  }
     199}
     200
    181201/** Helps to determine whether the current step really exists or getPosition() has just
    182202 * delivered the one closest to it in the past.
Note: See TracChangeset for help on using the changeset viewer.