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 | #include "bondgraph.hpp"
|
---|
23 |
|
---|
24 | /****************************************** forward declarations *****************************/
|
---|
25 |
|
---|
26 | class molecule;
|
---|
27 | class MoleculeListClass;
|
---|
28 | class periodentafel;
|
---|
29 |
|
---|
30 | /********************************************** declarations *******************************/
|
---|
31 |
|
---|
32 | class ConfigFileBuffer {
|
---|
33 | public:
|
---|
34 | char **buffer;
|
---|
35 | int *LineMapping;
|
---|
36 | int CurrentLine;
|
---|
37 | int NoLines;
|
---|
38 |
|
---|
39 | ConfigFileBuffer();
|
---|
40 | ConfigFileBuffer(const char * const filename);
|
---|
41 | ~ConfigFileBuffer();
|
---|
42 |
|
---|
43 | void InitMapping();
|
---|
44 | void MapIonTypesInBuffer(const int NoAtoms);
|
---|
45 | };
|
---|
46 |
|
---|
47 | /** The config file.
|
---|
48 | * The class contains all parameters that control a dft run also functions to load and save.
|
---|
49 | */
|
---|
50 | class config {
|
---|
51 | public:
|
---|
52 | class BondGraph *BG;
|
---|
53 |
|
---|
54 | int PsiType;
|
---|
55 | int MaxPsiDouble;
|
---|
56 | int PsiMaxNoUp;
|
---|
57 | int PsiMaxNoDown;
|
---|
58 | int MaxMinStopStep;
|
---|
59 | int InitMaxMinStopStep;
|
---|
60 | int ProcPEGamma;
|
---|
61 | int ProcPEPsi;
|
---|
62 | char *configpath;
|
---|
63 | char *configname;
|
---|
64 | bool FastParsing;
|
---|
65 | double Deltat;
|
---|
66 | string basis;
|
---|
67 |
|
---|
68 | char *databasepath;
|
---|
69 |
|
---|
70 | int DoConstrainedMD;
|
---|
71 | int MaxOuterStep;
|
---|
72 | int Thermostat;
|
---|
73 | int *ThermostatImplemented;
|
---|
74 | char **ThermostatNames;
|
---|
75 | double TempFrequency;
|
---|
76 | double alpha;
|
---|
77 | double HooverMass;
|
---|
78 | double TargetTemp;
|
---|
79 | int ScaleTempStep;
|
---|
80 |
|
---|
81 | private:
|
---|
82 | char *mainname;
|
---|
83 | char *defaultpath;
|
---|
84 | char *pseudopotpath;
|
---|
85 |
|
---|
86 | int DoOutVis;
|
---|
87 | int DoOutMes;
|
---|
88 | int DoOutNICS;
|
---|
89 | int DoOutOrbitals;
|
---|
90 | int DoOutCurrent;
|
---|
91 | int DoFullCurrent;
|
---|
92 | int DoPerturbation;
|
---|
93 | int DoWannier;
|
---|
94 | int CommonWannier;
|
---|
95 | double SawtoothStart;
|
---|
96 | int VectorPlane;
|
---|
97 | double VectorCut;
|
---|
98 | int UseAddGramSch;
|
---|
99 | int Seed;
|
---|
100 |
|
---|
101 | int OutVisStep;
|
---|
102 | int OutSrcStep;
|
---|
103 | int MaxPsiStep;
|
---|
104 | double EpsWannier;
|
---|
105 |
|
---|
106 | int MaxMinStep;
|
---|
107 | double RelEpsTotalEnergy;
|
---|
108 | double RelEpsKineticEnergy;
|
---|
109 | int MaxMinGapStopStep;
|
---|
110 | int MaxInitMinStep;
|
---|
111 | double InitRelEpsTotalEnergy;
|
---|
112 | double InitRelEpsKineticEnergy;
|
---|
113 | int InitMaxMinGapStopStep;
|
---|
114 |
|
---|
115 | //double BoxLength[NDIM*NDIM];
|
---|
116 |
|
---|
117 | double ECut;
|
---|
118 | int MaxLevel;
|
---|
119 | int RiemannTensor;
|
---|
120 | int LevRFactor;
|
---|
121 | int RiemannLevel;
|
---|
122 | int Lev0Factor;
|
---|
123 | int RTActualUse;
|
---|
124 | int AddPsis;
|
---|
125 |
|
---|
126 | double RCut;
|
---|
127 | int StructOpt;
|
---|
128 | int IsAngstroem;
|
---|
129 | int RelativeCoord;
|
---|
130 | int MaxTypes;
|
---|
131 |
|
---|
132 |
|
---|
133 | public:
|
---|
134 | config();
|
---|
135 | ~config();
|
---|
136 |
|
---|
137 | int TestSyntax(const char * const filename, const periodentafel * const periode) const;
|
---|
138 | void Load(const char * const filename, const string &BondGraphFileName, const periodentafel * const periode, MoleculeListClass * const &MolList);
|
---|
139 | void LoadOld(const char * const filename, const string &BondGraphFileName, const periodentafel * const periode, MoleculeListClass * const &MolList);
|
---|
140 | void RetrieveConfigPathAndName(const string filename);
|
---|
141 | bool Save(const char * const filename, const periodentafel * const periode, molecule * const mol) const;
|
---|
142 | bool SaveMPQC(const char * const filename, const molecule * const mol) const;
|
---|
143 | bool SavePDB(const char * const filename, const MoleculeListClass * const MolList) const;
|
---|
144 | bool SavePDB(const char * const filename, const molecule * const mol) const;
|
---|
145 | bool SaveTREMOLO(const char * const filename, const molecule * const mol) const;
|
---|
146 | bool SaveTREMOLO(const char * const filename, const MoleculeListClass * const MolList) const;
|
---|
147 |
|
---|
148 | void SaveAll(char *ConfigFileName, periodentafel *periode, MoleculeListClass *molecules);
|
---|
149 |
|
---|
150 | void Edit();
|
---|
151 | bool GetIsAngstroem() const;
|
---|
152 | char *GetDefaultPath() const;
|
---|
153 | void SetDefaultPath(const char * const path);
|
---|
154 | void InitThermostats();
|
---|
155 | void ParseThermostats(class ConfigFileBuffer * const fb);
|
---|
156 | };
|
---|
157 |
|
---|
158 | 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);
|
---|
159 | 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);
|
---|
160 | void LoadMolecule(molecule * const &mol, struct ConfigFileBuffer * const &FileBuffer, const periodentafel * const periode, const bool FastParsing);
|
---|
161 | void PrepareFileBuffer(const char * const filename, struct ConfigFileBuffer *&FileBuffer);
|
---|
162 |
|
---|
163 | #endif /* CONFIG_HPP_ */
|
---|