source: src/molecules.hpp@ 19f3d6

Action_Thermostats Add_AtomRandomPerturbation Add_FitFragmentPartialChargesAction Add_RotateAroundBondAction Add_SelectAtomByNameAction Added_ParseSaveFragmentResults AddingActions_SaveParseParticleParameters Adding_Graph_to_ChangeBondActions Adding_MD_integration_tests Adding_ParticleName_to_Atom Adding_StructOpt_integration_tests AtomFragments Automaking_mpqc_open AutomationFragmentation_failures Candidate_v1.5.4 Candidate_v1.6.0 Candidate_v1.6.1 ChangeBugEmailaddress ChangingTestPorts ChemicalSpaceEvaluator CombiningParticlePotentialParsing Combining_Subpackages Debian_Package_split Debian_package_split_molecuildergui_only Disabling_MemDebug Docu_Python_wait EmpiricalPotential_contain_HomologyGraph EmpiricalPotential_contain_HomologyGraph_documentation Enable_parallel_make_install Enhance_userguide Enhanced_StructuralOptimization Enhanced_StructuralOptimization_continued Example_ManyWaysToTranslateAtom Exclude_Hydrogens_annealWithBondGraph FitPartialCharges_GlobalError Fix_BoundInBox_CenterInBox_MoleculeActions Fix_ChargeSampling_PBC Fix_ChronosMutex Fix_FitPartialCharges Fix_FitPotential_needs_atomicnumbers Fix_ForceAnnealing Fix_IndependentFragmentGrids Fix_ParseParticles Fix_ParseParticles_split_forward_backward_Actions Fix_PopActions Fix_QtFragmentList_sorted_selection Fix_Restrictedkeyset_FragmentMolecule Fix_StatusMsg Fix_StepWorldTime_single_argument Fix_Verbose_Codepatterns Fix_fitting_potentials Fixes ForceAnnealing_goodresults ForceAnnealing_oldresults ForceAnnealing_tocheck ForceAnnealing_with_BondGraph ForceAnnealing_with_BondGraph_continued ForceAnnealing_with_BondGraph_continued_betteresults ForceAnnealing_with_BondGraph_contraction-expansion FragmentAction_writes_AtomFragments FragmentMolecule_checks_bonddegrees GeometryObjects Gui_Fixes Gui_displays_atomic_force_velocity ImplicitCharges IndependentFragmentGrids IndependentFragmentGrids_IndividualZeroInstances IndependentFragmentGrids_IntegrationTest IndependentFragmentGrids_Sole_NN_Calculation JobMarket_RobustOnKillsSegFaults JobMarket_StableWorkerPool JobMarket_unresolvable_hostname_fix MoreRobust_FragmentAutomation ODR_violation_mpqc_open PartialCharges_OrthogonalSummation PdbParser_setsAtomName PythonUI_with_named_parameters QtGui_reactivate_TimeChanged_changes Recreated_GuiChecks Rewrite_FitPartialCharges RotateToPrincipalAxisSystem_UndoRedo SaturateAtoms_findBestMatching SaturateAtoms_singleDegree StoppableMakroAction Subpackage_CodePatterns Subpackage_JobMarket Subpackage_LinearAlgebra Subpackage_levmar Subpackage_mpqc_open Subpackage_vmg Switchable_LogView ThirdParty_MPQC_rebuilt_buildsystem TrajectoryDependenant_MaxOrder TremoloParser_IncreasedPrecision TremoloParser_MultipleTimesteps TremoloParser_setsAtomName Ubuntu_1604_changes stable
Last change on this file since 19f3d6 was 3ccc3e, checked in by Frederik Heber <heber@…>, 16 years ago

BUGFIXES: CyclicStructureAnalysis() now compatible to disconnected subgraphs, AssignKeySetsToFragment() and FillBondStructureFromReference() memory cleanup corrected

