Changeset 4e10f5 for src/Actions


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

Location:
src/Actions
Files:
2 added
9 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/AnalysisAction/MolecularVolumeAction.cpp

    r5630bd r4e10f5  
    4747    LCList = new LinkedCell(mol, 10.);
    4848    config * const configuration = World::getInstance().getConfig();
    49     //FindConvexBorder(mol, LCList, argv[argptr]);
     49    Boundaries *BoundaryPoints = NULL;
     50    //FindConvexBorder(mol, BoundaryPoints, TesselStruct, LCList, argv[argptr]);
    5051    FindNonConvexBorder(mol, TesselStruct, LCList, 5., NULL);
    5152    //RemoveAllBoundaryPoints(TesselStruct, mol, argv[argptr]);
  • src/Actions/AnalysisAction/PairCorrelationAction.cpp

    r5630bd r4e10f5  
    8282    output.open(outputname.c_str());
    8383    binoutput.open(binoutputname.c_str());
    84     PairCorrelationMap *correlationmap = NULL;
    8584    if (type == "E") {
    8685      PairCorrelationMap *correlationmap = NULL;
     
    8988      else
    9089        correlationmap = PairCorrelation(World::getInstance().getMolecules(), elements);
    91       //OutputCorrelationToSurface(&output, correlationmap);
     90      OutputPairCorrelation(&output, correlationmap);
    9291      binmap = BinData( correlationmap, BinWidth, BinStart, BinEnd );
     92      OutputCorrelation ( &binoutput, binmap );
     93      delete(binmap);
     94      delete(correlationmap);
    9395    } else if (type == "P")  {
    9496      cout << "Point to correlate to is  " << Point << endl;
     
    98100      else
    99101        correlationmap = CorrelationToPoint(molecules, elements, &Point);
    100       //OutputCorrelationToSurface(&output, correlationmap);
     102      OutputCorrelationToPoint(&output, correlationmap);
    101103      binmap = BinData( correlationmap, BinWidth, BinStart, BinEnd );
     104      OutputCorrelation ( &binoutput, binmap );
     105      delete(binmap);
     106      delete(correlationmap);
    102107    } else if (type == "S") {
    103108      ASSERT(Boundary != NULL, "No molecule specified for SurfaceCorrelation.");
     
    106111      if (BinEnd > 0) {
    107112        if (BinEnd > 2.*radius)
    108             LCWidth = BinEnd;
     113          LCWidth = BinEnd;
    109114        else
    110115          LCWidth = 2.*radius;
     
    129134      else
    130135        surfacemap = CorrelationToSurface( molecules, elements, TesselStruct, LCList);
     136      delete LCList;
    131137      OutputCorrelationToSurface(&output, surfacemap);
     138      // re-set ActiveFlag
     139      counter = 0;
     140      for (MoleculeList::iterator BigFinder = molecules->ListOfMolecules.begin(); BigFinder != molecules->ListOfMolecules.end(); BigFinder++) {
     141        (*BigFinder)->ActiveFlag = Actives[counter++];
     142      }
     143      delete[] Actives;
    132144      // check whether radius was appropriate
    133145      {
     
    138150      }
    139151      binmap = BinData( surfacemap, BinWidth, BinStart, BinEnd );
    140     } else
     152      OutputCorrelation ( &binoutput, binmap );
     153      delete TesselStruct;  // surfacemap contains refs to triangles! delete here, not earlier!
     154      delete(binmap);
     155      delete(surfacemap);
     156    } else {
    141157      return Action::failure;
    142     OutputCorrelation ( &binoutput, binmap );
     158    }
    143159    output.close();
    144160    binoutput.close();
    145     delete(binmap);
    146     delete(correlationmap);
    147161    delete dialog;
    148162    return Action::success;
  • src/Actions/FragmentationAction/DepthFirstSearchAction.cpp

    r5630bd r4e10f5  
    4949    MoleculeLeafClass *Subgraphs = NULL;      // list of subgraphs from DFS analysis
    5050    int *MinimumRingSize = new int[mol->getAtomCount()];
    51     atom ***ListOfLocalAtoms = NULL;
     51    atom **ListOfAtoms = NULL;
    5252    class StackClass<bond *> *BackEdgeStack = NULL;
    5353    class StackClass<bond *> *LocalBackEdgeStack = NULL;
     
    5858      while (Subgraphs->next != NULL) {
    5959        Subgraphs = Subgraphs->next;
    60         Subgraphs->FillBondStructureFromReference(mol, FragmentCounter, ListOfLocalAtoms, false);  // we want to keep the created ListOfLocalAtoms
     60        ListOfAtoms = NULL;
     61        Subgraphs->FillBondStructureFromReference(mol, ListOfAtoms, false);  // we want to keep the created ListOfLocalAtoms
    6162        LocalBackEdgeStack = new StackClass<bond *> (Subgraphs->Leaf->BondCount);
    62         Subgraphs->Leaf->PickLocalBackEdges(ListOfLocalAtoms[FragmentCounter], BackEdgeStack, LocalBackEdgeStack);
     63        Subgraphs->Leaf->PickLocalBackEdges(ListOfAtoms, BackEdgeStack, LocalBackEdgeStack);
    6364        Subgraphs->Leaf->CyclicStructureAnalysis(LocalBackEdgeStack, MinimumRingSize);
    6465        delete(LocalBackEdgeStack);
    6566        delete(Subgraphs->previous);
     67        delete[](ListOfAtoms);  // and here we remove it
    6668        FragmentCounter++;
    6769      }
    6870      delete(Subgraphs);
    69       for (int i=0;i<FragmentCounter;i++)
    70         delete[](ListOfLocalAtoms[i]);
    71       delete[](ListOfLocalAtoms);
    7271    }
    7372    delete(BackEdgeStack);
  • src/Actions/Makefile.am

    r5630bd r4e10f5  
    126126  WorldAction/ScaleBoxAction.cpp \
    127127  WorldAction/SetDefaultNameAction.cpp \
    128   WorldAction/SetGaussianBasisAction.cpp               
     128  WorldAction/SetGaussianBasisAction.cpp \
     129  WorldAction/SetOutputFormatsAction.cpp
    129130WORLDACTIONHEADER = \
    130131  WorldAction/AddEmptyBoundaryAction.hpp \
     
    139140  WorldAction/ScaleBoxAction.hpp \
    140141  WorldAction/SetDefaultNameAction.hpp \
    141   WorldAction/SetGaussianBasisAction.hpp
     142  WorldAction/SetGaussianBasisAction.hpp \
     143  WorldAction/SetOutputFormatsAction.hpp               
    142144
  • 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              ;
  • src/Actions/MapOfActions.hpp

    r5630bd r4e10f5  
    123123  friend class MapOfActionsTest;
    124124public:
    125   enum OptionTypes { None, Boolean, Integer, ListOfInts, Double, ListOfDoubles, String, Axis, Vector, Box, Molecule, ListOfMolecules, Atom, ListOfAtoms, Element, ListOfElements };
     125  enum OptionTypes { None, Boolean, Integer, ListOfInts, Double, ListOfDoubles, String, ListOfString, Axis, Vector, Box, Molecule, ListOfMolecules, Atom, ListOfAtoms, Element, ListOfElements };
    126126
    127127  // getter for the action descriptions and short forms
  • src/Actions/TesselationAction/ConvexEnvelopeAction.cpp

    r5630bd r4e10f5  
    7070    DoLog(1) && (Log() << Verbose(1) << "Storing tecplot non-convex data in " << filenameNonConvex << "." << endl);
    7171    LCList = new LinkedCell(mol, 100.);
    72     //FindConvexBorder(mol, LCList, argv[argptr]);
     72    Boundaries *BoundaryPoints = NULL;
     73    //FindConvexBorder(mol, BoundaryPoints, TesselStruct, LCList, argv[argptr]);
    7374    // TODO: Beide Funktionen sollten streams anstelle des Filenamen benutzen, besser fuer unit tests
    7475    FindNonConvexBorder(mol, TesselStruct, LCList, 50., filenameNonConvex.c_str());
  • src/Actions/WorldAction/CenterOnEdgeAction.cpp

    r5630bd r4e10f5  
    6363      domain.at(i,i) = tmp;
    6464    }
    65     cout << "new domain is: " << domain << endl;
    6665    World::getInstance().setDomain(domain);
    6766    // translate all atoms, such that Min is aty (0,0,0)
  • src/Actions/WorldAction/OutputAction.cpp

    r5630bd r4e10f5  
    99
    1010#include "Actions/WorldAction/OutputAction.hpp"
     11#include "Parser/ChangeTracker.hpp"
    1112#include "log.hpp"
    1213#include "verbose.hpp"
     
    3334Action::state_ptr WorldOutputAction::performCall() {
    3435  Dialog *dialog = UIFactory::getInstance().makeDialog();
    35   string defaultname;
    3636
    37   defaultname = World::getInstance().getDefaultName();
    38   dialog->queryString(NAME, &defaultname, MapOfActions::getInstance().getDescription(NAME));
     37  dialog->queryEmpty(NAME, MapOfActions::getInstance().getDescription(NAME));
    3938
    4039  if(dialog->display()) {
    41     World::getInstance().setDefaultName(defaultname);
    42     DoLog(0) && (Log() << Verbose(0) << "Default name of new molecules set to " << World::getInstance().getDefaultName() << "." << endl);
     40    DoLog(0) && (Log() << Verbose(0) << "Saving world to files." << endl);
     41    ChangeTracker::getInstance().saveStatus();
    4342    delete dialog;
    4443    return Action::success;
Note: See TracChangeset for help on using the changeset viewer.