source: src/Parser/Psi3Parser_Parameters.cpp@ 4a187d

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 4a187d was a2f5e5, checked in by Frederik Heber <heber@…>, 12 years ago

FIX: Cleaned up includes in Psi3Parser_Parameters.

  • Property mode set to 100644
File size: 7.6 KB
Line 
1/*
2 * Project: MoleCuilder
3 * Description: creates and alters molecular systems
4 * Copyright (C) 2010-2012 University of Bonn. All rights reserved.
5 *
6 *
7 * This file is part of MoleCuilder.
8 *
9 * MoleCuilder is free software: you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation, either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * MoleCuilder is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with MoleCuilder. If not, see <http://www.gnu.org/licenses/>.
21 */
22
23/*
24 * Psi3Parser_Parameters.cpp
25 *
26 * Created on: Feb 3, 2011
27 * Author: heber
28 */
29
30// include config.h
31#ifdef HAVE_CONFIG_H
32#include <config.h>
33#endif
34
35#include "CodePatterns/MemDebug.hpp"
36
37#include <string>
38
39#include "CodePatterns/Log.hpp"
40
41#include "Psi3Parser_Parameters.hpp"
42
43#include "Parameters/Parameter.hpp"
44
45
46Psi3Parser_Parameters::Psi3Parser_Parameters()
47{
48 Init();
49}
50
51void Psi3Parser_Parameters::Init()
52{
53 // add all known basis
54 //initBasis();
55
56 // add all parameter names
57 {
58 ParamNames.clear();
59 ParamNames.resize(unknownParam);
60 ParamNames[labelParam] = "label";
61 ParamNames[jobtypeParam] = "jobtype";
62 ParamNames[wavefunctionParam] = "wfn";
63 ParamNames[maxiterParam] = "maxiter";
64 ParamNames[referenceParam] = "reference";
65 ParamNames[basisParam] = "basis";
66 ParamNames[freeze_coreParam] = "freeze_core";
67 ParamNames[unitsParam] = "units";
68 ParamNames[dertypeParam] = "dertype";
69 ParamNames[originParam] = "origin";
70 ParamNames[multiplicityParam] = "multp";
71 ParamNames[chargeParam] = "charge";
72 ParamNames[soccParam] = "socc";
73 ParamNames[doccParam] = "docc";
74 ParamNames[subgroupParam] = "subgroup";
75 ParamNames[unique_axisParam] = "unique_axis";
76 }
77
78 // create freeze_core parameter
79 {
80 ValidFreezeCore.clear();
81 ValidFreezeCore.resize(unknownFreezeCore);
82 ValidFreezeCore[YES]="yes";
83 ValidFreezeCore[TRUE]="true";
84 ValidFreezeCore[NO]="no";
85 ValidFreezeCore[FALSE]="false";
86 ValidFreezeCore[SMALL]="small";
87 ValidFreezeCore[LARGE]="large";
88 appendParameter(
89 new Parameter<std::string>(
90 ParamNames[freeze_coreParam],
91 ValidFreezeCore,
92 ValidFreezeCore[YES]));
93 }
94
95 // create units parameter
96 {
97 ValidUnits.clear();
98 ValidUnits.resize(unknownUnits);
99 ValidUnits[angstrom]="angstrom";
100 ValidUnits[bohr]="bohr";
101 appendParameter(
102 new Parameter<std::string>(
103 ParamNames[unitsParam],
104 ValidUnits,
105 ValidUnits[angstrom]));
106 }
107
108 // create dertype parameter
109 {
110 ValidDerivativeType.clear();
111 ValidDerivativeType.resize(unknownDerivativeType);
112 ValidDerivativeType[NONE]="none";
113 appendParameter(
114 new Parameter<std::string>(
115 ParamNames[dertypeParam],
116 ValidDerivativeType,
117 ValidDerivativeType[NONE]));
118 }
119
120 // create unique_axis parameter
121 {
122 ValidUniqueAxis.clear();
123 ValidUniqueAxis.resize(unknownUniqueAxis);
124 ValidUniqueAxis[X]="x";
125 ValidUniqueAxis[Y]="y";
126 ValidUniqueAxis[Z]="z";
127 appendParameter(
128 new Parameter<std::string>(
129 ParamNames[unique_axisParam],
130 ValidUniqueAxis,
131 ValidUniqueAxis[X]));
132 }
133
134 // create jobtype parameter
135 {
136 ValidJobtypes.clear();
137 ValidJobtypes.resize(unknownJobtype);
138 ValidJobtypes[SP]="sp";
139 ValidJobtypes[OPT]="opt";
140 ValidJobtypes[DISP]="disp";
141 ValidJobtypes[FREQ]="freq";
142 ValidJobtypes[SYMM_FREQ]="symm_freq";
143 ValidJobtypes[DBOC]="dboc";
144 ValidJobtypes[RESPONSE]="response";
145 appendParameter(
146 new Parameter<std::string>(
147 ParamNames[jobtypeParam],
148 ValidJobtypes,
149 ValidJobtypes[SP]));
150 }
151
152 // create wavefunction parameter
153 {
154 ValidWavefunction.clear();
155 ValidWavefunction.resize(unknownWavefunction);
156 ValidWavefunction[SCF]="scf";
157 ValidWavefunction[MP2]="mp2";
158 ValidWavefunction[MP2R12]="mp2r12";
159 ValidWavefunction[CIS]="cis";
160 ValidWavefunction[DETCI]="detci";
161 ValidWavefunction[CASSCF]="casscf";
162 ValidWavefunction[RASSCF]="rasscf";
163 ValidWavefunction[CCSD]="ccsd";
164 ValidWavefunction[CCSD_T]="ccsd_t";
165 ValidWavefunction[BCCD]="bccd";
166 ValidWavefunction[BCCD_T]="bccd_t";
167 ValidWavefunction[EOM_CCSD]="eom_ccsd";
168 ValidWavefunction[ZAPTN]="zaptn";
169 appendParameter(
170 new Parameter<std::string>(
171 ParamNames[wavefunctionParam],
172 ValidWavefunction,
173 ValidWavefunction[SCF]));
174 }
175
176 // create reference parameter
177 {
178 ValidReference.clear();
179 ValidReference.resize(unknownReference);
180 ValidReference[RHF]="rhf";
181 ValidReference[ROHF]="rohf";
182 ValidReference[UHF]="uhf";
183 ValidReference[TWOCON]="twocon";
184 appendParameter(
185 new Parameter<std::string>(
186 ParamNames[referenceParam],
187 ValidReference,
188 ValidReference[RHF]));
189 }
190
191 // add all continuous parameters
192 {
193 appendParameter(new Parameter<string>(ParamNames[labelParam], std::string("unknown job")));
194 appendParameter(new Parameter<int>(ParamNames[maxiterParam], 80));
195 appendParameter(new Parameter<string>(ParamNames[basisParam], std::string("cc-pVTZ")));
196 appendParameter(new Parameter<string>(ParamNames[originParam], std::string("(0.0\t0.0\t0.0)"))); // TODO: this should be a vector
197 appendParameter(new Parameter<int>(ParamNames[multiplicityParam], 1));
198 appendParameter(new Parameter<int>(ParamNames[chargeParam], 0));
199 appendParameter(new Parameter<string>(ParamNames[soccParam], std::string("()")));
200 appendParameter(new Parameter<string>(ParamNames[doccParam], std::string("()")));
201 appendParameter(new Parameter<string>(ParamNames[subgroupParam], std::string("")));
202 }
203}
204
205Psi3Parser_Parameters::~Psi3Parser_Parameters()
206{}
207
208/** Getter for a specific Parameter.
209 *
210 * @param param index among enum Parameters
211 * @return value of the desired Parameters
212 */
213const std::string Psi3Parser_Parameters::getParameter(const enum Parameters param) const
214{
215 return FormatParser_Parameters::getParameter(ParamNames[param])->getAsString();
216}
217
218/** Setter for a specific Parameter.
219 *
220 * @param param index among enum Parameters
221 * @param _value value to set desired Parameter to
222 */
223void Psi3Parser_Parameters::setParameter(const enum Parameters param, const std::string &_value)
224{
225 const std::string &name = getParameterName(param);
226 FormatParser_Parameters::getParameter(name)->setAsString(_value);
227}
228
229/** Getter for name of a specific Parameter.
230 *
231 * @param param index among enum Parameters
232 * @return name of the desired Parameter
233 */
234const std::string &Psi3Parser_Parameters::getParameterName(const enum Parameters param) const
235{
236 return ParamNames[param];
237}
238
239/** Getter for name of a specific Reference.
240 *
241 * @param reference index among enum Reference
242 * @return name of the desired Reference
243 */
244const std::string &Psi3Parser_Parameters::getReferenceName(const enum Reference reference) const
245{
246 return ValidReference[reference];
247}
248
249/** Checks whether all elements in the world also have parameters in the basis.
250 *
251 * @return true - all elements parametrized, false - at least one element is missing.
252 */
253bool Psi3Parser_Parameters::checkWorldElementsAgainstCurrentBasis() const
254{
255 ELOG(0, "Psi3Parser_Parameters::checkWorldElementsAgainstCurrentBasis() - not implemented yet.");
256
257 return false;
258}
259
Note: See TracBrowser for help on using the repository browser.