Ignore:
Timestamp:
Apr 10, 2018, 6:43:30 AM (7 years ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
AutomationFragmentation_failures, Candidate_v1.6.1, ChemicalSpaceEvaluator, Exclude_Hydrogens_annealWithBondGraph, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_contraction-expansion, Gui_displays_atomic_force_velocity, PythonUI_with_named_parameters, StoppableMakroAction, TremoloParser_IncreasedPrecision
Children:
825d33
Parents:
2f3905
git-author:
Frederik Heber <frederik.heber@…> (06/29/17 14:40:12)
git-committer:
Frederik Heber <frederik.heber@…> (04/10/18 06:43:30)
Message:

BondVectors now return subset of BondVectors for a given atom.

  • functionality extracted from ForceAnnealing::annealWithBondgraph().
  • also the mapped_t type is now kept up-to-date internally as we need it for returning the subset efficiently over a number of atoms, e.g. all in the given range.
  • also moved a few simple implementations over to _impl module.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Dynamics/BondVectors_impl.hpp

    r2f3905 r9861d0  
    2121#include "Atom/atom.hpp"
    2222
     23BondVectors::BondVectors() :
     24  map_is_dirty(false),
     25  current_step_for_map((size_t)-1)
     26{}
     27
    2328template <class T>
    2429void BondVectors::setFromAtomRange(
     
    3641  std::sort(container.begin(), container.end());
    3742  container.erase(std::unique(container.begin(), container.end()), container.end());
     43  map_is_dirty = true;
    3844}
    3945
     46const BondVectors::mapped_t&
     47BondVectors::getBondVectorsAtStep(const size_t &_step) const
     48{
     49  if (map_is_dirty || (current_step_for_map != _step))
     50    recalculateBondVectorsAtStep(_step);
     51  return current_mapped_vectors;
     52}
     53
     54const BondVectors::container_t&
     55BondVectors::getSorted() const
     56{
     57  ASSERT( !container.empty(),
     58      "BondVectors::getSorted() - empty internal container, not set properly?");
     59  return container;
     60}
    4061
    4162#endif /* DYNAMICS_BONDVECTORS_IMPL_HPP_ */
Note: See TracChangeset for help on using the changeset viewer.