| 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 |
|
|---|
| 21 | //#include "atom_observable.hpp"
|
|---|
| 22 | #include "Bond/bond.hpp"
|
|---|
| 23 |
|
|---|
| 24 | #include <list>
|
|---|
| 25 | #include <vector>
|
|---|
| 26 |
|
|---|
| 27 | /****************************************** forward declarations *****************************/
|
|---|
| 28 |
|
|---|
| 29 | class BondedParticle;
|
|---|
| 30 |
|
|---|
| 31 | typedef std::list<bond::ptr > BondList;
|
|---|
| 32 |
|
|---|
| 33 | /********************************************** declarations *******************************/
|
|---|
| 34 |
|
|---|
| 35 | class BondedParticleInfo // : public virtual AtomObservable // must be virtual(!)
|
|---|
| 36 | {
|
|---|
| 37 | friend class BondedParticle;
|
|---|
| 38 | public:
|
|---|
| 39 |
|
|---|
| 40 | virtual ~BondedParticleInfo() {}
|
|---|
| 41 |
|
|---|
| 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 | */
|
|---|
| 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;
|
|---|
| 57 |
|
|---|
| 58 | /** Const accessor to ListOfBonds of WorldTime::CurrentTime.
|
|---|
| 59 | *
|
|---|
| 60 | * @return ListOfBonds[WorldTime::CurrentTime]
|
|---|
| 61 | */
|
|---|
| 62 | const BondList& getListOfBonds() const;
|
|---|
| 63 |
|
|---|
| 64 | /** Const Accessor ListOfBonds of any present time step.
|
|---|
| 65 | *
|
|---|
| 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.
|
|---|
| 72 | *
|
|---|
| 73 | * @return MaxOrder[Current world time step].
|
|---|
| 74 | */
|
|---|
| 75 | const unsigned char& getMaxOrder() const;
|
|---|
| 76 |
|
|---|
| 77 | /** Const getter for the MaxOrder property at given \a _step.
|
|---|
| 78 | *
|
|---|
| 79 | * @param _step time step to access
|
|---|
| 80 | * @return MaxOrder[_step].
|
|---|
| 81 | */
|
|---|
| 82 | const unsigned char& getMaxOrder(const unsigned int _step) const;
|
|---|
| 83 |
|
|---|
| 84 | /** Setter for the MaxOrder property at current time step.
|
|---|
| 85 | *
|
|---|
| 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.
|
|---|
| 91 | *
|
|---|
| 92 | * @param _step time step to access
|
|---|
| 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
|
|---|
| 114 | */
|
|---|
| 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);
|
|---|
| 124 |
|
|---|
| 125 | protected:
|
|---|
| 126 | /** Function used by this and inheriting classes to extend the ListOfBonds
|
|---|
| 127 | * vector.
|
|---|
| 128 | */
|
|---|
| 129 | void AppendTrajectoryStep(const unsigned int _step);
|
|---|
| 130 |
|
|---|
| 131 | /** Function used by this and inheriting classes to reduce the ListOfBonds
|
|---|
| 132 | * vector by one.
|
|---|
| 133 | */
|
|---|
| 134 | void removeTrajectoryStep(const unsigned int _step);
|
|---|
| 135 |
|
|---|
| 136 | typedef std::map<unsigned int, BondList> BondTrajectory_t;
|
|---|
| 137 | BondTrajectory_t ListOfBonds; //!< list of all bonds
|
|---|
| 138 | static BondList emptyList; //!< empty list to return when step is not present
|
|---|
| 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")
|
|---|
| 143 | };
|
|---|
| 144 |
|
|---|
| 145 |
|
|---|
| 146 | #endif /* ATOM_BONDEDPARTICLEINFO_HPP_ */
|
|---|