Changeset f4a346 for molecuilder/src/molecules.hpp
- Timestamp:
- Aug 3, 2009, 8:21:05 PM (16 years ago)
- Children:
- 04dcc0
- Parents:
- 0e2190 (diff), eb167d (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. - File:
-
- 1 edited
-
molecuilder/src/molecules.hpp (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/molecules.hpp
r0e2190 rf4a346 18 18 #include <gsl/gsl_randist.h> 19 19 20 // STL headers20 //// STL headers 21 21 #include <map> 22 22 #include <set> … … 25 25 #include <vector> 26 26 27 #include "helpers.hpp" 27 #include "atom.hpp" 28 #include "bond.hpp" 29 #include "element.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 class config;36 37 class molecule; 37 38 class MoleculeLeafClass; 38 39 class MoleculeListClass; 39 class Verbose;40 class Tesselation;41 40 42 41 /******************************** Some definitions for easier reading **********************************/ … … 50 49 #define GraphTestPair pair<Graph::iterator, bool> 51 50 51 #define MoleculeList list <molecule *> 52 #define MoleculeListTest pair <MoleculeList::iterator, bool> 53 52 54 #define DistancePair pair < double, atom* > 53 55 #define DistanceMap multimap < double, atom* > 54 56 #define DistanceTestPair pair < DistanceMap::iterator, bool> 55 57 56 #define Boundaries map <double, DistancePair > 57 #define BoundariesPair pair<double, DistancePair > 58 #define BoundariesTestPair pair< Boundaries::iterator, bool> 59 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 #define MoleculeList list <molecule *> 77 #define MoleculeListTest pair <MoleculeList::iterator, bool> 78 79 #define LinkedAtoms list <atom *> 58 59 //#define LinkedAtoms list <atom *> 80 60 81 61 /******************************** Some small functions and/or structures **********************************/ … … 125 105 }; 126 106 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(const 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 205 107 #define MaxThermostats 6 //!< maximum number of thermostat entries in Ions#ThermostatNames and Ions#ThermostatImplemented 206 108 enum thermostats { None, Woodcock, Gaussian, Langevin, Berendsen, NoseHoover }; //!< Thermostat names for output … … 210 112 * Class incorporates number of types 211 113 */ 212 class molecule {114 class molecule : public PointCloud { 213 115 public: 214 116 double cell_size[6];//!< cell size … … 234 136 char name[MAXSTRINGSIZE]; //!< arbitrary name 235 137 int IndexNr; //!< index of molecule in a MoleculeListClass 138 class Tesselation *TesselStruct; 236 139 237 140 molecule(periodentafel *teil); 238 ~molecule(); 141 virtual ~molecule(); 142 143 // re-definition of virtual functions from PointCloud 144 Vector *GetCenter(ofstream *out); 145 TesselPoint *GetPoint(); 146 TesselPoint *GetTerminalPoint(); 147 void GoToNext(); 148 void GoToPrevious(); 149 void GoToFirst(); 150 void GoToLast(); 151 bool IsEmpty(); 152 bool IsLast(); 239 153 240 154 /// remove atoms from molecule. … … 350 264 private: 351 265 int last_atom; //!< number given to last atom 266 atom *InternalPointer; //!< internal pointer for PointCloud 352 267 }; 353 268 … … 423 338 424 339 425 /** The config file.426 * The class contains all parameters that control a dft run also functions to load and save.427 */428 class config {429 public:430 int PsiType;431 int MaxPsiDouble;432 int PsiMaxNoUp;433 int PsiMaxNoDown;434 int MaxMinStopStep;435 int InitMaxMinStopStep;436 int ProcPEGamma;437 int ProcPEPsi;438 char *configpath;439 char *configname;440 bool FastParsing;441 double Deltat;442 string basis;443 444 char *databasepath;445 446 int DoConstrainedMD;447 int MaxOuterStep;448 int Thermostat;449 int *ThermostatImplemented;450 char **ThermostatNames;451 double TempFrequency;452 double alpha;453 double HooverMass;454 double TargetTemp;455 int ScaleTempStep;456 457 private:458 char *mainname;459 char *defaultpath;460 char *pseudopotpath;461 462 int DoOutVis;463 int DoOutMes;464 int DoOutNICS;465 int DoOutOrbitals;466 int DoOutCurrent;467 int DoFullCurrent;468 int DoPerturbation;469 int DoWannier;470 int CommonWannier;471 double SawtoothStart;472 int VectorPlane;473 double VectorCut;474 int UseAddGramSch;475 int Seed;476 477 int OutVisStep;478 int OutSrcStep;479 int MaxPsiStep;480 double EpsWannier;481 482 int MaxMinStep;483 double RelEpsTotalEnergy;484 double RelEpsKineticEnergy;485 int MaxMinGapStopStep;486 int MaxInitMinStep;487 double InitRelEpsTotalEnergy;488 double InitRelEpsKineticEnergy;489 int InitMaxMinGapStopStep;490 491 //double BoxLength[NDIM*NDIM];492 493 double ECut;494 int MaxLevel;495 int RiemannTensor;496 int LevRFactor;497 int RiemannLevel;498 int Lev0Factor;499 int RTActualUse;500 int AddPsis;501 502 double RCut;503 int StructOpt;504 int IsAngstroem;505 int RelativeCoord;506 int MaxTypes;507 508 509 int ParseForParameter(int verbose, ifstream *file, const char *name, int sequential, int const xth, int const yth, int type, void *value, int repetition, int critical);510 int ParseForParameter(int verbose, struct ConfigFileBuffer *FileBuffer, const char *name, int sequential, int const xth, int const yth, int type, void *value, int repetition, int critical);511 512 public:513 config();514 ~config();515 516 int TestSyntax(char *filename, periodentafel *periode, molecule *mol);517 void Load(char *filename, periodentafel *periode, molecule *mol);518 void LoadOld(char *filename, periodentafel *periode, molecule *mol);519 void RetrieveConfigPathAndName(string filename);520 bool Save(const char *filename, periodentafel *periode, molecule *mol) const;521 bool SaveMPQC(const char *filename, molecule *mol) const;522 void Edit();523 bool GetIsAngstroem() const;524 char *GetDefaultPath() const;525 void SetDefaultPath(const char *path);526 void InitThermostats(ifstream *source);527 };528 529 340 #endif /*MOLECULES_HPP_*/ 530 341
Note:
See TracChangeset
for help on using the changeset viewer.
