Changeset 41d023 for src


Ignore:
Timestamp:
Oct 31, 2011, 11:16:17 AM (13 years ago)
Author:
Frederik Heber <heber@…>
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:
e5ece4
Parents:
07a47e
git-author:
Frederik Heber <heber@…> (10/26/11 16:22:33)
git-committer:
Frederik Heber <heber@…> (10/31/11 11:16:17)
Message:

Renamed SetMpqcParametersAction to SetParserParametersAction and generalized.

  • now we may set the parameters of basically any parser, so far it's probably just mpqc and pis3.
  • changed operator<<(FormatParser_Parameters): no output when value is empty string.
  • changed operator>>(FormatParser_Parameters): Asserts were not really making sure that value_iter and param_iter were readible.
  • Added regression test on setting psi3 parameters (wfn).
Location:
src
Files:
1 added
1 deleted
2 edited
2 moved

Legend:

Unmodified
Added
Removed
  • src/Actions/Makefile.am

    r07a47e r41d023  
    229229PARSERACTIONSOURCE = \
    230230  Actions/ParserAction/ParseTremoloPotentialsAction.cpp \
    231   Actions/ParserAction/SetMpqcParametersAction.cpp \
     231  Actions/ParserAction/SetParserParametersAction.cpp \
    232232  Actions/ParserAction/SetOutputFormatsAction.cpp \
    233233  Actions/ParserAction/SetTremoloAtomdataAction.cpp
    234234PARSERACTIONHEADER = \
    235235  Actions/ParserAction/ParseTremoloPotentialsAction.hpp \
    236   Actions/ParserAction/SetMpqcParametersAction.hpp \
     236  Actions/ParserAction/SetParserParametersAction.hpp \
    237237  Actions/ParserAction/SetOutputFormatsAction.hpp \
    238238  Actions/ParserAction/SetTremoloAtomdataAction.hpp
    239239PARSERACTIONDEFS = \
    240240  Actions/ParserAction/ParseTremoloPotentialsAction.def \
    241   Actions/ParserAction/SetMpqcParametersAction.def \
     241  Actions/ParserAction/SetParserParametersAction.def \
    242242  Actions/ParserAction/SetOutputFormatsAction.def \
    243243  Actions/ParserAction/SetTremoloAtomdataAction.def
  • src/Actions/ParserAction/SetParserParametersAction.def

    r07a47e r41d023  
    11/*
    2  * SetMpqcParametersAction.def
     2 * SetParserParametersAction.def
    33 *
    44 *  Created on: Aug 26, 2010
     
    1212// ValueStorage by the token "Z" -> first column: int, Z, "Z"
    1313// "undefine" if no parameters are required, use (NODEFAULT) for each (undefined) default value
    14 #define paramtypes (std::string)
    15 #define paramtokens ("set-mpqc-parameters")
    16 #define paramdescriptions ("parameter (key = value;) assignment for MPQC")
    17 #undef paramdefaults
    18 #define paramreferences (newparams)
     14#define paramtypes (std::string)(std::string)
     15#define paramtokens ("set-parser-parameters")("parser-parameters")
     16#define paramdescriptions ("name of the parser to change")("parameter (key = value;)")
     17#define paramdefaults (NODEFAULT)(NODEFAULT)
     18#define paramreferences (parsername)(newparams)
    1919
    2020#define statetypes (std::string)
     
    2525#define MENUNAME "parser"
    2626#define MENUPOSITION 11
    27 #define ACTIONNAME SetMpqcParameters
    28 #define TOKEN "set-mpqc-parameters"
     27#define ACTIONNAME SetParserParameters
     28#define TOKEN "set-parser-parameters"
    2929
    3030
    3131// finally the information stored in the ActionTrait specialization
    32 #define DESCRIPTION "set the parameters for MPQC"
     32#define DESCRIPTION "set the parameters for a given parser"
    3333#define SHORTFORM "M"
  • src/Actions/ParserAction/SetParserParametersAction.hpp

    r07a47e r41d023  
    11/*
    2  * SetMpqcParametersAction.hpp
     2 * SetParserParametersAction.hpp
    33 *
    44 *  Created on: May 8, 2010
     
    66 */
    77
    8 #ifndef SETMPQCPARAMETERSACTION_HPP_
    9 #define SETMPQCPARAMETERSACTION_HPP_
     8#ifndef SETPARSERPARAMETERSACTION_HPP_
     9#define SETPARSERPARAMETERSACTION_HPP_
    1010
    1111// include config.h
     
    1717#include "Actions/Action.hpp"
    1818
    19 #include "SetMpqcParametersAction.def"
     19#include "SetParserParametersAction.def"
    2020#include "Action_impl_header.hpp"
    2121
    22 #endif /* SETMPQCPARAMETERSACTION_HPP_ */
     22#endif /* SETPARSERPARAMETERSACTION_HPP_ */
  • src/Parser/FormatParser_Parameters.cpp

    r07a47e r41d023  
    129129      iter != params.storage->getEndIter();
    130130      ++iter)
    131     output << iter->first
    132           <<  "=" << iter->second->get() << ";";
     131    if (!iter->second->get().empty())
     132      output << iter->first <<  "=" << iter->second->get() << ";";
    133133  ost << output.str();
    134134  return ost;
     
    160160    if (paramtokens.begin() != paramtokens.end()) {
    161161      tokenizer::iterator tok_paramiter = paramtokens.begin();
     162      ASSERT(tok_paramiter != paramtokens.end(),
     163          "operator<< on FormatParser_Parameters - missing value before ' =' in token "+*tok_iter+"!");
    162164      tokenizer::iterator tok_valueiter = tok_paramiter;
    163165      tokenizer::iterator tok_checkiter = ++tok_valueiter;
    164       ++tok_checkiter;
    165       LOG(3, "INFO: key is '" << *tok_paramiter << "', value is '" << *tok_valueiter << "'.");
    166       // TODO: throw exception instead of ASSERT
    167       ASSERT(tok_paramiter != paramtokens.end(),
    168           "operator<< on FormatParser_Parameters - missing value before ' =' in token "+*tok_iter+"!");
    169166      ASSERT(tok_valueiter != paramtokens.end(),
    170167          "operator<< on FormatParser_Parameters - missing value after ' =' in token "+*tok_iter+"!");
     168      ++tok_checkiter;
    171169      ASSERT(tok_checkiter == paramtokens.end(),
    172170          "operator<< on FormatParser_Parameters - still more tokens after ' =' in token "+*tok_iter+":"
    173171          +*tok_checkiter+"!");
     172      LOG(3, "INFO: key is '" << *tok_paramiter << "', value is '" << *tok_valueiter << "'.");
     173      // TODO: throw exception instead of ASSERT
    174174      std::string key(*tok_paramiter);
    175175      std::string value(*tok_valueiter);
Note: See TracChangeset for help on using the changeset viewer.