Ignore:
Timestamp:
Apr 10, 2018, 6:43:12 AM (7 years ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
AutomationFragmentation_failures, Candidate_v1.6.1, ChemicalSpaceEvaluator, Enhanced_StructuralOptimization_continued, Exclude_Hydrogens_annealWithBondGraph, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_contraction-expansion, Gui_displays_atomic_force_velocity, PythonUI_with_named_parameters, StoppableMakroAction, TremoloParser_IncreasedPrecision
Children:
6145577
Parents:
efd020
git-author:
Frederik Heber <frederik.heber@…> (08/03/17 10:46:48)
git-committer:
Frederik Heber <frederik.heber@…> (04/10/18 06:43:12)
Message:

atom::removeStep() extended to removing interval of steps.

  • AtomInfo::removeTrajectorySteps() and BondedParticle::removeTrajectorySteps() changed and all calls adapted.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Atom/atom_atominfo.cpp

    refd020 r8c6b68  
    101101}
    102102
    103 void AtomInfo::removeTrajectoryStep(const unsigned int _step)
     103void AtomInfo::eraseInTrajctory(
     104    VectorTrajectory_t &_trajectory,
     105    const unsigned int _firststep, const unsigned int _laststep)
     106{
     107  const VectorTrajectory_t::iterator firstiter = _trajectory.lower_bound(_firststep);
     108  const VectorTrajectory_t::iterator lastiter = _trajectory.upper_bound(_laststep);
     109  _trajectory.erase(firstiter, lastiter);
     110}
     111
     112void AtomInfo::removeTrajectorySteps(const unsigned int _firststep, const unsigned int _laststep)
    104113{
    105114  NOTIFY(TrajectoryChanged);
    106   AtomicPosition.erase(_step);
    107   AtomicVelocity.erase(_step);
    108   AtomicForce.erase(_step);
    109   LOG(5,"AtomInfo::removeTrajectoryStep() called, size is ("
     115  eraseInTrajctory(AtomicPosition, _firststep, _laststep);
     116  eraseInTrajctory(AtomicVelocity, _firststep, _laststep);
     117  eraseInTrajctory(AtomicForce, _firststep, _laststep);
     118  LOG(5,"AtomInfo::removeTrajectorySteps() called, size is ("
    110119      << AtomicPosition.size() << ","
    111120      << AtomicVelocity.size() << ","
Note: See TracChangeset for help on using the changeset viewer.