Changeset c1db05 for src/Parser/MpqcParser.cpp
- Timestamp:
- Oct 10, 2011, 2:27:06 PM (13 years ago)
- Branches:
- 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
- Children:
- 4151b0
- Parents:
- e611dc
- git-author:
- Frederik Heber <heber@…> (09/06/11 08:45:22)
- git-committer:
- Frederik Heber <heber@…> (10/10/11 14:27:06)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/MpqcParser.cpp
re611dc rc1db05 25 25 26 26 #include "MpqcParser.hpp" 27 #include "MpqcParser_Parameters.hpp" 27 28 28 29 #include "atom.hpp" … … 42 43 */ 43 44 MpqcParser::MpqcParser() 44 {} 45 { 46 parameters = new MpqcParser_Parameters(); 47 } 45 48 46 49 /** Destructor of MpqcParser. … … 48 51 */ 49 52 MpqcParser::~MpqcParser() 50 {} 53 { 54 delete parameters; 55 } 51 56 52 57 /** Load an MPQC config file into the World. … … 123 128 std::string value(*tok_iter); 124 129 std::stringstream linestream("theory = "+value); 125 linestream >> params;130 linestream >> getParams(); 126 131 } else if (linestring.find("integrals<") != string::npos) { // get theory 127 132 tokenizer tokens(linestring, angularsep); … … 132 137 std::string value(*tok_iter); 133 138 std::stringstream linestream("integration = "+value); 134 linestream >> params;139 linestream >> getParams(); 135 140 } else if ((linestring.find("molecule") == string::npos) && (linestring.find("basis") == string::npos)){ 136 141 // molecule and basis must not be parsed in this section … … 142 147 std::string key; 143 148 whitespacefilter >> ws >> key; 144 if ( params.haveParam(key)) {149 if (getParams().haveParam(key)) { 145 150 std::stringstream linestream(linestring); 146 linestream >> params;151 linestream >> getParams(); 147 152 } else { // unknown keys are simply ignored as long as parser is incomplete 148 153 DoLog(2) && (Log() << Verbose(2) << "INFO: '"+key+"' is unknown and ignored." << std::endl); … … 165 170 if (key == "name") { 166 171 std::stringstream linestream("basis = "+value); 167 linestream >> params;172 linestream >> getParams(); 168 173 } 169 174 } … … 183 188 if (key == "name") { 184 189 std::stringstream linestream("aux_basis = "+value); 185 linestream >> params;190 linestream >> getParams(); 186 191 } 187 192 } … … 227 232 *file << "% Created by MoleCuilder" << endl; 228 233 *file << "mpqc: (" << endl; 229 *file << "\tsavestate = " << params.getString(MpqcParser_Parameters::savestateParam) << endl;230 *file << "\tdo_gradient = " << params.getString(MpqcParser_Parameters::do_gradientParam) << endl;231 if ( params.getBool(MpqcParser_Parameters::hessianParam)) {234 *file << "\tsavestate = " << getParams().getString(MpqcParser_Parameters::savestateParam) << endl; 235 *file << "\tdo_gradient = " << getParams().getString(MpqcParser_Parameters::do_gradientParam) << endl; 236 if (getParams().getBool(MpqcParser_Parameters::hessianParam)) { 232 237 *file << "\tfreq<MolecularFrequencies>: (" << endl; 233 238 *file << "\t\tmolecule=$:molecule" << endl; 234 239 *file << "\t)" << endl; 235 240 } 236 switch ( params.getTheory()) {241 switch (getParams().getTheory()) { 237 242 case MpqcParser_Parameters::CLHF: 238 *file << "\tmole<" << params.getString(MpqcParser_Parameters::theoryParam) << ">: (" << endl;243 *file << "\tmole<" << getParams().getString(MpqcParser_Parameters::theoryParam) << ">: (" << endl; 239 244 *file << "\t\tmolecule = $:molecule" << endl; 240 245 *file << "\t\tbasis = $:basis" << endl; 241 *file << "\t\tmaxiter = " << toString( params.getInt(MpqcParser_Parameters::maxiterParam))<< endl;242 *file << "\t\tmemory = " << toString( params.getInt(MpqcParser_Parameters::memoryParam)) << endl;246 *file << "\t\tmaxiter = " << toString(getParams().getInt(MpqcParser_Parameters::maxiterParam))<< endl; 247 *file << "\t\tmemory = " << toString(getParams().getInt(MpqcParser_Parameters::memoryParam)) << endl; 243 248 *file << "\t)" << endl; 244 249 break; 245 250 case MpqcParser_Parameters::CLKS: 246 *file << "\tmole<" << params.getString(MpqcParser_Parameters::theoryParam) << ">: (" << endl;251 *file << "\tmole<" << getParams().getString(MpqcParser_Parameters::theoryParam) << ">: (" << endl; 247 252 *file << "\t\tfunctional<StdDenFunctional>:(name=B3LYP)" << endl; 248 253 *file << "\t\tmolecule = $:molecule" << endl; 249 254 *file << "\t\tbasis = $:basis" << endl; 250 *file << "\t\tmaxiter = " << toString( params.getInt(MpqcParser_Parameters::maxiterParam))<< endl;251 *file << "\t\tmemory = " << toString( params.getInt(MpqcParser_Parameters::memoryParam)) << endl;255 *file << "\t\tmaxiter = " << toString(getParams().getInt(MpqcParser_Parameters::maxiterParam))<< endl; 256 *file << "\t\tmemory = " << toString(getParams().getInt(MpqcParser_Parameters::memoryParam)) << endl; 252 257 *file << "\t)" << endl; 253 258 break; 254 259 case MpqcParser_Parameters::MBPT2: 255 *file << "\tmole<" << params.getString(MpqcParser_Parameters::theoryParam) << ">: (" << endl;260 *file << "\tmole<" << getParams().getString(MpqcParser_Parameters::theoryParam) << ">: (" << endl; 256 261 *file << "\t\tbasis = $:basis" << endl; 257 262 *file << "\t\tmolecule = $:molecule" << endl; 258 *file << "\t\tmemory = " << toString( params.getInt(MpqcParser_Parameters::memoryParam)) << endl;263 *file << "\t\tmemory = " << toString(getParams().getInt(MpqcParser_Parameters::memoryParam)) << endl; 259 264 *file << "\t\treference<CLHF>: (" << endl; 260 *file << "\t\t\tmaxiter = " << toString( params.getInt(MpqcParser_Parameters::maxiterParam))<< endl;265 *file << "\t\t\tmaxiter = " << toString(getParams().getInt(MpqcParser_Parameters::maxiterParam))<< endl; 261 266 *file << "\t\t\tbasis = $:basis" << endl; 262 267 *file << "\t\t\tmolecule = $:molecule" << endl; 263 *file << "\t\t\tmemory = " << toString( params.getInt(MpqcParser_Parameters::memoryParam)) << endl;268 *file << "\t\t\tmemory = " << toString(getParams().getInt(MpqcParser_Parameters::memoryParam)) << endl; 264 269 *file << "\t\t)" << endl; 265 270 *file << "\t)" << endl; 266 271 break; 267 272 case MpqcParser_Parameters::MBPT2_R12: 268 *file << "\tmole<" << params.getString(MpqcParser_Parameters::theoryParam) << ">: (" << endl;273 *file << "\tmole<" << getParams().getString(MpqcParser_Parameters::theoryParam) << ">: (" << endl; 269 274 *file << "\t\tmolecule = $:molecule" << endl; 270 275 *file << "\t\tbasis = $:basis" << endl; 271 276 *file << "\t\taux_basis = $:abasis" << endl; 272 *file << "\t\tstdapprox = \"" << params.getString(MpqcParser_Parameters::stdapproxParam) << "\"" << endl;273 *file << "\t\tnfzc = " << toString( params.getInt(MpqcParser_Parameters::nfzcParam)) << endl;274 *file << "\t\tmemory = " << toString( params.getInt(MpqcParser_Parameters::memoryParam)) << endl;277 *file << "\t\tstdapprox = \"" << getParams().getString(MpqcParser_Parameters::stdapproxParam) << "\"" << endl; 278 *file << "\t\tnfzc = " << toString(getParams().getInt(MpqcParser_Parameters::nfzcParam)) << endl; 279 *file << "\t\tmemory = " << toString(getParams().getInt(MpqcParser_Parameters::memoryParam)) << endl; 275 280 *file << "\t\tintegrals<IntegralCints>:()" << endl; 276 281 *file << "\t\treference<CLHF>: (" << endl; 277 282 *file << "\t\t\tmolecule = $:molecule" << endl; 278 283 *file << "\t\t\tbasis = $:basis" << endl; 279 *file << "\t\t\tmaxiter = " << toString( params.getInt(MpqcParser_Parameters::maxiterParam)) << endl;280 *file << "\t\t\tmemory = " << toString( params.getInt(MpqcParser_Parameters::memoryParam)) << endl;281 *file << "\t\t\tintegrals<" << params.getString(MpqcParser_Parameters::integrationParam) << ">:()" << endl;284 *file << "\t\t\tmaxiter = " << toString(getParams().getInt(MpqcParser_Parameters::maxiterParam)) << endl; 285 *file << "\t\t\tmemory = " << toString(getParams().getInt(MpqcParser_Parameters::memoryParam)) << endl; 286 *file << "\t\t\tintegrals<" << getParams().getString(MpqcParser_Parameters::integrationParam) << ">:()" << endl; 282 287 *file << "\t\t)" << endl; 283 288 *file << "\t)" << endl; … … 299 304 *file << ")" << endl; 300 305 *file << "basis<GaussianBasisSet>: (" << endl; 301 *file << "\tname = \"" << params.getString(MpqcParser_Parameters::basisParam) << "\"" << endl;306 *file << "\tname = \"" << getParams().getString(MpqcParser_Parameters::basisParam) << "\"" << endl; 302 307 *file << "\tmolecule = $:molecule" << endl; 303 308 *file << ")" << endl; 304 if ( params.getTheory() == MpqcParser_Parameters::MBPT2_R12) {309 if (getParams().getTheory() == MpqcParser_Parameters::MBPT2_R12) { 305 310 *file << "% auxiliary basis set specification" << endl; 306 311 *file << "\tabasis<GaussianBasisSet>: (" << endl; 307 *file << "\tname = \"" << params.getString(MpqcParser_Parameters::aux_basisParam) << "\"" << endl;312 *file << "\tname = \"" << getParams().getString(MpqcParser_Parameters::aux_basisParam) << "\"" << endl; 308 313 *file << "\tmolecule = $:molecule" << endl; 309 314 *file << ")" << endl; … … 312 317 } 313 318 314 MpqcParser_Parameters & MpqcParser::getParams() 315 { 316 return params; 317 } 318 319
Note:
See TracChangeset
for help on using the changeset viewer.