| [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 | 
|---|
| [8c6b68] | 54 | * the real functions, \sa removeTrajectorySteps(), by all necessary subclasses. | 
|---|
|  | 55 | * | 
|---|
|  | 56 | * \param _firststep first step in interval to be removed | 
|---|
|  | 57 | * \param _laststep last step in interval to be removed | 
|---|
| [8cc22f] | 58 | */ | 
|---|
| [8c6b68] | 59 | virtual void removeSteps(const unsigned int _firststep, const unsigned int _laststep)=0; | 
|---|
| [1e6249] | 60 |  | 
|---|
| [9d83b6] | 61 | /** Const accessor to ListOfBonds of WorldTime::CurrentTime. | 
|---|
|  | 62 | * | 
|---|
|  | 63 | * @return ListOfBonds[WorldTime::CurrentTime] | 
|---|
|  | 64 | */ | 
|---|
|  | 65 | const BondList& getListOfBonds() const; | 
|---|
| [5e2f80] | 66 |  | 
|---|
| [a1c8fa] | 67 | /** Const Accessor ListOfBonds of any present time step. | 
|---|
| [9d83b6] | 68 | * | 
|---|
| [a1c8fa] | 69 | * @param _step time step to access | 
|---|
|  | 70 | * @return ListOfBonds[_step]. | 
|---|
|  | 71 | */ | 
|---|
|  | 72 | const BondList& getListOfBondsAtStep(unsigned int _step) const; | 
|---|
|  | 73 |  | 
|---|
|  | 74 | /** Const getter for the MaxOrder property at current time step. | 
|---|
| [9d83b6] | 75 | * | 
|---|
| [a1c8fa] | 76 | * @return MaxOrder[Current world time step]. | 
|---|
| [9d83b6] | 77 | */ | 
|---|
| [a1c8fa] | 78 | const unsigned char& getMaxOrder() const; | 
|---|
| [9d83b6] | 79 |  | 
|---|
| [a1c8fa] | 80 | /** Const getter for the MaxOrder property at given \a _step. | 
|---|
| [9d83b6] | 81 | * | 
|---|
|  | 82 | * @param _step time step to access | 
|---|
| [a1c8fa] | 83 | * @return MaxOrder[_step]. | 
|---|
| [9d83b6] | 84 | */ | 
|---|
| [a1c8fa] | 85 | const unsigned char& getMaxOrder(const unsigned int _step) const; | 
|---|
| [5e2f80] | 86 |  | 
|---|
| [a1c8fa] | 87 | /** Setter for the MaxOrder property at current time step. | 
|---|
| [9d83b6] | 88 | * | 
|---|
| [a1c8fa] | 89 | * @param _value value to set for MaxOrder at current time step | 
|---|
|  | 90 | */ | 
|---|
|  | 91 | void setMaxOrder(const unsigned char _value); | 
|---|
|  | 92 |  | 
|---|
|  | 93 | /**Setter for the MaxOrder property at given \a _step. | 
|---|
| [9d83b6] | 94 | * | 
|---|
|  | 95 | * @param _step time step to access | 
|---|
| [a1c8fa] | 96 | * @param _value value to set for MaxOrder at the desired time step | 
|---|
|  | 97 | * @return MaxOrder[_step]. | 
|---|
|  | 98 | */ | 
|---|
|  | 99 | void setMaxOrder(const unsigned int _step, const unsigned char _value); | 
|---|
|  | 100 |  | 
|---|
|  | 101 | /** Const getter for the AdaptiveOrder property at current time step. | 
|---|
|  | 102 | * | 
|---|
|  | 103 | * @return AdaptiveOrder[Current world time step]. | 
|---|
|  | 104 | */ | 
|---|
|  | 105 | const unsigned char& getAdaptiveOrder() const; | 
|---|
|  | 106 |  | 
|---|
|  | 107 | /** Const getter for the AdaptiveOrder property at given \a _step. | 
|---|
|  | 108 | * | 
|---|
|  | 109 | * @param _step time step to access | 
|---|
|  | 110 | * @return AdaptiveOrder[_step]. | 
|---|
|  | 111 | */ | 
|---|
|  | 112 | const unsigned char& getAdaptiveOrder(const unsigned int _step) const; | 
|---|
|  | 113 |  | 
|---|
|  | 114 | /** Setter for the AdaptiveOrder property at current time step. | 
|---|
|  | 115 | * | 
|---|
|  | 116 | * @param _value value to set for AdaptiveOrder at current time step | 
|---|
| [9d83b6] | 117 | */ | 
|---|
| [a1c8fa] | 118 | void setAdaptiveOrder(const unsigned char _value); | 
|---|
|  | 119 |  | 
|---|
|  | 120 | /** Setter for the AdaptiveOrder property at given \a _step. | 
|---|
|  | 121 | * | 
|---|
|  | 122 | * @param _step time step to access | 
|---|
|  | 123 | * @param _value value to set for AdaptiveOrder at the desired time step | 
|---|
|  | 124 | * @return AdaptiveOrder[_step]. | 
|---|
|  | 125 | */ | 
|---|
|  | 126 | void setAdaptiveOrder(const unsigned int _step, const unsigned char _value); | 
|---|
| [9d83b6] | 127 |  | 
|---|
| [9a3a53] | 128 | protected: | 
|---|
| [1e6249] | 129 | /** Function used by this and inheriting classes to extend the ListOfBonds | 
|---|
|  | 130 | * vector. | 
|---|
|  | 131 | */ | 
|---|
| [8cc22f] | 132 | void AppendTrajectoryStep(const unsigned int _step); | 
|---|
| [1e6249] | 133 |  | 
|---|
| [7e51e1] | 134 | /** Function used by this and inheriting classes to reduce the ListOfBonds | 
|---|
|  | 135 | * vector by one. | 
|---|
| [8c6b68] | 136 | * | 
|---|
|  | 137 | * \param _firststep first step in interval to be removed | 
|---|
|  | 138 | * \param _laststep last step in interval to be removed | 
|---|
| [7e51e1] | 139 | */ | 
|---|
| [8c6b68] | 140 | void removeTrajectorySteps(const unsigned int _firststep, const unsigned int _laststep); | 
|---|
| [7e51e1] | 141 |  | 
|---|
| [8cc22f] | 142 | typedef std::map<unsigned int, BondList> BondTrajectory_t; | 
|---|
|  | 143 | BondTrajectory_t ListOfBonds; //!< list of all bonds | 
|---|
| [5e2f80] | 144 | static BondList emptyList;  //!< empty list to return when step is not present | 
|---|
| [a1c8fa] | 145 |  | 
|---|
|  | 146 | typedef std::map<unsigned int, unsigned char> OrderTrajectory_t; | 
|---|
|  | 147 | OrderTrajectory_t AdaptiveOrder;  //!< current present bond order at site (0 means "not set") | 
|---|
|  | 148 | OrderTrajectory_t MaxOrder;  //!< desired maximum order of this atom (0 means "not set") | 
|---|
| [6b919f8] | 149 | }; | 
|---|
|  | 150 |  | 
|---|
|  | 151 |  | 
|---|
|  | 152 | #endif /* ATOM_BONDEDPARTICLEINFO_HPP_ */ | 
|---|