+ molecule::DepthFirstSearchAnalysis() now just returns BackEdgeStack, not MinimumRingSize. CyclicStructureAnalysis() is called during FragmentMolecule(), after subgraphs bonds list have been filled by FillBondStructureFromReference().
+ new function molecule::PickLocalBackEdges(), as the BackEdgeStack returned by DepthFirstSearchAnalysis() co
ntains only global bonds, not the local ones for the subgraph, we have to step through it and pick the right
ones out.
+ molecule::FragmentMolecule() now calls molecule::CyclicStructureAnalysis() separately for each subgraph, along with a BackEdgeStack filled by PickLocalBackEdges(), and allocates&initialises MinimumRingSize array. Als
o AssignKeySetsToFragment() frees the LocalListOfAtoms now (FreeList=true), now longer after the following wh
ile
+ molecule::CyclicStructureAnalysis() takes a local BackEdgeStack and analysis the subgraphs cycles, returnin
g minimum ring size
+ MoleculeLeafClass::AssignKeySetsToFragment() now frees memory for ListOfLocalAtoms when FreeList is set. BUGFIX: test of first key was testing against ..->nr != -1. However, LocalListOfAtoms was not even initialised correctly to NULL, hence ...->nr pointed in some cases to nowhere. Now it test atom* against NULL.
+ MoleculeLeafClass::FillBondStructureFromReference() now frees memory for ListOfLocalAtoms when FreeList is set correctly (only free initial pointer when FragmentCounter == 0, also it was decreased not before but after freeing, hence we free'd the wrong list). Also, father replaced by GetTrueFather() (makes the function moregenerally useable, was not a bug).
+ ParseCommandLineOptions() option 'D': adapted to changes in DepthFirstSearchAnalysis() in a similar manner
to FragmentMolecule()
+ molecule::CountCyclicBonds() adapted but does not perform CyclicStructureAnalysis()
+ molecule::CreateAdjacencyList() counts the bonds that could not be brought to covalently corrected degree (i.e. the remaining ionic atoms)
+ molecule::CreateListOfBondsPerAtom() prints atom names and number, which is helpful as name contains global

and number contains local number (helped in finding above bugs)

+ CreateFatherLookupTable(): BUGFIX: LookupTable was not initialised to NULL (see above)

  • Property mode set to 100644
File size: 17.6 KB
RevLine 
[14de469]1/** \file molecules.hpp
2 *
3 * Class definitions of atom and molecule, element and periodentafel
4 */
5
6#ifndef MOLECULES_HPP_
7#define MOLECULES_HPP_
8
9using namespace std;
10
11// GSL headers
12#include <gsl/gsl_multimin.h>
13#include <gsl/gsl_vector.h>
14#include <gsl/gsl_matrix.h>
[d52ea1b]15#include <gsl/gsl_eigen.h>
[14de469]16#include <gsl/gsl_heapsort.h>
17
18// STL headers
19#include <map>
20#include <set>
21#include <deque>
[d7e30c]22#include <list>
[5e0d1f]23#include <vector>
[14de469]24
25#include "helpers.hpp"
[362b0e]26#include "parser.hpp"
[68cb0f]27#include "periodentafel.hpp"
[6d35e4]28#include "stackclass.hpp"
[342f33f]29#include "vector.hpp"
[14de469]30
31class atom;
32class bond;
33class config;
34class molecule;
35class MoleculeListClass;
36class Verbose;
37
38/******************************** Some definitions for easier reading **********************************/
39
40#define KeyStack deque<int>
41#define KeySet set<int>
[5de3c9]42#define NumberValuePair pair<int, double>
[49de64]43#define Graph map <KeySet, NumberValuePair, KeyCompare >
44#define GraphPair pair <KeySet, NumberValuePair >
[14de469]45#define KeySetTestPair pair<KeySet::iterator, bool>
46#define GraphTestPair pair<Graph::iterator, bool>
47
[ed060e]48#define DistancePair pair < double, atom* >
49#define DistanceMap multimap < double, atom* >
50#define DistanceTestPair pair < DistanceMap::iterator, bool>
51
52#define Boundaries map <double, DistancePair >
53#define BoundariesPair pair<double, DistancePair >
54#define BoundariesTestPair pair< Boundaries::iterator, bool>
55
56#define PointMap map < int, class BoundaryPointSet * >
57#define PointPair pair < int, class BoundaryPointSet * >
58#define PointTestPair pair < PointMap::iterator, bool >
59
60#define LineMap map < int, class BoundaryLineSet * >
61#define LinePair pair < int, class BoundaryLineSet * >
62#define LineTestPair pair < LinePair::iterator, bool >
63
64#define TriangleMap map < int, class BoundaryTriangleSet * >
65#define TrianglePair pair < int, class BoundaryTriangleSet * >
66#define TriangleTestPair pair < TrianglePair::iterator, bool >
67
68#define DistanceMultiMap multimap <double, pair < PointMap::iterator, PointMap::iterator> >
69#define DistanceMultiMapPair pair <double, pair < PointMap::iterator, PointMap::iterator> >
70
71/******************************** Some small functions and/or structures **********************************/
72
[14de469]73struct KeyCompare
74{
75 bool operator() (const KeySet SubgraphA, const KeySet SubgraphB) const;
76};
[6d35e4]77
[d7e30c]78struct Trajectory
79{
[5e0d1f]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
[d7e30c]84};
85
[14de469]86//bool operator < (KeySet SubgraphA, KeySet SubgraphB); //note: this declaration is important, otherwise normal < is used (producing wrong order)
87inline void InsertFragmentIntoGraph(ofstream *out, struct UniqueFragments *Fragment); // Insert a KeySet into a Graph
88inline void InsertGraphIntoGraph(ofstream *out, Graph &graph1, Graph &graph2, int *counter); // Insert all KeySet's in a Graph into another Graph
89int CompareDoubles (const void * a, const void * b);
90
[6d35e4]91
[14de469]92/************************************* Class definitions ****************************************/
93
94
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 matrix
97#define RDET2(a0,a1,a2,a3) ((a0)*(a3)-(a1)*(a2)) //!< hard-coded determinant of a 2x2 matrix
98
99
100/** Parameter structure for least square minimsation.
101 */
102struct LSQ_params {
[e9b8bb]103 Vector **vectors;
[14de469]104 int num;
105};
106
107double LSQ(const gsl_vector * x, void * params);
108
109/** Parameter structure for least square minimsation.
110 */
111struct lsq_params {
112 gsl_vector *x;
113 const molecule *mol;
114 element *type;
115};
116
117
118
119/** Single atom.
120 * Class incoporates position, type
121 */
122class atom {
123 public:
[e9b8bb]124 Vector x; //!< coordinate array of atom, giving position within cell
125 Vector v; //!< velocity array of atom
[14de469]126 element *type; //!< pointing to element
127 atom *previous; //!< previous atom in molecule list
128 atom *next; //!< next atom in molecule list
129 atom *father; //!< In many-body bond order fragmentations points to originating atom
130 atom *Ancestor; //!< "Father" in Depth-First-Search
131 char *Name; //!< unique name used during many-body bond-order fragmentation
[943d02]132 int FixedIon; //!< config variable that states whether forces act on the ion or not
[14de469]133 int *sort; //!< sort criteria
134 int nr; //!< continuous, unique number
135 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.
[683914]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()
[db942e]140 unsigned char AdaptiveOrder; //!< current present bond order at site (0 means "not set")
[362b0e]141 bool MaxOrder; //!< whether this atom as a root in fragmentation still creates more fragments on higher orders or not
[14de469]142
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:
152};
153
154ostream & operator << (ostream &ost, atom &a);
155
156/** Bonds between atoms.
157 * Class incorporates bonds between atoms in a molecule,
158 * used to derive tge fragments in many-body bond order
159 * calculations.
160 */
161class bond {
162 public:
163 atom *leftatom; //!< first bond partner
164 atom *rightatom; //!< second bond partner
165 bond *previous; //!< previous atom in molecule list
166 bond *next; //!< next atom in molecule list
167 int HydrogenBond; //!< Number of hydrogen atoms in the bond
168 int BondDegree; //!< single, double, triple, ... bond
169 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 edge
172
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()
191};
192
193ostream & operator << (ostream &ost, bond &b);
194
195class MoleculeLeafClass;
196
197/** The complete molecule.
198 * Class incorporates number of types
199 */
200class molecule {
201 public:
202 double cell_size[6];//!< cell size
203 periodentafel *elemente; //!< periodic table with each element
204 atom *start; //!< start of atom list
205 atom *end; //!< end of atom list
206 bond *first; //!< start of bond list
207 bond *last; //!< end of bond list
208 bond ***ListOfBondsPerAtom; //!< pointer list for each atom and each bond it has
[5e0d1f]209 map<atom *, struct Trajectory> Trajectories; //!< contains old trajectory points
210 int MDSteps; //!< The number of MD steps in Trajectories
[14de469]211 int *NumberOfBondsPerAtom; //!< Number of Bonds each atom has
212 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 therein
215 int ElementsInMolecule[MAX_ELEMENTS]; //!< list whether element (sorted by atomic number) is alread present or not
216 int NoNonHydrogen; //!< number of non-hydrogen atoms in molecule
217 int NoNonBonds; //!< number of non-hydrogen bonds in molecule
218 int NoCyclicBonds; //!< number of cyclic bonds in molecule, by DepthFirstSearchAnalysis()
219 double BondDistance; //!< typical bond distance used in CreateAdjacencyList() and furtheron
220
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;
[342f33f]239 atom * AskAtom(string text);
[14de469]240
241 /// Count and change present atoms' coordination.
242 void CountAtoms(ofstream *out);
243 void CountElements();
244 void CalculateOrbitals(class config &configuration);
[e9b8bb]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);
[14de469]252 void Scale(double **factor);
[e9b8bb]253 void DetermineCenter(Vector &center);
254 Vector * DetermineCenterOfGravity(ofstream *out);
[a6b7fb]255 Vector * DetermineCenterOfAll(ofstream *out);
[e9b8bb]256 void SetBoxDimension(Vector *dim);
[14de469]257 double * ReturnFullMatrixforSymmetric(double *cell_size);
258 void ScanForPeriodicCorrection(ofstream *out);
[d52ea1b]259 void PrincipalAxisSystem(ofstream *out, bool DoRotate);
260 double VolumeOfConvexEnvelope(ofstream *out, bool IsAngstroem);
[362b0e]261 bool VerletForceIntegration(char *file, double delta_t, bool IsAngstroem);
[d52ea1b]262
[e9b8bb]263 bool CheckBounds(const Vector *x) const;
[d7e30c]264 void GetAlignvector(struct lsq_params * par) const;
[14de469]265
266 /// Initialising routines in fragmentation
[a251a3]267 void CreateAdjacencyList(ofstream *out, double bonddistance, bool IsAngstroem);
[14de469]268 void CreateListOfBondsPerAtom(ofstream *out);
269
270 // Graph analysis
[3ccc3e]271 MoleculeLeafClass * DepthFirstSearchAnalysis(ofstream *out, class StackClass<bond *> *&BackEdgeStack);
[fc850d]272 void CyclicStructureAnalysis(ofstream *out, class StackClass<bond *> *BackEdgeStack, int *&MinimumRingSize);
[3ccc3e]273 bool PickLocalBackEdges(ofstream *out, atom **ListOfLocalAtoms, class StackClass<bond *> *&ReferenceStack, class StackClass<bond *> *&LocalStack);
[14de469]274 bond * FindNextUnused(atom *vertex);
275 void SetNextComponentNumber(atom *vertex, int nr);
276 void InitComponentNumbers();
277 void OutputComponentNumber(ofstream *out, atom *vertex);
278 void ResetAllBondsToUnused();
279 void ResetAllAtomNumbers();
280 int CountCyclicBonds(ofstream *out);
[4aa03a]281 bool CheckForConnectedSubgraph(ofstream *out, KeySet *Fragment);
[342f33f]282 string GetColor(enum Shading color);
[14de469]283
284 molecule *CopyMolecule();
285
286 /// Fragment molecule by two different approaches:
[362b0e]287 int FragmentMolecule(ofstream *out, int Order, config *configuration);
[958457]288 bool CheckOrderAtSite(ofstream *out, bool *AtomMask, Graph *GlobalKeySetList, int Order, int *MinimumRingSize, char *path = NULL);
[db942e]289 bool StoreAdjacencyToFile(ofstream *out, char *path);
290 bool CheckAdjacencyFileAgainstMolecule(ofstream *out, char *path, atom **ListOfAtoms);
291 bool ParseOrderAtSiteFromFile(ofstream *out, char *path);
292 bool StoreOrderAtSiteFile(ofstream *out, char *path);
[d52ea1b]293 bool ParseKeySetFile(ofstream *out, char *filename, Graph *&FragmentList);
[2459b1]294 bool StoreKeySetFile(ofstream *out, Graph &KeySetList, char *path);
295 bool StoreForcesFile(ofstream *out, MoleculeListClass *BondFragments, char *path, int *SortIndex);
[bf46da]296 bool CreateMappingLabelsToConfigSequence(ofstream *out, int *&SortIndex);
[b0a0c3]297 bool ScanBufferIntoKeySet(ofstream *out, char *buffer, KeySet &CurrentSet);
[db942e]298 void BreadthFirstSearchAdd(ofstream *out, molecule *Mol, atom **&AddedAtomList, bond **&AddedBondList, atom *Root, bond *Bond, int BondOrder, bool IsAngstroem);
[14de469]299 /// -# BOSSANOVA
[fc850d]300 void FragmentBOSSANOVA(ofstream *out, Graph *&FragmentList, KeyStack &RootStack, int *MinimumRingSize);
[2459b1]301 int PowerSetGenerator(ofstream *out, int Order, struct UniqueFragments &FragmentSearch, KeySet RestrictedKeySet);
[14de469]302 bool BuildInducedSubgraph(ofstream *out, const molecule *Father);
[183f35]303 molecule * StoreFragmentFromKeySet(ofstream *out, KeySet &Leaflet, bool IsAngstroem);
[14de469]304 void SPFragmentGenerator(ofstream *out, struct UniqueFragments *FragmentSearch, int RootDistance, bond **BondsSet, int SetDimension, int SubOrder);
305 int LookForRemovalCandidate(ofstream *&out, KeySet *&Leaf, int *&ShortestPathList);
306 int GuesstimateFragmentCount(ofstream *out, int order);
307
308 // Recognize doubly appearing molecules in a list of them
309 int * IsEqualToWithinThreshold(ofstream *out, molecule *OtherMolecule, double threshold);
310 int * GetFatherSonAtomicMap(ofstream *out, molecule *OtherMolecule);
311
312 // Output routines.
313 bool Output(ofstream *out);
[5e0d1f]314 bool OutputTrajectories(ofstream *out);
[da5355]315 void OutputListOfBonds(ofstream *out) const;
[14de469]316 bool OutputXYZ(ofstream *out) const;
[362b0e]317 bool OutputTrajectoriesXYZ(ofstream *out);
[14de469]318 bool Checkout(ofstream *out) const;
[698b04]319 bool OutputTemperatureFromTrajectories(ofstream *out, int startstep, int endstep, ofstream *output);
[14de469]320
321 private:
322 int last_atom; //!< number given to last atom
323};
324
325/** A list of \a molecule classes.
326 */
327class MoleculeListClass {
328 public:
329 molecule **ListOfMolecules; //!< pointer list of fragment molecules to check for equality
330 int NumberOfMolecules; //!< Number of entries in \a **FragmentList and of to be returned one.
331 int NumberOfTopAtoms; //!< Number of atoms in the molecule from which all fragments originate
332
333 MoleculeListClass();
334 MoleculeListClass(int Num, int NumAtoms);
335 ~MoleculeListClass();
336
337 /// Output configs.
[390248]338 bool AddHydrogenCorrection(ofstream *out, char *path);
[2459b1]339 bool StoreForcesFile(ofstream *out, char *path, int *SortIndex);
[db942e]340 bool OutputConfigForListOfFragments(ofstream *out, config *configuration, int *SortIndex);
[14de469]341 void Output(ofstream *out);
342
343 private:
344};
345
346
347/** A leaf for a tree of \a molecule class
348 * Wraps molecules in a tree structure
349 */
350class MoleculeLeafClass {
351 public:
352 molecule *Leaf; //!< molecule of this leaf
353 //MoleculeLeafClass *UpLeaf; //!< Leaf one level up
354 //MoleculeLeafClass *DownLeaf; //!< First leaf one level down
355 MoleculeLeafClass *previous; //!< Previous leaf on this level
356 MoleculeLeafClass *next; //!< Next leaf on this level
357
358 //MoleculeLeafClass(MoleculeLeafClass *Up, MoleculeLeafClass *Previous);
359 MoleculeLeafClass(MoleculeLeafClass *PreviousLeaf);
360 ~MoleculeLeafClass();
361
362 bool AddLeaf(molecule *ptr, MoleculeLeafClass *Previous);
[9fcf47]363 bool FillBondStructureFromReference(ofstream *out, molecule *reference, int &FragmentCounter, atom ***&ListOfLocalAtoms, bool FreeList = false);
[fc850d]364 bool FillRootStackForSubgraphs(ofstream *out, KeyStack *&RootStack, bool *AtomMask, int &FragmentCounter);
[da5355]365 bool AssignKeySetsToFragment(ofstream *out, molecule *reference, Graph *KeySetList, atom ***&ListOfLocalAtoms, Graph **&FragmentList, int &FragmentCounter, bool FreeList = false);
[3ccc3e]366 bool FillListOfLocalAtoms(ofstream *out, atom ***&ListOfLocalAtoms, const int FragmentCounter, const int GlobalAtomCount, bool &FreeList);
[87f6c9]367 void TranslateIndicesToGlobalIDs(ofstream *out, Graph **FragmentList, int &FragmentCounter, int &TotalNumberOfKeySets, Graph &TotalGraph);
[da5355]368 int Count() const;
[14de469]369};
370
371/** The config file.
372 * The class contains all parameters that control a dft run also functions to load and save.
373 */
374class config {
375 public:
376 int PsiType;
377 int MaxPsiDouble;
378 int PsiMaxNoUp;
379 int PsiMaxNoDown;
380 int MaxMinStopStep;
381 int InitMaxMinStopStep;
382 int ProcPEGamma;
383 int ProcPEPsi;
[5b15ab]384 char *configpath;
[b5ecd9]385 char *configname;
[49de64]386 bool FastParsing;
[362b0e]387 double Deltat;
[14de469]388
389 private:
390 char *mainname;
391 char *defaultpath;
392 char *pseudopotpath;
393
394 int DoOutVis;
395 int DoOutMes;
396 int DoOutNICS;
397 int DoOutOrbitals;
398 int DoOutCurrent;
399 int DoFullCurrent;
400 int DoPerturbation;
[18913c]401 int DoWannier;
[14de469]402 int CommonWannier;
403 double SawtoothStart;
404 int VectorPlane;
405 double VectorCut;
406 int UseAddGramSch;
407 int Seed;
408
409 int MaxOuterStep;
410 int OutVisStep;
411 int OutSrcStep;
412 double TargetTemp;
413 int ScaleTempStep;
414 int MaxPsiStep;
415 double EpsWannier;
416
417 int MaxMinStep;
418 double RelEpsTotalEnergy;
419 double RelEpsKineticEnergy;
420 int MaxMinGapStopStep;
421 int MaxInitMinStep;
422 double InitRelEpsTotalEnergy;
423 double InitRelEpsKineticEnergy;
424 int InitMaxMinGapStopStep;
425
426 //double BoxLength[NDIM*NDIM];
427
428 double ECut;
429 int MaxLevel;
430 int RiemannTensor;
431 int LevRFactor;
432 int RiemannLevel;
433 int Lev0Factor;
434 int RTActualUse;
435 int AddPsis;
436
437 double RCut;
438 int StructOpt;
439 int IsAngstroem;
440 int RelativeCoord;
441 int MaxTypes;
442
443
444 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);
445
446 public:
447 config();
448 ~config();
449
[5b15ab]450 int TestSyntax(char *filename, periodentafel *periode, molecule *mol);
451 void Load(char *filename, periodentafel *periode, molecule *mol);
452 void LoadOld(char *filename, periodentafel *periode, molecule *mol);
[7f3b9d]453 void RetrieveConfigPathAndName(string filename);
[14de469]454 bool Save(ofstream *file, periodentafel *periode, molecule *mol) const;
[c1fc22]455 bool SaveMPQC(ofstream *file, molecule *mol) const;
[14de469]456 void Edit(molecule *mol);
457 bool GetIsAngstroem() const;
458 char *GetDefaultPath() const;
[342f33f]459 void SetDefaultPath(const char *path);
[14de469]460};
461
462#endif /*MOLECULES_HPP_*/
463
Note: See TracBrowser for help on using the repository browser.