Ignore:
Timestamp:
Jul 7, 2010, 4:08:32 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:
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.
Message:

Merge branch 'stable' into StructureRefactoring

Conflicts:

src/Actions/WorldAction/CenterOnEdgeAction.cpp
src/Actions/WorldAction/ChangeBoxAction.cpp
src/Actions/WorldAction/RepeatBoxAction.cpp
src/Actions/WorldAction/ScaleBoxAction.cpp
src/World.cpp
src/boundary.cpp

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/MapOfActions.cpp

    r5630bd r4e10f5  
    6767#include "Actions/WorldAction/SetDefaultNameAction.hpp"
    6868#include "Actions/WorldAction/SetGaussianBasisAction.hpp"
     69#include "Actions/WorldAction/SetOutputFormatsAction.hpp"
    6970#include "Actions/Values.hpp"
    7071
     
    7273{
    7374  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;
    7698    throw boost::program_options::validation_error("Specified vector does not have three components");
    7799  }
    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));
    81103  v = boost::any(VectorValue(VV));
    82104}
     
    85107{
    86108  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;
    89132    throw boost::program_options::validation_error("Specified symmetric box matrix does not have six components");
    90133  }
    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));
    97140  v = boost::any(BoxValue(BV));
    98141}
     
    130173  DescriptionMap["input"] = "specify input files";
    131174  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";
    132176  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";
    135179  DescriptionMap["pair-correlation"] = "pair correlation analysis between two elements, element and point or element and surface";
    136180  DescriptionMap["parse-xyz"] = "parse xyz file into World";
     
    140184  DescriptionMap["repeat-box"] = "create periodic copies of the simulation box per axis";
    141185  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";
    143186  DescriptionMap["save-adjacency"] = "name of the adjacency file to write to";
    144187  DescriptionMap["save-bonds"] = "name of the bonds file to write to";
     
    146189  DescriptionMap["SaveXyz"] = "save world as xyz file";
    147190  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";
    148193  DescriptionMap["subgraph-dissect"] = "dissect the molecular system into molecules representing disconnected subgraphs";
    149194  DescriptionMap["suspend-in-water"] = "suspend the given molecule in water such that in the domain the mean density is as specified";
     
    189234  ShortFormMap["center-in-box"] = "b";
    190235  ShortFormMap["change-element"] = "E";
    191   ShortFormMap["convex-envelope"] = "o";
     236//  ShortFormMap["convex-envelope"] = "x";
    192237  ShortFormMap["default-molname"] = "X";
    193238  ShortFormMap["depth-first-search"] = "D";
     
    200245  ShortFormMap["linear-interpolate"] = "L";
    201246  ShortFormMap["nonconvex-envelope"] = "N";
     247//  ShortFormMap["output"] = "o";
    202248  ShortFormMap["pair-correlation"] = "C";
    203249  ShortFormMap["parse-xyz"] = "p";
     
    211257  ShortFormMap["scale-box"] = "s";
    212258  ShortFormMap["set-basis"] = "M";
     259  ShortFormMap["set-output"] = "o";
    213260  ShortFormMap["subgraph-dissect"] = "I";
    214261  ShortFormMap["suspend-in-water"] = "u";
     
    238285  TypeMap["molecular-volume"] = Molecule;
    239286  TypeMap["nonconvex-envelope"] = Molecule;
    240   TypeMap["output"] = String;
     287  TypeMap["output"] = None;
    241288  TypeMap["parse-xyz"] = String;
    242289  TypeMap["pair-correlation"] = String;
     
    251298  TypeMap["scale-box"] = Vector;
    252299  TypeMap["set-basis"] = String;
     300  TypeMap["set-output"] = ListOfString;
    253301  TypeMap["subgraph-dissect"] = None;
    254302  TypeMap["suspend-in-water"] = Double;
     
    349397  MenuContainsActionMap.insert( pair<std::string, std::string> ("world", "default-molname") );
    350398  MenuContainsActionMap.insert( pair<std::string, std::string> ("world", "set-basis") );
     399  MenuContainsActionMap.insert( pair<std::string, std::string> ("world", "set-output") );
    351400
    352401  // put actions into command line category
     
    386435  generic.insert("scale-box");
    387436  generic.insert("set-basis");
     437  generic.insert("set-output");
    388438        generic.insert("subgraph-dissect");
    389439  generic.insert("suspend-in-water");
     
    484534  new WorldSetDefaultNameAction();
    485535  new WorldSetGaussianBasisAction();
     536  new WorldSetOutputFormatsAction();
    486537}
    487538
     
    561612              ;
    562613            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;
    563621          case Axis:
    564622            ListRunner->second->add_options()
     
    573631            ListRunner->second->add_options()
    574632              (getKeyAndShortForm(*OptionRunner).c_str(),
    575                   po::value<VectorValue>()->multitoken(),
     633                  po::value<VectorValue>(),
    576634                  getDescription(*OptionRunner).c_str())
    577635              ;
Note: See TracChangeset for help on using the changeset viewer.