Changeset 39b639


Ignore:
Timestamp:
Jul 25, 2010, 6:14:09 PM (14 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:
33b750
Parents:
8bc733
Message:

Lots of small fixes to MapOfActions:

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/MapOfActions.cpp

    r8bc733 r39b639  
    352352  TypeEnumMap[&typeid(std::vector<std::string>)] = ListOfStrings;
    353353  TypeEnumMap[&typeid(VectorValue)] = Vector;
     354  TypeEnumMap[&typeid(std::vector<VectorValue>)] = ListOfVectors;
    354355  TypeEnumMap[&typeid(BoxValue)] = Box;
    355356  TypeEnumMap[&typeid(molecule)] = Molecule;
     
    554555      throw MissingValueException(__FILE__, __LINE__);
    555556    std::istringstream stream(CurrentValue[name]);
    556     CurrentValue.erase(name);
    557557    stream >> tmp;
    558558    M.set(0,0,tmp);
     
    570570    stream >> tmp;
    571571    M.set(2,2,tmp);
     572    _T = M;
     573    CurrentValue.erase(name);
    572574  } else
    573575    throw IllegalTypeException(__FILE__,__LINE__);
     
    676678{
    677679  const Matrix &M = _T.getM();
    678   if (typeid( Box ) == *TypeMap[name]) {
     680  if (typeid( BoxValue ) == *TypeMap[name]) {
    679681    std::ostringstream stream;
    680682    stream << M.at(0,0) << " ";
     
    691693void MapOfActions::setCurrentValue(const char * name, class Vector &_T)
    692694{
    693   if (typeid( Vector ) == *TypeMap[name]){
     695  if (typeid( VectorValue ) == *TypeMap[name]){
    694696    std::ostringstream stream;
    695697    stream << _T[0] << " ";
     
    816818              (getKeyAndShortForm(*OptionRunner).c_str(),
    817819                  CurrentValue.find(*OptionRunner) != CurrentValue.end() ?
    818                         po::value< bool >()->default_value(atoi(CurrentValue[*OptionRunner].c_str())) :
     820                        po::value< bool >()->default_value(lexical_cast<int>(CurrentValue[*OptionRunner].c_str())) :
    819821                        po::value< bool >(),
    820822                  getDescription(*OptionRunner).c_str())
     
    824826            ListRunner->second->add_options()
    825827              (getKeyAndShortForm(*OptionRunner).c_str(),
    826                   po::value<BoxValue>()->multitoken(),
     828                  po::value<BoxValue>(),
    827829                  getDescription(*OptionRunner).c_str())
    828830              ;
     
    832834              (getKeyAndShortForm(*OptionRunner).c_str(),
    833835                  CurrentValue.find(*OptionRunner) != CurrentValue.end() ?
    834                         po::value< int >()->default_value(atoi(CurrentValue[*OptionRunner].c_str())) :
     836                        po::value< int >()->default_value(lexical_cast<int>(CurrentValue[*OptionRunner].c_str())) :
    835837                        po::value< int >(),
    836838                  getDescription(*OptionRunner).c_str())
     
    848850              (getKeyAndShortForm(*OptionRunner).c_str(),
    849851                  CurrentValue.find(*OptionRunner) != CurrentValue.end() ?
    850                         po::value< double >()->default_value(atof(CurrentValue[*OptionRunner].c_str())) :
     852                        po::value< double >()->default_value(lexical_cast<double>(CurrentValue[*OptionRunner].c_str())) :
    851853                        po::value< double >(),
    852854                  getDescription(*OptionRunner).c_str())
     
    894896              (getKeyAndShortForm(*OptionRunner).c_str(),
    895897                  CurrentValue.find(*OptionRunner) != CurrentValue.end() ?
    896                         po::value< int >()->default_value(atoi(CurrentValue[*OptionRunner].c_str())) :
     898                        po::value< int >()->default_value(lexical_cast<int>(CurrentValue[*OptionRunner].c_str())) :
    897899                        po::value< int >(),
    898900                  getDescription(*OptionRunner).c_str())
     
    910912              (getKeyAndShortForm(*OptionRunner).c_str(),
    911913                  CurrentValue.find(*OptionRunner) != CurrentValue.end() ?
    912                         po::value< int >()->default_value(atoi(CurrentValue[*OptionRunner].c_str())) :
     914                        po::value< int >()->default_value(lexical_cast<int>(CurrentValue[*OptionRunner].c_str())) :
    913915                        po::value< int >(),
    914916                  getDescription(*OptionRunner).c_str())
     
    925927            ListRunner->second->add_options()
    926928              (getKeyAndShortForm(*OptionRunner).c_str(),
    927                   po::value< vector<int> >(),
     929                  po::value< int >(),
    928930                  getDescription(*OptionRunner).c_str())
    929931              ;
Note: See TracChangeset for help on using the changeset viewer.