Changeset e6317b for src/Actions


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, Candidate_v1.7.0, 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

Location:
src/Actions
Files:
1 added
4 deleted
34 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/ActionRegistry.cpp

    rf8e486 re6317b  
    3939}
    4040
     41bool ActionRegistry::isActionByNamePresent(const std::string name){
     42  map<const string,Action*>::iterator iter;
     43  iter = actionMap.find(name);
     44  return iter!=actionMap.end();
     45}
     46
    4147void ActionRegistry::registerAction(Action* action){
    4248  pair<map<const string,Action*>::iterator,bool> ret;
  • src/Actions/ActionRegistry.hpp

    rf8e486 re6317b  
    2121public:
    2222  Action* getActionByName(const std::string);
     23  bool isActionByNamePresent(const std::string name);
    2324  void registerAction(Action*);
    2425  void unregisterAction(Action*);
  • src/Actions/AnalysisAction/MolecularVolumeAction.cpp

    rf8e486 re6317b  
    99
    1010#include "Actions/AnalysisAction/MolecularVolumeAction.hpp"
    11 #include "CommandLineParser.hpp"
    1211#include "boundary.hpp"
    1312#include "config.hpp"
  • src/Actions/AnalysisAction/PairCorrelationAction.cpp

    rf8e486 re6317b  
    99
    1010#include "Actions/AnalysisAction/PairCorrelationAction.hpp"
    11 #include "CommandLineParser.hpp"
    1211#include "analysis_correlation.hpp"
     12#include "boundary.hpp"
     13#include "linkedcell.hpp"
    1314#include "log.hpp"
    1415#include "element.hpp"
     16#include "molecule.hpp"
    1517#include "periodentafel.hpp"
     18#include "vector.hpp"
    1619#include "World.hpp"
    1720
     
    3740  Dialog *dialog = UIFactory::getInstance().makeDialog();
    3841  int ranges[3] = {1, 1, 1};
     42  double BinEnd = 0.;
    3943  double BinStart = 0.;
    40   double BinEnd = 0.;
     44  double BinWidth = 0.;
     45  molecule *Boundary = NULL;
    4146  string outputname;
    4247  string binoutputname;
     
    4449  ofstream output;
    4550  ofstream binoutput;
    46   const element *elemental1;
    47   const element *elemental2;
     51  std::vector< element *> elements;
     52  string type;
     53  Vector Point;
     54  BinPairMap *binmap = NULL;
     55  MoleculeListClass *molecules = World::getInstance().getMolecules();
    4856
    49   dialog->queryElement("elements", &elemental1, MapOfActions::getInstance().getDescription("elements"));
    50   dialog->queryElement("elements", &elemental2, MapOfActions::getInstance().getDescription("elements"));
     57  // first dialog: Obtain which type of correlation
     58  dialog->queryString(NAME, &type, MapOfActions::getInstance().getDescription(NAME));
     59  if(dialog->display()) {
     60    delete dialog;
     61  } else {
     62    delete dialog;
     63    return Action::failure;
     64  }
     65
     66  // second dialog: Obtain parameters specific to this type
     67  dialog = UIFactory::getInstance().makeDialog();
     68  if (type == "P")
     69    dialog->queryVector("position", &Point, World::getInstance().getDomain(), false, MapOfActions::getInstance().getDescription("position"));
     70  if (type == "S")
     71    dialog->queryMolecule("molecule-by-id", &Boundary, MapOfActions::getInstance().getDescription("molecule-by-id"));
     72  dialog->queryElement("elements", &elements, MapOfActions::getInstance().getDescription("elements"));
    5173  dialog->queryDouble("bin-start", &BinStart, MapOfActions::getInstance().getDescription("bin-start"));
     74  dialog->queryDouble("bin-width", &BinWidth, MapOfActions::getInstance().getDescription("bin-width"));
    5275  dialog->queryDouble("bin-end", &BinEnd, MapOfActions::getInstance().getDescription("bin-end"));
    5376  dialog->queryString("output-file", &outputname, MapOfActions::getInstance().getDescription("output-file"));
     
    5982    binoutput.open(binoutputname.c_str());
    6083    PairCorrelationMap *correlationmap = NULL;
    61     if (periodic)
    62       correlationmap = PeriodicPairCorrelation(World::getInstance().getMolecules(), elemental1, elemental2, ranges);
    63     else
    64       correlationmap = PairCorrelation(World::getInstance().getMolecules(), elemental1, elemental2);
    65     //OutputCorrelationToSurface(&output, correlationmap);
    66     BinPairMap *binmap = BinData( correlationmap, 0.5, BinStart, BinEnd );
     84    if (type == "E") {
     85      PairCorrelationMap *correlationmap = NULL;
     86      if (periodic)
     87        correlationmap = PeriodicPairCorrelation(World::getInstance().getMolecules(), elements, ranges);
     88      else
     89        correlationmap = PairCorrelation(World::getInstance().getMolecules(), elements);
     90      //OutputCorrelationToSurface(&output, correlationmap);
     91      binmap = BinData( correlationmap, BinWidth, BinStart, BinEnd );
     92    } else if (type == "P")  {
     93      cout << "Point to correlate to is  " << Point << endl;
     94      CorrelationToPointMap *correlationmap = NULL;
     95      if (periodic)
     96        correlationmap  = PeriodicCorrelationToPoint(molecules, elements, &Point, ranges);
     97      else
     98        correlationmap = CorrelationToPoint(molecules, elements, &Point);
     99      //OutputCorrelationToSurface(&output, correlationmap);
     100      binmap = BinData( correlationmap, BinWidth, BinStart, BinEnd );
     101    } else if (type == "S") {
     102      ASSERT(Boundary != NULL, "No molecule specified for SurfaceCorrelation.");
     103      const double radius = 4.;
     104      double LCWidth = 20.;
     105      if (BinEnd > 0) {
     106        if (BinEnd > 2.*radius)
     107            LCWidth = BinEnd;
     108        else
     109          LCWidth = 2.*radius;
     110      }
     111
     112      // get the boundary
     113      class Tesselation *TesselStruct = NULL;
     114      const LinkedCell *LCList = NULL;
     115      // find biggest molecule
     116      int counter  = molecules->ListOfMolecules.size();
     117      bool *Actives = new bool[counter];
     118      counter = 0;
     119      for (MoleculeList::iterator BigFinder = molecules->ListOfMolecules.begin(); BigFinder != molecules->ListOfMolecules.end(); BigFinder++) {
     120        Actives[counter++] = (*BigFinder)->ActiveFlag;
     121        (*BigFinder)->ActiveFlag = (*BigFinder == Boundary) ? false : true;
     122      }
     123      LCList = new LinkedCell(Boundary, LCWidth);
     124      FindNonConvexBorder(Boundary, TesselStruct, LCList, radius, NULL);
     125      CorrelationToSurfaceMap *surfacemap = NULL;
     126      if (periodic)
     127        surfacemap = PeriodicCorrelationToSurface( molecules, elements, TesselStruct, LCList, ranges);
     128      else
     129        surfacemap = CorrelationToSurface( molecules, elements, TesselStruct, LCList);
     130      OutputCorrelationToSurface(&output, surfacemap);
     131      // check whether radius was appropriate
     132      {
     133        double start; double end;
     134        GetMinMax( surfacemap, start, end);
     135        if (LCWidth < end)
     136          DoeLog(1) && (eLog()<< Verbose(1) << "Linked Cell width is smaller than the found range of values! Bins can only be correct up to: " << radius << "." << endl);
     137      }
     138      binmap = BinData( surfacemap, BinWidth, BinStart, BinEnd );
     139    } else
     140      return Action::failure;
    67141    OutputCorrelation ( &binoutput, binmap );
    68142    output.close();
  • src/Actions/AnalysisAction/PrincipalAxisSystemAction.cpp

    rf8e486 re6317b  
    99
    1010#include "Actions/AnalysisAction/PrincipalAxisSystemAction.hpp"
    11 #include "CommandLineParser.hpp"
    1211#include "molecule.hpp"
    1312#include "log.hpp"
  • src/Actions/AtomAction/AddAction.cpp

    rf8e486 re6317b  
    99
    1010#include "Actions/AtomAction/AddAction.hpp"
    11 #include "CommandLineParser.hpp"
    1211#include "atom.hpp"
    1312#include "element.hpp"
    1413#include "log.hpp"
    15 #include "periodentafel.hpp"
     14#include "molecule.hpp"
    1615#include "vector.hpp"
    1716#include "verbose.hpp"
     
    3837Action::state_ptr AtomAddAction::performCall() {
    3938  Dialog *dialog = UIFactory::getInstance().makeDialog();
    40   int Z = -1;
     39  std::vector<element *> elements;
    4140  Vector position;
    4241
    43   dialog->queryInt(NAME, &Z, MapOfActions::getInstance().getDescription(NAME));
     42  dialog->queryElement(NAME, &elements, MapOfActions::getInstance().getDescription(NAME));
    4443  dialog->queryVector("position", &position, World::getInstance().getDomain(), true, MapOfActions::getInstance().getDescription("position"));
     44  cout << "pre-dialog" << endl;
    4545
    4646  if(dialog->display()) {
     47    cout << "post-dialog" << endl;
    4748    delete dialog;
    48     atom * first = World::getInstance().createAtom();
    49     first->type = World::getInstance().getPeriode()->FindElement(Z);
    50     first->x = position;
    51     if (first->type != NULL) {
     49    if (elements.size() == 1) {
     50      atom * first = World::getInstance().createAtom();
     51      first->type = *(elements.begin());
     52      first->x = position;
    5253      DoLog(1) && (Log() << Verbose(1) << "Adding new atom with element " << first->type->name << " at " << (first->x) << "." << endl);
     54      // TODO: remove when all of World's atoms are stored.
     55      std::vector<molecule *> molecules = World::getInstance().getAllMolecules();
     56      if (!molecules.empty()) {
     57        std::vector<molecule *>::iterator iter = molecules.begin();
     58        (*iter)->AddAtom(first);
     59      }
    5360      return Action::success;
    5461    } else {
    5562      DoeLog(1) && (eLog()<< Verbose(1) << "Could not find the specified element." << endl);
    56       World::getInstance().destroyAtom(first);
    5763      return Action::failure;
    5864    }
  • src/Actions/AtomAction/ChangeElementAction.cpp

    rf8e486 re6317b  
    99
    1010#include "Actions/AtomAction/ChangeElementAction.hpp"
    11 #include "CommandLineParser.hpp"
    1211#include "atom.hpp"
    1312#include "log.hpp"
     
    3635Action::state_ptr AtomChangeElementAction::performCall() {
    3736  Dialog *dialog = UIFactory::getInstance().makeDialog();
    38   int Z = -1;
    3937  atom *first = NULL;
    40   element *elemental = NULL;
     38  std::vector<element *> elements;
    4139
    42   dialog->queryElement(NAME, (const element **) &elemental, MapOfActions::getInstance().getDescription(NAME));
    43   dialog->queryAtom("atom-by-id", &first, MapOfActions::getInstance().getDescription("atom-by-id"));
     40  dialog->queryAtom(NAME, &first, MapOfActions::getInstance().getDescription(NAME));
     41  dialog->queryElement("element", &elements, MapOfActions::getInstance().getDescription("element"));
    4442
    4543  if(dialog->display()) {
    4644    delete dialog;
    47     DoLog(1) && (Log() << Verbose(1) << "Changing atom " << *first << " to element " << elemental << "." << endl);
    48     if (elemental != NULL) {
    49       first->type = elemental;
     45    ASSERT(elements.size() == 1, "Unequal to one element specified when changing an atom's element");
     46    ASSERT(first != NULL, "No valid atom specified");
     47    DoLog(1) && (Log() << Verbose(1) << "Changing atom " << *first << " to element " << elements.at(0) << "." << endl);
     48    if (elements.at(0) != NULL) {
     49      first->type = elements.at(0);
    5050      return Action::success;
    5151    } else
  • src/Actions/AtomAction/RemoveAction.cpp

    rf8e486 re6317b  
    99
    1010#include "Actions/AtomAction/RemoveAction.hpp"
    11 #include "CommandLineParser.hpp"
    1211#include "atom.hpp"
    1312#include "Descriptors/AtomDescriptor.hpp"
    1413#include "log.hpp"
     14#include "molecule.hpp"
    1515#include "verbose.hpp"
    1616#include "World.hpp"
     
    4343    delete dialog;
    4444    DoLog(1) && (Log() << Verbose(1) << "Removing atom " << first->getId() << "." << endl);
     45    // TODO: this is not necessary when atoms and their storing to file are handled by the World
     46    // simply try to erase in every molecule found
     47    std::vector<molecule *> molecules = World::getInstance().getAllMolecules();
     48    for (std::vector<molecule *>::iterator iter = molecules.begin();iter != molecules.end(); ++iter) {
     49      (*iter)->erase(first);
     50    }
    4551    World::getInstance().destroyAtom(first);
    4652    return Action::success;
  • src/Actions/CmdAction/BondLengthTableAction.cpp

    rf8e486 re6317b  
    99
    1010#include "Actions/CmdAction/BondLengthTableAction.hpp"
    11 #include "CommandLineParser.hpp"
    1211#include "config.hpp"
    1312#include "log.hpp"
     
    4241
    4342  if(dialog->display()) {
     43    DoLog(0) && (Log() << Verbose(0) << "Using " << BondGraphFileName << " as bond length table." << endl);
    4444    delete dialog;
    4545  } else {
    4646    delete dialog;
     47    return Action::failure;
    4748  }
    4849
  • src/Actions/CmdAction/ElementDbAction.cpp

    rf8e486 re6317b  
    99
    1010#include "Actions/CmdAction/ElementDbAction.hpp"
    11 #include "CommandLineParser.hpp"
    1211#include "config.hpp"
    1312#include "log.hpp"
     
    4342  config *configuration = World::getInstance().getConfig();
    4443  dialog->queryString(NAME, &databasepath, MapOfActions::getInstance().getDescription(NAME));
    45   strcpy(configuration->databasepath, databasepath.c_str());
    4644
    4745  if(dialog->display()) {
     46    strcpy(configuration->databasepath, databasepath.c_str());
    4847    delete dialog;
    4948  } else {
    5049    delete dialog;
     50    return Action::failure;
    5151  }
    5252
  • src/Actions/CmdAction/FastParsingAction.cpp

    rf8e486 re6317b  
    99
    1010#include "Actions/CmdAction/FastParsingAction.hpp"
    11 #include "CommandLineParser.hpp"
    1211#include "config.hpp"
    1312#include "log.hpp"
  • src/Actions/CmdAction/VerboseAction.cpp

    rf8e486 re6317b  
    99
    1010#include "Actions/CmdAction/VerboseAction.hpp"
    11 #include "CommandLineParser.hpp"
    1211#include "log.hpp"
    1312#include "verbose.hpp"
  • src/Actions/CmdAction/VersionAction.cpp

    rf8e486 re6317b  
    99
    1010#include "Actions/CmdAction/VersionAction.hpp"
    11 #include "CommandLineParser.hpp"
    1211
    1312#include <iostream>
  • src/Actions/FragmentationAction/DepthFirstSearchAction.cpp

    rf8e486 re6317b  
    99
    1010#include "Actions/FragmentationAction/DepthFirstSearchAction.hpp"
    11 #include "CommandLineParser.hpp"
    1211#include "atom.hpp"
    1312#include "config.hpp"
  • src/Actions/FragmentationAction/FragmentationAction.cpp

    rf8e486 re6317b  
    99
    1010#include "Actions/FragmentationAction/FragmentationAction.hpp"
    11 #include "CommandLineParser.hpp"
    1211#include "atom.hpp"
    1312#include "config.hpp"
     
    2726#include "Actions/MapOfActions.hpp"
    2827
    29 const char FragmentationFragmentationAction::NAME[] = "subspace-dissect";
     28const char FragmentationFragmentationAction::NAME[] = "fragment-mol";
    3029
    3130FragmentationFragmentationAction::FragmentationFragmentationAction() :
     
    3837Action::state_ptr FragmentationFragmentationAction::performCall() {
    3938  Dialog *dialog = UIFactory::getInstance().makeDialog();
     39  clock_t start,end;
     40  molecule *mol = NULL;
     41  double distance = -1.;
     42  int order = 0;
     43  config *configuration = World::getInstance().getConfig();
     44  int ExitFlag = 0;
    4045
    41   dialog->queryEmpty(NAME, MapOfActions::getInstance().getDescription(NAME));
     46  cout << "pre-dialog"<< endl;
     47  dialog->queryMolecule(NAME, &mol, MapOfActions::getInstance().getDescription(NAME));
     48  dialog->queryDouble("distance", &distance, MapOfActions::getInstance().getDescription("distance"));
     49  dialog->queryInt("order", &order, MapOfActions::getInstance().getDescription("order"));
    4250
    4351  if(dialog->display()) {
     52    cout << "POST-dialog"<< endl;
     53    ASSERT(mol != NULL, "No molecule has been picked for fragmentation.");
     54    DoLog(0) && (Log() << Verbose(0) << "Fragmenting molecule with bond distance " << distance << " angstroem, order of " << order << "." << endl);
     55    DoLog(0) && (Log() << Verbose(0) << "Creating connection matrix..." << endl);
     56    start = clock();
     57    mol->CreateAdjacencyList(distance, configuration->GetIsAngstroem(), &BondGraph::CovalentMinMaxDistance, NULL);
     58    DoLog(0) && (Log() << Verbose(0) << "Fragmenting molecule with current connection matrix ..." << endl);
     59    if (mol->hasBondStructure()) {
     60      ExitFlag = mol->FragmentMolecule(order, configuration);
     61    }
     62    World::getInstance().setExitFlag(ExitFlag);
     63    end = clock();
     64    DoLog(0) && (Log() << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl);
    4465    delete dialog;
    4566    return Action::success;
  • src/Actions/FragmentationAction/SubgraphDissectionAction.cpp

    rf8e486 re6317b  
    99
    1010#include "Actions/FragmentationAction/SubgraphDissectionAction.hpp"
    11 #include "CommandLineParser.hpp"
    1211#include "atom.hpp"
    1312#include "config.hpp"
     
    2726#include "Actions/MapOfActions.hpp"
    2827
    29 const char FragmentationSubgraphDissectionAction::NAME[] = "subspace-dissect";
     28const char FragmentationSubgraphDissectionAction::NAME[] = "subgraph-dissect";
    3029
    3130FragmentationSubgraphDissectionAction::FragmentationSubgraphDissectionAction() :
     
    4241
    4342  if(dialog->display()) {
     43    DoLog(1) && (Log() << Verbose(1) << "Dissecting molecular system into a set of disconnected subgraphs ... " << endl);
     44    // @TODO rather do the dissection afterwards
     45    MoleculeListClass *molecules = World::getInstance().getMolecules();
     46    molecules->DissectMoleculeIntoConnectedSubgraphs(World::getInstance().getPeriode(), World::getInstance().getConfig());
    4447    delete dialog;
    4548    return Action::success;
  • src/Actions/Makefile.am

    rf8e486 re6317b  
    3030  ${TESSELATIONACTIONHEADER} \
    3131  ${WORLDACTIONHEADER} \
    32   MapOfActions.hpp
     32  MapOfActions.hpp \
     33  Values.hpp
    3334 
    3435ANALYSISACTIONSOURCE = \
    3536  AnalysisAction/MolecularVolumeAction.cpp \
    3637  AnalysisAction/PairCorrelationAction.cpp \
    37   AnalysisAction/PairCorrelationToPointAction.cpp \
    38   AnalysisAction/PairCorrelationToSurfaceAction.cpp \
    3938  AnalysisAction/PrincipalAxisSystemAction.cpp
    4039ANALYSISACTIONHEADER = \
    4140  AnalysisAction/MolecularVolumeAction.hpp \
    4241  AnalysisAction/PairCorrelationAction.hpp \
    43   AnalysisAction/PairCorrelationToPointAction.hpp \
    44   AnalysisAction/PairCorrelationToSurfaceAction.hpp \
    4542  AnalysisAction/PrincipalAxisSystemAction.hpp
    4643
  • 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
  • src/Actions/MapOfActions.hpp

    rf8e486 re6317b  
    3030  std::string getKeyAndShortForm(string actionname);
    3131  std::string getShortForm(string actionname);
     32  map <std::string, std::string> getShortFormToActionMap();
    3233
    3334  void AddOptionsToParser();
  • src/Actions/MoleculeAction/FillWithMoleculeAction.cpp

    rf8e486 re6317b  
    6868
    6969  if(dialog->display()) {
     70    DoLog(1) && (Log() << Verbose(1) << "Filling Box with water molecules, lengths(" << lengths[0] << "," << lengths[1] << "," << lengths[2] << "), distances (" << distances[0] << "," << distances[1] << "," << distances[2] << "), MaxDistance " << MaxDistance << ", DoRotate " << DoRotate << "." << endl);
    7071    // construct water molecule
    7172    molecule *filler = World::getInstance().createMolecule();
    72 //    if (!filler->AddXYZFile(filename)) {
    73 //      DoeLog(0) && (eLog()<< Verbose(0) << "Could not parse filler molecule from " << filename << "." << endl);
    74 //    }
    75 //    filler->SetNameFromFilename(filename);
     73    if (!filler->AddXYZFile(filename)) {
     74      DoeLog(0) && (eLog()<< Verbose(0) << "Could not parse filler molecule from " << filename << "." << endl);
     75    }
     76    filler->SetNameFromFilename(filename.c_str());
    7677    molecule *Filling = NULL;
    77     atom *first = NULL, *second = NULL, *third = NULL;
    78     first = World::getInstance().createAtom();
    79     first->type = World::getInstance().getPeriode()->FindElement(1);
    80     first->x = Vector(0.441, -0.143, 0.);
    81     filler->AddAtom(first);
    82     second = World::getInstance().createAtom();
    83     second->type = World::getInstance().getPeriode()->FindElement(1);
    84     second->x = Vector(-0.464, 1.137, 0.0);
    85     filler->AddAtom(second);
    86     third = World::getInstance().createAtom();
    87     third->type = World::getInstance().getPeriode()->FindElement(8);
    88     third->x = Vector(-0.464, 0.177, 0.);
    89     filler->AddAtom(third);
    90     filler->AddBond(first, third, 1);
    91     filler->AddBond(second, third, 1);
     78//    atom *first = NULL, *second = NULL, *third = NULL;
     79//    first = World::getInstance().createAtom();
     80//    first->type = World::getInstance().getPeriode()->FindElement(1);
     81//    first->x = Vector(0.441, -0.143, 0.);
     82//    filler->AddAtom(first);
     83//    second = World::getInstance().createAtom();
     84//    second->type = World::getInstance().getPeriode()->FindElement(1);
     85//    second->x = Vector(-0.464, 1.137, 0.0);
     86//    filler->AddAtom(second);
     87//    third = World::getInstance().createAtom();
     88//    third->type = World::getInstance().getPeriode()->FindElement(8);
     89//    third->x = Vector(-0.464, 0.177, 0.);
     90//    filler->AddAtom(third);
     91//    filler->AddBond(first, third, 1);
     92//    filler->AddBond(second, third, 1);
    9293    World::getInstance().getConfig()->BG->ConstructBondGraph(filler);
    93     filler->SetNameFromFilename("water");
     94//    filler->SetNameFromFilename("water");
    9495    // call routine
    9596    double distance[NDIM];
  • src/Actions/MoleculeAction/LinearInterpolationofTrajectoriesAction.cpp

    rf8e486 re6317b  
    6060
    6161  dialog->queryString(NAME, &filename, MapOfActions::getInstance().getDescription(NAME));
    62   dialog->queryInt("start-mol", &start, MapOfActions::getInstance().getDescription("start"));
    63   dialog->queryInt("end-mol", &start, MapOfActions::getInstance().getDescription("end"));
     62  dialog->queryInt("start-step", &start, MapOfActions::getInstance().getDescription("start-step"));
     63  dialog->queryInt("end-step", &end, MapOfActions::getInstance().getDescription("end-step"));
    6464  dialog->queryMolecule("molecule-by-id", &mol, MapOfActions::getInstance().getDescription("molecule-by-id"));
    6565  dialog->queryBoolean("id-mapping", &IdMapping, MapOfActions::getInstance().getDescription("id-mapping"));
  • src/Actions/MoleculeAction/TranslateAction.cpp

    rf8e486 re6317b  
    5858  dialog->queryMolecule("molecule-by-id", &mol, MapOfActions::getInstance().getDescription("molecule-by-id"));
    5959  dialog->queryBoolean("periodic", &periodic, MapOfActions::getInstance().getDescription("periodic"));
     60  cout << "pre-dialog" << endl;
    6061
    6162  if(dialog->display()) {
     63    cout << "post-dialog" << endl;
    6264    DoLog(1) && (Log() << Verbose(1) << "Translating all ions by given vector." << endl);
    6365    if (periodic)
  • src/Actions/TesselationAction/ConvexEnvelopeAction.cpp

    rf8e486 re6317b  
    2121#include "atom.hpp"
    2222#include "boundary.hpp"
     23#include "config.hpp"
    2324#include "linkedcell.hpp"
    2425#include "log.hpp"
     
    5657  molecule * mol = NULL;
    5758  bool Success = false;
     59  config *configuration = World::getInstance().getConfig();
    5860
    5961  dialog->queryMolecule(NAME, &mol, MapOfActions::getInstance().getDescription(NAME));
    60   dialog->queryString("output", &filenameConvex, MapOfActions::getInstance().getDescription("output"));
    61   dialog->queryString("output", &filenameNonConvex, MapOfActions::getInstance().getDescription("output"));
     62  dialog->queryString("convex-file", &filenameConvex, MapOfActions::getInstance().getDescription("convex-file"));
     63  dialog->queryString("nonconvex-file", &filenameNonConvex, MapOfActions::getInstance().getDescription("nonconvex-file"));
    6264
    6365  if(dialog->display()) {
     
    7274    FindNonConvexBorder(mol, TesselStruct, LCList, 50., filenameNonConvex.c_str());
    7375    //RemoveAllBoundaryPoints(TesselStruct, mol, argv[argptr]);
    74     ConvexizeNonconvexEnvelope(TesselStruct, mol, filenameConvex.c_str());
     76    const double volumedifference = ConvexizeNonconvexEnvelope(TesselStruct, mol, filenameConvex.c_str());
     77    const double clustervolume = VolumeOfConvexEnvelope(TesselStruct, configuration);
     78    DoLog(0) && (Log() << Verbose(0) << "The tesselated volume area is " << clustervolume << " " << (configuration->GetIsAngstroem() ? "angstrom" : "atomiclength") << "^3." << endl);
     79    DoLog(0) && (Log() << Verbose(0) << "The non-convex tesselated volume area is " << clustervolume-volumedifference << " " << (configuration->GetIsAngstroem() ? "angstrom" : "atomiclength") << "^3." << endl);
    7580    delete(TesselStruct);
    7681    delete(LCList);
  • src/Actions/TesselationAction/NonConvexEnvelopeAction.cpp

    rf8e486 re6317b  
    5858  clock_t start,end;
    5959
    60   dialog->queryDouble(NAME, &SphereRadius, MapOfActions::getInstance().getDescription(NAME));
    61   dialog->queryString("output", &filename, MapOfActions::getInstance().getDescription("output"));
    62   dialog->queryMolecule("molecule-by-id", &Boundary, MapOfActions::getInstance().getDescription("molecule-by-id"));
     60  dialog->queryMolecule(NAME, &Boundary, MapOfActions::getInstance().getDescription(NAME));
     61  dialog->queryString("nonconvex-file", &filename, MapOfActions::getInstance().getDescription("nonconvex-file"));
     62  dialog->queryDouble("sphere-radius", &SphereRadius, MapOfActions::getInstance().getDescription("sphere-radius"));
    6363
    6464  if(dialog->display()) {
  • src/Actions/WorldAction/AddEmptyBoundaryAction.cpp

    rf8e486 re6317b  
    99
    1010#include "Actions/WorldAction/AddEmptyBoundaryAction.hpp"
    11 #include "CommandLineParser.hpp"
    1211#include "atom.hpp"
    1312#include "log.hpp"
  • src/Actions/WorldAction/BoundInBoxAction.cpp

    rf8e486 re6317b  
    99
    1010#include "Actions/WorldAction/BoundInBoxAction.hpp"
    11 #include "CommandLineParser.hpp"
    1211#include "log.hpp"
    1312#include "molecule.hpp"
  • src/Actions/WorldAction/CenterInBoxAction.cpp

    rf8e486 re6317b  
    99
    1010#include "Actions/WorldAction/CenterInBoxAction.hpp"
    11 #include "CommandLineParser.hpp"
    1211#include "log.hpp"
    1312#include "molecule.hpp"
  • src/Actions/WorldAction/CenterOnEdgeAction.cpp

    rf8e486 re6317b  
    99
    1010#include "Actions/WorldAction/CenterOnEdgeAction.hpp"
    11 #include "CommandLineParser.hpp"
    1211#include "atom.hpp"
    1312#include "log.hpp"
  • src/Actions/WorldAction/ChangeBoxAction.cpp

    rf8e486 re6317b  
    99
    1010#include "Actions/WorldAction/ChangeBoxAction.hpp"
    11 #include "CommandLineParser.hpp"
    1211#include "log.hpp"
    1312#include "verbose.hpp"
  • src/Actions/WorldAction/RemoveSphereOfAtomsAction.cpp

    rf8e486 re6317b  
    99
    1010#include "Actions/WorldAction/RemoveSphereOfAtomsAction.hpp"
    11 #include "CommandLineParser.hpp"
    1211#include "atom.hpp"
    1312#include "Descriptors/AtomDescriptor.hpp"
    1413#include "log.hpp"
     14#include "molecule.hpp"
    1515#include "vector.hpp"
    1616#include "verbose.hpp"
     
    3838  Dialog *dialog = UIFactory::getInstance().makeDialog();
    3939  double radius = 0.;
    40   atom *first = NULL;
     40  Vector point;
    4141
    4242  dialog->queryDouble(NAME, &radius, MapOfActions::getInstance().getDescription(NAME));
    43   dialog->queryAtom("atom-by-id", &first, MapOfActions::getInstance().getDescription("atom-by-id"));
     43  dialog->queryVector("position", &point, World::getInstance().getDomain(), false, MapOfActions::getInstance().getDescription("position"));
    4444
    4545  if(dialog->display()) {
    4646    delete dialog;
    47     DoLog(1) && (Log() << Verbose(1) << "Removing atoms around " << first->nr << " with radius " << radius << "." << endl);
     47    DoLog(1) && (Log() << Verbose(1) << "Removing atoms around " << point << " with radius " << radius << "." << endl);
    4848    vector<atom*> AllAtoms = World::getInstance().getAllAtoms();
    49     vector<atom*>::iterator AtomAdvancer = AllAtoms.begin();
    50     for (vector<atom*>::iterator AtomRunner = AtomAdvancer; AtomRunner != AllAtoms.end(); ) {
    51       ++AtomAdvancer;
    52       if (first != *AtomRunner) // dont't destroy reference ...
    53         if (first->x.DistanceSquared((*AtomRunner)->x) > radius*radius) // distance to first above radius ...
    54           World::getInstance().destroyAtom(*AtomRunner);
     49    vector<molecule *> molecules = World::getInstance().getAllMolecules();
     50    for (vector<atom*>::iterator AtomRunner = AllAtoms.begin(); AtomRunner != AllAtoms.end(); ++AtomRunner) {
     51      if (point.DistanceSquared((*AtomRunner)->x) > radius*radius) { // distance to first above radius ...
     52        // TODO: This is not necessary anymore when atoms are completely handled by World (create/destroy and load/save)
     53        for (vector<molecule *>::iterator iter = molecules.begin();iter != molecules.end();++iter)
     54          (*iter)->erase(*AtomRunner);
     55        World::getInstance().destroyAtom(*AtomRunner);
     56      }
    5557    }
    56     World::getInstance().destroyAtom(first);
    5758    return Action::success;
    5859  } else {
  • src/Actions/WorldAction/RepeatBoxAction.cpp

    rf8e486 re6317b  
    99
    1010#include "Actions/WorldAction/RepeatBoxAction.hpp"
    11 #include "CommandLineParser.hpp"
    1211#include "atom.hpp"
    1312#include "log.hpp"
  • src/Actions/WorldAction/ScaleBoxAction.cpp

    rf8e486 re6317b  
    99
    1010#include "Actions/WorldAction/ScaleBoxAction.hpp"
    11 #include "CommandLineParser.hpp"
    1211#include "atom.hpp"
    1312#include "log.hpp"
  • src/Actions/WorldAction/SetDefaultNameAction.cpp

    rf8e486 re6317b  
    99
    1010#include "Actions/WorldAction/SetDefaultNameAction.hpp"
    11 #include "CommandLineParser.hpp"
    1211#include "log.hpp"
     12#include "verbose.hpp"
    1313#include "World.hpp"
    1414
     
    3939
    4040  if(dialog->display()) {
    41     char outputname[MAXSTRINGSIZE];
    42     strcpy(outputname, defaultname.c_str());
    43     World::getInstance().setDefaultName(outputname);
     41    World::getInstance().setDefaultName(defaultname);
     42    DoLog(0) && (Log() << Verbose(0) << "Default name of new molecules set to " << World::getInstance().getDefaultName() << "." << endl);
    4443    delete dialog;
    4544    return Action::success;
  • src/Actions/WorldAction/SetGaussianBasisAction.cpp

    rf8e486 re6317b  
    99
    1010#include "Actions/WorldAction/SetGaussianBasisAction.hpp"
    11 #include "CommandLineParser.hpp"
    1211#include "config.hpp"
     12#include "log.hpp"
     13#include "verbose.hpp"
    1314#include "World.hpp"
    1415
     
    3334Action::state_ptr WorldSetGaussianBasisAction::performCall() {
    3435  Dialog *dialog = UIFactory::getInstance().makeDialog();
    35 
    36   dialog->queryString(NAME, &World::getInstance().getConfig()->basis, MapOfActions::getInstance().getDescription(NAME));
     36  config *configuration = World::getInstance().getConfig();
     37  dialog->queryString(NAME, &(configuration->basis), MapOfActions::getInstance().getDescription(NAME));
    3738
    3839  if(dialog->display()) {
     40    DoLog(1) && (Log() << Verbose(1) << "Setting MPQC basis to " << configuration->basis << "." << endl);
    3941    delete dialog;
    4042    return Action::success;
Note: See TracChangeset for help on using the changeset viewer.