Changeset e6317b for src/Actions
- Timestamp:
- Jun 16, 2010, 12:24:21 PM (15 years ago)
- Branches:
- Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, 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. - Location:
- src/Actions
- Files:
-
- 1 added
- 4 deleted
- 34 edited
-
ActionRegistry.cpp (modified) (1 diff)
-
ActionRegistry.hpp (modified) (1 diff)
-
AnalysisAction/MolecularVolumeAction.cpp (modified) (1 diff)
-
AnalysisAction/PairCorrelationAction.cpp (modified) (4 diffs)
-
AnalysisAction/PairCorrelationToPointAction.cpp (deleted)
-
AnalysisAction/PairCorrelationToPointAction.hpp (deleted)
-
AnalysisAction/PairCorrelationToSurfaceAction.cpp (deleted)
-
AnalysisAction/PairCorrelationToSurfaceAction.hpp (deleted)
-
AnalysisAction/PrincipalAxisSystemAction.cpp (modified) (1 diff)
-
AtomAction/AddAction.cpp (modified) (2 diffs)
-
AtomAction/ChangeElementAction.cpp (modified) (2 diffs)
-
AtomAction/RemoveAction.cpp (modified) (2 diffs)
-
CmdAction/BondLengthTableAction.cpp (modified) (2 diffs)
-
CmdAction/ElementDbAction.cpp (modified) (2 diffs)
-
CmdAction/FastParsingAction.cpp (modified) (1 diff)
-
CmdAction/VerboseAction.cpp (modified) (1 diff)
-
CmdAction/VersionAction.cpp (modified) (1 diff)
-
FragmentationAction/DepthFirstSearchAction.cpp (modified) (1 diff)
-
FragmentationAction/FragmentationAction.cpp (modified) (3 diffs)
-
FragmentationAction/SubgraphDissectionAction.cpp (modified) (3 diffs)
-
Makefile.am (modified) (1 diff)
-
MapOfActions.cpp (modified) (17 diffs)
-
MapOfActions.hpp (modified) (1 diff)
-
MoleculeAction/FillWithMoleculeAction.cpp (modified) (1 diff)
-
MoleculeAction/LinearInterpolationofTrajectoriesAction.cpp (modified) (1 diff)
-
MoleculeAction/TranslateAction.cpp (modified) (1 diff)
-
TesselationAction/ConvexEnvelopeAction.cpp (modified) (3 diffs)
-
TesselationAction/NonConvexEnvelopeAction.cpp (modified) (1 diff)
-
Values.hpp (added)
-
WorldAction/AddEmptyBoundaryAction.cpp (modified) (1 diff)
-
WorldAction/BoundInBoxAction.cpp (modified) (1 diff)
-
WorldAction/CenterInBoxAction.cpp (modified) (1 diff)
-
WorldAction/CenterOnEdgeAction.cpp (modified) (1 diff)
-
WorldAction/ChangeBoxAction.cpp (modified) (1 diff)
-
WorldAction/RemoveSphereOfAtomsAction.cpp (modified) (2 diffs)
-
WorldAction/RepeatBoxAction.cpp (modified) (1 diff)
-
WorldAction/ScaleBoxAction.cpp (modified) (1 diff)
-
WorldAction/SetDefaultNameAction.cpp (modified) (2 diffs)
-
WorldAction/SetGaussianBasisAction.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/ActionRegistry.cpp
rf8e486 re6317b 39 39 } 40 40 41 bool 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 41 47 void ActionRegistry::registerAction(Action* action){ 42 48 pair<map<const string,Action*>::iterator,bool> ret; -
src/Actions/ActionRegistry.hpp
rf8e486 re6317b 21 21 public: 22 22 Action* getActionByName(const std::string); 23 bool isActionByNamePresent(const std::string name); 23 24 void registerAction(Action*); 24 25 void unregisterAction(Action*); -
src/Actions/AnalysisAction/MolecularVolumeAction.cpp
rf8e486 re6317b 9 9 10 10 #include "Actions/AnalysisAction/MolecularVolumeAction.hpp" 11 #include "CommandLineParser.hpp"12 11 #include "boundary.hpp" 13 12 #include "config.hpp" -
src/Actions/AnalysisAction/PairCorrelationAction.cpp
rf8e486 re6317b 9 9 10 10 #include "Actions/AnalysisAction/PairCorrelationAction.hpp" 11 #include "CommandLineParser.hpp"12 11 #include "analysis_correlation.hpp" 12 #include "boundary.hpp" 13 #include "linkedcell.hpp" 13 14 #include "log.hpp" 14 15 #include "element.hpp" 16 #include "molecule.hpp" 15 17 #include "periodentafel.hpp" 18 #include "vector.hpp" 16 19 #include "World.hpp" 17 20 … … 37 40 Dialog *dialog = UIFactory::getInstance().makeDialog(); 38 41 int ranges[3] = {1, 1, 1}; 42 double BinEnd = 0.; 39 43 double BinStart = 0.; 40 double BinEnd = 0.; 44 double BinWidth = 0.; 45 molecule *Boundary = NULL; 41 46 string outputname; 42 47 string binoutputname; … … 44 49 ofstream output; 45 50 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(); 48 56 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")); 51 73 dialog->queryDouble("bin-start", &BinStart, MapOfActions::getInstance().getDescription("bin-start")); 74 dialog->queryDouble("bin-width", &BinWidth, MapOfActions::getInstance().getDescription("bin-width")); 52 75 dialog->queryDouble("bin-end", &BinEnd, MapOfActions::getInstance().getDescription("bin-end")); 53 76 dialog->queryString("output-file", &outputname, MapOfActions::getInstance().getDescription("output-file")); … … 59 82 binoutput.open(binoutputname.c_str()); 60 83 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; 67 141 OutputCorrelation ( &binoutput, binmap ); 68 142 output.close(); -
src/Actions/AnalysisAction/PrincipalAxisSystemAction.cpp
rf8e486 re6317b 9 9 10 10 #include "Actions/AnalysisAction/PrincipalAxisSystemAction.hpp" 11 #include "CommandLineParser.hpp"12 11 #include "molecule.hpp" 13 12 #include "log.hpp" -
src/Actions/AtomAction/AddAction.cpp
rf8e486 re6317b 9 9 10 10 #include "Actions/AtomAction/AddAction.hpp" 11 #include "CommandLineParser.hpp"12 11 #include "atom.hpp" 13 12 #include "element.hpp" 14 13 #include "log.hpp" 15 #include " periodentafel.hpp"14 #include "molecule.hpp" 16 15 #include "vector.hpp" 17 16 #include "verbose.hpp" … … 38 37 Action::state_ptr AtomAddAction::performCall() { 39 38 Dialog *dialog = UIFactory::getInstance().makeDialog(); 40 int Z = -1;39 std::vector<element *> elements; 41 40 Vector position; 42 41 43 dialog->query Int(NAME, &Z, MapOfActions::getInstance().getDescription(NAME));42 dialog->queryElement(NAME, &elements, MapOfActions::getInstance().getDescription(NAME)); 44 43 dialog->queryVector("position", &position, World::getInstance().getDomain(), true, MapOfActions::getInstance().getDescription("position")); 44 cout << "pre-dialog" << endl; 45 45 46 46 if(dialog->display()) { 47 cout << "post-dialog" << endl; 47 48 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; 52 53 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 } 53 60 return Action::success; 54 61 } else { 55 62 DoeLog(1) && (eLog()<< Verbose(1) << "Could not find the specified element." << endl); 56 World::getInstance().destroyAtom(first);57 63 return Action::failure; 58 64 } -
src/Actions/AtomAction/ChangeElementAction.cpp
rf8e486 re6317b 9 9 10 10 #include "Actions/AtomAction/ChangeElementAction.hpp" 11 #include "CommandLineParser.hpp"12 11 #include "atom.hpp" 13 12 #include "log.hpp" … … 36 35 Action::state_ptr AtomChangeElementAction::performCall() { 37 36 Dialog *dialog = UIFactory::getInstance().makeDialog(); 38 int Z = -1;39 37 atom *first = NULL; 40 element *elemental = NULL;38 std::vector<element *> elements; 41 39 42 dialog->query Element(NAME, (const element **) &elemental, MapOfActions::getInstance().getDescription(NAME));43 dialog->query Atom("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")); 44 42 45 43 if(dialog->display()) { 46 44 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); 50 50 return Action::success; 51 51 } else -
src/Actions/AtomAction/RemoveAction.cpp
rf8e486 re6317b 9 9 10 10 #include "Actions/AtomAction/RemoveAction.hpp" 11 #include "CommandLineParser.hpp"12 11 #include "atom.hpp" 13 12 #include "Descriptors/AtomDescriptor.hpp" 14 13 #include "log.hpp" 14 #include "molecule.hpp" 15 15 #include "verbose.hpp" 16 16 #include "World.hpp" … … 43 43 delete dialog; 44 44 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 } 45 51 World::getInstance().destroyAtom(first); 46 52 return Action::success; -
src/Actions/CmdAction/BondLengthTableAction.cpp
rf8e486 re6317b 9 9 10 10 #include "Actions/CmdAction/BondLengthTableAction.hpp" 11 #include "CommandLineParser.hpp"12 11 #include "config.hpp" 13 12 #include "log.hpp" … … 42 41 43 42 if(dialog->display()) { 43 DoLog(0) && (Log() << Verbose(0) << "Using " << BondGraphFileName << " as bond length table." << endl); 44 44 delete dialog; 45 45 } else { 46 46 delete dialog; 47 return Action::failure; 47 48 } 48 49 -
src/Actions/CmdAction/ElementDbAction.cpp
rf8e486 re6317b 9 9 10 10 #include "Actions/CmdAction/ElementDbAction.hpp" 11 #include "CommandLineParser.hpp"12 11 #include "config.hpp" 13 12 #include "log.hpp" … … 43 42 config *configuration = World::getInstance().getConfig(); 44 43 dialog->queryString(NAME, &databasepath, MapOfActions::getInstance().getDescription(NAME)); 45 strcpy(configuration->databasepath, databasepath.c_str());46 44 47 45 if(dialog->display()) { 46 strcpy(configuration->databasepath, databasepath.c_str()); 48 47 delete dialog; 49 48 } else { 50 49 delete dialog; 50 return Action::failure; 51 51 } 52 52 -
src/Actions/CmdAction/FastParsingAction.cpp
rf8e486 re6317b 9 9 10 10 #include "Actions/CmdAction/FastParsingAction.hpp" 11 #include "CommandLineParser.hpp"12 11 #include "config.hpp" 13 12 #include "log.hpp" -
src/Actions/CmdAction/VerboseAction.cpp
rf8e486 re6317b 9 9 10 10 #include "Actions/CmdAction/VerboseAction.hpp" 11 #include "CommandLineParser.hpp"12 11 #include "log.hpp" 13 12 #include "verbose.hpp" -
src/Actions/CmdAction/VersionAction.cpp
rf8e486 re6317b 9 9 10 10 #include "Actions/CmdAction/VersionAction.hpp" 11 #include "CommandLineParser.hpp"12 11 13 12 #include <iostream> -
src/Actions/FragmentationAction/DepthFirstSearchAction.cpp
rf8e486 re6317b 9 9 10 10 #include "Actions/FragmentationAction/DepthFirstSearchAction.hpp" 11 #include "CommandLineParser.hpp"12 11 #include "atom.hpp" 13 12 #include "config.hpp" -
src/Actions/FragmentationAction/FragmentationAction.cpp
rf8e486 re6317b 9 9 10 10 #include "Actions/FragmentationAction/FragmentationAction.hpp" 11 #include "CommandLineParser.hpp"12 11 #include "atom.hpp" 13 12 #include "config.hpp" … … 27 26 #include "Actions/MapOfActions.hpp" 28 27 29 const char FragmentationFragmentationAction::NAME[] = " subspace-dissect";28 const char FragmentationFragmentationAction::NAME[] = "fragment-mol"; 30 29 31 30 FragmentationFragmentationAction::FragmentationFragmentationAction() : … … 38 37 Action::state_ptr FragmentationFragmentationAction::performCall() { 39 38 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; 40 45 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")); 42 50 43 51 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); 44 65 delete dialog; 45 66 return Action::success; -
src/Actions/FragmentationAction/SubgraphDissectionAction.cpp
rf8e486 re6317b 9 9 10 10 #include "Actions/FragmentationAction/SubgraphDissectionAction.hpp" 11 #include "CommandLineParser.hpp"12 11 #include "atom.hpp" 13 12 #include "config.hpp" … … 27 26 #include "Actions/MapOfActions.hpp" 28 27 29 const char FragmentationSubgraphDissectionAction::NAME[] = "sub space-dissect";28 const char FragmentationSubgraphDissectionAction::NAME[] = "subgraph-dissect"; 30 29 31 30 FragmentationSubgraphDissectionAction::FragmentationSubgraphDissectionAction() : … … 42 41 43 42 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()); 44 47 delete dialog; 45 48 return Action::success; -
src/Actions/Makefile.am
rf8e486 re6317b 30 30 ${TESSELATIONACTIONHEADER} \ 31 31 ${WORLDACTIONHEADER} \ 32 MapOfActions.hpp 32 MapOfActions.hpp \ 33 Values.hpp 33 34 34 35 ANALYSISACTIONSOURCE = \ 35 36 AnalysisAction/MolecularVolumeAction.cpp \ 36 37 AnalysisAction/PairCorrelationAction.cpp \ 37 AnalysisAction/PairCorrelationToPointAction.cpp \38 AnalysisAction/PairCorrelationToSurfaceAction.cpp \39 38 AnalysisAction/PrincipalAxisSystemAction.cpp 40 39 ANALYSISACTIONHEADER = \ 41 40 AnalysisAction/MolecularVolumeAction.hpp \ 42 41 AnalysisAction/PairCorrelationAction.hpp \ 43 AnalysisAction/PairCorrelationToPointAction.hpp \44 AnalysisAction/PairCorrelationToSurfaceAction.hpp \45 42 AnalysisAction/PrincipalAxisSystemAction.hpp 46 43 -
src/Actions/MapOfActions.cpp
rf8e486 re6317b 14 14 #include "Helpers/Assert.hpp" 15 15 16 #include <boost/lexical_cast.hpp> 17 #include <boost/optional.hpp> 18 #include <boost/program_options.hpp> 19 16 20 #include "CommandLineParser.hpp" 17 21 #include "log.hpp" 18 22 #include "verbose.hpp" 23 24 #include "Actions/Values.hpp" 25 26 void 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 39 void 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 } 19 54 20 55 /** Constructor of class MapOfActions. … … 51 86 DescriptionMap["nonconvex-envelope"] = "create the non-convex envelope for a molecule"; 52 87 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"; 56 89 DescriptionMap["parse-xyz"] = "parse xyz file into World"; 57 90 DescriptionMap["principal-axis-system"] = "calculate the principal axis system of the specified molecule"; … … 65 98 DescriptionMap["save-temperature"] = "name of the temperature file to write to"; 66 99 DescriptionMap["scale-box"] = "scale box and atomic positions inside"; 67 DescriptionMap["sub space-dissect"] = "dissect the molecular system into molecules representing disconnected subgraphs";100 DescriptionMap["subgraph-dissect"] = "dissect the molecular system into molecules representing disconnected subgraphs"; 68 101 DescriptionMap["suspend-in-water"] = "suspend the given molecule in water such that in the domain the mean density is as specified"; 69 102 DescriptionMap["translate-mol"] = "translate molecule by given vector"; … … 72 105 DescriptionMap["version"] = "show version"; 73 106 // keys for values 107 DescriptionMap["atom-by-id"] = "index of an atom"; 74 108 DescriptionMap["bin-output-file"] = "name of the bin output file"; 75 109 DescriptionMap["bin-end"] = "start of the last bin"; 76 110 DescriptionMap["bin-start"] = "start of the first bin"; 77 111 DescriptionMap["bin-width"] = "width of the bins"; 112 DescriptionMap["convex-file"] = "filename of the non-convex envelope"; 78 113 DescriptionMap["distance"] = "distance in space"; 79 114 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"; 82 120 DescriptionMap["input"] = "name of input file"; 83 121 DescriptionMap["length"] = "length in space"; … … 85 123 DescriptionMap["MaxDistance"] = "maximum distance in space"; 86 124 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, ..."; 87 128 DescriptionMap["output-file"] = "name of the output file"; 88 129 DescriptionMap["periodic"] = "system is constraint to periodic boundary conditions (y/n)"; 89 130 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"; 91 133 92 134 // short forms for the actions … … 110 152 ShortFormMap["linear-interpolate"] = "L"; 111 153 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"; 115 155 ShortFormMap["parse-xyz"] = "p"; 116 156 ShortFormMap["remove-atom"] = "r"; … … 123 163 ShortFormMap["scale-box"] = "s"; 124 164 ShortFormMap["set-basis"] = "M"; 125 ShortFormMap["sub space-dissect"] = "I";126 ShortFormMap["suspend-in-water"] = " U";165 ShortFormMap["subgraph-dissect"] = "I"; 166 ShortFormMap["suspend-in-water"] = "u"; 127 167 ShortFormMap["translate-mol"] = "t"; 128 168 ShortFormMap["verbose"] = "v"; … … 131 171 132 172 // value types for the actions 133 TypeMap["add-atom"] = Atom;173 TypeMap["add-atom"] = Element; 134 174 TypeMap["bond-file"] = String; 135 175 TypeMap["bond-table"] = String; 136 176 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; 140 180 TypeMap["change-molname"] = String; 141 181 TypeMap["convex-envelope"] = Molecule; … … 143 183 TypeMap["depth-first-search"] = Double; 144 184 TypeMap["element-db"] = String; 145 TypeMap["end-mol"] = Molecule;146 185 TypeMap["fastparsing"] = Boolean; 147 186 TypeMap["fill-molecule"] = String; … … 152 191 TypeMap["nonconvex-envelope"] = Molecule; 153 192 TypeMap["parse-xyz"] = String; 154 TypeMap["principal-axis-system"] = Axis; 193 TypeMap["pair-correlation"] = String; 194 TypeMap["principal-axis-system"] = Molecule; 155 195 TypeMap["remove-atom"] = Atom; 156 TypeMap["remove-sphere"] = Atom;196 TypeMap["remove-sphere"] = Double; 157 197 TypeMap["repeat-box"] = Vector; 158 198 TypeMap["rotate-to-pas"] = Molecule; … … 162 202 TypeMap["scale-box"] = Vector; 163 203 TypeMap["set-basis"] = String; 164 TypeMap["s tart-mol"] = Molecule;165 TypeMap["suspend-in-water"] = Molecule;204 TypeMap["subgraph-dissect"] = None; 205 TypeMap["suspend-in-water"] = Double; 166 206 TypeMap["translate-mol"] = Vector; 167 207 TypeMap["verlet-integrate"] = String; … … 169 209 170 210 // value types for the values 211 TypeMap["atom-by-id"] = Atom; 171 212 TypeMap["bin-output-file"] = String; 172 213 TypeMap["bin-end"] = Double; 173 214 TypeMap["bin-start"] = Double; 215 TypeMap["bin-width"] = Double; 216 TypeMap["convex-file"] = String; 174 217 TypeMap["distance"] = Double; 175 TypeMap["distances"] = ListOfDoubles; 176 TypeMap["elements"] = Element; 218 TypeMap["distances"] = Vector; 219 TypeMap["DoRotate"] = Boolean; 220 TypeMap["element"] = Element; 177 221 TypeMap["elements"] = ListOfElements; 222 TypeMap["end-step"] = Integer; 223 TypeMap["id-mapping"] = Boolean; 178 224 TypeMap["length"] = Double; 179 TypeMap["lengths"] = ListOfDoubles;225 TypeMap["lengths"] = Vector; 180 226 TypeMap["MaxDistance"] = Double; 181 227 TypeMap["molecule-by-id"] = Molecule; 228 TypeMap["molecule-by-name"] = Molecule; 229 TypeMap["nonconvex-file"] = String; 230 TypeMap["order"] = Integer; 182 231 TypeMap["output-file"] = String; 183 232 TypeMap["periodic"] = Boolean; 184 233 TypeMap["position"] = Vector; 234 TypeMap["sphere-radius"] = Double; 235 TypeMap["start-step"] = Integer; 185 236 186 237 // 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"; 187 241 DefaultValue["molecule-by-id"] = "-1"; 242 DefaultValue["periodic"] = "0"; 188 243 189 244 190 245 // 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"); 194 249 generic.insert("boundary"); 195 250 // generic.insert("bound-in-box"); … … 198 253 generic.insert("change-box"); 199 254 // 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"); 208 263 generic.insert("help"); 209 //generic.insert("linear-interpolate");264 generic.insert("linear-interpolate"); 210 265 // 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"); 215 268 // generic.insert("parse-xyz"); 216 269 // 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"); 224 277 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"); 229 282 generic.insert("verbose"); 230 //generic.insert("verlet-integrate");283 generic.insert("verlet-integrate"); 231 284 generic.insert("version"); 232 // // list of generic values233 // 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");249 285 250 286 // 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"); 252 315 } 253 316 … … 286 349 ; 287 350 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; 288 358 case Integer: 289 359 ListRunner->second->add_options() … … 339 409 ListRunner->second->add_options() 340 410 (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(), 349 412 getDescription(*OptionRunner).c_str()) 350 413 ; … … 385 448 ListRunner->second->add_options() 386 449 (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> >(), 390 451 getDescription(*OptionRunner).c_str()) 391 452 ; … … 497 558 } 498 559 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 */ 563 map <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 } 499 572 500 573 -
src/Actions/MapOfActions.hpp
rf8e486 re6317b 30 30 std::string getKeyAndShortForm(string actionname); 31 31 std::string getShortForm(string actionname); 32 map <std::string, std::string> getShortFormToActionMap(); 32 33 33 34 void AddOptionsToParser(); -
src/Actions/MoleculeAction/FillWithMoleculeAction.cpp
rf8e486 re6317b 68 68 69 69 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); 70 71 // construct water molecule 71 72 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()); 76 77 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); 92 93 World::getInstance().getConfig()->BG->ConstructBondGraph(filler); 93 filler->SetNameFromFilename("water");94 // filler->SetNameFromFilename("water"); 94 95 // call routine 95 96 double distance[NDIM]; -
src/Actions/MoleculeAction/LinearInterpolationofTrajectoriesAction.cpp
rf8e486 re6317b 60 60 61 61 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")); 64 64 dialog->queryMolecule("molecule-by-id", &mol, MapOfActions::getInstance().getDescription("molecule-by-id")); 65 65 dialog->queryBoolean("id-mapping", &IdMapping, MapOfActions::getInstance().getDescription("id-mapping")); -
src/Actions/MoleculeAction/TranslateAction.cpp
rf8e486 re6317b 58 58 dialog->queryMolecule("molecule-by-id", &mol, MapOfActions::getInstance().getDescription("molecule-by-id")); 59 59 dialog->queryBoolean("periodic", &periodic, MapOfActions::getInstance().getDescription("periodic")); 60 cout << "pre-dialog" << endl; 60 61 61 62 if(dialog->display()) { 63 cout << "post-dialog" << endl; 62 64 DoLog(1) && (Log() << Verbose(1) << "Translating all ions by given vector." << endl); 63 65 if (periodic) -
src/Actions/TesselationAction/ConvexEnvelopeAction.cpp
rf8e486 re6317b 21 21 #include "atom.hpp" 22 22 #include "boundary.hpp" 23 #include "config.hpp" 23 24 #include "linkedcell.hpp" 24 25 #include "log.hpp" … … 56 57 molecule * mol = NULL; 57 58 bool Success = false; 59 config *configuration = World::getInstance().getConfig(); 58 60 59 61 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")); 62 64 63 65 if(dialog->display()) { … … 72 74 FindNonConvexBorder(mol, TesselStruct, LCList, 50., filenameNonConvex.c_str()); 73 75 //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); 75 80 delete(TesselStruct); 76 81 delete(LCList); -
src/Actions/TesselationAction/NonConvexEnvelopeAction.cpp
rf8e486 re6317b 58 58 clock_t start,end; 59 59 60 dialog->query Double(NAME, &SphereRadius, MapOfActions::getInstance().getDescription(NAME));61 dialog->queryString(" output", &filename, MapOfActions::getInstance().getDescription("output"));62 dialog->query Molecule("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")); 63 63 64 64 if(dialog->display()) { -
src/Actions/WorldAction/AddEmptyBoundaryAction.cpp
rf8e486 re6317b 9 9 10 10 #include "Actions/WorldAction/AddEmptyBoundaryAction.hpp" 11 #include "CommandLineParser.hpp"12 11 #include "atom.hpp" 13 12 #include "log.hpp" -
src/Actions/WorldAction/BoundInBoxAction.cpp
rf8e486 re6317b 9 9 10 10 #include "Actions/WorldAction/BoundInBoxAction.hpp" 11 #include "CommandLineParser.hpp"12 11 #include "log.hpp" 13 12 #include "molecule.hpp" -
src/Actions/WorldAction/CenterInBoxAction.cpp
rf8e486 re6317b 9 9 10 10 #include "Actions/WorldAction/CenterInBoxAction.hpp" 11 #include "CommandLineParser.hpp"12 11 #include "log.hpp" 13 12 #include "molecule.hpp" -
src/Actions/WorldAction/CenterOnEdgeAction.cpp
rf8e486 re6317b 9 9 10 10 #include "Actions/WorldAction/CenterOnEdgeAction.hpp" 11 #include "CommandLineParser.hpp"12 11 #include "atom.hpp" 13 12 #include "log.hpp" -
src/Actions/WorldAction/ChangeBoxAction.cpp
rf8e486 re6317b 9 9 10 10 #include "Actions/WorldAction/ChangeBoxAction.hpp" 11 #include "CommandLineParser.hpp"12 11 #include "log.hpp" 13 12 #include "verbose.hpp" -
src/Actions/WorldAction/RemoveSphereOfAtomsAction.cpp
rf8e486 re6317b 9 9 10 10 #include "Actions/WorldAction/RemoveSphereOfAtomsAction.hpp" 11 #include "CommandLineParser.hpp"12 11 #include "atom.hpp" 13 12 #include "Descriptors/AtomDescriptor.hpp" 14 13 #include "log.hpp" 14 #include "molecule.hpp" 15 15 #include "vector.hpp" 16 16 #include "verbose.hpp" … … 38 38 Dialog *dialog = UIFactory::getInstance().makeDialog(); 39 39 double radius = 0.; 40 atom *first = NULL;40 Vector point; 41 41 42 42 dialog->queryDouble(NAME, &radius, MapOfActions::getInstance().getDescription(NAME)); 43 dialog->query Atom("atom-by-id", &first, MapOfActions::getInstance().getDescription("atom-by-id"));43 dialog->queryVector("position", &point, World::getInstance().getDomain(), false, MapOfActions::getInstance().getDescription("position")); 44 44 45 45 if(dialog->display()) { 46 46 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); 48 48 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 } 55 57 } 56 World::getInstance().destroyAtom(first);57 58 return Action::success; 58 59 } else { -
src/Actions/WorldAction/RepeatBoxAction.cpp
rf8e486 re6317b 9 9 10 10 #include "Actions/WorldAction/RepeatBoxAction.hpp" 11 #include "CommandLineParser.hpp"12 11 #include "atom.hpp" 13 12 #include "log.hpp" -
src/Actions/WorldAction/ScaleBoxAction.cpp
rf8e486 re6317b 9 9 10 10 #include "Actions/WorldAction/ScaleBoxAction.hpp" 11 #include "CommandLineParser.hpp"12 11 #include "atom.hpp" 13 12 #include "log.hpp" -
src/Actions/WorldAction/SetDefaultNameAction.cpp
rf8e486 re6317b 9 9 10 10 #include "Actions/WorldAction/SetDefaultNameAction.hpp" 11 #include "CommandLineParser.hpp"12 11 #include "log.hpp" 12 #include "verbose.hpp" 13 13 #include "World.hpp" 14 14 … … 39 39 40 40 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); 44 43 delete dialog; 45 44 return Action::success; -
src/Actions/WorldAction/SetGaussianBasisAction.cpp
rf8e486 re6317b 9 9 10 10 #include "Actions/WorldAction/SetGaussianBasisAction.hpp" 11 #include "CommandLineParser.hpp"12 11 #include "config.hpp" 12 #include "log.hpp" 13 #include "verbose.hpp" 13 14 #include "World.hpp" 14 15 … … 33 34 Action::state_ptr WorldSetGaussianBasisAction::performCall() { 34 35 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)); 37 38 38 39 if(dialog->display()) { 40 DoLog(1) && (Log() << Verbose(1) << "Setting MPQC basis to " << configuration->basis << "." << endl); 39 41 delete dialog; 40 42 return Action::success;
Note:
See TracChangeset
for help on using the changeset viewer.
