[a80fbdf] | 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 |
|
---|
[f66195] | 13 | /*********************************************** includes ***********************************/
|
---|
| 14 |
|
---|
[cd4ccc] | 15 | // include config.h
|
---|
| 16 | #ifdef HAVE_CONFIG_H
|
---|
| 17 | #include <config.h>
|
---|
| 18 | #endif
|
---|
| 19 |
|
---|
[f66195] | 20 | #include <string>
|
---|
| 21 |
|
---|
| 22 | /****************************************** forward declarations *****************************/
|
---|
| 23 |
|
---|
[a3fded] | 24 | class ConfigFileBuffer;
|
---|
[f66195] | 25 | class molecule;
|
---|
[568be7] | 26 | class MoleculeListClass;
|
---|
[f66195] | 27 | class periodentafel;
|
---|
| 28 |
|
---|
| 29 | /********************************************** declarations *******************************/
|
---|
[a80fbdf] | 30 |
|
---|
| 31 | /** The config file.
|
---|
| 32 | * The class contains all parameters that control a dft run also functions to load and save.
|
---|
| 33 | */
|
---|
| 34 | class config {
|
---|
| 35 | public:
|
---|
[b21a64] | 36 |
|
---|
[a80fbdf] | 37 | int PsiType;
|
---|
| 38 | int MaxPsiDouble;
|
---|
| 39 | int PsiMaxNoUp;
|
---|
| 40 | int PsiMaxNoDown;
|
---|
| 41 | int MaxMinStopStep;
|
---|
| 42 | int InitMaxMinStopStep;
|
---|
| 43 | int ProcPEGamma;
|
---|
| 44 | int ProcPEPsi;
|
---|
| 45 | char *configname;
|
---|
| 46 | bool FastParsing;
|
---|
| 47 | double Deltat;
|
---|
| 48 |
|
---|
| 49 | char *databasepath;
|
---|
| 50 |
|
---|
| 51 | int DoConstrainedMD;
|
---|
| 52 | int MaxOuterStep;
|
---|
| 53 |
|
---|
| 54 | private:
|
---|
| 55 | char *mainname;
|
---|
| 56 | char *defaultpath;
|
---|
| 57 | char *pseudopotpath;
|
---|
| 58 |
|
---|
| 59 | int DoOutVis;
|
---|
| 60 | int DoOutMes;
|
---|
| 61 | int DoOutNICS;
|
---|
| 62 | int DoOutOrbitals;
|
---|
| 63 | int DoOutCurrent;
|
---|
| 64 | int DoFullCurrent;
|
---|
| 65 | int DoPerturbation;
|
---|
| 66 | int DoWannier;
|
---|
| 67 | int CommonWannier;
|
---|
| 68 | double SawtoothStart;
|
---|
| 69 | int VectorPlane;
|
---|
| 70 | double VectorCut;
|
---|
| 71 | int UseAddGramSch;
|
---|
| 72 | int Seed;
|
---|
| 73 |
|
---|
| 74 | int OutVisStep;
|
---|
| 75 | int OutSrcStep;
|
---|
| 76 | int MaxPsiStep;
|
---|
| 77 | double EpsWannier;
|
---|
| 78 |
|
---|
| 79 | int MaxMinStep;
|
---|
| 80 | double RelEpsTotalEnergy;
|
---|
| 81 | double RelEpsKineticEnergy;
|
---|
| 82 | int MaxMinGapStopStep;
|
---|
| 83 | int MaxInitMinStep;
|
---|
| 84 | double InitRelEpsTotalEnergy;
|
---|
| 85 | double InitRelEpsKineticEnergy;
|
---|
| 86 | int InitMaxMinGapStopStep;
|
---|
| 87 |
|
---|
| 88 | //double BoxLength[NDIM*NDIM];
|
---|
| 89 |
|
---|
| 90 | double ECut;
|
---|
| 91 | int MaxLevel;
|
---|
| 92 | int RiemannTensor;
|
---|
| 93 | int LevRFactor;
|
---|
| 94 | int RiemannLevel;
|
---|
| 95 | int Lev0Factor;
|
---|
| 96 | int RTActualUse;
|
---|
| 97 | int AddPsis;
|
---|
| 98 |
|
---|
| 99 | double RCut;
|
---|
| 100 | int StructOpt;
|
---|
| 101 | int IsAngstroem;
|
---|
| 102 | int RelativeCoord;
|
---|
| 103 | int MaxTypes;
|
---|
| 104 |
|
---|
| 105 |
|
---|
| 106 | public:
|
---|
| 107 | config();
|
---|
| 108 | ~config();
|
---|
| 109 |
|
---|
[fa649a] | 110 | int TestSyntax(const char * const filename, const periodentafel * const periode) const;
|
---|
[fb73b8] | 111 | bool Save(const char * const filename, const periodentafel * const periode, molecule * const mol) const;
|
---|
| 112 | bool SaveMPQC(const char * const filename, const molecule * const mol) const;
|
---|
[568be7] | 113 | bool SavePDB(const char * const filename, const MoleculeListClass * const MolList) const;
|
---|
| 114 | bool SavePDB(const char * const filename, const molecule * const mol) const;
|
---|
| 115 | bool SaveTREMOLO(const char * const filename, const molecule * const mol) const;
|
---|
| 116 | bool SaveTREMOLO(const char * const filename, const MoleculeListClass * const MolList) const;
|
---|
| 117 |
|
---|
[235bed] | 118 | void SaveAll(char *ConfigFileName, periodentafel *periode, MoleculeListClass *molecules);
|
---|
| 119 |
|
---|
[a80fbdf] | 120 | void Edit();
|
---|
| 121 | bool GetIsAngstroem() const;
|
---|
| 122 | char *GetDefaultPath() const;
|
---|
[fb73b8] | 123 | void SetDefaultPath(const char * const path);
|
---|
[43dad6] | 124 | void ParseThermostats(class ConfigFileBuffer * const fb);
|
---|
[a80fbdf] | 125 | };
|
---|
| 126 |
|
---|
[fb73b8] | 127 | 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);
|
---|
| 128 | 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);
|
---|
| 129 | void LoadMolecule(molecule * const &mol, struct ConfigFileBuffer * const &FileBuffer, const periodentafel * const periode, const bool FastParsing);
|
---|
| 130 | void PrepareFileBuffer(const char * const filename, struct ConfigFileBuffer *&FileBuffer);
|
---|
[3a9fe9] | 131 |
|
---|
[a80fbdf] | 132 | #endif /* CONFIG_HPP_ */
|
---|