1 | /*
|
---|
2 | * config.hpp
|
---|
3 | *
|
---|
4 | * Created on: Aug 3, 2009
|
---|
5 | * Author: heber
|
---|
6 | */
|
---|
7 |
|
---|
8 | #ifndef CONFIG_HPP_
|
---|
9 | #define CONFIG_HPP_
|
---|
10 |
|
---|
11 | using namespace std;
|
---|
12 |
|
---|
13 | /*********************************************** includes ***********************************/
|
---|
14 |
|
---|
15 | // include config.h
|
---|
16 | #ifdef HAVE_CONFIG_H
|
---|
17 | #include <config.h>
|
---|
18 | #endif
|
---|
19 |
|
---|
20 | #include <string>
|
---|
21 |
|
---|
22 | /****************************************** forward declarations *****************************/
|
---|
23 |
|
---|
24 | class molecule;
|
---|
25 | class periodentafel;
|
---|
26 |
|
---|
27 | /********************************************** declarations *******************************/
|
---|
28 |
|
---|
29 | class ConfigFileBuffer {
|
---|
30 | public:
|
---|
31 | char **buffer;
|
---|
32 | int *LineMapping;
|
---|
33 | int CurrentLine;
|
---|
34 | int NoLines;
|
---|
35 |
|
---|
36 | ConfigFileBuffer();
|
---|
37 | ConfigFileBuffer(const char * const filename);
|
---|
38 | ~ConfigFileBuffer();
|
---|
39 |
|
---|
40 | void InitMapping();
|
---|
41 | void MapIonTypesInBuffer(const int NoAtoms);
|
---|
42 | };
|
---|
43 |
|
---|
44 | /** The config file.
|
---|
45 | * The class contains all parameters that control a dft run also functions to load and save.
|
---|
46 | */
|
---|
47 | class config {
|
---|
48 | public:
|
---|
49 | int PsiType;
|
---|
50 | int MaxPsiDouble;
|
---|
51 | int PsiMaxNoUp;
|
---|
52 | int PsiMaxNoDown;
|
---|
53 | int MaxMinStopStep;
|
---|
54 | int InitMaxMinStopStep;
|
---|
55 | int ProcPEGamma;
|
---|
56 | int ProcPEPsi;
|
---|
57 | char *configpath;
|
---|
58 | char *configname;
|
---|
59 | bool FastParsing;
|
---|
60 | double Deltat;
|
---|
61 | string basis;
|
---|
62 |
|
---|
63 | char *databasepath;
|
---|
64 |
|
---|
65 | int DoConstrainedMD;
|
---|
66 | int MaxOuterStep;
|
---|
67 | int Thermostat;
|
---|
68 | int *ThermostatImplemented;
|
---|
69 | char **ThermostatNames;
|
---|
70 | double TempFrequency;
|
---|
71 | double alpha;
|
---|
72 | double HooverMass;
|
---|
73 | double TargetTemp;
|
---|
74 | int ScaleTempStep;
|
---|
75 |
|
---|
76 | private:
|
---|
77 | char *mainname;
|
---|
78 | char *defaultpath;
|
---|
79 | char *pseudopotpath;
|
---|
80 |
|
---|
81 | int DoOutVis;
|
---|
82 | int DoOutMes;
|
---|
83 | int DoOutNICS;
|
---|
84 | int DoOutOrbitals;
|
---|
85 | int DoOutCurrent;
|
---|
86 | int DoFullCurrent;
|
---|
87 | int DoPerturbation;
|
---|
88 | int DoWannier;
|
---|
89 | int CommonWannier;
|
---|
90 | double SawtoothStart;
|
---|
91 | int VectorPlane;
|
---|
92 | double VectorCut;
|
---|
93 | int UseAddGramSch;
|
---|
94 | int Seed;
|
---|
95 |
|
---|
96 | int OutVisStep;
|
---|
97 | int OutSrcStep;
|
---|
98 | int MaxPsiStep;
|
---|
99 | double EpsWannier;
|
---|
100 |
|
---|
101 | int MaxMinStep;
|
---|
102 | double RelEpsTotalEnergy;
|
---|
103 | double RelEpsKineticEnergy;
|
---|
104 | int MaxMinGapStopStep;
|
---|
105 | int MaxInitMinStep;
|
---|
106 | double InitRelEpsTotalEnergy;
|
---|
107 | double InitRelEpsKineticEnergy;
|
---|
108 | int InitMaxMinGapStopStep;
|
---|
109 |
|
---|
110 | //double BoxLength[NDIM*NDIM];
|
---|
111 |
|
---|
112 | double ECut;
|
---|
113 | int MaxLevel;
|
---|
114 | int RiemannTensor;
|
---|
115 | int LevRFactor;
|
---|
116 | int RiemannLevel;
|
---|
117 | int Lev0Factor;
|
---|
118 | int RTActualUse;
|
---|
119 | int AddPsis;
|
---|
120 |
|
---|
121 | double RCut;
|
---|
122 | int StructOpt;
|
---|
123 | int IsAngstroem;
|
---|
124 | int RelativeCoord;
|
---|
125 | int MaxTypes;
|
---|
126 |
|
---|
127 |
|
---|
128 | public:
|
---|
129 | config();
|
---|
130 | ~config();
|
---|
131 |
|
---|
132 | int TestSyntax(const char * const filename, const periodentafel * const periode, const molecule * const mol) const;
|
---|
133 | void Load(const char * const filename, const periodentafel * const periode, molecule * const &mol);
|
---|
134 | void LoadOld(const char * const filename, const periodentafel * const periode, molecule * const &mol);
|
---|
135 | void RetrieveConfigPathAndName(const string filename);
|
---|
136 | bool Save(const char * const filename, const periodentafel * const periode, molecule * const mol) const;
|
---|
137 | bool SaveMPQC(const char * const filename, const molecule * const mol) const;
|
---|
138 | void Edit();
|
---|
139 | bool GetIsAngstroem() const;
|
---|
140 | char *GetDefaultPath() const;
|
---|
141 | void SetDefaultPath(const char * const path);
|
---|
142 | void InitThermostats();
|
---|
143 | void ParseThermostats(class ConfigFileBuffer * const fb);
|
---|
144 | };
|
---|
145 |
|
---|
146 | int ParseForParameter(const int verbose, ifstream * const file, const char * const name, const int sequential, const int xth, const int yth, const int type, void * value, const int repetition, const int critical);
|
---|
147 | int ParseForParameter(const int verbose, struct ConfigFileBuffer * const FileBuffer, const char * const name, const int sequential, const int xth, const int yth, const int type, void * value, const int repetition, const int critical);
|
---|
148 | void LoadMolecule(molecule * const &mol, struct ConfigFileBuffer * const &FileBuffer, const periodentafel * const periode, const bool FastParsing);
|
---|
149 | void PrepareFileBuffer(const char * const filename, struct ConfigFileBuffer *&FileBuffer);
|
---|
150 |
|
---|
151 | #endif /* CONFIG_HPP_ */
|
---|