| [6b919f8] | 1 | /* | 
|---|
|  | 2 | * atom_bondedparticleinfo.hpp | 
|---|
|  | 3 | * | 
|---|
|  | 4 | *  Created on: Oct 19, 2009 | 
|---|
|  | 5 | *      Author: heber | 
|---|
|  | 6 | */ | 
|---|
|  | 7 |  | 
|---|
|  | 8 | #ifndef ATOM_BONDEDPARTICLEINFO_HPP_ | 
|---|
|  | 9 | #define ATOM_BONDEDPARTICLEINFO_HPP_ | 
|---|
|  | 10 |  | 
|---|
|  | 11 |  | 
|---|
|  | 12 | using namespace std; | 
|---|
|  | 13 |  | 
|---|
|  | 14 | /*********************************************** includes ***********************************/ | 
|---|
|  | 15 |  | 
|---|
|  | 16 | // include config.h | 
|---|
|  | 17 | #ifdef HAVE_CONFIG_H | 
|---|
|  | 18 | #include <config.h> | 
|---|
|  | 19 | #endif | 
|---|
|  | 20 |  | 
|---|
| [7d82a5] | 21 | //#include "atom_observable.hpp" | 
|---|
| [88c8ec] | 22 | #include "Bond/bond.hpp" | 
|---|
| [7188b1] | 23 |  | 
|---|
| [6b919f8] | 24 | #include <list> | 
|---|
| [9e3fca] | 25 | #include <vector> | 
|---|
| [6b919f8] | 26 |  | 
|---|
|  | 27 | /****************************************** forward declarations *****************************/ | 
|---|
|  | 28 |  | 
|---|
| [9d83b6] | 29 | class BondedParticle; | 
|---|
| [6b919f8] | 30 |  | 
|---|
| [9e3fca] | 31 | typedef std::list<bond::ptr > BondList; | 
|---|
| [6b919f8] | 32 |  | 
|---|
|  | 33 | /********************************************** declarations *******************************/ | 
|---|
|  | 34 |  | 
|---|
| [7d82a5] | 35 | class BondedParticleInfo // : public virtual AtomObservable // must be virtual(!) | 
|---|
|  | 36 | { | 
|---|
| [9d83b6] | 37 | friend class BondedParticle; | 
|---|
| [6b919f8] | 38 | public: | 
|---|
|  | 39 |  | 
|---|
| [a1c8fa] | 40 | virtual ~BondedParticleInfo() {} | 
|---|
| [6b919f8] | 41 |  | 
|---|
| [1e6249] | 42 | /** Pushes back another step in all trajectory vectors. | 
|---|
|  | 43 | * | 
|---|
|  | 44 | * This allows to extend all trajectories contained in different classes | 
|---|
|  | 45 | * consistently. This is implemented by the topmost class which calls the | 
|---|
|  | 46 | * real functions, \sa AppendTrajectoryStep(), by all necessary subclasses. | 
|---|
|  | 47 | */ | 
|---|
| [8cc22f] | 48 | virtual void UpdateStep(const unsigned int _step)=0; | 
|---|
|  | 49 |  | 
|---|
|  | 50 | /** Pops the last step in all trajectory vectors. | 
|---|
|  | 51 | * | 
|---|
|  | 52 | * This allows to decrease all trajectories contained in different classes | 
|---|
|  | 53 | * by one consistently. This is implemented by the topmost class which calls | 
|---|
|  | 54 | * the real functions, \sa removeTrajectoryStep(), by all necessary subclasses. | 
|---|
|  | 55 | */ | 
|---|
|  | 56 | virtual void removeStep(const unsigned int _step)=0; | 
|---|
| [1e6249] | 57 |  | 
|---|
| [9d83b6] | 58 | /** Const accessor to ListOfBonds of WorldTime::CurrentTime. | 
|---|
|  | 59 | * | 
|---|
|  | 60 | * @return ListOfBonds[WorldTime::CurrentTime] | 
|---|
|  | 61 | */ | 
|---|
|  | 62 | const BondList& getListOfBonds() const; | 
|---|
| [5e2f80] | 63 |  | 
|---|
| [a1c8fa] | 64 | /** Const Accessor ListOfBonds of any present time step. | 
|---|
| [9d83b6] | 65 | * | 
|---|
| [a1c8fa] | 66 | * @param _step time step to access | 
|---|
|  | 67 | * @return ListOfBonds[_step]. | 
|---|
|  | 68 | */ | 
|---|
|  | 69 | const BondList& getListOfBondsAtStep(unsigned int _step) const; | 
|---|
|  | 70 |  | 
|---|
|  | 71 | /** Const getter for the MaxOrder property at current time step. | 
|---|
| [9d83b6] | 72 | * | 
|---|
| [a1c8fa] | 73 | * @return MaxOrder[Current world time step]. | 
|---|
| [9d83b6] | 74 | */ | 
|---|
| [a1c8fa] | 75 | const unsigned char& getMaxOrder() const; | 
|---|
| [9d83b6] | 76 |  | 
|---|
| [a1c8fa] | 77 | /** Const getter for the MaxOrder property at given \a _step. | 
|---|
| [9d83b6] | 78 | * | 
|---|
|  | 79 | * @param _step time step to access | 
|---|
| [a1c8fa] | 80 | * @return MaxOrder[_step]. | 
|---|
| [9d83b6] | 81 | */ | 
|---|
| [a1c8fa] | 82 | const unsigned char& getMaxOrder(const unsigned int _step) const; | 
|---|
| [5e2f80] | 83 |  | 
|---|
| [a1c8fa] | 84 | /** Setter for the MaxOrder property at current time step. | 
|---|
| [9d83b6] | 85 | * | 
|---|
| [a1c8fa] | 86 | * @param _value value to set for MaxOrder at current time step | 
|---|
|  | 87 | */ | 
|---|
|  | 88 | void setMaxOrder(const unsigned char _value); | 
|---|
|  | 89 |  | 
|---|
|  | 90 | /**Setter for the MaxOrder property at given \a _step. | 
|---|
| [9d83b6] | 91 | * | 
|---|
|  | 92 | * @param _step time step to access | 
|---|
| [a1c8fa] | 93 | * @param _value value to set for MaxOrder at the desired time step | 
|---|
|  | 94 | * @return MaxOrder[_step]. | 
|---|
|  | 95 | */ | 
|---|
|  | 96 | void setMaxOrder(const unsigned int _step, const unsigned char _value); | 
|---|
|  | 97 |  | 
|---|
|  | 98 | /** Const getter for the AdaptiveOrder property at current time step. | 
|---|
|  | 99 | * | 
|---|
|  | 100 | * @return AdaptiveOrder[Current world time step]. | 
|---|
|  | 101 | */ | 
|---|
|  | 102 | const unsigned char& getAdaptiveOrder() const; | 
|---|
|  | 103 |  | 
|---|
|  | 104 | /** Const getter for the AdaptiveOrder property at given \a _step. | 
|---|
|  | 105 | * | 
|---|
|  | 106 | * @param _step time step to access | 
|---|
|  | 107 | * @return AdaptiveOrder[_step]. | 
|---|
|  | 108 | */ | 
|---|
|  | 109 | const unsigned char& getAdaptiveOrder(const unsigned int _step) const; | 
|---|
|  | 110 |  | 
|---|
|  | 111 | /** Setter for the AdaptiveOrder property at current time step. | 
|---|
|  | 112 | * | 
|---|
|  | 113 | * @param _value value to set for AdaptiveOrder at current time step | 
|---|
| [9d83b6] | 114 | */ | 
|---|
| [a1c8fa] | 115 | void setAdaptiveOrder(const unsigned char _value); | 
|---|
|  | 116 |  | 
|---|
|  | 117 | /** Setter for the AdaptiveOrder property at given \a _step. | 
|---|
|  | 118 | * | 
|---|
|  | 119 | * @param _step time step to access | 
|---|
|  | 120 | * @param _value value to set for AdaptiveOrder at the desired time step | 
|---|
|  | 121 | * @return AdaptiveOrder[_step]. | 
|---|
|  | 122 | */ | 
|---|
|  | 123 | void setAdaptiveOrder(const unsigned int _step, const unsigned char _value); | 
|---|
| [9d83b6] | 124 |  | 
|---|
| [9a3a53] | 125 | protected: | 
|---|
| [1e6249] | 126 | /** Function used by this and inheriting classes to extend the ListOfBonds | 
|---|
|  | 127 | * vector. | 
|---|
|  | 128 | */ | 
|---|
| [8cc22f] | 129 | void AppendTrajectoryStep(const unsigned int _step); | 
|---|
| [1e6249] | 130 |  | 
|---|
| [7e51e1] | 131 | /** Function used by this and inheriting classes to reduce the ListOfBonds | 
|---|
|  | 132 | * vector by one. | 
|---|
|  | 133 | */ | 
|---|
| [8cc22f] | 134 | void removeTrajectoryStep(const unsigned int _step); | 
|---|
| [7e51e1] | 135 |  | 
|---|
| [8cc22f] | 136 | typedef std::map<unsigned int, BondList> BondTrajectory_t; | 
|---|
|  | 137 | BondTrajectory_t ListOfBonds; //!< list of all bonds | 
|---|
| [5e2f80] | 138 | static BondList emptyList;  //!< empty list to return when step is not present | 
|---|
| [a1c8fa] | 139 |  | 
|---|
|  | 140 | typedef std::map<unsigned int, unsigned char> OrderTrajectory_t; | 
|---|
|  | 141 | OrderTrajectory_t AdaptiveOrder;  //!< current present bond order at site (0 means "not set") | 
|---|
|  | 142 | OrderTrajectory_t MaxOrder;  //!< desired maximum order of this atom (0 means "not set") | 
|---|
| [6b919f8] | 143 | }; | 
|---|
|  | 144 |  | 
|---|
|  | 145 |  | 
|---|
|  | 146 | #endif /* ATOM_BONDEDPARTICLEINFO_HPP_ */ | 
|---|