source: src/Parser/PcpParser.hpp@ 50e4e5

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 50e4e5 was 765f16, checked in by Frederik Heber <heber@…>, 13 years ago

Huge Refactoring of FormatParserStorage and all FormatParser's.

FormatParser:

FormatParserStorage:

  • We construct all lookup tables and alikes via boost preprocessor magic from a list of all available parser (enums).
  • we use the templated getParser() and addParser() functions to serve parsers to the outside. Instances are as usual created only once.

Tests:

  • tests only had to be changed because of the "renaming" of the Parsers.
  • Property mode set to 100644
File size: 3.7 KB
Line 
1/*
2 * PcpParser.hpp
3 *
4 * Created on: 12.06.2010
5 * Author: heber
6 */
7
8#ifndef PCPPARSER_HPP_
9#define PCPPARSER_HPP_
10
11// include config.h
12#ifdef HAVE_CONFIG_H
13#include <config.h>
14#endif
15
16#include <iosfwd>
17#include <map>
18#include <string>
19#include <vector>
20
21#include "FormatParser.hpp"
22#include "FormatParserTrait.hpp"
23#include "FormatParserInterface.hpp"
24#include "FormatParser_common.hpp"
25#include "ParserTypes.hpp"
26
27class atom;
28
29// declaration of specialized FormatParserTrait
30template<>
31struct FormatParserTrait<pcp>
32{
33 //!> Name of the parser
34 static const std::string name;
35 //!> suffix of the files the parser understands to read and write
36 static const std::string suffix;
37 //!> ParserTypes enumeration for the parser
38 static const enum ParserTypes type;
39};
40
41/**
42 * Parser for PCP config files.
43 */
44template <>
45class FormatParser< pcp > : virtual public FormatParserInterface, public FormatParser_common
46{
47public:
48 FormatParser();
49 virtual ~FormatParser();
50 void load(std::istream* file);
51 void save(std::ostream* file, const std::vector<atom *> &atoms);
52
53 bool operator==(const FormatParser< pcp >& b) const;
54
55private:
56
57 void ParseThermostats(class ConfigFileBuffer * const fb);
58 void OutputAtoms(std::ostream *file, const std::vector<atom *> &allatoms, std::map<int, int> &ZtoIndexMap);
59 void OutputElements(std::ostream *file, const std::vector<atom *> &allatoms, std::map<int, int> &ZtoIndexMap);
60 void CalculateOrbitals(const std::vector<atom *> &allatoms);
61
62 class StructParallelization {
63 public:
64 StructParallelization();
65 ~StructParallelization();
66
67 int ProcPEGamma;
68 int ProcPEPsi;
69 } Parallelization;
70
71 /*
72 * Contains all the paths and names
73 */
74 class StructPaths {
75 public:
76 StructPaths();
77 ~StructPaths();
78
79 char *databasepath;
80 char *configname;
81 char *mainname;
82 char *defaultpath;
83 char *pseudopotpath;
84 } Paths;
85
86 /*
87 * Contains all Do/Don't switches
88 */
89 class StructSwitches {
90 public:
91 StructSwitches();
92 ~StructSwitches();
93
94 int DoConstrainedMD;
95 int DoOutVis;
96 int DoOutMes;
97 int DoOutNICS;
98 int DoOutOrbitals;
99 int DoOutCurrent;
100 int DoFullCurrent;
101 int DoPerturbation;
102 int DoWannier;
103 } Switches;
104
105 /*
106 * Contains parameters regarding localization of orbitals or magnetic perturbation
107 */
108 class StructLocalizedOrbitals {
109 public:
110 StructLocalizedOrbitals();
111 ~StructLocalizedOrbitals();
112
113 int CommonWannier;
114 double SawtoothStart;
115 int VectorPlane;
116 double VectorCut;
117 int UseAddGramSch;
118 int Seed;
119 double EpsWannier;
120 } LocalizedOrbitals;
121
122 /*
123 * Contains all step count and other epsilon threshold parameters
124 */
125 class StructStepCounts {
126 public:
127 StructStepCounts();
128 ~StructStepCounts();
129
130 int MaxMinStopStep;
131 int InitMaxMinStopStep;
132
133 int OutVisStep;
134 int OutSrcStep;
135 int MaxPsiStep;
136
137 int MaxOuterStep;
138
139 int MaxMinStep;
140 double RelEpsTotalEnergy;
141 double RelEpsKineticEnergy;
142 int MaxMinGapStopStep;
143 int MaxInitMinStep;
144 double InitRelEpsTotalEnergy;
145 double InitRelEpsKineticEnergy;
146 int InitMaxMinGapStopStep;
147 } StepCounts;
148
149 /*
150 * Contains all parameters specific to the plane wave basis set
151 */
152 class StructPlaneWaveSpecifics {
153 public:
154 StructPlaneWaveSpecifics();
155 ~StructPlaneWaveSpecifics();
156
157 int PsiType;
158 int MaxPsiDouble;
159 int PsiMaxNoUp;
160 int PsiMaxNoDown;
161 double ECut;
162 int MaxLevel;
163 int RiemannTensor;
164 int LevRFactor;
165 int RiemannLevel;
166 int Lev0Factor;
167 int RTActualUse;
168 int AddPsis;
169 double RCut;
170 } PlaneWaveSpecifics;
171
172 bool FastParsing;
173
174 double Deltat;
175 int IsAngstroem;
176 int RelativeCoord;
177 int StructOpt;
178 int MaxTypes;
179 std::string basis;
180};
181
182#endif /* PCPPARSER_HPP_ */
Note: See TracBrowser for help on using the repository browser.