Changeset 1024cb for src/molecule.hpp


Ignore:
Timestamp:
May 31, 2010, 5:32:27 PM (16 years ago)
Author:
Frederik Heber <heber@…>
Branches:
Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, Candidate_v1.7.0, Candidate_v1.7.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
Children:
e08c46
Parents:
42af9e (diff), a7b761b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Frederik Heber <heber@…> (05/31/10 17:29:30)
git-committer:
Frederik Heber <heber@…> (05/31/10 17:32:27)
Message:

Merge commit 'jupiter/MoleculeStartEndSwitch' into CommandLineActionMapping

Conflicts:

molecuilder/src/Makefile.am
molecuilder/src/builder.cpp
molecuilder/src/config.cpp
molecuilder/src/helpers.hpp
molecuilder/src/molecule.cpp
molecuilder/src/molecule_dynamics.cpp
molecuilder/src/molecule_fragmentation.cpp
molecuilder/src/molecule_geometry.cpp
molecuilder/src/molecule_graph.cpp
molecuilder/src/moleculelist.cpp
molecuilder/src/unittests/AnalysisCorrelationToPointUnitTest.cpp
molecuilder/src/unittests/listofbondsunittest.cpp

Integration of MoleculeStartEndSwitch had the following consequences:

  • no more AtomCount -> getAtomCount()
  • no more start/end -> begin(), end() and iterator
  • no more decent ordering in atomic ids (hence, Simple_configuration/8 and Domain/5, Domain/6 now check by comparing sorted xyz, not confs)

There is still a huge problem with bonds. One test runs into an endless loop.

Signed-off-by: Frederik Heber <heber@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/molecule.hpp

    r42af9e r1024cb  
    3434#include "tesselation.hpp"
    3535#include "Patterns/Observer.hpp"
     36#include "Patterns/ObservedIterator.hpp"
    3637#include "Patterns/Cacheable.hpp"
    3738
     
    9091  friend molecule *NewMolecule();
    9192  friend void DeleteMolecule(molecule *);
     93
    9294  public:
     95    typedef std::set<atom*> atomSet;
     96    typedef ObservedIterator<atomSet> iterator;
     97    typedef atomSet::const_iterator const_iterator;
     98
    9399    const periodentafel * const elemente; //!< periodic table with each element
    94     atom *start;        //!< start of atom list
    95     atom *end;          //!< end of atom list
     100    // old deprecated atom handling
     101    //atom *start;        //!< start of atom list
     102    //atom *end;          //!< end of atom list
    96103    bond *first;        //!< start of bond list
    97104    bond *last;         //!< end of bond list
    98105    int MDSteps;        //!< The number of MD steps in Trajectories
    99     int AtomCount;          //!< number of atoms, brought up-to-date by CountAtoms()
     106    //int AtomCount;          //!< number of atoms, brought up-to-date by CountAtoms()
    100107    int BondCount;          //!< number of atoms, brought up-to-date by CountBonds()
    101108    int ElementCount;       //!< how many unique elements are therein
     
    112119  private:
    113120    Cacheable<string> formula;
     121    Cacheable<int>    AtomCount;
    114122    moleculeId_t id;
     123    atomSet atoms; //<!set of atoms
    115124  protected:
     125    //void CountAtoms();
     126    /**
     127     * this iterator type should be used for internal variables, \
     128     * since it will not lock
     129     */
     130    typedef atomSet::iterator internal_iterator;
     131
     132
    116133    molecule(const periodentafel * const teil);
    117134    virtual ~molecule();
     
    121138  //getter and setter
    122139  const std::string getName();
     140  int getAtomCount() const;
     141  int doCountAtoms();
    123142  moleculeId_t getId();
    124143  void setId(moleculeId_t);
     
    127146  std::string calcFormula();
    128147
     148  iterator begin();
     149  const_iterator begin() const;
     150  iterator end();
     151  const_iterator end() const;
     152  bool empty() const;
     153  size_t size() const;
     154  const_iterator erase( const_iterator loc );
     155  const_iterator erase( atom *& key );
     156  const_iterator find (  atom *& key ) const;
     157  pair<iterator,bool> insert ( atom * const key );
     158
    129159
    130160  // re-definition of virtual functions from PointCloud
     
    132162  Vector *GetCenter() const ;
    133163  TesselPoint *GetPoint() const ;
    134   TesselPoint *GetTerminalPoint() const ;
    135164  int GetMaxId() const;
    136165  void GoToNext() const ;
    137   void GoToPrevious() const ;
    138166  void GoToFirst() const ;
    139   void GoToLast() const ;
    140167  bool IsEmpty() const ;
    141168  bool IsEnd() const ;
     
    232259
    233260  /// Count and change present atoms' coordination.
    234   void CountAtoms();
    235261  void CountElements();
    236262  void CalculateOrbitals(class config &configuration);
     
    302328  bool StoreForcesFile(MoleculeListClass *BondFragments, char *path, int *SortIndex);
    303329  bool CreateMappingLabelsToConfigSequence(int *&SortIndex);
     330  bool CreateFatherLookupTable(atom **&LookupTable, int count = 0);
    304331  void BreadthFirstSearchAdd(molecule *Mol, atom **&AddedAtomList, bond **&AddedBondList, atom *Root, bond *Bond, int BondOrder, bool IsAngstroem);
    305332  /// -# BOSSANOVA
     
    330357  private:
    331358  int last_atom;      //!< number given to last atom
    332   mutable atom *InternalPointer;  //!< internal pointer for PointCloud
     359  mutable internal_iterator InternalPointer;  //!< internal pointer for PointCloud
    333360};
    334361
Note: See TracChangeset for help on using the changeset viewer.