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.hpp

    r2f3905 r9861d0  
    3737  typedef std::map<bond::ptr, Vector> mapped_t;
    3838
     39  /** Default cstor for class BondVectors.
     40   *
     41   */
     42  BondVectors();
     43
    3944  /** Prepares the internal container from the bonds of a range of atoms.
    4045   *
     
    5358   * \return const ref to internal container
    5459   */
    55   const container_t& getSorted() const
    56   {
    57     ASSERT( !container.empty(),
    58         "BondVectors::getSorted() - empty internal container, not set properly?");
    59     return container;
    60   }
     60  const container_t& getSorted() const;
    6161
    62   /** Calculates the bond vector for each bond in the internal container and
    63    * returns them in same order as the internal container.
     62  /** Getter for the Bondvectors.
    6463   *
    6564   * \param _step time step for which the bond vector is request
    6665   * \return a map from bond to bond vector
    6766   */
    68   mapped_t getBondVectorsAtStep(const size_t &_step) const;
     67  const mapped_t& getBondVectorsAtStep(const size_t &_step) const;
    6968
    7069  /** Get the position in the internal container for a specific bond.
     
    7574  size_t getIndexForBond(const bond::ptr &_bond) const;
    7675
     76  /** Gather the subset of BondVectors for the given atom.
     77   *
     78   * \param _walker atom to get BondVectors for
     79   * \param _step time step for which the bond vector is request
     80   */
     81  std::vector<Vector> getAtomsBondVectorsAtStep(
     82      const atom &_walker,
     83      const size_t &_step) const;
     84
     85private:
     86  /** Calculates the bond vector for each bond in the internal container.
     87   *
     88   * \param _step time step for which the bond vector is request
     89   */
     90  void recalculateBondVectorsAtStep(const size_t &_step) const;
     91
    7792private:
    7893  //!> internal container for sorted bonds
    7994  container_t container;
     95
     96  //!> states whether map needs update or not
     97  mutable bool map_is_dirty;
     98
     99  //!> contains the step for which the map was calculated
     100  mutable size_t current_step_for_map;
     101
     102  //!> internal map for bond Bondvector association
     103  mutable mapped_t current_mapped_vectors;
    80104};
    81105
Note: See TracChangeset for help on using the changeset viewer.