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