Changeset e08f45 for molecuilder/src/molecules.hpp
- Timestamp:
- Feb 9, 2009, 5:24:10 PM (17 years ago)
- Children:
- 451d7a
- Parents:
- 4aef8a
- git-author:
- Frederik Heber <heber@…> (02/09/09 15:55:37)
- git-committer:
- Frederik Heber <heber@…> (02/09/09 17:24:10)
- File:
-
- 1 edited
-
molecuilder/src/molecules.hpp (modified) (11 diffs, 1 prop)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/molecules.hpp
-
Property mode
changed from
100644to100755
r4aef8a re08f45 60 60 #define LineMap map < int, class BoundaryLineSet * > 61 61 #define LinePair pair < int, class BoundaryLineSet * > 62 #define LineTestPair pair < Line Pair::iterator, bool >62 #define LineTestPair pair < LineMap::iterator, bool > 63 63 64 64 #define TriangleMap map < int, class BoundaryTriangleSet * > … … 73 73 struct KeyCompare 74 74 { 75 bool operator() (const KeySet SubgraphA, const KeySet SubgraphB) const;75 bool operator() (const KeySet SubgraphA, const KeySet SubgraphB) const; 76 76 }; 77 77 78 78 struct Trajectory 79 79 { 80 vector<Vector> R;//!< position vector81 vector<Vector> U;//!< velocity vector82 vector<Vector> F;//!< last force vector83 atom *ptr;//!< pointer to atom whose trajectory we contain84 }; 85 86 //bool operator < (KeySet SubgraphA, KeySet SubgraphB); //note: this declaration is important, otherwise normal < is used (producing wrong order)80 vector<Vector> R; //!< position vector 81 vector<Vector> U; //!< velocity vector 82 vector<Vector> F; //!< last force vector 83 atom *ptr; //!< pointer to atom whose trajectory we contain 84 }; 85 86 //bool operator < (KeySet SubgraphA, KeySet SubgraphB); //note: this declaration is important, otherwise normal < is used (producing wrong order) 87 87 inline void InsertFragmentIntoGraph(ofstream *out, struct UniqueFragments *Fragment); // Insert a KeySet into a Graph 88 inline void InsertGraphIntoGraph(ofstream *out, Graph &graph1, Graph &graph2, int *counter); // Insert all KeySet's in a Graph into another Graph88 inline void InsertGraphIntoGraph(ofstream *out, Graph &graph1, Graph &graph2, int *counter); // Insert all KeySet's in a Graph into another Graph 89 89 int CompareDoubles (const void * a, const void * b); 90 90 … … 94 94 95 95 // some algebraic matrix stuff 96 #define RDET3(a) ((a)[0]*(a)[4]*(a)[8] + (a)[3]*(a)[7]*(a)[2] + (a)[6]*(a)[1]*(a)[5] - (a)[2]*(a)[4]*(a)[6] - (a)[5]*(a)[7]*(a)[0] - (a)[8]*(a)[1]*(a)[3]) //!< hard-coded determinant of a 3x3 matrix97 #define RDET2(a0,a1,a2,a3) ((a0)*(a3)-(a1)*(a2)) //!< hard-coded determinant of a 2x2 matrix96 #define RDET3(a) ((a)[0]*(a)[4]*(a)[8] + (a)[3]*(a)[7]*(a)[2] + (a)[6]*(a)[1]*(a)[5] - (a)[2]*(a)[4]*(a)[6] - (a)[5]*(a)[7]*(a)[0] - (a)[8]*(a)[1]*(a)[3]) //!< hard-coded determinant of a 3x3 matrix 97 #define RDET2(a0,a1,a2,a3) ((a0)*(a3)-(a1)*(a2)) //!< hard-coded determinant of a 2x2 matrix 98 98 99 99 … … 101 101 */ 102 102 struct LSQ_params { 103 Vector **vectors;104 int num;103 Vector **vectors; 104 int num; 105 105 }; 106 106 … … 110 110 */ 111 111 struct lsq_params { 112 gsl_vector *x; 113 const molecule *mol; 114 element *type; 115 }; 116 117 112 gsl_vector *x; 113 const molecule *mol; 114 element *type; 115 }; 118 116 119 117 /** Single atom. … … 121 119 */ 122 120 class atom { 123 public:124 Vector x;//!< coordinate array of atom, giving position within cell125 Vector v;//!< velocity array of atom126 element *type;//!< pointing to element127 atom *previous; //!< previous atom in molecule list128 atom *next;//!< next atom in molecule list129 atom *father;//!< In many-body bond order fragmentations points to originating atom130 atom *Ancestor; //!< "Father" in Depth-First-Search131 char *Name; //!< unique name used during many-body bond-order fragmentation132 int FixedIon;//!< config variable that states whether forces act on the ion or not133 int *sort;//!< sort criteria134 int nr;//!< continuous, unique number135 int GraphNr;//!< unique number, given in DepthFirstSearchAnalysis()136 int *ComponentNr;//!< belongs to this nonseparable components, given in DepthFirstSearchAnalysis() (if more than one, then is SeparationVertex)137 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.138 bool SeparationVertex; //!< whether this atom separates off subsets of atoms or not, determined in DepthFirstSearchAnalysis()139 bool IsCyclic;//!< whether atom belong to as cycle or not, determined in DepthFirstSearchAnalysis()140 unsigned char AdaptiveOrder;//!< current present bond order at site (0 means "not set")141 bool MaxOrder;//!< whether this atom as a root in fragmentation still creates more fragments on higher orders or not142 143 atom();144 ~atom();145 146 bool Output(int ElementNo, int AtomNo, ofstream *out) const;147 bool OutputXYZLine(ofstream *out) const;148 atom *GetTrueFather();149 bool Compare(atom &ptr);150 151 private:121 public: 122 Vector x; //!< coordinate array of atom, giving position within cell 123 Vector v; //!< velocity array of atom 124 element *type; //!< pointing to element 125 atom *previous; //!< previous atom in molecule list 126 atom *next; //!< next atom in molecule list 127 atom *father; //!< In many-body bond order fragmentations points to originating atom 128 atom *Ancestor; //!< "Father" in Depth-First-Search 129 char *Name; //!< unique name used during many-body bond-order fragmentation 130 int FixedIon; //!< config variable that states whether forces act on the ion or not 131 int *sort; //!< sort criteria 132 int nr; //!< continuous, unique number 133 int GraphNr; //!< unique number, given in DepthFirstSearchAnalysis() 134 int *ComponentNr;//!< belongs to this nonseparable components, given in DepthFirstSearchAnalysis() (if more than one, then is SeparationVertex) 135 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. 136 bool SeparationVertex; //!< whether this atom separates off subsets of atoms or not, determined in DepthFirstSearchAnalysis() 137 bool IsCyclic; //!< whether atom belong to as cycle or not, determined in DepthFirstSearchAnalysis() 138 unsigned char AdaptiveOrder; //!< current present bond order at site (0 means "not set") 139 bool MaxOrder; //!< whether this atom as a root in fragmentation still creates more fragments on higher orders or not 140 141 atom(); 142 ~atom(); 143 144 bool Output(int ElementNo, int AtomNo, ofstream *out) const; 145 bool OutputXYZLine(ofstream *out) const; 146 atom *GetTrueFather(); 147 bool Compare(atom &ptr); 148 149 private: 152 150 }; 153 151 … … 160 158 */ 161 159 class bond { 162 public:163 atom *leftatom; //!< first bond partner164 atom *rightatom; //!< second bond partner165 bond *previous; //!< previous atom in molecule list166 bond *next;//!< next atom in molecule list167 int HydrogenBond; //!< Number of hydrogen atoms in the bond168 int BondDegree; //!< single, double, triple, ... bond169 int nr;//!< unique number in a molecule, updated by molecule::CreateAdjacencyList()170 bool Cyclic;//!< flag whether bond is part of a cycle or not, given in DepthFirstSearchAnalysis()171 enum EdgeType Type;//!< whether this is a tree or back edge172 173 atom * GetOtherAtom(atom *Atom) const;174 bond * GetFirstBond();175 bond * GetLastBond();176 177 bool MarkUsed(enum Shading color);178 enum Shading IsUsed();179 void ResetUsed();180 bool Contains(const atom *ptr);181 bool Contains(const int nr);182 183 bond();184 bond(atom *left, atom *right);185 bond(atom *left, atom *right, int degree);186 bond(atom *left, atom *right, int degree, int number);187 ~bond();188 189 private:190 enum Shading Used;//!< marker in depth-first search, DepthFirstSearchAnalysis()160 public: 161 atom *leftatom; //!< first bond partner 162 atom *rightatom; //!< second bond partner 163 bond *previous; //!< previous atom in molecule list 164 bond *next; //!< next atom in molecule list 165 int HydrogenBond; //!< Number of hydrogen atoms in the bond 166 int BondDegree; //!< single, double, triple, ... bond 167 int nr; //!< unique number in a molecule, updated by molecule::CreateAdjacencyList() 168 bool Cyclic; //!< flag whether bond is part of a cycle or not, given in DepthFirstSearchAnalysis() 169 enum EdgeType Type;//!< whether this is a tree or back edge 170 171 atom * GetOtherAtom(atom *Atom) const; 172 bond * GetFirstBond(); 173 bond * GetLastBond(); 174 175 bool MarkUsed(enum Shading color); 176 enum Shading IsUsed(); 177 void ResetUsed(); 178 bool Contains(const atom *ptr); 179 bool Contains(const int nr); 180 181 bond(); 182 bond(atom *left, atom *right); 183 bond(atom *left, atom *right, int degree); 184 bond(atom *left, atom *right, int degree, int number); 185 ~bond(); 186 187 private: 188 enum Shading Used; //!< marker in depth-first search, DepthFirstSearchAnalysis() 191 189 }; 192 190 … … 199 197 */ 200 198 class molecule { 201 public:202 double cell_size[6];//!< cell size203 periodentafel *elemente; //!< periodic table with each element204 atom *start;//!< start of atom list205 atom *end;//!< end of atom list206 bond *first;//!< start of bond list207 bond *last;//!< end of bond list208 bond ***ListOfBondsPerAtom; //!< pointer list for each atom and each bond it has209 map<atom *, struct Trajectory> Trajectories; //!< contains old trajectory points210 int MDSteps;//!< The number of MD steps in Trajectories211 int *NumberOfBondsPerAtom;//!< Number of Bonds each atom has212 int AtomCount; //!< number of atoms, brought up-to-date by CountAtoms()213 int BondCount; //!< number of atoms, brought up-to-date by CountBonds()214 int ElementCount;//!< how many unique elements are therein215 int ElementsInMolecule[MAX_ELEMENTS]; //!< list whether element (sorted by atomic number) is alread present or not216 int NoNonHydrogen; //!< number of non-hydrogen atoms in molecule217 int NoNonBonds;//!< number of non-hydrogen bonds in molecule218 int NoCyclicBonds;//!< number of cyclic bonds in molecule, by DepthFirstSearchAnalysis()219 double BondDistance;//!< typical bond distance used in CreateAdjacencyList() and furtheron220 221 molecule(periodentafel *teil);222 ~molecule();223 224 /// remove atoms from molecule.225 bool AddAtom(atom *pointer);226 bool RemoveAtom(atom *pointer);227 bool CleanupMolecule();228 229 /// Add/remove atoms to/from molecule.230 atom * AddCopyAtom(atom *pointer);231 bool AddXYZFile(string filename);232 bool AddHydrogenReplacementAtom(ofstream *out, bond *Bond, atom *BottomOrigin, atom *TopOrigin, atom *TopReplacement, bond **BondList, int NumBond, bool IsAngstroem);233 bond * AddBond(atom *first, atom *second, int degree);234 bool RemoveBond(bond *pointer);235 bool RemoveBonds(atom *BondPartner);236 237 /// Find atoms.238 atom * FindAtom(int Nr) const;239 atom * AskAtom(string text);240 241 /// Count and change present atoms' coordination.242 void CountAtoms(ofstream *out);243 void CountElements();244 void CalculateOrbitals(class config &configuration);245 bool CenterInBox(ofstream *out, Vector *BoxLengths);246 void CenterEdge(ofstream *out, Vector *max);247 void CenterOrigin(ofstream *out, Vector *max);248 void CenterGravity(ofstream *out, Vector *max);249 void Translate(const Vector *x);250 void Mirror(const Vector *x);251 void Align(Vector *n);252 void Scale(double **factor);253 void DetermineCenter(Vector ¢er);254 Vector * DetermineCenterOfGravity(ofstream *out);255 Vector * DetermineCenterOfAll(ofstream *out);256 void SetBoxDimension(Vector *dim);257 double * ReturnFullMatrixforSymmetric(double *cell_size);258 void ScanForPeriodicCorrection(ofstream *out);199 public: 200 double cell_size[6];//!< cell size 201 periodentafel *elemente; //!< periodic table with each element 202 atom *start; //!< start of atom list 203 atom *end; //!< end of atom list 204 bond *first; //!< start of bond list 205 bond *last; //!< end of bond list 206 bond ***ListOfBondsPerAtom; //!< pointer list for each atom and each bond it has 207 map<atom *, struct Trajectory> Trajectories; //!< contains old trajectory points 208 int MDSteps; //!< The number of MD steps in Trajectories 209 int *NumberOfBondsPerAtom; //!< Number of Bonds each atom has 210 int AtomCount; //!< number of atoms, brought up-to-date by CountAtoms() 211 int BondCount; //!< number of atoms, brought up-to-date by CountBonds() 212 int ElementCount; //!< how many unique elements are therein 213 int ElementsInMolecule[MAX_ELEMENTS]; //!< list whether element (sorted by atomic number) is alread present or not 214 int NoNonHydrogen; //!< number of non-hydrogen atoms in molecule 215 int NoNonBonds; //!< number of non-hydrogen bonds in molecule 216 int NoCyclicBonds; //!< number of cyclic bonds in molecule, by DepthFirstSearchAnalysis() 217 double BondDistance; //!< typical bond distance used in CreateAdjacencyList() and furtheron 218 219 molecule(periodentafel *teil); 220 ~molecule(); 221 222 /// remove atoms from molecule. 223 bool AddAtom(atom *pointer); 224 bool RemoveAtom(atom *pointer); 225 bool CleanupMolecule(); 226 227 /// Add/remove atoms to/from molecule. 228 atom * AddCopyAtom(atom *pointer); 229 bool AddXYZFile(string filename); 230 bool AddHydrogenReplacementAtom(ofstream *out, bond *Bond, atom *BottomOrigin, atom *TopOrigin, atom *TopReplacement, bond **BondList, int NumBond, bool IsAngstroem); 231 bond * AddBond(atom *first, atom *second, int degree); 232 bool RemoveBond(bond *pointer); 233 bool RemoveBonds(atom *BondPartner); 234 235 /// Find atoms. 236 atom * FindAtom(int Nr) const; 237 atom * AskAtom(string text); 238 239 /// Count and change present atoms' coordination. 240 void CountAtoms(ofstream *out); 241 void CountElements(); 242 void CalculateOrbitals(class config &configuration); 243 bool CenterInBox(ofstream *out, Vector *BoxLengths); 244 void CenterEdge(ofstream *out, Vector *max); 245 void CenterOrigin(ofstream *out, Vector *max); 246 void CenterGravity(ofstream *out, Vector *max); 247 void Translate(const Vector *x); 248 void Mirror(const Vector *x); 249 void Align(Vector *n); 250 void Scale(double **factor); 251 void DetermineCenter(Vector ¢er); 252 Vector * DetermineCenterOfGravity(ofstream *out); 253 Vector * DetermineCenterOfAll(ofstream *out); 254 void SetBoxDimension(Vector *dim); 255 double * ReturnFullMatrixforSymmetric(double *cell_size); 256 void ScanForPeriodicCorrection(ofstream *out); 259 257 void PrincipalAxisSystem(ofstream *out, bool DoRotate); 260 258 double VolumeOfConvexEnvelope(ofstream *out, bool IsAngstroem); 261 259 bool VerletForceIntegration(char *file, double delta_t, bool IsAngstroem); 262 260 263 bool CheckBounds(const Vector *x) const;264 void GetAlignvector(struct lsq_params * par) const;265 266 /// Initialising routines in fragmentation267 void CreateAdjacencyList2(ofstream *out, ifstream *output);268 void CreateAdjacencyList(ofstream *out, double bonddistance, bool IsAngstroem);269 void CreateListOfBondsPerAtom(ofstream *out);270 271 // Graph analysis272 MoleculeLeafClass * DepthFirstSearchAnalysis(ofstream *out, class StackClass<bond *> *&BackEdgeStack);273 void CyclicStructureAnalysis(ofstream *out, class StackClass<bond *> *BackEdgeStack, int *&MinimumRingSize);274 bool PickLocalBackEdges(ofstream *out, atom **ListOfLocalAtoms, class StackClass<bond *> *&ReferenceStack, class StackClass<bond *> *&LocalStack);275 bond * FindNextUnused(atom *vertex);276 void SetNextComponentNumber(atom *vertex, int nr);277 void InitComponentNumbers();278 void OutputComponentNumber(ofstream *out, atom *vertex);279 void ResetAllBondsToUnused();280 void ResetAllAtomNumbers();281 int CountCyclicBonds(ofstream *out);282 bool CheckForConnectedSubgraph(ofstream *out, KeySet *Fragment);283 string GetColor(enum Shading color);284 285 molecule *CopyMolecule();286 287 /// Fragment molecule by two different approaches:288 int FragmentMolecule(ofstream *out, int Order, config *configuration);289 bool CheckOrderAtSite(ofstream *out, bool *AtomMask, Graph *GlobalKeySetList, int Order, int *MinimumRingSize, char *path = NULL);290 bool StoreAdjacencyToFile(ofstream *out, char *path);291 bool CheckAdjacencyFileAgainstMolecule(ofstream *out, char *path, atom **ListOfAtoms);292 bool ParseOrderAtSiteFromFile(ofstream *out, char *path);293 bool StoreOrderAtSiteFile(ofstream *out, char *path);294 bool ParseKeySetFile(ofstream *out, char *filename, Graph *&FragmentList);295 bool StoreKeySetFile(ofstream *out, Graph &KeySetList, char *path);296 bool StoreForcesFile(ofstream *out, MoleculeListClass *BondFragments, char *path, int *SortIndex);297 bool CreateMappingLabelsToConfigSequence(ofstream *out, int *&SortIndex);298 bool ScanBufferIntoKeySet(ofstream *out, char *buffer, KeySet &CurrentSet);299 void BreadthFirstSearchAdd(ofstream *out, molecule *Mol, atom **&AddedAtomList, bond **&AddedBondList, atom *Root, bond *Bond, int BondOrder, bool IsAngstroem);300 /// -# BOSSANOVA301 void FragmentBOSSANOVA(ofstream *out, Graph *&FragmentList, KeyStack &RootStack, int *MinimumRingSize);261 bool CheckBounds(const Vector *x) const; 262 void GetAlignvector(struct lsq_params * par) const; 263 264 /// Initialising routines in fragmentation 265 void CreateAdjacencyList2(ofstream *out, ifstream *output); 266 void CreateAdjacencyList(ofstream *out, double bonddistance, bool IsAngstroem); 267 void CreateListOfBondsPerAtom(ofstream *out); 268 269 // Graph analysis 270 MoleculeLeafClass * DepthFirstSearchAnalysis(ofstream *out, class StackClass<bond *> *&BackEdgeStack); 271 void CyclicStructureAnalysis(ofstream *out, class StackClass<bond *> *BackEdgeStack, int *&MinimumRingSize); 272 bool PickLocalBackEdges(ofstream *out, atom **ListOfLocalAtoms, class StackClass<bond *> *&ReferenceStack, class StackClass<bond *> *&LocalStack); 273 bond * FindNextUnused(atom *vertex); 274 void SetNextComponentNumber(atom *vertex, int nr); 275 void InitComponentNumbers(); 276 void OutputComponentNumber(ofstream *out, atom *vertex); 277 void ResetAllBondsToUnused(); 278 void ResetAllAtomNumbers(); 279 int CountCyclicBonds(ofstream *out); 280 bool CheckForConnectedSubgraph(ofstream *out, KeySet *Fragment); 281 string GetColor(enum Shading color); 282 283 molecule *CopyMolecule(); 284 285 /// Fragment molecule by two different approaches: 286 int FragmentMolecule(ofstream *out, int Order, config *configuration); 287 bool CheckOrderAtSite(ofstream *out, bool *AtomMask, Graph *GlobalKeySetList, int Order, int *MinimumRingSize, char *path = NULL); 288 bool StoreAdjacencyToFile(ofstream *out, char *path); 289 bool CheckAdjacencyFileAgainstMolecule(ofstream *out, char *path, atom **ListOfAtoms); 290 bool ParseOrderAtSiteFromFile(ofstream *out, char *path); 291 bool StoreOrderAtSiteFile(ofstream *out, char *path); 292 bool ParseKeySetFile(ofstream *out, char *filename, Graph *&FragmentList); 293 bool StoreKeySetFile(ofstream *out, Graph &KeySetList, char *path); 294 bool StoreForcesFile(ofstream *out, MoleculeListClass *BondFragments, char *path, int *SortIndex); 295 bool CreateMappingLabelsToConfigSequence(ofstream *out, int *&SortIndex); 296 bool ScanBufferIntoKeySet(ofstream *out, char *buffer, KeySet &CurrentSet); 297 void BreadthFirstSearchAdd(ofstream *out, molecule *Mol, atom **&AddedAtomList, bond **&AddedBondList, atom *Root, bond *Bond, int BondOrder, bool IsAngstroem); 298 /// -# BOSSANOVA 299 void FragmentBOSSANOVA(ofstream *out, Graph *&FragmentList, KeyStack &RootStack, int *MinimumRingSize); 302 300 int PowerSetGenerator(ofstream *out, int Order, struct UniqueFragments &FragmentSearch, KeySet RestrictedKeySet); 303 bool BuildInducedSubgraph(ofstream *out, const molecule *Father);304 molecule * StoreFragmentFromKeySet(ofstream *out, KeySet &Leaflet, bool IsAngstroem);305 void SPFragmentGenerator(ofstream *out, struct UniqueFragments *FragmentSearch, int RootDistance, bond **BondsSet, int SetDimension, int SubOrder);306 int LookForRemovalCandidate(ofstream *&out, KeySet *&Leaf, int *&ShortestPathList);307 int GuesstimateFragmentCount(ofstream *out, int order);308 309 // Recognize doubly appearing molecules in a list of them310 int * IsEqualToWithinThreshold(ofstream *out, molecule *OtherMolecule, double threshold);311 int * GetFatherSonAtomicMap(ofstream *out, molecule *OtherMolecule);312 313 // Output routines.314 bool Output(ofstream *out);315 bool OutputTrajectories(ofstream *out);316 void OutputListOfBonds(ofstream *out) const;317 bool OutputXYZ(ofstream *out) const;318 bool OutputTrajectoriesXYZ(ofstream *out);319 bool Checkout(ofstream *out) const;320 bool OutputTemperatureFromTrajectories(ofstream *out, int startstep, int endstep, ofstream *output);321 322 private:323 int last_atom;//!< number given to last atom301 bool BuildInducedSubgraph(ofstream *out, const molecule *Father); 302 molecule * StoreFragmentFromKeySet(ofstream *out, KeySet &Leaflet, bool IsAngstroem); 303 void SPFragmentGenerator(ofstream *out, struct UniqueFragments *FragmentSearch, int RootDistance, bond **BondsSet, int SetDimension, int SubOrder); 304 int LookForRemovalCandidate(ofstream *&out, KeySet *&Leaf, int *&ShortestPathList); 305 int GuesstimateFragmentCount(ofstream *out, int order); 306 307 // Recognize doubly appearing molecules in a list of them 308 int * IsEqualToWithinThreshold(ofstream *out, molecule *OtherMolecule, double threshold); 309 int * GetFatherSonAtomicMap(ofstream *out, molecule *OtherMolecule); 310 311 // Output routines. 312 bool Output(ofstream *out); 313 bool OutputTrajectories(ofstream *out); 314 void OutputListOfBonds(ofstream *out) const; 315 bool OutputXYZ(ofstream *out) const; 316 bool OutputTrajectoriesXYZ(ofstream *out); 317 bool Checkout(ofstream *out) const; 318 bool OutputTemperatureFromTrajectories(ofstream *out, int startstep, int endstep, ofstream *output); 319 320 private: 321 int last_atom; //!< number given to last atom 324 322 }; 325 323 … … 327 325 */ 328 326 class MoleculeListClass { 329 public:330 molecule **ListOfMolecules;//!< pointer list of fragment molecules to check for equality331 int NumberOfMolecules;//!< Number of entries in \a **FragmentList and of to be returned one.332 int NumberOfTopAtoms;//!< Number of atoms in the molecule from which all fragments originate333 334 MoleculeListClass();335 MoleculeListClass(int Num, int NumAtoms);336 ~MoleculeListClass();337 338 /// Output configs.339 bool AddHydrogenCorrection(ofstream *out, char *path);340 bool StoreForcesFile(ofstream *out, char *path, int *SortIndex);341 bool OutputConfigForListOfFragments(ofstream *out, config *configuration, int *SortIndex);342 void Output(ofstream *out);343 344 private:327 public: 328 molecule **ListOfMolecules; //!< pointer list of fragment molecules to check for equality 329 int NumberOfMolecules; //!< Number of entries in \a **FragmentList and of to be returned one. 330 int NumberOfTopAtoms; //!< Number of atoms in the molecule from which all fragments originate 331 332 MoleculeListClass(); 333 MoleculeListClass(int Num, int NumAtoms); 334 ~MoleculeListClass(); 335 336 /// Output configs. 337 bool AddHydrogenCorrection(ofstream *out, char *path); 338 bool StoreForcesFile(ofstream *out, char *path, int *SortIndex); 339 bool OutputConfigForListOfFragments(ofstream *out, config *configuration, int *SortIndex); 340 void Output(ofstream *out); 341 342 private: 345 343 }; 346 344 … … 350 348 */ 351 349 class MoleculeLeafClass { 352 public:353 molecule *Leaf;//!< molecule of this leaf354 //MoleculeLeafClass *UpLeaf;//!< Leaf one level up355 //MoleculeLeafClass *DownLeaf;//!< First leaf one level down356 MoleculeLeafClass *previous;//!< Previous leaf on this level357 MoleculeLeafClass *next;//!< Next leaf on this level358 359 //MoleculeLeafClass(MoleculeLeafClass *Up, MoleculeLeafClass *Previous);360 MoleculeLeafClass(MoleculeLeafClass *PreviousLeaf);361 ~MoleculeLeafClass();362 363 bool AddLeaf(molecule *ptr, MoleculeLeafClass *Previous);364 bool FillBondStructureFromReference(ofstream *out, molecule *reference, int &FragmentCounter, atom ***&ListOfLocalAtoms, bool FreeList = false);365 bool FillRootStackForSubgraphs(ofstream *out, KeyStack *&RootStack, bool *AtomMask, int &FragmentCounter);366 bool AssignKeySetsToFragment(ofstream *out, molecule *reference, Graph *KeySetList, atom ***&ListOfLocalAtoms, Graph **&FragmentList, int &FragmentCounter, bool FreeList = false);367 bool FillListOfLocalAtoms(ofstream *out, atom ***&ListOfLocalAtoms, const int FragmentCounter, const int GlobalAtomCount, bool &FreeList);368 void TranslateIndicesToGlobalIDs(ofstream *out, Graph **FragmentList, int &FragmentCounter, int &TotalNumberOfKeySets, Graph &TotalGraph);369 int Count() const;350 public: 351 molecule *Leaf; //!< molecule of this leaf 352 //MoleculeLeafClass *UpLeaf; //!< Leaf one level up 353 //MoleculeLeafClass *DownLeaf; //!< First leaf one level down 354 MoleculeLeafClass *previous; //!< Previous leaf on this level 355 MoleculeLeafClass *next; //!< Next leaf on this level 356 357 //MoleculeLeafClass(MoleculeLeafClass *Up, MoleculeLeafClass *Previous); 358 MoleculeLeafClass(MoleculeLeafClass *PreviousLeaf); 359 ~MoleculeLeafClass(); 360 361 bool AddLeaf(molecule *ptr, MoleculeLeafClass *Previous); 362 bool FillBondStructureFromReference(ofstream *out, molecule *reference, int &FragmentCounter, atom ***&ListOfLocalAtoms, bool FreeList = false); 363 bool FillRootStackForSubgraphs(ofstream *out, KeyStack *&RootStack, bool *AtomMask, int &FragmentCounter); 364 bool AssignKeySetsToFragment(ofstream *out, molecule *reference, Graph *KeySetList, atom ***&ListOfLocalAtoms, Graph **&FragmentList, int &FragmentCounter, bool FreeList = false); 365 bool FillListOfLocalAtoms(ofstream *out, atom ***&ListOfLocalAtoms, const int FragmentCounter, const int GlobalAtomCount, bool &FreeList); 366 void TranslateIndicesToGlobalIDs(ofstream *out, Graph **FragmentList, int &FragmentCounter, int &TotalNumberOfKeySets, Graph &TotalGraph); 367 int Count() const; 370 368 }; 371 369 … … 374 372 */ 375 373 class config { 376 public:377 int PsiType;378 int MaxPsiDouble;379 int PsiMaxNoUp;380 int PsiMaxNoDown;381 int MaxMinStopStep;382 int InitMaxMinStopStep;383 int ProcPEGamma;384 int ProcPEPsi;385 char *configpath;386 char *configname;387 bool FastParsing;388 double Deltat;389 390 private:391 char *mainname;392 char *defaultpath;393 char *pseudopotpath;394 395 int DoOutVis;396 int DoOutMes;397 int DoOutNICS;398 int DoOutOrbitals;399 int DoOutCurrent;400 int DoFullCurrent;401 int DoPerturbation;402 int DoWannier;403 int CommonWannier;404 double SawtoothStart;405 int VectorPlane;406 double VectorCut;407 int UseAddGramSch;408 int Seed;409 410 int MaxOuterStep;411 int OutVisStep;412 int OutSrcStep;413 double TargetTemp;414 int ScaleTempStep;415 int MaxPsiStep;416 double EpsWannier;417 418 int MaxMinStep;419 double RelEpsTotalEnergy;420 double RelEpsKineticEnergy;421 int MaxMinGapStopStep;422 int MaxInitMinStep;423 double InitRelEpsTotalEnergy;424 double InitRelEpsKineticEnergy;425 int InitMaxMinGapStopStep;426 427 //double BoxLength[NDIM*NDIM];428 429 double ECut;430 int MaxLevel;431 int RiemannTensor;432 int LevRFactor;433 int RiemannLevel;434 int Lev0Factor;435 int RTActualUse;436 int AddPsis;437 438 double RCut;439 int StructOpt;440 int IsAngstroem;441 int RelativeCoord;442 int MaxTypes;443 444 445 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);446 447 public:448 config();449 ~config();450 451 int TestSyntax(char *filename, periodentafel *periode, molecule *mol);452 void Load(char *filename, periodentafel *periode, molecule *mol);453 void LoadOld(char *filename, periodentafel *periode, molecule *mol);454 void RetrieveConfigPathAndName(string filename);455 bool Save(const char *filename, periodentafel *periode, molecule *mol) const;456 bool SaveMPQC(const char *filename, molecule *mol) const;457 void Edit(molecule *mol);458 bool GetIsAngstroem() const;459 char *GetDefaultPath() const;460 void SetDefaultPath(const char *path);374 public: 375 int PsiType; 376 int MaxPsiDouble; 377 int PsiMaxNoUp; 378 int PsiMaxNoDown; 379 int MaxMinStopStep; 380 int InitMaxMinStopStep; 381 int ProcPEGamma; 382 int ProcPEPsi; 383 char *configpath; 384 char *configname; 385 bool FastParsing; 386 double Deltat; 387 388 private: 389 char *mainname; 390 char *defaultpath; 391 char *pseudopotpath; 392 393 int DoOutVis; 394 int DoOutMes; 395 int DoOutNICS; 396 int DoOutOrbitals; 397 int DoOutCurrent; 398 int DoFullCurrent; 399 int DoPerturbation; 400 int DoWannier; 401 int CommonWannier; 402 double SawtoothStart; 403 int VectorPlane; 404 double VectorCut; 405 int UseAddGramSch; 406 int Seed; 407 408 int MaxOuterStep; 409 int OutVisStep; 410 int OutSrcStep; 411 double TargetTemp; 412 int ScaleTempStep; 413 int MaxPsiStep; 414 double EpsWannier; 415 416 int MaxMinStep; 417 double RelEpsTotalEnergy; 418 double RelEpsKineticEnergy; 419 int MaxMinGapStopStep; 420 int MaxInitMinStep; 421 double InitRelEpsTotalEnergy; 422 double InitRelEpsKineticEnergy; 423 int InitMaxMinGapStopStep; 424 425 //double BoxLength[NDIM*NDIM]; 426 427 double ECut; 428 int MaxLevel; 429 int RiemannTensor; 430 int LevRFactor; 431 int RiemannLevel; 432 int Lev0Factor; 433 int RTActualUse; 434 int AddPsis; 435 436 double RCut; 437 int StructOpt; 438 int IsAngstroem; 439 int RelativeCoord; 440 int MaxTypes; 441 442 443 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); 444 445 public: 446 config(); 447 ~config(); 448 449 int TestSyntax(char *filename, periodentafel *periode, molecule *mol); 450 void Load(char *filename, periodentafel *periode, molecule *mol); 451 void LoadOld(char *filename, periodentafel *periode, molecule *mol); 452 void RetrieveConfigPathAndName(string filename); 453 bool Save(const char *filename, periodentafel *periode, molecule *mol) const; 454 bool SaveMPQC(const char *filename, molecule *mol) const; 455 void Edit(molecule *mol); 456 bool GetIsAngstroem() const; 457 char *GetDefaultPath() const; 458 void SetDefaultPath(const char *path); 461 459 }; 462 460 -
Property mode
changed from
Note:
See TracChangeset
for help on using the changeset viewer.
