source: src/config.hpp@ fb73b8

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 fb73b8 was fb73b8, checked in by Frederik Heber <heber@…>, 16 years ago

class config, ConfigFileBuffer, periodentafel and Vector are refactored with respect to ticket #38, #4 and #39.

  • <type> * const ptr ... means the pointer itself is const (not its contents that he points at).
  • const <type> * ptr ... means the pointer's content is const.
  • "ofstream *out" ... can be changed to "ofstream * const out" (pointer is constant, not output).

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