source: molecuilder/src/config.hpp@ e651e7

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

Added config::SavePDB() and config::SaveMPQC().

  • note: for CODICE we need to know about the different connected subgraphs created by the DFSAnalysis(). Hence, we write a pdb file which contains a resid number to discern in VMD between the molecules. Also, we need neighbour construction from a simple xyz file for TREMOLO in order to measure MSDs per water molecule.
  • new function in config.cpp: config::SavePDB() gets molecule or MoleculeListClass and writes PDB file
  • new function in config.cpp: config::SaveTREMOLO() gets molecule or MoleculeListClass and writes TREMOLO data file (with neighbours, mapped to global ids, and resid and resname)
  • new function in moleculelist.cpp: MoleculeListClass::CountAllAtoms() - counts all atoms.
  • BUGFIX: In MoleculeListClass::DissectMoleculeIntoConnectedSubgraphs() we did not shift the chained bond list from mol into the connected subgraphs. Thus, they were free'd on delete(mol) and no bonds were present afterwards. This is fixed, now we unlink() in mol and re-link() in the respective subgraph
  • Property mode set to 100644
File size: 4.4 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 MoleculeListClass;
28class periodentafel;
29
30/********************************************** declarations *******************************/
31
32class 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 */
50class 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 Edit();
149 bool GetIsAngstroem() const;
150 char *GetDefaultPath() const;
151 void SetDefaultPath(const char * const path);
152 void InitThermostats();
153 void ParseThermostats(class ConfigFileBuffer * const fb);
154};
155
156int 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);
157int 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);
158void LoadMolecule(molecule * const &mol, struct ConfigFileBuffer * const &FileBuffer, const periodentafel * const periode, const bool FastParsing);
159void PrepareFileBuffer(const char * const filename, struct ConfigFileBuffer *&FileBuffer);
160
161#endif /* CONFIG_HPP_ */
Note: See TracBrowser for help on using the repository browser.