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