Changeset 4e10f5 for src/Actions/MapOfActions.cpp
- Timestamp:
- Jul 7, 2010, 4:08:32 PM (15 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:
- 77a570
- Parents:
- 5630bd (diff), 192f6e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/MapOfActions.cpp
r5630bd r4e10f5 67 67 #include "Actions/WorldAction/SetDefaultNameAction.hpp" 68 68 #include "Actions/WorldAction/SetGaussianBasisAction.hpp" 69 #include "Actions/WorldAction/SetOutputFormatsAction.hpp" 69 70 #include "Actions/Values.hpp" 70 71 … … 72 73 { 73 74 VectorValue VV; 74 if (values.size() != 3) { 75 cerr << "Specified vector does not have three components but " << values.size() << endl; 75 std::vector<std::string> components; 76 77 // split comma-separated values 78 if (values.size() != 1) { 79 cerr << "Not one vector but " << components.size() << " given " << endl; 80 throw boost::program_options::validation_error("Unequal to one vector given"); 81 } 82 std::string argument(values.at(0)); 83 std::string::iterator Aiter = argument.begin(); 84 std::string::iterator Biter = argument.begin(); 85 for (; Aiter != argument.end(); ++Aiter) { 86 if (*Aiter == ',') { 87 components.push_back(string(Biter,Aiter)); 88 do { 89 Aiter++; 90 } while (*Aiter == ' ' || *Aiter == '\t'); 91 Biter = Aiter; 92 } 93 } 94 components.push_back(string(Biter,argument.end())); 95 96 if (components.size() != 3) { 97 cerr << "Specified vector does not have three components but " << components.size() << endl; 76 98 throw boost::program_options::validation_error("Specified vector does not have three components"); 77 99 } 78 VV.x = boost::lexical_cast<double>( values.at(0));79 VV.y = boost::lexical_cast<double>( values.at(1));80 VV.z = boost::lexical_cast<double>( values.at(2));100 VV.x = boost::lexical_cast<double>(components.at(0)); 101 VV.y = boost::lexical_cast<double>(components.at(1)); 102 VV.z = boost::lexical_cast<double>(components.at(2)); 81 103 v = boost::any(VectorValue(VV)); 82 104 } … … 85 107 { 86 108 BoxValue BV; 87 if (values.size() != 6) { 88 cerr << "Specified vector does not have three components but " << values.size() << endl; 109 std::vector<std::string> components; 110 111 // split comma-separated values 112 if (values.size() != 1) { 113 cerr << "Not one vector but " << components.size() << " given " << endl; 114 throw boost::program_options::validation_error("Unequal to one vector given"); 115 } 116 std::string argument(values.at(0)); 117 std::string::iterator Aiter = argument.begin(); 118 std::string::iterator Biter = argument.begin(); 119 for (; Aiter != argument.end(); ++Aiter) { 120 if (*Aiter == ',') { 121 components.push_back(string(Biter,Aiter)); 122 do { 123 Aiter++; 124 } while (*Aiter == ' ' || *Aiter == '\t'); 125 Biter = Aiter; 126 } 127 } 128 components.push_back(string(Biter,argument.end())); 129 130 if (components.size() != 6) { 131 cerr << "Specified vector does not have three components but " << components.size() << endl; 89 132 throw boost::program_options::validation_error("Specified symmetric box matrix does not have six components"); 90 133 } 91 BV.xx = boost::lexical_cast<double>( values.at(0));92 BV.xy = boost::lexical_cast<double>( values.at(1));93 BV.xz = boost::lexical_cast<double>( values.at(2));94 BV.yy = boost::lexical_cast<double>( values.at(3));95 BV.yz = boost::lexical_cast<double>( values.at(4));96 BV.zz = boost::lexical_cast<double>( values.at(5));134 BV.xx = boost::lexical_cast<double>(components.at(0)); 135 BV.xy = boost::lexical_cast<double>(components.at(1)); 136 BV.xz = boost::lexical_cast<double>(components.at(2)); 137 BV.yy = boost::lexical_cast<double>(components.at(3)); 138 BV.yz = boost::lexical_cast<double>(components.at(4)); 139 BV.zz = boost::lexical_cast<double>(components.at(5)); 97 140 v = boost::any(BoxValue(BV)); 98 141 } … … 130 173 DescriptionMap["input"] = "specify input files"; 131 174 DescriptionMap["linear-interpolate"] = "linear interpolation in discrete steps between start and end position of a molecule"; 175 DescriptionMap["molecular-volume"] = "calculate the volume of a given molecule"; 132 176 DescriptionMap["nonconvex-envelope"] = "create the non-convex envelope for a molecule"; 133 DescriptionMap[" molecular-volume"] = "calculate the volume of a given molecule";134 DescriptionMap[" output"] = "specify output formats";177 DescriptionMap["output"] = "write output files"; 178 DescriptionMap["set-output"] = "specify output formats"; 135 179 DescriptionMap["pair-correlation"] = "pair correlation analysis between two elements, element and point or element and surface"; 136 180 DescriptionMap["parse-xyz"] = "parse xyz file into World"; … … 140 184 DescriptionMap["repeat-box"] = "create periodic copies of the simulation box per axis"; 141 185 DescriptionMap["rotate-to-pas"] = "calculate the principal axis system of the specified molecule and rotate specified axis to align with main axis"; 142 DescriptionMap["set-basis"] = "set the name of the gaussian basis set for MPQC";143 186 DescriptionMap["save-adjacency"] = "name of the adjacency file to write to"; 144 187 DescriptionMap["save-bonds"] = "name of the bonds file to write to"; … … 146 189 DescriptionMap["SaveXyz"] = "save world as xyz file"; 147 190 DescriptionMap["scale-box"] = "scale box and atomic positions inside"; 191 DescriptionMap["set-basis"] = "set the name of the gaussian basis set for MPQC"; 192 DescriptionMap["set-output"] = "specify output formats"; 148 193 DescriptionMap["subgraph-dissect"] = "dissect the molecular system into molecules representing disconnected subgraphs"; 149 194 DescriptionMap["suspend-in-water"] = "suspend the given molecule in water such that in the domain the mean density is as specified"; … … 189 234 ShortFormMap["center-in-box"] = "b"; 190 235 ShortFormMap["change-element"] = "E"; 191 ShortFormMap["convex-envelope"] = "o";236 // ShortFormMap["convex-envelope"] = "x"; 192 237 ShortFormMap["default-molname"] = "X"; 193 238 ShortFormMap["depth-first-search"] = "D"; … … 200 245 ShortFormMap["linear-interpolate"] = "L"; 201 246 ShortFormMap["nonconvex-envelope"] = "N"; 247 // ShortFormMap["output"] = "o"; 202 248 ShortFormMap["pair-correlation"] = "C"; 203 249 ShortFormMap["parse-xyz"] = "p"; … … 211 257 ShortFormMap["scale-box"] = "s"; 212 258 ShortFormMap["set-basis"] = "M"; 259 ShortFormMap["set-output"] = "o"; 213 260 ShortFormMap["subgraph-dissect"] = "I"; 214 261 ShortFormMap["suspend-in-water"] = "u"; … … 238 285 TypeMap["molecular-volume"] = Molecule; 239 286 TypeMap["nonconvex-envelope"] = Molecule; 240 TypeMap["output"] = String;287 TypeMap["output"] = None; 241 288 TypeMap["parse-xyz"] = String; 242 289 TypeMap["pair-correlation"] = String; … … 251 298 TypeMap["scale-box"] = Vector; 252 299 TypeMap["set-basis"] = String; 300 TypeMap["set-output"] = ListOfString; 253 301 TypeMap["subgraph-dissect"] = None; 254 302 TypeMap["suspend-in-water"] = Double; … … 349 397 MenuContainsActionMap.insert( pair<std::string, std::string> ("world", "default-molname") ); 350 398 MenuContainsActionMap.insert( pair<std::string, std::string> ("world", "set-basis") ); 399 MenuContainsActionMap.insert( pair<std::string, std::string> ("world", "set-output") ); 351 400 352 401 // put actions into command line category … … 386 435 generic.insert("scale-box"); 387 436 generic.insert("set-basis"); 437 generic.insert("set-output"); 388 438 generic.insert("subgraph-dissect"); 389 439 generic.insert("suspend-in-water"); … … 484 534 new WorldSetDefaultNameAction(); 485 535 new WorldSetGaussianBasisAction(); 536 new WorldSetOutputFormatsAction(); 486 537 } 487 538 … … 561 612 ; 562 613 break; 614 case ListOfString: 615 ListRunner->second->add_options() 616 (getKeyAndShortForm(*OptionRunner).c_str(), 617 po::value< vector<std::string> >()->multitoken(), 618 getDescription(*OptionRunner).c_str()) 619 ; 620 break; 563 621 case Axis: 564 622 ListRunner->second->add_options() … … 573 631 ListRunner->second->add_options() 574 632 (getKeyAndShortForm(*OptionRunner).c_str(), 575 po::value<VectorValue>() ->multitoken(),633 po::value<VectorValue>(), 576 634 getDescription(*OptionRunner).c_str()) 577 635 ;
Note:
See TracChangeset
for help on using the changeset viewer.