Changeset 834ff3 for molecuilder/src/molecules.hpp
- Timestamp:
- Aug 3, 2009, 2:48:42 PM (16 years ago)
- Children:
- d8fce3, e78824
- Parents:
- 4e4940
- File:
-
- 1 edited
-
molecuilder/src/molecules.hpp (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/molecules.hpp
r4e4940 r834ff3 25 25 #include <vector> 26 26 27 #include "atom.hpp" 28 #include "bond.hpp" 27 29 #include "helpers.hpp" 30 #include "linkedcell.hpp" 28 31 #include "parser.hpp" 29 32 #include "periodentafel.hpp" 30 33 #include "stackclass.hpp" 34 #include "tesselation.hpp" 31 35 #include "vector.hpp" 32 36 33 class atom;34 class bond;35 37 class config; 36 38 class molecule; … … 38 40 class MoleculeListClass; 39 41 class Verbose; 40 class Tesselation;41 42 42 43 /******************************** Some definitions for easier reading **********************************/ … … 58 59 #define BoundariesTestPair pair< Boundaries::iterator, bool> 59 60 60 #define PointMap map < int, class BoundaryPointSet * >61 #define PointPair pair < int, class BoundaryPointSet * >62 #define PointTestPair pair < PointMap::iterator, bool >63 #define CandidateList list <class CandidateForTesselation *>64 65 #define LineMap multimap < int, class BoundaryLineSet * >66 #define LinePair pair < int, class BoundaryLineSet * >67 #define LineTestPair pair < LineMap::iterator, bool >68 69 #define TriangleMap map < int, class BoundaryTriangleSet * >70 #define TrianglePair pair < int, class BoundaryTriangleSet * >71 #define TriangleTestPair pair < TrianglePair::iterator, bool >72 73 #define DistanceMultiMap multimap <double, pair < PointMap::iterator, PointMap::iterator> >74 #define DistanceMultiMapPair pair <double, pair < PointMap::iterator, PointMap::iterator> >75 76 61 #define MoleculeList list <molecule *> 77 62 #define MoleculeListTest pair <MoleculeList::iterator, bool> … … 125 110 }; 126 111 127 /** Single atom.128 * Class incoporates position, type129 */130 class atom {131 public:132 Vector x; //!< coordinate array of atom, giving position within cell133 Vector v; //!< velocity array of atom134 element *type; //!< pointing to element135 atom *previous; //!< previous atom in molecule list136 atom *next; //!< next atom in molecule list137 atom *father; //!< In many-body bond order fragmentations points to originating atom138 atom *Ancestor; //!< "Father" in Depth-First-Search139 char *Name; //!< unique name used during many-body bond-order fragmentation140 int FixedIon; //!< config variable that states whether forces act on the ion or not141 int *sort; //!< sort criteria142 int nr; //!< continuous, unique number143 int GraphNr; //!< unique number, given in DepthFirstSearchAnalysis()144 int *ComponentNr;//!< belongs to this nonseparable components, given in DepthFirstSearchAnalysis() (if more than one, then is SeparationVertex)145 int LowpointNr; //!< needed in DepthFirstSearchAnalysis() to detect nonseparable components, is the lowest possible number of an atom to reach via tree edges only followed by at most one back edge.146 bool SeparationVertex; //!< whether this atom separates off subsets of atoms or not, determined in DepthFirstSearchAnalysis()147 bool IsCyclic; //!< whether atom belong to as cycle or not, determined in DepthFirstSearchAnalysis()148 unsigned char AdaptiveOrder; //!< current present bond order at site (0 means "not set")149 bool MaxOrder; //!< whether this atom as a root in fragmentation still creates more fragments on higher orders or not150 151 atom();152 atom(class atom *pointer);153 ~atom();154 155 bool Output(int ElementNo, int AtomNo, ofstream *out, const char *comment = NULL) const;156 bool OutputXYZLine(ofstream *out) const;157 atom *GetTrueFather();158 bool Compare(atom &ptr);159 160 private:161 };162 163 ostream & operator << (ostream &ost, const atom &a);164 165 /** Bonds between atoms.166 * Class incorporates bonds between atoms in a molecule,167 * used to derive tge fragments in many-body bond order168 * calculations.169 */170 class bond {171 public:172 atom *leftatom; //!< first bond partner173 atom *rightatom; //!< second bond partner174 bond *previous; //!< previous atom in molecule list175 bond *next; //!< next atom in molecule list176 int HydrogenBond; //!< Number of hydrogen atoms in the bond177 int BondDegree; //!< single, double, triple, ... bond178 int nr; //!< unique number in a molecule, updated by molecule::CreateAdjacencyList()179 bool Cyclic; //!< flag whether bond is part of a cycle or not, given in DepthFirstSearchAnalysis()180 enum EdgeType Type;//!< whether this is a tree or back edge181 182 atom * GetOtherAtom(atom *Atom) const;183 bond * GetFirstBond();184 bond * GetLastBond();185 186 bool MarkUsed(enum Shading color);187 enum Shading IsUsed();188 void ResetUsed();189 bool Contains(const atom *ptr);190 bool Contains(const int nr);191 192 bond();193 bond(atom *left, atom *right);194 bond(atom *left, atom *right, int degree);195 bond(atom *left, atom *right, int degree, int number);196 ~bond();197 198 private:199 enum Shading Used; //!< marker in depth-first search, DepthFirstSearchAnalysis()200 };201 202 203 ostream & operator << (ostream &ost, const bond &b);204 112 205 113 #define MaxThermostats 6 //!< maximum number of thermostat entries in Ions#ThermostatNames and Ions#ThermostatImplemented … … 210 118 * Class incorporates number of types 211 119 */ 212 class molecule {120 class molecule : public PointCloud { 213 121 public: 214 122 double cell_size[6];//!< cell size … … 234 142 char name[MAXSTRINGSIZE]; //!< arbitrary name 235 143 int IndexNr; //!< index of molecule in a MoleculeListClass 144 class Tesselation *TesselStruct; 236 145 237 146 molecule(periodentafel *teil); 238 147 ~molecule(); 148 149 // re-definition of virtual functions from PointCloud 150 Vector *GetCenter(ofstream *out); 151 TesselPoint *GetPoint(); 152 TesselPoint *GetTerminalPoint(); 153 void GoToNext(); 154 void GoToPrevious(); 155 void GoToFirst(); 156 void GoToLast(); 157 bool IsEmpty(); 158 bool IsLast(); 239 159 240 160 /// remove atoms from molecule. … … 350 270 private: 351 271 int last_atom; //!< number given to last atom 272 atom *InternalPointer; //!< internal pointer for PointCloud 352 273 }; 353 274 … … 524 445 char *GetDefaultPath() const; 525 446 void SetDefaultPath(const char *path); 526 void InitThermostats( ifstream *source);447 void InitThermostats(class ConfigFileBuffer *fb); 527 448 }; 528 449
Note:
See TracChangeset
for help on using the changeset viewer.
