source: src/config.hpp@ 1513a74

Action_Thermostats Add_AtomRandomPerturbation Add_FitFragmentPartialChargesAction Add_RotateAroundBondAction Add_SelectAtomByNameAction Added_ParseSaveFragmentResults AddingActions_SaveParseParticleParameters Adding_Graph_to_ChangeBondActions Adding_MD_integration_tests Adding_ParticleName_to_Atom Adding_StructOpt_integration_tests AtomFragments Automaking_mpqc_open AutomationFragmentation_failures Candidate_v1.5.4 Candidate_v1.6.0 Candidate_v1.6.1 ChangeBugEmailaddress ChangingTestPorts ChemicalSpaceEvaluator CombiningParticlePotentialParsing Combining_Subpackages Debian_Package_split Debian_package_split_molecuildergui_only Disabling_MemDebug Docu_Python_wait EmpiricalPotential_contain_HomologyGraph EmpiricalPotential_contain_HomologyGraph_documentation Enable_parallel_make_install Enhance_userguide Enhanced_StructuralOptimization Enhanced_StructuralOptimization_continued Example_ManyWaysToTranslateAtom Exclude_Hydrogens_annealWithBondGraph FitPartialCharges_GlobalError Fix_BoundInBox_CenterInBox_MoleculeActions Fix_ChargeSampling_PBC Fix_ChronosMutex Fix_FitPartialCharges Fix_FitPotential_needs_atomicnumbers Fix_ForceAnnealing Fix_IndependentFragmentGrids Fix_ParseParticles Fix_ParseParticles_split_forward_backward_Actions Fix_PopActions Fix_QtFragmentList_sorted_selection Fix_Restrictedkeyset_FragmentMolecule Fix_StatusMsg Fix_StepWorldTime_single_argument Fix_Verbose_Codepatterns Fix_fitting_potentials Fixes ForceAnnealing_goodresults ForceAnnealing_oldresults ForceAnnealing_tocheck ForceAnnealing_with_BondGraph ForceAnnealing_with_BondGraph_continued ForceAnnealing_with_BondGraph_continued_betteresults ForceAnnealing_with_BondGraph_contraction-expansion FragmentAction_writes_AtomFragments FragmentMolecule_checks_bonddegrees GeometryObjects Gui_Fixes Gui_displays_atomic_force_velocity ImplicitCharges IndependentFragmentGrids IndependentFragmentGrids_IndividualZeroInstances IndependentFragmentGrids_IntegrationTest IndependentFragmentGrids_Sole_NN_Calculation JobMarket_RobustOnKillsSegFaults JobMarket_StableWorkerPool JobMarket_unresolvable_hostname_fix MoreRobust_FragmentAutomation ODR_violation_mpqc_open PartialCharges_OrthogonalSummation PdbParser_setsAtomName PythonUI_with_named_parameters QtGui_reactivate_TimeChanged_changes Recreated_GuiChecks Rewrite_FitPartialCharges RotateToPrincipalAxisSystem_UndoRedo SaturateAtoms_findBestMatching SaturateAtoms_singleDegree StoppableMakroAction Subpackage_CodePatterns Subpackage_JobMarket Subpackage_LinearAlgebra Subpackage_levmar Subpackage_mpqc_open Subpackage_vmg Switchable_LogView ThirdParty_MPQC_rebuilt_buildsystem TrajectoryDependenant_MaxOrder TremoloParser_IncreasedPrecision TremoloParser_MultipleTimesteps TremoloParser_setsAtomName Ubuntu_1604_changes stable
Last change on this file since 1513a74 was 235bed, checked in by Tillmann Crueger <crueger@…>, 15 years ago

Moved saveConfig method from oldmenu to a method inside config class

  • Property mode set to 100644
File size: 4.5 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 SaveAll(char *ConfigFileName, periodentafel *periode, MoleculeListClass *molecules);
149
150 void Edit();
151 bool GetIsAngstroem() const;
152 char *GetDefaultPath() const;
153 void SetDefaultPath(const char * const path);
154 void InitThermostats();
155 void ParseThermostats(class ConfigFileBuffer * const fb);
156};
157
158int 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);
159int 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);
160void LoadMolecule(molecule * const &mol, struct ConfigFileBuffer * const &FileBuffer, const periodentafel * const periode, const bool FastParsing);
161void PrepareFileBuffer(const char * const filename, struct ConfigFileBuffer *&FileBuffer);
162
163#endif /* CONFIG_HPP_ */
Note: See TracBrowser for help on using the repository browser.