source: molecuilder/src/config.hpp@ b84ab4

Last change on this file since b84ab4 was b84ab4, checked in by Frederik Heber <heber@…>, 16 years ago

BondGraph is parsed if command line switch '-g' is given.

  • builder.cpp: case 'g' which gives a bond length table file which is parsed after the configuration and before other command line options.
  • BondGraph::BondLengthMatrixMinMaxDistance() falls back to CovalentMinMaxDistance() if no table parsed.
  • Bond Length Table was changed to have first row _and_ column each enlist all the elements and does not have a "#" in front anymore.
  • The unit test has been changed accordingly.

Signed-off-by: Frederik Heber <heber@…>

  • Property mode set to 100644
File size: 4.0 KB
Line 
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
11using 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
26class molecule;
27class periodentafel;
28
29/********************************************** declarations *******************************/
30
31class ConfigFileBuffer {
32 public:
33 char **buffer;
34 int *LineMapping;
35 int CurrentLine;
36 int NoLines;
37
38 ConfigFileBuffer();
39 ConfigFileBuffer(const char * const filename);
40 ~ConfigFileBuffer();
41
42 void InitMapping();
43 void MapIonTypesInBuffer(const int NoAtoms);
44};
45
46/** The config file.
47 * The class contains all parameters that control a dft run also functions to load and save.
48 */
49class config {
50 public:
51 class BondGraph *BG;
52
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
136 int TestSyntax(const char * const filename, const periodentafel * const periode, const molecule * const mol) const;
137 void Load(const char * const filename, const periodentafel * const periode, molecule * const &mol);
138 void LoadOld(const char * const filename, const periodentafel * const periode, molecule * const &mol);
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;
142 void Edit();
143 bool GetIsAngstroem() const;
144 char *GetDefaultPath() const;
145 void SetDefaultPath(const char * const path);
146 void InitThermostats();
147 void ParseThermostats(class ConfigFileBuffer * const fb);
148};
149
150int 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);
151int 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);
152void LoadMolecule(molecule * const &mol, struct ConfigFileBuffer * const &FileBuffer, const periodentafel * const periode, const bool FastParsing);
153void PrepareFileBuffer(const char * const filename, struct ConfigFileBuffer *&FileBuffer);
154
155#endif /* CONFIG_HPP_ */
Note: See TracBrowser for help on using the repository browser.