Ignore:
Timestamp:
Jun 16, 2010, 12:24:21 PM (15 years ago)
Author:
Tillmann Crueger <crueger@…>
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:
492279
Parents:
f8e486 (diff), 980dd6 (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.
Message:

Broken: Merge commit 'Gitosis/stable' into stable

Conflicts:

molecuilder/src/Actions/AnalysisAction/PairCorrelationToPointAction.cpp
molecuilder/src/Actions/AnalysisAction/PairCorrelationToSurfaceAction.cpp
molecuilder/src/Makefile.am

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/MapOfActions.cpp

    rf8e486 re6317b  
    1414#include "Helpers/Assert.hpp"
    1515
     16#include <boost/lexical_cast.hpp>
     17#include <boost/optional.hpp>
     18#include <boost/program_options.hpp>
     19
    1620#include "CommandLineParser.hpp"
    1721#include "log.hpp"
    1822#include "verbose.hpp"
     23
     24#include "Actions/Values.hpp"
     25
     26void validate(boost::any& v, const std::vector<std::string>& values, VectorValue *, int)
     27{
     28  VectorValue VV;
     29  if (values.size() != 3) {
     30    cerr <<  "Specified vector does not have three components but " << values.size() << endl;
     31    throw boost::program_options::validation_error("Specified vector does not have three components");
     32  }
     33  VV.x = boost::lexical_cast<double>(values.at(0));
     34  VV.y = boost::lexical_cast<double>(values.at(1));
     35  VV.z = boost::lexical_cast<double>(values.at(2));
     36  v = boost::any(VectorValue(VV));
     37}
     38
     39void validate(boost::any& v, const std::vector<std::string>& values, BoxValue *, int)
     40{
     41  BoxValue BV;
     42  if (values.size() != 6) {
     43    cerr <<  "Specified vector does not have three components but " << values.size() << endl;
     44    throw boost::program_options::validation_error("Specified symmetric box matrix does not have six components");
     45  }
     46  BV.xx = boost::lexical_cast<double>(values.at(0));
     47  BV.xy = boost::lexical_cast<double>(values.at(1));
     48  BV.xz = boost::lexical_cast<double>(values.at(2));
     49  BV.yy = boost::lexical_cast<double>(values.at(3));
     50  BV.yz = boost::lexical_cast<double>(values.at(4));
     51  BV.zz = boost::lexical_cast<double>(values.at(5));
     52  v = boost::any(BoxValue(BV));
     53}
    1954
    2055/** Constructor of class MapOfActions.
     
    5186  DescriptionMap["nonconvex-envelope"] = "create the non-convex envelope for a molecule";
    5287  DescriptionMap["molecular-volume"] = "calculate the volume of a given molecule";
    53   DescriptionMap["pair-correlation"] = "pair correlation analysis between two elements";
    54   DescriptionMap["pair-correlation-point"] = "pair correlation analysis between atoms of a element to a given point";
    55   DescriptionMap["pair-correlation-surface"] = "pair correlation analysis between atoms of a given element and a surface";
     88  DescriptionMap["pair-correlation"] = "pair correlation analysis between two elements, element and point or element and surface";
    5689  DescriptionMap["parse-xyz"] = "parse xyz file into World";
    5790  DescriptionMap["principal-axis-system"] = "calculate the principal axis system of the specified molecule";
     
    6598  DescriptionMap["save-temperature"] = "name of the temperature file to write to";
    6699  DescriptionMap["scale-box"] = "scale box and atomic positions inside";
    67   DescriptionMap["subspace-dissect"] = "dissect the molecular system into molecules representing disconnected subgraphs";
     100  DescriptionMap["subgraph-dissect"] = "dissect the molecular system into molecules representing disconnected subgraphs";
    68101  DescriptionMap["suspend-in-water"] = "suspend the given molecule in water such that in the domain the mean density is as specified";
    69102  DescriptionMap["translate-mol"] = "translate molecule by given vector";
     
    72105  DescriptionMap["version"] = "show version";
    73106  // keys for values
     107  DescriptionMap["atom-by-id"] = "index of an atom";
    74108  DescriptionMap["bin-output-file"] = "name of the bin output file";
    75109  DescriptionMap["bin-end"] = "start of the last bin";
    76110  DescriptionMap["bin-start"] = "start of the first bin";
    77111  DescriptionMap["bin-width"] = "width of the bins";
     112  DescriptionMap["convex-file"] = "filename of the non-convex envelope";
    78113  DescriptionMap["distance"] = "distance in space";
    79114  DescriptionMap["distances"] = "list of three of distances in space, one for each axis direction";
    80   DescriptionMap["element"] = "set of elements";
    81   DescriptionMap["end-mol"] = "last or end step";
     115  DescriptionMap["DoRotate"] = "whether to rotate or just report angles";
     116  DescriptionMap["element"] = "single element";
     117  DescriptionMap["elements"] = "set of elements";
     118  DescriptionMap["end-step"] = "last or end step";
     119  DescriptionMap["id-mapping"] = "whether the identity shall be used in mapping atoms onto atoms or some closest distance measure shall be used";
    82120  DescriptionMap["input"] = "name of input file";
    83121  DescriptionMap["length"] = "length in space";
     
    85123  DescriptionMap["MaxDistance"] = "maximum distance in space";
    86124  DescriptionMap["molecule-by-id"] = "index of a molecule";
     125  DescriptionMap["molecule-by-name"] = "name of a molecule";
     126  DescriptionMap["nonconvex-file"] = "filename of the non-convex envelope";
     127  DescriptionMap["order"] = "order of a discretization, dissection, ...";
    87128  DescriptionMap["output-file"] = "name of the output file";
    88129  DescriptionMap["periodic"] = "system is constraint to periodic boundary conditions (y/n)";
    89130  DescriptionMap["position"] = "position in R^3 space";
    90   DescriptionMap["start-mol"] = "first or start step";
     131  DescriptionMap["sphere-radius"] = "radius of tesselation sphere";
     132  DescriptionMap["start-step"] = "first or start step";
    91133
    92134  // short forms for the actions
     
    110152  ShortFormMap["linear-interpolate"] = "L";
    111153  ShortFormMap["nonconvex-envelope"] = "N";
    112   ShortFormMap["pair-correlation"] = "CE";
    113   ShortFormMap["pair-correlation-point"] = "CP";
    114   ShortFormMap["pair-correlation-surface"] = "CS";
     154  ShortFormMap["pair-correlation"] = "C";
    115155  ShortFormMap["parse-xyz"] = "p";
    116156  ShortFormMap["remove-atom"] = "r";
     
    123163  ShortFormMap["scale-box"] = "s";
    124164  ShortFormMap["set-basis"] = "M";
    125   ShortFormMap["subspace-dissect"] = "I";
    126   ShortFormMap["suspend-in-water"] = "U";
     165  ShortFormMap["subgraph-dissect"] = "I";
     166  ShortFormMap["suspend-in-water"] = "u";
    127167  ShortFormMap["translate-mol"] = "t";
    128168  ShortFormMap["verbose"] = "v";
     
    131171
    132172  // value types for the actions
    133   TypeMap["add-atom"] = Atom;
     173  TypeMap["add-atom"] = Element;
    134174  TypeMap["bond-file"] = String;
    135175  TypeMap["bond-table"] = String;
    136176  TypeMap["boundary"] = Vector;
    137   TypeMap["center-in-box"] = ListOfDoubles;
    138   TypeMap["change-box"] = ListOfDoubles;
    139   TypeMap["change-element"] = Element;
     177  TypeMap["center-in-box"] = Box;
     178  TypeMap["change-box"] = Box;
     179  TypeMap["change-element"] = Atom;
    140180  TypeMap["change-molname"] = String;
    141181  TypeMap["convex-envelope"] = Molecule;
     
    143183  TypeMap["depth-first-search"] = Double;
    144184  TypeMap["element-db"] = String;
    145   TypeMap["end-mol"] = Molecule;
    146185  TypeMap["fastparsing"] = Boolean;
    147186  TypeMap["fill-molecule"] = String;
     
    152191  TypeMap["nonconvex-envelope"] = Molecule;
    153192  TypeMap["parse-xyz"] = String;
    154   TypeMap["principal-axis-system"] = Axis;
     193  TypeMap["pair-correlation"] = String;
     194  TypeMap["principal-axis-system"] = Molecule;
    155195  TypeMap["remove-atom"] = Atom;
    156   TypeMap["remove-sphere"] = Atom;
     196  TypeMap["remove-sphere"] = Double;
    157197  TypeMap["repeat-box"] = Vector;
    158198  TypeMap["rotate-to-pas"] = Molecule;
     
    162202  TypeMap["scale-box"] = Vector;
    163203  TypeMap["set-basis"] = String;
    164   TypeMap["start-mol"] = Molecule;
    165   TypeMap["suspend-in-water"] = Molecule;
     204  TypeMap["subgraph-dissect"] = None;
     205  TypeMap["suspend-in-water"] = Double;
    166206  TypeMap["translate-mol"] = Vector;
    167207  TypeMap["verlet-integrate"] = String;
     
    169209
    170210  // value types for the values
     211  TypeMap["atom-by-id"] = Atom;
    171212  TypeMap["bin-output-file"] = String;
    172213  TypeMap["bin-end"] = Double;
    173214  TypeMap["bin-start"] = Double;
     215  TypeMap["bin-width"] = Double;
     216  TypeMap["convex-file"] = String;
    174217  TypeMap["distance"] = Double;
    175   TypeMap["distances"] = ListOfDoubles;
    176   TypeMap["elements"] = Element;
     218  TypeMap["distances"] = Vector;
     219  TypeMap["DoRotate"] = Boolean;
     220  TypeMap["element"] = Element;
    177221  TypeMap["elements"] = ListOfElements;
     222  TypeMap["end-step"] = Integer;
     223  TypeMap["id-mapping"] = Boolean;
    178224  TypeMap["length"] = Double;
    179   TypeMap["lengths"] = ListOfDoubles;
     225  TypeMap["lengths"] = Vector;
    180226  TypeMap["MaxDistance"] = Double;
    181227  TypeMap["molecule-by-id"] = Molecule;
     228  TypeMap["molecule-by-name"] = Molecule;
     229  TypeMap["nonconvex-file"] = String;
     230  TypeMap["order"] = Integer;
    182231  TypeMap["output-file"] = String;
    183232  TypeMap["periodic"] = Boolean;
    184233  TypeMap["position"] = Vector;
     234  TypeMap["sphere-radius"] = Double;
     235  TypeMap["start-step"] = Integer;
    185236
    186237  // default values for any action that needs one (always string!)
     238  DefaultValue["bin-width"] = "0.5";
     239  DefaultValue["fastparsing"] = "0";
     240  DefaultValue["atom-by-id"] = "-1";
    187241  DefaultValue["molecule-by-id"] = "-1";
     242  DefaultValue["periodic"] = "0";
    188243
    189244
    190245  // list of generic actions
    191 //      generic.insert("add-atom");
    192 //  generic.insert("bond-file");
    193 //      generic.insert("bond-table");
     246        generic.insert("add-atom");
     247  generic.insert("bond-file");
     248        generic.insert("bond-table");
    194249  generic.insert("boundary");
    195250//  generic.insert("bound-in-box");
     
    198253        generic.insert("change-box");
    199254//  generic.insert("change-molname");
    200 //      generic.insert("change-element");
    201 //  generic.insert("convex-envelope");
    202 //      generic.insert("default-molname");
    203 //      generic.insert("depth-first-search");
    204 //      generic.insert("element-db");
    205 //      generic.insert("fastparsing");
    206 //  generic.insert("fill-molecule");
    207 //  generic.insert("fragment-mol");
     255        generic.insert("change-element");
     256  generic.insert("convex-envelope");
     257        generic.insert("default-molname");
     258        generic.insert("depth-first-search");
     259        generic.insert("element-db");
     260        generic.insert("fastparsing");
     261  generic.insert("fill-molecule");
     262  generic.insert("fragment-mol");
    208263  generic.insert("help");
    209 //      generic.insert("linear-interpolate");
     264        generic.insert("linear-interpolate");
    210265//  generic.insert("molecular-volume");
    211 //  generic.insert("nonconvex-envelope");
    212 //      generic.insert("pair-correlation");
    213 //      generic.insert("pair-correlation-point");
    214 //      generic.insert("pair-correlation-surface");
     266  generic.insert("nonconvex-envelope");
     267        generic.insert("pair-correlation");
    215268//      generic.insert("parse-xyz");
    216269//  generic.insert("principal-axis-system");
    217 //  generic.insert("remove-atom");
    218 //  generic.insert("remove-sphere");
    219     generic.insert("repeat-box");
    220 //  generic.insert("rotate-to-pas");
    221 //      generic.insert("save-adjacency");
    222 //  generic.insert("save-bonds");
    223 //  generic.insert("save-temperature");
     270  generic.insert("remove-atom");
     271  generic.insert("remove-sphere");
     272  generic.insert("repeat-box");
     273  generic.insert("rotate-to-pas");
     274        generic.insert("save-adjacency");
     275  generic.insert("save-bonds");
     276  generic.insert("save-temperature");
    224277  generic.insert("scale-box");
    225 //  generic.insert("set-basis");
    226 //      generic.insert("subspace-dissect");
    227 //  generic.insert("suspend-in-water");
    228 //  generic.insert("translate-mol");
     278  generic.insert("set-basis");
     279        generic.insert("subgraph-dissect");
     280  generic.insert("suspend-in-water");
     281  generic.insert("translate-mol");
    229282        generic.insert("verbose");
    230 //  generic.insert("verlet-integrate");
     283  generic.insert("verlet-integrate");
    231284        generic.insert("version");
    232 //      // list of generic values
    233 //      generic.insert("bin-output-file");
    234 //  generic.insert("bin-end");
    235 //  generic.insert("bin-start");
    236 //  generic.insert("distance");
    237 //  generic.insert("distances");
    238 //  generic.insert("element");
    239 //  generic.insert("end-mol");
    240     generic.insert("input");
    241 //  generic.insert("length");
    242 //  generic.insert("lengths");
    243 //  generic.insert("MaxDistance");
    244 //  generic.insert("molecule-by-id");
    245 //  generic.insert("output-file");
    246 //  generic.insert("periodic");
    247 //  generic.insert("position");
    248 //  generic.insert("start-mol");
    249285
    250286    // positional arguments
    251     inputfile.insert("input");
     287  generic.insert("input");
     288  inputfile.insert("input");
     289
     290    // hidden arguments
     291  generic.insert("atom-by-id");
     292  generic.insert("bin-end");
     293  generic.insert("bin-output-file");
     294  generic.insert("bin-start");
     295  generic.insert("bin-width");
     296  generic.insert("convex-file");
     297  generic.insert("distance");
     298  generic.insert("DoRotate");
     299  generic.insert("distances");
     300  generic.insert("element");
     301  generic.insert("elements");
     302  generic.insert("end-step");
     303  generic.insert("id-mapping");
     304  generic.insert("lengths");
     305  generic.insert("MaxDistance");
     306  generic.insert("molecule-by-id");
     307  generic.insert("molecule-by-name");
     308  generic.insert("nonconvex-file");
     309  generic.insert("order");
     310  generic.insert("output-file");
     311  generic.insert("periodic");
     312  generic.insert("position");
     313  generic.insert("sphere-radius");
     314  generic.insert("start-step");
    252315}
    253316
     
    286349              ;
    287350            break;
     351          case Box:
     352            ListRunner->second->add_options()
     353              (getKeyAndShortForm(*OptionRunner).c_str(),
     354                  po::value<BoxValue>()->multitoken(),
     355                  getDescription(*OptionRunner).c_str())
     356              ;
     357            break;
    288358          case Integer:
    289359            ListRunner->second->add_options()
     
    339409            ListRunner->second->add_options()
    340410              (getKeyAndShortForm(*OptionRunner).c_str(),
    341                   po::value< vector<double> >()->multitoken(),
    342                   getDescription(*OptionRunner).c_str())
    343               ;
    344             break;
    345           case Box:
    346             ListRunner->second->add_options()
    347               (getKeyAndShortForm(*OptionRunner).c_str(),
    348                   po::value< vector<double> >(),
     411                  po::value<VectorValue>()->multitoken(),
    349412                  getDescription(*OptionRunner).c_str())
    350413              ;
     
    385448            ListRunner->second->add_options()
    386449              (getKeyAndShortForm(*OptionRunner).c_str(),
    387                   DefaultValue.find(*OptionRunner) != DefaultValue.end() ?
    388                         po::value< int >()->default_value(atoi(DefaultValue[*OptionRunner].c_str())) :
    389                         po::value< int >(),
     450                  po::value< vector<int> >(),
    390451                  getDescription(*OptionRunner).c_str())
    391452              ;
     
    497558}
    498559
     560/** Returns the inverse to MapOfActions::ShortFormMap, i.e. lookup actionname for its short form.
     561 * \return map from short form of action to name of action
     562 */
     563map <std::string, std::string> MapOfActions::getShortFormToActionMap()
     564{
     565  map <std::string, std::string> result;
     566
     567  for (map<std::string, std::string>::iterator iter = ShortFormMap.begin(); iter != ShortFormMap.end();  ++iter)
     568    result[iter->second] = iter->first;
     569
     570  return result;
     571}
    499572
    500573
Note: See TracChangeset for help on using the changeset viewer.