source: src/Parser/PcpParser.cpp@ 9df5c6

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 9df5c6 was 35b698, checked in by Frederik Heber <heber@…>, 15 years ago

BIG CHANGE: config::load and config::save in ParseCommandLineOptions() and main() replaced with FormatParser replacements.

Fragmentation:

  • FIX: MoleculeFillWithMoleculeAction: filler atoms have to be removed before the system can be stored to file.
  • FIX: PcpParser::load() - has to put the molecule also into World's MoleculeListClass (otherwise the name cannot be set right after loading)
  • new Libparser.a
  • all sources from PARSER subdir are compiled into libparser such that only ParserUnitTest is recompiled.

Testfixes:

  • testsuite-fragmentation - changes to due to different -f calling syntax.
  • most of the xyz files had to be replaced due to a single whitespace at the end of each entry: Domain/6, Simple_configuration/2, Simple_configuration/3, Simple_configuration/4, Simple_configuration/5, Simple_configuration/8
  • in many cases were the number orbitals (and thus MaxMinStopStep) wrong: Filling/1, Simple_configuration/4, Simple_configuration/5

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

  • Property mode set to 100644
File size: 37.6 KB
Line 
1/*
2 * PcpParser.cpp
3 *
4 * Created on: 12.06.2010
5 * Author: heber
6 */
7
8#include <iostream>
9
10#include "atom.hpp"
11#include "config.hpp"
12#include "ConfigFileBuffer.hpp"
13#include "element.hpp"
14#include "Helpers/Assert.hpp"
15#include "log.hpp"
16#include "molecule.hpp"
17#include "PcpParser.hpp"
18#include "periodentafel.hpp"
19#include "ThermoStatContainer.hpp"
20#include "verbose.hpp"
21#include "World.hpp"
22
23/** Constructor of PcpParser.
24 *
25 */
26PcpParser::PcpParser()
27{
28 Parallelization.ProcPEGamma = 8;
29 Parallelization.ProcPEPsi = 1;
30
31 Paths.databasepath = NULL;
32 Paths.configname = NULL;
33 Paths.mainname = NULL;
34 Paths.defaultpath = NULL;
35 Paths.pseudopotpath = NULL;
36
37 Switches.DoConstrainedMD = 0;
38 Switches.DoOutVis = 0;
39 Switches.DoOutMes = 1;
40 Switches.DoOutNICS = 0;
41 Switches.DoOutOrbitals = 0;
42 Switches.DoOutCurrent = 0;
43 Switches.DoFullCurrent = 0;
44 Switches.DoPerturbation = 0;
45 Switches.DoWannier = 0;
46
47 LocalizedOrbitals.CommonWannier = 0;
48 LocalizedOrbitals.SawtoothStart = 0.01;
49 LocalizedOrbitals.VectorPlane = 0;
50 LocalizedOrbitals.VectorCut = 0;
51 LocalizedOrbitals.UseAddGramSch = 1;
52 LocalizedOrbitals.Seed = 1;
53 LocalizedOrbitals.EpsWannier = 1e-7;
54
55 StepCounts.MaxMinStopStep = 1;
56 StepCounts.InitMaxMinStopStep = 1;
57 StepCounts.OutVisStep = 10;
58 StepCounts.OutSrcStep = 5;
59 StepCounts.MaxPsiStep = 0;
60 StepCounts.MaxOuterStep = 0;
61 StepCounts.MaxMinStep = 100;
62 StepCounts.RelEpsTotalEnergy = 1e-07;
63 StepCounts.RelEpsKineticEnergy = 1e-05;
64 StepCounts.MaxMinGapStopStep = 0;
65 StepCounts.MaxInitMinStep = 100;
66 StepCounts.InitRelEpsTotalEnergy = 1e-05;
67 StepCounts.InitRelEpsKineticEnergy = 0.0001;
68 StepCounts.InitMaxMinGapStopStep = 0;
69
70 PlaneWaveSpecifics.PsiType = 0;
71 PlaneWaveSpecifics.MaxPsiDouble = 0;
72 PlaneWaveSpecifics.PsiMaxNoUp = 0;
73 PlaneWaveSpecifics.PsiMaxNoDown = 0;
74 PlaneWaveSpecifics.ECut = 128;
75 PlaneWaveSpecifics.MaxLevel = 5;
76 PlaneWaveSpecifics.RiemannTensor = 0;
77 PlaneWaveSpecifics.LevRFactor = 0;
78 PlaneWaveSpecifics.RiemannLevel = 0;
79 PlaneWaveSpecifics.Lev0Factor = 2;
80 PlaneWaveSpecifics.RTActualUse = 0;
81 PlaneWaveSpecifics.AddPsis = 0;
82 PlaneWaveSpecifics.RCut = 20;
83 PlaneWaveSpecifics.PsiType = 0;
84
85 FastParsing = false;
86
87 Deltat = 0.01;
88 IsAngstroem = 1;
89 RelativeCoord = 0;
90 MaxTypes = 0;
91}
92
93/** Destructor of PcpParser.
94 *
95 */
96PcpParser::~PcpParser()
97{}
98
99void PcpParser::load(std::istream* file)
100{
101 if (file->fail()) {
102 DoeLog(1) && (eLog()<< Verbose(1) << "could not access given file" << endl);
103 return;
104 }
105
106 // ParseParameterFile
107 class ConfigFileBuffer *FileBuffer = new ConfigFileBuffer();
108 FileBuffer->InitFileBuffer(file);
109
110 /* Oeffne Hauptparameterdatei */
111 int di = 0;
112 double BoxLength[9];
113 string zeile;
114 string dummy;
115 int verbose = 0;
116
117 ParseThermostats(FileBuffer);
118
119 /* Namen einlesen */
120
121 // 1. parse in options
122 ParseForParameter(verbose,FileBuffer, "mainname", 0, 1, 1, string_type, (Paths.mainname), 1, critical);
123 ParseForParameter(verbose,FileBuffer, "defaultpath", 0, 1, 1, string_type, (Paths.defaultpath), 1, critical);
124 ParseForParameter(verbose,FileBuffer, "pseudopotpath", 0, 1, 1, string_type, (Paths.pseudopotpath), 1, critical);
125 ParseForParameter(verbose,FileBuffer,"ProcPEGamma", 0, 1, 1, int_type, &(Parallelization.ProcPEGamma), 1, critical);
126 ParseForParameter(verbose,FileBuffer,"ProcPEPsi", 0, 1, 1, int_type, &(Parallelization.ProcPEPsi), 1, critical);
127
128 if (!ParseForParameter(verbose,FileBuffer,"Seed", 0, 1, 1, int_type, &(LocalizedOrbitals.Seed), 1, optional))
129 LocalizedOrbitals.Seed = 1;
130
131 if(!ParseForParameter(verbose,FileBuffer,"DoOutOrbitals", 0, 1, 1, int_type, &(Switches.DoOutOrbitals), 1, optional)) {
132 Switches.DoOutOrbitals = 0;
133 } else {
134 if (Switches.DoOutOrbitals < 0) Switches.DoOutOrbitals = 0;
135 if (Switches.DoOutOrbitals > 1) Switches.DoOutOrbitals = 1;
136 }
137 ParseForParameter(verbose,FileBuffer,"DoOutVis", 0, 1, 1, int_type, &(Switches.DoOutVis), 1, critical);
138 if (Switches.DoOutVis < 0) Switches.DoOutVis = 0;
139 if (Switches.DoOutVis > 1) Switches.DoOutVis = 1;
140 if (!ParseForParameter(verbose,FileBuffer,"VectorPlane", 0, 1, 1, int_type, &(LocalizedOrbitals.VectorPlane), 1, optional))
141 LocalizedOrbitals.VectorPlane = -1;
142 if (!ParseForParameter(verbose,FileBuffer,"VectorCut", 0, 1, 1, double_type, &(LocalizedOrbitals.VectorCut), 1, optional))
143 LocalizedOrbitals.VectorCut = 0.;
144 ParseForParameter(verbose,FileBuffer,"DoOutMes", 0, 1, 1, int_type, &(Switches.DoOutMes), 1, critical);
145 if (Switches.DoOutMes < 0) Switches.DoOutMes = 0;
146 if (Switches.DoOutMes > 1) Switches.DoOutMes = 1;
147 if (!ParseForParameter(verbose,FileBuffer,"DoOutCurr", 0, 1, 1, int_type, &(Switches.DoOutCurrent), 1, optional))
148 Switches.DoOutCurrent = 0;
149 if (Switches.DoOutCurrent < 0) Switches.DoOutCurrent = 0;
150 if (Switches.DoOutCurrent > 1) Switches.DoOutCurrent = 1;
151 ParseForParameter(verbose,FileBuffer,"AddGramSch", 0, 1, 1, int_type, &(LocalizedOrbitals.UseAddGramSch), 1, critical);
152 if (LocalizedOrbitals.UseAddGramSch < 0) LocalizedOrbitals.UseAddGramSch = 0;
153 if (LocalizedOrbitals.UseAddGramSch > 2) LocalizedOrbitals.UseAddGramSch = 2;
154 if(!ParseForParameter(verbose,FileBuffer,"DoWannier", 0, 1, 1, int_type, &(Switches.DoWannier), 1, optional)) {
155 Switches.DoWannier = 0;
156 } else {
157 if (Switches.DoWannier < 0) Switches.DoWannier = 0;
158 if (Switches.DoWannier > 1) Switches.DoWannier = 1;
159 }
160 if(!ParseForParameter(verbose,FileBuffer,"CommonWannier", 0, 1, 1, int_type, &(LocalizedOrbitals.CommonWannier), 1, optional)) {
161 LocalizedOrbitals.CommonWannier = 0;
162 } else {
163 if (LocalizedOrbitals.CommonWannier < 0) LocalizedOrbitals.CommonWannier = 0;
164 if (LocalizedOrbitals.CommonWannier > 4) LocalizedOrbitals.CommonWannier = 4;
165 }
166 if(!ParseForParameter(verbose,FileBuffer,"SawtoothStart", 0, 1, 1, double_type, &(LocalizedOrbitals.SawtoothStart), 1, optional)) {
167 LocalizedOrbitals.SawtoothStart = 0.01;
168 } else {
169 if (LocalizedOrbitals.SawtoothStart < 0.) LocalizedOrbitals.SawtoothStart = 0.;
170 if (LocalizedOrbitals.SawtoothStart > 1.) LocalizedOrbitals.SawtoothStart = 1.;
171 }
172
173 if (ParseForParameter(verbose,FileBuffer,"DoConstrainedMD", 0, 1, 1, int_type, &(Switches.DoConstrainedMD), 1, optional))
174 if (Switches.DoConstrainedMD < 0)
175 Switches.DoConstrainedMD = 0;
176 ParseForParameter(verbose,FileBuffer,"MaxOuterStep", 0, 1, 1, int_type, &(StepCounts.MaxOuterStep), 1, critical);
177 if (!ParseForParameter(verbose,FileBuffer,"Deltat", 0, 1, 1, double_type, &(Deltat), 1, optional))
178 Deltat = 1;
179 ParseForParameter(verbose,FileBuffer,"OutVisStep", 0, 1, 1, int_type, &(StepCounts.OutVisStep), 1, optional);
180 ParseForParameter(verbose,FileBuffer,"OutSrcStep", 0, 1, 1, int_type, &(StepCounts.OutSrcStep), 1, optional);
181 ParseForParameter(verbose,FileBuffer,"TargetTemp", 0, 1, 1, double_type, &(World::getInstance().getThermostats()->TargetTemp), 1, optional);
182 //ParseForParameter(verbose,FileBuffer,"Thermostat", 0, 1, 1, int_type, &(ScaleTempStep), 1, optional);
183 if (!ParseForParameter(verbose,FileBuffer,"EpsWannier", 0, 1, 1, double_type, &(LocalizedOrbitals.EpsWannier), 1, optional))
184 LocalizedOrbitals.EpsWannier = 1e-8;
185
186 // stop conditions
187 //if (MaxOuterStep <= 0) MaxOuterStep = 1;
188 ParseForParameter(verbose,FileBuffer,"MaxPsiStep", 0, 1, 1, int_type, &(StepCounts.MaxPsiStep), 1, critical);
189 if (StepCounts.MaxPsiStep <= 0) StepCounts.MaxPsiStep = 3;
190
191 ParseForParameter(verbose,FileBuffer,"MaxMinStep", 0, 1, 1, int_type, &(StepCounts.MaxMinStep), 1, critical);
192 ParseForParameter(verbose,FileBuffer,"RelEpsTotalE", 0, 1, 1, double_type, &(StepCounts.RelEpsTotalEnergy), 1, critical);
193 ParseForParameter(verbose,FileBuffer,"RelEpsKineticE", 0, 1, 1, double_type, &(StepCounts.RelEpsKineticEnergy), 1, critical);
194 ParseForParameter(verbose,FileBuffer,"MaxMinStopStep", 0, 1, 1, int_type, &(StepCounts.MaxMinStopStep), 1, critical);
195 ParseForParameter(verbose,FileBuffer,"MaxMinGapStopStep", 0, 1, 1, int_type, &(StepCounts.MaxMinGapStopStep), 1, critical);
196 if (StepCounts.MaxMinStep <= 0) StepCounts.MaxMinStep = StepCounts.MaxPsiStep;
197 if (StepCounts.MaxMinStopStep < 1) StepCounts.MaxMinStopStep = 1;
198 if (StepCounts.MaxMinGapStopStep < 1) StepCounts.MaxMinGapStopStep = 1;
199
200 ParseForParameter(verbose,FileBuffer,"MaxInitMinStep", 0, 1, 1, int_type, &(StepCounts.MaxInitMinStep), 1, critical);
201 ParseForParameter(verbose,FileBuffer,"InitRelEpsTotalE", 0, 1, 1, double_type, &(StepCounts.InitRelEpsTotalEnergy), 1, critical);
202 ParseForParameter(verbose,FileBuffer,"InitRelEpsKineticE", 0, 1, 1, double_type, &(StepCounts.InitRelEpsKineticEnergy), 1, critical);
203 ParseForParameter(verbose,FileBuffer,"InitMaxMinStopStep", 0, 1, 1, int_type, &(StepCounts.InitMaxMinStopStep), 1, critical);
204 ParseForParameter(verbose,FileBuffer,"InitMaxMinGapStopStep", 0, 1, 1, int_type, &(StepCounts.InitMaxMinGapStopStep), 1, critical);
205 if (StepCounts.MaxInitMinStep <= 0) StepCounts.MaxInitMinStep = StepCounts.MaxPsiStep;
206 if (StepCounts.InitMaxMinStopStep < 1) StepCounts.InitMaxMinStopStep = 1;
207 if (StepCounts.InitMaxMinGapStopStep < 1) StepCounts.InitMaxMinGapStopStep = 1;
208
209 // Unit cell and magnetic field
210 ParseForParameter(verbose,FileBuffer, "BoxLength", 0, 3, 3, lower_trigrid, BoxLength, 1, critical); /* Lattice->RealBasis */
211 double * const cell_size = World::getInstance().getDomain();
212 cell_size[0] = BoxLength[0];
213 cell_size[1] = BoxLength[3];
214 cell_size[2] = BoxLength[4];
215 cell_size[3] = BoxLength[6];
216 cell_size[4] = BoxLength[7];
217 cell_size[5] = BoxLength[8];
218 //if (1) fprintf(stderr,"\n");
219
220 ParseForParameter(verbose,FileBuffer,"DoPerturbation", 0, 1, 1, int_type, &(Switches.DoPerturbation), 1, optional);
221 ParseForParameter(verbose,FileBuffer,"DoOutNICS", 0, 1, 1, int_type, &(Switches.DoOutNICS), 1, optional);
222 if (!ParseForParameter(verbose,FileBuffer,"DoFullCurrent", 0, 1, 1, int_type, &(Switches.DoFullCurrent), 1, optional))
223 Switches.DoFullCurrent = 0;
224 if (Switches.DoFullCurrent < 0) Switches.DoFullCurrent = 0;
225 if (Switches.DoFullCurrent > 2) Switches.DoFullCurrent = 2;
226 if (Switches.DoOutNICS < 0) Switches.DoOutNICS = 0;
227 if (Switches.DoOutNICS > 2) Switches.DoOutNICS = 2;
228 if (Switches.DoPerturbation == 0) {
229 Switches.DoFullCurrent = 0;
230 Switches.DoOutNICS = 0;
231 }
232
233 ParseForParameter(verbose,FileBuffer,"ECut", 0, 1, 1, double_type, &(PlaneWaveSpecifics.ECut), 1, critical);
234 ParseForParameter(verbose,FileBuffer,"MaxLevel", 0, 1, 1, int_type, &(PlaneWaveSpecifics.MaxLevel), 1, critical);
235 ParseForParameter(verbose,FileBuffer,"Level0Factor", 0, 1, 1, int_type, &(PlaneWaveSpecifics.Lev0Factor), 1, critical);
236 if (PlaneWaveSpecifics.Lev0Factor < 2) {
237 PlaneWaveSpecifics.Lev0Factor = 2;
238 }
239 ParseForParameter(verbose,FileBuffer,"RiemannTensor", 0, 1, 1, int_type, &di, 1, critical);
240 if (di >= 0 && di < 2) {
241 PlaneWaveSpecifics.RiemannTensor = di;
242 } else {
243 cerr << "0 <= RiemanTensor < 2: 0 UseNotRT, 1 UseRT" << endl;
244 exit(1);
245 }
246 switch (PlaneWaveSpecifics.RiemannTensor) {
247 case 0: //UseNoRT
248 if (PlaneWaveSpecifics.MaxLevel < 2) {
249 PlaneWaveSpecifics.MaxLevel = 2;
250 }
251 PlaneWaveSpecifics.LevRFactor = 2;
252 PlaneWaveSpecifics.RTActualUse = 0;
253 break;
254 case 1: // UseRT
255 if (PlaneWaveSpecifics.MaxLevel < 3) {
256 PlaneWaveSpecifics.MaxLevel = 3;
257 }
258 ParseForParameter(verbose,FileBuffer,"RiemannLevel", 0, 1, 1, int_type, &(PlaneWaveSpecifics.RiemannLevel), 1, critical);
259 if (PlaneWaveSpecifics.RiemannLevel < 2) {
260 PlaneWaveSpecifics.RiemannLevel = 2;
261 }
262 if (PlaneWaveSpecifics.RiemannLevel > PlaneWaveSpecifics.MaxLevel-1) {
263 PlaneWaveSpecifics.RiemannLevel = PlaneWaveSpecifics.MaxLevel-1;
264 }
265 ParseForParameter(verbose,FileBuffer,"LevRFactor", 0, 1, 1, int_type, &(PlaneWaveSpecifics.LevRFactor), 1, critical);
266 if (PlaneWaveSpecifics.LevRFactor < 2) {
267 PlaneWaveSpecifics.LevRFactor = 2;
268 }
269 PlaneWaveSpecifics.Lev0Factor = 2;
270 PlaneWaveSpecifics.RTActualUse = 2;
271 break;
272 }
273 ParseForParameter(verbose,FileBuffer,"PsiType", 0, 1, 1, int_type, &di, 1, critical);
274 if (di >= 0 && di < 2) {
275 PlaneWaveSpecifics.PsiType = di;
276 } else {
277 cerr << "0 <= PsiType < 2: 0 UseSpinDouble, 1 UseSpinUpDown" << endl;
278 exit(1);
279 }
280 switch (PlaneWaveSpecifics.PsiType) {
281 case 0: // SpinDouble
282 ParseForParameter(verbose,FileBuffer,"MaxPsiDouble", 0, 1, 1, int_type, &(PlaneWaveSpecifics.MaxPsiDouble), 1, critical);
283 ParseForParameter(verbose,FileBuffer,"PsiMaxNoUp", 0, 1, 1, int_type, &(PlaneWaveSpecifics.PsiMaxNoUp), 1, optional);
284 ParseForParameter(verbose,FileBuffer,"PsiMaxNoDown", 0, 1, 1, int_type, &(PlaneWaveSpecifics.PsiMaxNoDown), 1, optional);
285 ParseForParameter(verbose,FileBuffer,"AddPsis", 0, 1, 1, int_type, &(PlaneWaveSpecifics.AddPsis), 1, optional);
286 break;
287 case 1: // SpinUpDown
288 if (Parallelization.ProcPEGamma % 2) Parallelization.ProcPEGamma*=2;
289 ParseForParameter(verbose,FileBuffer,"MaxPsiDouble", 0, 1, 1, int_type, &(PlaneWaveSpecifics.MaxPsiDouble), 1, optional);
290 ParseForParameter(verbose,FileBuffer,"PsiMaxNoUp", 0, 1, 1, int_type, &(PlaneWaveSpecifics.PsiMaxNoUp), 1, critical);
291 ParseForParameter(verbose,FileBuffer,"PsiMaxNoDown", 0, 1, 1, int_type, &(PlaneWaveSpecifics.PsiMaxNoDown), 1, critical);
292 ParseForParameter(verbose,FileBuffer,"AddPsis", 0, 1, 1, int_type, &(PlaneWaveSpecifics.AddPsis), 1, optional);
293 break;
294 }
295
296 // IonsInitRead
297
298 ParseForParameter(verbose,FileBuffer,"RCut", 0, 1, 1, double_type, &(PlaneWaveSpecifics.RCut), 1, critical);
299 ParseForParameter(verbose,FileBuffer,"IsAngstroem", 0, 1, 1, int_type, &(IsAngstroem), 1, critical);
300 ParseForParameter(verbose,FileBuffer,"MaxTypes", 0, 1, 1, int_type, &(MaxTypes), 1, critical);
301 if (!ParseForParameter(verbose,FileBuffer,"RelativeCoord", 0, 1, 1, int_type, &(RelativeCoord) , 1, optional))
302 RelativeCoord = 0;
303 if (!ParseForParameter(verbose,FileBuffer,"StructOpt", 0, 1, 1, int_type, &(StructOpt), 1, optional))
304 StructOpt = 0;
305
306 // 3. parse the molecule in
307 molecule *mol = World::getInstance().createMolecule();
308 MoleculeListClass *molecules = World::getInstance().getMolecules();
309 molecules->insert(mol);
310 LoadMolecule(mol, FileBuffer, World::getInstance().getPeriode(), FastParsing);
311 //mol->SetNameFromFilename(filename);
312 mol->ActiveFlag = true;
313 //MolList->insert(mol);
314
315 // 4. dissect the molecule into connected subgraphs
316 // don't do this here ...
317 //MolList->DissectMoleculeIntoConnectedSubgraphs(mol,this);
318 //delete(mol);
319
320 delete(FileBuffer);
321}
322
323/** Saves the World into a PCP config file.
324 * \param *file output stream to save to
325 */
326void PcpParser::save(std::ostream* file)
327{
328 const double * const cell_size = World::getInstance().getDomain();
329 class ThermoStatContainer *Thermostats = World::getInstance().getThermostats();
330 if (!file->fail()) {
331 // calculate number of Psis
332 vector<atom *> allatoms = World::getInstance().getAllAtoms();
333 CalculateOrbitals(allatoms);
334 *file << "# ParallelCarParinello - main configuration file - created with molecuilder" << endl;
335 *file << endl;
336 if (Paths.mainname != NULL)
337 *file << "mainname\t" << Paths.mainname << "\t# programm name (for runtime files)" << endl;
338 else
339 *file << "mainname\tpcp\t# programm name (for runtime files)" << endl;
340 if (Paths.defaultpath != NULL)
341 *file << "defaultpath\t" << Paths.defaultpath << "\t# where to put files during runtime" << endl;
342 else
343 *file << "defaultpath\tnot specified\t# where to put files during runtime" << endl;
344 if (Paths.pseudopotpath != NULL)
345 *file << "pseudopotpath\t" << Paths.pseudopotpath << "\t# where to find pseudopotentials" << endl;
346 else
347 *file << "pseudopotpath\tnot specified\t# where to find pseudopotentials" << endl;
348 *file << endl;
349 *file << "ProcPEGamma\t" << Parallelization.ProcPEGamma << "\t# for parallel computing: share constants" << endl;
350 *file << "ProcPEPsi\t" << Parallelization.ProcPEPsi << "\t# for parallel computing: share wave functions" << endl;
351 *file << "DoOutVis\t" << Switches.DoOutVis << "\t# Output data for OpenDX" << endl;
352 *file << "DoOutMes\t" << Switches.DoOutMes << "\t# Output data for measurements" << endl;
353 *file << "DoOutOrbitals\t" << Switches.DoOutOrbitals << "\t# Output all Orbitals" << endl;
354 *file << "DoOutCurr\t" << Switches.DoOutCurrent << "\t# Ouput current density for OpenDx" << endl;
355 *file << "DoOutNICS\t" << Switches.DoOutNICS << "\t# Output Nucleus independent current shieldings" << endl;
356 *file << "DoPerturbation\t" << Switches.DoPerturbation << "\t# Do perturbation calculate and determine susceptibility and shielding" << endl;
357 *file << "DoFullCurrent\t" << Switches.DoFullCurrent << "\t# Do full perturbation" << endl;
358 *file << "DoConstrainedMD\t" << Switches.DoConstrainedMD << "\t# Do perform a constrained (>0, relating to current MD step) instead of unconstrained (0) MD" << endl;
359 ASSERT(Thermostats != NULL, "PcpParser::save() - Thermostats not initialized!");
360 ASSERT(Thermostats->ThermostatNames != NULL, "PcpParser::save() - Thermostats not initialized!");
361 *file << "Thermostat\t" << Thermostats->ThermostatNames[Thermostats->Thermostat] << "\t";
362 switch(Thermostats->Thermostat) {
363 default:
364 case None:
365 break;
366 case Woodcock:
367 *file << Thermostats->ScaleTempStep;
368 break;
369 case Gaussian:
370 *file << Thermostats->ScaleTempStep;
371 break;
372 case Langevin:
373 *file << Thermostats->TempFrequency << "\t" << Thermostats->alpha;
374 break;
375 case Berendsen:
376 *file << Thermostats->TempFrequency;
377 break;
378 case NoseHoover:
379 *file << Thermostats->HooverMass;
380 break;
381 };
382 *file << "\t# Which Thermostat and its parameters to use in MD case." << endl;
383 *file << "CommonWannier\t" << LocalizedOrbitals.CommonWannier << "\t# Put virtual centers at indivual orbits, all common, merged by variance, to grid point, to cell center" << endl;
384 *file << "SawtoothStart\t" << LocalizedOrbitals.SawtoothStart << "\t# Absolute value for smooth transition at cell border " << endl;
385 *file << "VectorPlane\t" << LocalizedOrbitals.VectorPlane << "\t# Cut plane axis (x, y or z: 0,1,2) for two-dim current vector plot" << endl;
386 *file << "VectorCut\t" << LocalizedOrbitals.VectorCut << "\t# Cut plane axis value" << endl;
387 *file << "AddGramSch\t" << LocalizedOrbitals.UseAddGramSch << "\t# Additional GramSchmidtOrtogonalization to be safe" << endl;
388 *file << "Seed\t\t" << LocalizedOrbitals.Seed << "\t# initial value for random seed for Psi coefficients" << endl;
389 *file << endl;
390 *file << "MaxOuterStep\t" << StepCounts.MaxOuterStep << "\t# number of MolecularDynamics/Structure optimization steps" << endl;
391 *file << "Deltat\t" << Deltat << "\t# time per MD step" << endl;
392 *file << "OutVisStep\t" << StepCounts.OutVisStep << "\t# Output visual data every ...th step" << endl;
393 *file << "OutSrcStep\t" << StepCounts.OutSrcStep << "\t# Output \"restart\" data every ..th step" << endl;
394 *file << "TargetTemp\t" << Thermostats->TargetTemp << "\t# Target temperature" << endl;
395 *file << "MaxPsiStep\t" << StepCounts.MaxPsiStep << "\t# number of Minimisation steps per state (0 - default)" << endl;
396 *file << "EpsWannier\t" << LocalizedOrbitals.EpsWannier << "\t# tolerance value for spread minimisation of orbitals" << endl;
397 *file << endl;
398 *file << "# Values specifying when to stop" << endl;
399 *file << "MaxMinStep\t" << StepCounts.MaxMinStep << "\t# Maximum number of steps" << endl;
400 *file << "RelEpsTotalE\t" << StepCounts.RelEpsTotalEnergy << "\t# relative change in total energy" << endl;
401 *file << "RelEpsKineticE\t" << StepCounts.RelEpsKineticEnergy << "\t# relative change in kinetic energy" << endl;
402 *file << "MaxMinStopStep\t" << StepCounts.MaxMinStopStep << "\t# check every ..th steps" << endl;
403 *file << "MaxMinGapStopStep\t" << StepCounts.MaxMinGapStopStep << "\t# check every ..th steps" << endl;
404 *file << endl;
405 *file << "# Values specifying when to stop for INIT, otherwise same as above" << endl;
406 *file << "MaxInitMinStep\t" << StepCounts.MaxInitMinStep << "\t# Maximum number of steps" << endl;
407 *file << "InitRelEpsTotalE\t" << StepCounts.InitRelEpsTotalEnergy << "\t# relative change in total energy" << endl;
408 *file << "InitRelEpsKineticE\t" << StepCounts.InitRelEpsKineticEnergy << "\t# relative change in kinetic energy" << endl;
409 *file << "InitMaxMinStopStep\t" << StepCounts.InitMaxMinStopStep << "\t# check every ..th steps" << endl;
410 *file << "InitMaxMinGapStopStep\t" << StepCounts.InitMaxMinGapStopStep << "\t# check every ..th steps" << endl;
411 *file << endl;
412 *file << "BoxLength\t\t\t# (Length of a unit cell)" << endl;
413 *file << cell_size[0] << "\t" << endl;
414 *file << cell_size[1] << "\t" << cell_size[2] << "\t" << endl;
415 *file << cell_size[3] << "\t" << cell_size[4] << "\t" << cell_size[5] << "\t" << endl;
416 // FIXME
417 *file << endl;
418 *file << "ECut\t\t" << PlaneWaveSpecifics.ECut << "\t# energy cutoff for discretization in Hartrees" << endl;
419 *file << "MaxLevel\t" << PlaneWaveSpecifics.MaxLevel << "\t# number of different levels in the code, >=2" << endl;
420 *file << "Level0Factor\t" << PlaneWaveSpecifics.Lev0Factor << "\t# factor by which node number increases from S to 0 level" << endl;
421 *file << "RiemannTensor\t" << PlaneWaveSpecifics.RiemannTensor << "\t# (Use metric)" << endl;
422 switch (PlaneWaveSpecifics.RiemannTensor) {
423 case 0: //UseNoRT
424 break;
425 case 1: // UseRT
426 *file << "RiemannLevel\t" << PlaneWaveSpecifics.RiemannLevel << "\t# Number of Riemann Levels" << endl;
427 *file << "LevRFactor\t" << PlaneWaveSpecifics.LevRFactor << "\t# factor by which node number increases from 0 to R level from" << endl;
428 break;
429 }
430 *file << "PsiType\t\t" << PlaneWaveSpecifics.PsiType << "\t# 0 - doubly occupied, 1 - SpinUp,SpinDown" << endl;
431 *file << "MaxPsiDouble\t" << PlaneWaveSpecifics.MaxPsiDouble << "\t# here: specifying both maximum number of SpinUp- and -Down-states" << endl;
432 *file << "PsiMaxNoUp\t" << PlaneWaveSpecifics.PsiMaxNoUp << "\t# here: specifying maximum number of SpinUp-states" << endl;
433 *file << "PsiMaxNoDown\t" << PlaneWaveSpecifics.PsiMaxNoDown << "\t# here: specifying maximum number of SpinDown-states" << endl;
434 *file << "AddPsis\t\t" << PlaneWaveSpecifics.AddPsis << "\t# Additional unoccupied Psis for bandgap determination" << endl;
435 *file << endl;
436 *file << "RCut\t\t" << PlaneWaveSpecifics.RCut << "\t# R-cut for the ewald summation" << endl;
437 *file << "StructOpt\t" << StructOpt << "\t# Do structure optimization beforehand" << endl;
438 *file << "IsAngstroem\t" << IsAngstroem << "\t# 0 - Bohr, 1 - Angstroem" << endl;
439 *file << "RelativeCoord\t" << RelativeCoord << "\t# whether ion coordinates are relative (1) or absolute (0)" << endl;
440 map<int, int> ZtoIndexMap;
441 OutputElements(file, allatoms, ZtoIndexMap);
442 OutputAtoms(file, allatoms, ZtoIndexMap);
443 } else {
444 DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open output file." << endl);
445 }
446}
447
448
449/** Counts necessary number of valence electrons and returns number and SpinType.
450 * \param &allatoms all atoms to store away
451 */
452void PcpParser::CalculateOrbitals(vector<atom *> &allatoms)
453{
454 PlaneWaveSpecifics.MaxPsiDouble = PlaneWaveSpecifics.PsiMaxNoDown = PlaneWaveSpecifics.PsiMaxNoUp = PlaneWaveSpecifics.PsiType = 0;
455 for (vector<atom *>::iterator runner = allatoms.begin(); runner != allatoms.end(); ++runner) {
456 PlaneWaveSpecifics.MaxPsiDouble += (*runner)->type->NoValenceOrbitals;
457 }
458 cout << PlaneWaveSpecifics.MaxPsiDouble << endl;
459 PlaneWaveSpecifics.PsiMaxNoDown = PlaneWaveSpecifics.MaxPsiDouble/2 + (PlaneWaveSpecifics.MaxPsiDouble % 2);
460 PlaneWaveSpecifics.PsiMaxNoUp = PlaneWaveSpecifics.MaxPsiDouble/2;
461 PlaneWaveSpecifics.MaxPsiDouble /= 2;
462 PlaneWaveSpecifics.PsiType = (PlaneWaveSpecifics.PsiMaxNoDown == PlaneWaveSpecifics.PsiMaxNoUp) ? 0 : 1;
463 if ((PlaneWaveSpecifics.PsiType == 1) && (Parallelization.ProcPEPsi < 2) && ((PlaneWaveSpecifics.PsiMaxNoDown != 1) || (PlaneWaveSpecifics.PsiMaxNoUp != 0))) {
464 Parallelization.ProcPEGamma /= 2;
465 Parallelization.ProcPEPsi *= 2;
466 } else {
467 Parallelization.ProcPEGamma *= Parallelization.ProcPEPsi;
468 Parallelization.ProcPEPsi = 1;
469 }
470 cout << PlaneWaveSpecifics.PsiMaxNoDown << ">" << PlaneWaveSpecifics.PsiMaxNoUp << endl;
471 if (PlaneWaveSpecifics.PsiMaxNoDown > PlaneWaveSpecifics.PsiMaxNoUp) {
472 StepCounts.InitMaxMinStopStep = StepCounts.MaxMinStopStep = PlaneWaveSpecifics.PsiMaxNoDown;
473 cout << PlaneWaveSpecifics.PsiMaxNoDown << " " << StepCounts.InitMaxMinStopStep << endl;
474 } else {
475 StepCounts.InitMaxMinStopStep = StepCounts.MaxMinStopStep = PlaneWaveSpecifics.PsiMaxNoUp;
476 cout << PlaneWaveSpecifics.PsiMaxNoUp << " " << StepCounts.InitMaxMinStopStep << endl;
477 }
478};
479
480/** Prints MaxTypes and list of elements to strea,
481 * \param *file output stream
482 * \param &allatoms vector of all atoms in the system, such as by World::getAllAtoms()
483 * \param &ZtoIndexMap map of which atoms belong to which ion number
484 */
485void PcpParser::OutputElements(ostream *file, vector<atom *> &allatoms, map<int, int> &ZtoIndexMap)
486{
487 map<int, int> PresentElements;
488 pair < map<int, int>::iterator, bool > Inserter;
489 // insert all found elements into the map
490 for (vector<atom *>::iterator AtomRunner = allatoms.begin();AtomRunner != allatoms.end();++AtomRunner) {
491 Inserter = PresentElements.insert(pair<int, int>((*AtomRunner)->type->Z, 1));
492 if (!Inserter.second) // increase if present
493 Inserter.first->second += 1;
494 }
495 // print total element count
496 *file << "MaxTypes\t" << PresentElements.size() << "\t# maximum number of different ion types" << endl;
497 *file << endl;
498 // print element list
499 *file << "# Ion type data (PP = PseudoPotential, Z = atomic number)" << endl;
500 *file << "#Ion_TypeNr.\tAmount\tZ\tRGauss\tL_Max(PP)L_Loc(PP)IonMass\t# chemical name, symbol" << endl;
501 // elements are due to map sorted by Z value automatically, hence just count through them
502 int counter = 1;
503 for(map<int, int>::const_iterator iter=PresentElements.begin(); iter!=PresentElements.end();++iter) {
504 const element * const elemental = World::getInstance().getPeriode()->FindElement(iter->first);
505 ZtoIndexMap.insert( pair<int,int> (iter->first, counter) );
506 *file << "Ion_Type" << counter++ << "\t" << iter->second << "\t" << elemental->Z << "\t1.0\t3\t3\t" << fixed << setprecision(11) << showpoint << elemental->mass << "\t" << elemental->name << "\t" << elemental->symbol <<endl;
507 }
508}
509
510/** Output all atoms one per line.
511 * \param *file output stream
512 * \param &allatoms vector of all atoms in the system, such as by World::getAllAtoms()
513 * \param &ZtoIndexMap map of which atoms belong to which ion number
514 */
515void PcpParser::OutputAtoms(ostream *file, vector<atom *> &allatoms, map<int, int> &ZtoIndexMap)
516{
517 *file << "#Ion_TypeNr._Nr.R[0] R[1] R[2] MoveType (0 MoveIon, 1 FixedIon)" << endl;
518 map<int, int> ZtoCountMap;
519 pair < map<int, int>::iterator, bool > Inserter;
520 int nr = 0;
521 for (vector<atom *>::iterator AtomRunner = allatoms.begin();AtomRunner != allatoms.end();++AtomRunner) {
522 Inserter = ZtoCountMap.insert( pair<int, int>((*AtomRunner)->type->Z, 1) );
523 if (!Inserter.second)
524 Inserter.first->second += 1;
525 const int Z = (*AtomRunner)->type->Z;
526 *file << "Ion_Type" << ZtoIndexMap[Z] << "_" << ZtoCountMap[Z] << "\t" << fixed << setprecision(9) << showpoint;
527 *file << (*AtomRunner)->x[0] << "\t" << (*AtomRunner)->x[1] << "\t" << (*AtomRunner)->x[2];
528 *file << "\t" << (*AtomRunner)->FixedIon;
529 if ((*AtomRunner)->v.Norm() > MYEPSILON)
530 *file << "\t" << scientific << setprecision(6) << (*AtomRunner)->v[0] << "\t" << (*AtomRunner)->v[1] << "\t" << (*AtomRunner)->v[2] << "\t";
531 *file << " # molecule nr " << nr++ << endl;
532 }
533}
534
535/** Reading of Thermostat related values from parameter file.
536 * \param *fb file buffer containing the config file
537 */
538void PcpParser::ParseThermostats(class ConfigFileBuffer * const fb)
539{
540 char * const thermo = new char[12];
541 const int verbose = 0;
542 class ThermoStatContainer *Thermostats = World::getInstance().getThermostats();
543
544 // read desired Thermostat from file along with needed additional parameters
545 if (ParseForParameter(verbose,fb,"Thermostat", 0, 1, 1, string_type, thermo, 1, optional)) {
546 if (strcmp(thermo, Thermostats->ThermostatNames[0]) == 0) { // None
547 if (Thermostats->ThermostatImplemented[0] == 1) {
548 Thermostats->Thermostat = None;
549 } else {
550 DoLog(1) && (Log() << Verbose(1) << "Warning: " << Thermostats->ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl);
551 Thermostats->Thermostat = None;
552 }
553 } else if (strcmp(thermo, Thermostats->ThermostatNames[1]) == 0) { // Woodcock
554 if (Thermostats->ThermostatImplemented[1] == 1) {
555 Thermostats->Thermostat = Woodcock;
556 ParseForParameter(verbose,fb,"Thermostat", 0, 2, 1, int_type, &Thermostats->ScaleTempStep, 1, critical); // read scaling frequency
557 } else {
558 DoLog(1) && (Log() << Verbose(1) << "Warning: " << Thermostats->ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl);
559 Thermostats->Thermostat = None;
560 }
561 } else if (strcmp(thermo, Thermostats->ThermostatNames[2]) == 0) { // Gaussian
562 if (Thermostats->ThermostatImplemented[2] == 1) {
563 Thermostats->Thermostat = Gaussian;
564 ParseForParameter(verbose,fb,"Thermostat", 0, 2, 1, int_type, &Thermostats->ScaleTempStep, 1, critical); // read collision rate
565 } else {
566 DoLog(1) && (Log() << Verbose(1) << "Warning: " << Thermostats->ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl);
567 Thermostats->Thermostat = None;
568 }
569 } else if (strcmp(thermo, Thermostats->ThermostatNames[3]) == 0) { // Langevin
570 if (Thermostats->ThermostatImplemented[3] == 1) {
571 Thermostats->Thermostat = Langevin;
572 ParseForParameter(verbose,fb,"Thermostat", 0, 2, 1, double_type, &Thermostats->TempFrequency, 1, critical); // read gamma
573 if (ParseForParameter(verbose,fb,"Thermostat", 0, 3, 1, double_type, &Thermostats->alpha, 1, optional)) {
574 DoLog(2) && (Log() << Verbose(2) << "Extended Stochastic Thermostat detected with interpolation coefficient " << Thermostats->alpha << "." << endl);
575 } else {
576 Thermostats->alpha = 1.;
577 }
578 } else {
579 DoLog(1) && (Log() << Verbose(1) << "Warning: " << Thermostats->ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl);
580 Thermostats->Thermostat = None;
581 }
582 } else if (strcmp(thermo, Thermostats->ThermostatNames[4]) == 0) { // Berendsen
583 if (Thermostats->ThermostatImplemented[4] == 1) {
584 Thermostats->Thermostat = Berendsen;
585 ParseForParameter(verbose,fb,"Thermostat", 0, 2, 1, double_type, &Thermostats->TempFrequency, 1, critical); // read \tau_T
586 } else {
587 DoLog(1) && (Log() << Verbose(1) << "Warning: " << Thermostats->ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl);
588 Thermostats->Thermostat = None;
589 }
590 } else if (strcmp(thermo, Thermostats->ThermostatNames[5]) == 0) { // Nose-Hoover
591 if (Thermostats->ThermostatImplemented[5] == 1) {
592 Thermostats->Thermostat = NoseHoover;
593 ParseForParameter(verbose,fb,"Thermostat", 0, 2, 1, double_type, &Thermostats->HooverMass, 1, critical); // read Hoovermass
594 Thermostats->alpha = 0.;
595 } else {
596 DoLog(1) && (Log() << Verbose(1) << "Warning: " << Thermostats->ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl);
597 Thermostats->Thermostat = None;
598 }
599 } else {
600 DoLog(1) && (Log() << Verbose(1) << " Warning: thermostat name was not understood!" << endl);
601 Thermostats->Thermostat = None;
602 }
603 } else {
604 if ((Thermostats->TargetTemp != 0))
605 DoLog(2) && (Log() << Verbose(2) << "No thermostat chosen despite finite temperature MD, falling back to None." << endl);
606 Thermostats->Thermostat = None;
607 }
608 delete[](thermo);
609};
610
611bool PcpParser::operator==(const PcpParser& b) const
612{
613 ASSERT(Parallelization.ProcPEGamma == b.Parallelization.ProcPEGamma, "PcpParser ==: ProcPEGamma not");
614 ASSERT(Parallelization.ProcPEPsi == b.Parallelization.ProcPEPsi, "PcpParser ==: ProcPEPsi not");
615
616 if ((Paths.databasepath != NULL) && (b.Paths.databasepath != NULL))
617 ASSERT(strcmp(Paths.databasepath, b.Paths.databasepath), "PcpParser ==: databasepath not");
618 if ((Paths.configname != NULL) && (b.Paths.configname != NULL))
619 ASSERT(strcmp(Paths.configname, b.Paths.configname), "PcpParser ==: configname not");
620 if ((Paths.mainname != NULL) && (b.Paths.mainname != NULL))
621 ASSERT(strcmp(Paths.mainname, b.Paths.mainname), "PcpParser ==: mainname not");
622 if ((Paths.defaultpath != NULL) && (b.Paths.defaultpath != NULL))
623 ASSERT(strcmp(Paths.defaultpath, b.Paths.defaultpath), "PcpParser ==: defaultpath not");
624 if ((Paths.pseudopotpath != NULL) && (b.Paths.pseudopotpath != NULL))
625 ASSERT(strcmp(Paths.pseudopotpath, b.Paths.pseudopotpath), "PcpParser ==: pseudopotpath not");
626
627 ASSERT(Switches.DoConstrainedMD == b.Switches.DoConstrainedMD, "PcpParser ==: DoConstrainedMD not");
628 ASSERT(Switches.DoOutVis == b.Switches.DoOutVis, "PcpParser ==: DoOutVis not");
629 ASSERT(Switches.DoOutMes == b.Switches.DoOutMes, "PcpParser ==: DoOutMes not");
630 ASSERT(Switches.DoOutNICS == b.Switches.DoOutNICS, "PcpParser ==: DoOutNICS not");
631 ASSERT(Switches.DoOutOrbitals == b.Switches.DoOutOrbitals, "PcpParser ==: DoOutOrbitals not");
632 ASSERT(Switches.DoOutCurrent == b.Switches.DoOutCurrent, "PcpParser ==: DoOutCurrent not");
633 ASSERT(Switches.DoFullCurrent == b.Switches.DoFullCurrent, "PcpParser ==: DoFullCurrent not");
634 ASSERT(Switches.DoPerturbation == b.Switches.DoPerturbation, "PcpParser ==: DoPerturbation not");
635 ASSERT(Switches.DoWannier == b.Switches.DoWannier, "PcpParser ==: DoWannier not");
636
637 ASSERT(LocalizedOrbitals.CommonWannier == b.LocalizedOrbitals.CommonWannier, "PcpParser ==: CommonWannier not");
638 ASSERT(LocalizedOrbitals.SawtoothStart == b.LocalizedOrbitals.SawtoothStart, "PcpParser ==: SawtoothStart not");
639 ASSERT(LocalizedOrbitals.VectorPlane == b.LocalizedOrbitals.VectorPlane, "PcpParser ==: VectorPlane not");
640 ASSERT(LocalizedOrbitals.VectorCut == b.LocalizedOrbitals.VectorCut, "PcpParser ==: VectorCut not");
641 ASSERT(LocalizedOrbitals.UseAddGramSch == b.LocalizedOrbitals.UseAddGramSch, "PcpParser ==: UseAddGramSch not");
642 ASSERT(LocalizedOrbitals.Seed == b.LocalizedOrbitals.Seed, "PcpParser ==: Seed not");
643 ASSERT(LocalizedOrbitals.EpsWannier == b.LocalizedOrbitals.EpsWannier, "PcpParser ==: EpsWannier not");
644
645 ASSERT(StepCounts.MaxMinStopStep == b.StepCounts.MaxMinStopStep, "PcpParser ==: MaxMinStopStep not");
646 ASSERT(StepCounts.InitMaxMinStopStep == b.StepCounts.InitMaxMinStopStep, "PcpParser ==: InitMaxMinStopStep not");
647 ASSERT(StepCounts.OutVisStep == b.StepCounts.OutVisStep, "PcpParser ==: OutVisStep not");
648 ASSERT(StepCounts.OutSrcStep == b.StepCounts.OutSrcStep, "PcpParser ==: OutSrcStep not");
649 ASSERT(StepCounts.MaxPsiStep == b.StepCounts.MaxPsiStep, "PcpParser ==: MaxPsiStep not");
650 ASSERT(StepCounts.MaxOuterStep == b.StepCounts.MaxOuterStep, "PcpParser ==: MaxOuterStep not");
651 ASSERT(StepCounts.MaxMinStep == b.StepCounts.MaxMinStep, "PcpParser ==: MaxMinStep not");
652 ASSERT(StepCounts.RelEpsTotalEnergy == b.StepCounts.RelEpsTotalEnergy, "PcpParser ==: RelEpsTotalEnergy not");
653 ASSERT(StepCounts.MaxMinGapStopStep == b.StepCounts.MaxMinGapStopStep, "PcpParser ==: MaxMinGapStopStep not");
654 ASSERT(StepCounts.MaxInitMinStep == b.StepCounts.MaxInitMinStep, "PcpParser ==: MaxInitMinStep not");
655 ASSERT(StepCounts.InitRelEpsTotalEnergy == b.StepCounts.InitRelEpsTotalEnergy, "PcpParser ==: InitRelEpsTotalEnergy not");
656 ASSERT(StepCounts.InitRelEpsKineticEnergy == b.StepCounts.InitRelEpsKineticEnergy, "PcpParser ==: InitRelEpsKineticEnergy not");
657 ASSERT(StepCounts.InitMaxMinGapStopStep == b.StepCounts.InitMaxMinGapStopStep, "PcpParser ==: InitMaxMinGapStopStep not");
658
659 ASSERT(PlaneWaveSpecifics.PsiType == b.PlaneWaveSpecifics.PsiType, "PcpParser ==: PsiType not");
660 ASSERT(PlaneWaveSpecifics.MaxPsiDouble == b.PlaneWaveSpecifics.MaxPsiDouble, "PcpParser ==: MaxPsiDouble not");
661 ASSERT(PlaneWaveSpecifics.PsiMaxNoUp == b.PlaneWaveSpecifics.PsiMaxNoUp, "PcpParser ==: PsiMaxNoUp not");
662 ASSERT(PlaneWaveSpecifics.PsiMaxNoDown == b.PlaneWaveSpecifics.PsiMaxNoDown, "PcpParser ==: PsiMaxNoDown not");
663 ASSERT(PlaneWaveSpecifics.ECut == b.PlaneWaveSpecifics.ECut, "PcpParser ==: ECut not");
664 ASSERT(PlaneWaveSpecifics.MaxLevel == b.PlaneWaveSpecifics.MaxLevel, "PcpParser ==: MaxLevel not");
665 ASSERT(PlaneWaveSpecifics.RiemannTensor == b.PlaneWaveSpecifics.RiemannTensor, "PcpParser ==: RiemannTensor not");
666 ASSERT(PlaneWaveSpecifics.LevRFactor == b.PlaneWaveSpecifics.LevRFactor, "PcpParser ==: LevRFactor not");
667 ASSERT(PlaneWaveSpecifics.RiemannLevel == b.PlaneWaveSpecifics.RiemannLevel, "PcpParser ==: RiemannLevel not");
668 ASSERT(PlaneWaveSpecifics.Lev0Factor == b.PlaneWaveSpecifics.Lev0Factor, "PcpParser ==: Lev0Factor not");
669 ASSERT(PlaneWaveSpecifics.RTActualUse == b.PlaneWaveSpecifics.RTActualUse, "PcpParser ==: RTActualUse not");
670 ASSERT(PlaneWaveSpecifics.AddPsis == b.PlaneWaveSpecifics.AddPsis, "PcpParser ==: AddPsis not");
671 ASSERT(PlaneWaveSpecifics.AddPsis == b.PlaneWaveSpecifics.AddPsis, "PcpParser ==: AddPsis not");
672 ASSERT(PlaneWaveSpecifics.RCut == b.PlaneWaveSpecifics.RCut, "PcpParser ==: RCut not");
673
674 ASSERT(FastParsing == b.FastParsing, "PcpParser ==: FastParsing not");
675
676 ASSERT(Deltat == b.Deltat, "PcpParser ==: Deltat not");
677 ASSERT(IsAngstroem == b.IsAngstroem, "PcpParser ==: IsAngstroem not");
678 ASSERT(RelativeCoord == b.RelativeCoord, "PcpParser ==: RelativeCoord not");
679 ASSERT(StructOpt == b.StructOpt, "PcpParser ==: StructOpt not");
680 ASSERT(MaxTypes == b.MaxTypes, "PcpParser ==: MaxTypes not");
681 ASSERT(basis == b.basis, "PcpParser ==: basis not");
682
683 return true;
684}
Note: See TracBrowser for help on using the repository browser.