Changeset 4e10f5 for src/Actions
- Timestamp:
- Jul 7, 2010, 4:08:32 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, 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. - Location:
- src/Actions
- Files:
-
- 2 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/AnalysisAction/MolecularVolumeAction.cpp
r5630bd r4e10f5 47 47 LCList = new LinkedCell(mol, 10.); 48 48 config * const configuration = World::getInstance().getConfig(); 49 //FindConvexBorder(mol, LCList, argv[argptr]); 49 Boundaries *BoundaryPoints = NULL; 50 //FindConvexBorder(mol, BoundaryPoints, TesselStruct, LCList, argv[argptr]); 50 51 FindNonConvexBorder(mol, TesselStruct, LCList, 5., NULL); 51 52 //RemoveAllBoundaryPoints(TesselStruct, mol, argv[argptr]); -
src/Actions/AnalysisAction/PairCorrelationAction.cpp
r5630bd r4e10f5 82 82 output.open(outputname.c_str()); 83 83 binoutput.open(binoutputname.c_str()); 84 PairCorrelationMap *correlationmap = NULL;85 84 if (type == "E") { 86 85 PairCorrelationMap *correlationmap = NULL; … … 89 88 else 90 89 correlationmap = PairCorrelation(World::getInstance().getMolecules(), elements); 91 //OutputCorrelationToSurface(&output, correlationmap);90 OutputPairCorrelation(&output, correlationmap); 92 91 binmap = BinData( correlationmap, BinWidth, BinStart, BinEnd ); 92 OutputCorrelation ( &binoutput, binmap ); 93 delete(binmap); 94 delete(correlationmap); 93 95 } else if (type == "P") { 94 96 cout << "Point to correlate to is " << Point << endl; … … 98 100 else 99 101 correlationmap = CorrelationToPoint(molecules, elements, &Point); 100 //OutputCorrelationToSurface(&output, correlationmap);102 OutputCorrelationToPoint(&output, correlationmap); 101 103 binmap = BinData( correlationmap, BinWidth, BinStart, BinEnd ); 104 OutputCorrelation ( &binoutput, binmap ); 105 delete(binmap); 106 delete(correlationmap); 102 107 } else if (type == "S") { 103 108 ASSERT(Boundary != NULL, "No molecule specified for SurfaceCorrelation."); … … 106 111 if (BinEnd > 0) { 107 112 if (BinEnd > 2.*radius) 108 113 LCWidth = BinEnd; 109 114 else 110 115 LCWidth = 2.*radius; … … 129 134 else 130 135 surfacemap = CorrelationToSurface( molecules, elements, TesselStruct, LCList); 136 delete LCList; 131 137 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; 132 144 // check whether radius was appropriate 133 145 { … … 138 150 } 139 151 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 { 141 157 return Action::failure; 142 OutputCorrelation ( &binoutput, binmap );158 } 143 159 output.close(); 144 160 binoutput.close(); 145 delete(binmap);146 delete(correlationmap);147 161 delete dialog; 148 162 return Action::success; -
src/Actions/FragmentationAction/DepthFirstSearchAction.cpp
r5630bd r4e10f5 49 49 MoleculeLeafClass *Subgraphs = NULL; // list of subgraphs from DFS analysis 50 50 int *MinimumRingSize = new int[mol->getAtomCount()]; 51 atom ** *ListOfLocalAtoms = NULL;51 atom **ListOfAtoms = NULL; 52 52 class StackClass<bond *> *BackEdgeStack = NULL; 53 53 class StackClass<bond *> *LocalBackEdgeStack = NULL; … … 58 58 while (Subgraphs->next != NULL) { 59 59 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 61 62 LocalBackEdgeStack = new StackClass<bond *> (Subgraphs->Leaf->BondCount); 62 Subgraphs->Leaf->PickLocalBackEdges(ListOf LocalAtoms[FragmentCounter], BackEdgeStack, LocalBackEdgeStack);63 Subgraphs->Leaf->PickLocalBackEdges(ListOfAtoms, BackEdgeStack, LocalBackEdgeStack); 63 64 Subgraphs->Leaf->CyclicStructureAnalysis(LocalBackEdgeStack, MinimumRingSize); 64 65 delete(LocalBackEdgeStack); 65 66 delete(Subgraphs->previous); 67 delete[](ListOfAtoms); // and here we remove it 66 68 FragmentCounter++; 67 69 } 68 70 delete(Subgraphs); 69 for (int i=0;i<FragmentCounter;i++)70 delete[](ListOfLocalAtoms[i]);71 delete[](ListOfLocalAtoms);72 71 } 73 72 delete(BackEdgeStack); -
src/Actions/Makefile.am
r5630bd r4e10f5 126 126 WorldAction/ScaleBoxAction.cpp \ 127 127 WorldAction/SetDefaultNameAction.cpp \ 128 WorldAction/SetGaussianBasisAction.cpp 128 WorldAction/SetGaussianBasisAction.cpp \ 129 WorldAction/SetOutputFormatsAction.cpp 129 130 WORLDACTIONHEADER = \ 130 131 WorldAction/AddEmptyBoundaryAction.hpp \ … … 139 140 WorldAction/ScaleBoxAction.hpp \ 140 141 WorldAction/SetDefaultNameAction.hpp \ 141 WorldAction/SetGaussianBasisAction.hpp 142 WorldAction/SetGaussianBasisAction.hpp \ 143 WorldAction/SetOutputFormatsAction.hpp 142 144 -
src/Actions/MapOfActions.cpp
r5630bd r4e10f5 67 67 #include "Actions/WorldAction/SetDefaultNameAction.hpp" 68 68 #include "Actions/WorldAction/SetGaussianBasisAction.hpp" 69 #include "Actions/WorldAction/SetOutputFormatsAction.hpp" 69 70 #include "Actions/Values.hpp" 70 71 … … 72 73 { 73 74 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; 76 98 throw boost::program_options::validation_error("Specified vector does not have three components"); 77 99 } 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)); 81 103 v = boost::any(VectorValue(VV)); 82 104 } … … 85 107 { 86 108 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; 89 132 throw boost::program_options::validation_error("Specified symmetric box matrix does not have six components"); 90 133 } 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)); 97 140 v = boost::any(BoxValue(BV)); 98 141 } … … 130 173 DescriptionMap["input"] = "specify input files"; 131 174 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"; 132 176 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"; 135 179 DescriptionMap["pair-correlation"] = "pair correlation analysis between two elements, element and point or element and surface"; 136 180 DescriptionMap["parse-xyz"] = "parse xyz file into World"; … … 140 184 DescriptionMap["repeat-box"] = "create periodic copies of the simulation box per axis"; 141 185 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";143 186 DescriptionMap["save-adjacency"] = "name of the adjacency file to write to"; 144 187 DescriptionMap["save-bonds"] = "name of the bonds file to write to"; … … 146 189 DescriptionMap["SaveXyz"] = "save world as xyz file"; 147 190 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"; 148 193 DescriptionMap["subgraph-dissect"] = "dissect the molecular system into molecules representing disconnected subgraphs"; 149 194 DescriptionMap["suspend-in-water"] = "suspend the given molecule in water such that in the domain the mean density is as specified"; … … 189 234 ShortFormMap["center-in-box"] = "b"; 190 235 ShortFormMap["change-element"] = "E"; 191 ShortFormMap["convex-envelope"] = "o";236 // ShortFormMap["convex-envelope"] = "x"; 192 237 ShortFormMap["default-molname"] = "X"; 193 238 ShortFormMap["depth-first-search"] = "D"; … … 200 245 ShortFormMap["linear-interpolate"] = "L"; 201 246 ShortFormMap["nonconvex-envelope"] = "N"; 247 // ShortFormMap["output"] = "o"; 202 248 ShortFormMap["pair-correlation"] = "C"; 203 249 ShortFormMap["parse-xyz"] = "p"; … … 211 257 ShortFormMap["scale-box"] = "s"; 212 258 ShortFormMap["set-basis"] = "M"; 259 ShortFormMap["set-output"] = "o"; 213 260 ShortFormMap["subgraph-dissect"] = "I"; 214 261 ShortFormMap["suspend-in-water"] = "u"; … … 238 285 TypeMap["molecular-volume"] = Molecule; 239 286 TypeMap["nonconvex-envelope"] = Molecule; 240 TypeMap["output"] = String;287 TypeMap["output"] = None; 241 288 TypeMap["parse-xyz"] = String; 242 289 TypeMap["pair-correlation"] = String; … … 251 298 TypeMap["scale-box"] = Vector; 252 299 TypeMap["set-basis"] = String; 300 TypeMap["set-output"] = ListOfString; 253 301 TypeMap["subgraph-dissect"] = None; 254 302 TypeMap["suspend-in-water"] = Double; … … 349 397 MenuContainsActionMap.insert( pair<std::string, std::string> ("world", "default-molname") ); 350 398 MenuContainsActionMap.insert( pair<std::string, std::string> ("world", "set-basis") ); 399 MenuContainsActionMap.insert( pair<std::string, std::string> ("world", "set-output") ); 351 400 352 401 // put actions into command line category … … 386 435 generic.insert("scale-box"); 387 436 generic.insert("set-basis"); 437 generic.insert("set-output"); 388 438 generic.insert("subgraph-dissect"); 389 439 generic.insert("suspend-in-water"); … … 484 534 new WorldSetDefaultNameAction(); 485 535 new WorldSetGaussianBasisAction(); 536 new WorldSetOutputFormatsAction(); 486 537 } 487 538 … … 561 612 ; 562 613 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; 563 621 case Axis: 564 622 ListRunner->second->add_options() … … 573 631 ListRunner->second->add_options() 574 632 (getKeyAndShortForm(*OptionRunner).c_str(), 575 po::value<VectorValue>() ->multitoken(),633 po::value<VectorValue>(), 576 634 getDescription(*OptionRunner).c_str()) 577 635 ; -
src/Actions/MapOfActions.hpp
r5630bd r4e10f5 123 123 friend class MapOfActionsTest; 124 124 public: 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 }; 126 126 127 127 // getter for the action descriptions and short forms -
src/Actions/TesselationAction/ConvexEnvelopeAction.cpp
r5630bd r4e10f5 70 70 DoLog(1) && (Log() << Verbose(1) << "Storing tecplot non-convex data in " << filenameNonConvex << "." << endl); 71 71 LCList = new LinkedCell(mol, 100.); 72 //FindConvexBorder(mol, LCList, argv[argptr]); 72 Boundaries *BoundaryPoints = NULL; 73 //FindConvexBorder(mol, BoundaryPoints, TesselStruct, LCList, argv[argptr]); 73 74 // TODO: Beide Funktionen sollten streams anstelle des Filenamen benutzen, besser fuer unit tests 74 75 FindNonConvexBorder(mol, TesselStruct, LCList, 50., filenameNonConvex.c_str()); -
src/Actions/WorldAction/CenterOnEdgeAction.cpp
r5630bd r4e10f5 63 63 domain.at(i,i) = tmp; 64 64 } 65 cout << "new domain is: " << domain << endl;66 65 World::getInstance().setDomain(domain); 67 66 // translate all atoms, such that Min is aty (0,0,0) -
src/Actions/WorldAction/OutputAction.cpp
r5630bd r4e10f5 9 9 10 10 #include "Actions/WorldAction/OutputAction.hpp" 11 #include "Parser/ChangeTracker.hpp" 11 12 #include "log.hpp" 12 13 #include "verbose.hpp" … … 33 34 Action::state_ptr WorldOutputAction::performCall() { 34 35 Dialog *dialog = UIFactory::getInstance().makeDialog(); 35 string defaultname;36 36 37 defaultname = World::getInstance().getDefaultName(); 38 dialog->queryString(NAME, &defaultname, MapOfActions::getInstance().getDescription(NAME)); 37 dialog->queryEmpty(NAME, MapOfActions::getInstance().getDescription(NAME)); 39 38 40 39 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(); 43 42 delete dialog; 44 43 return Action::success;
Note:
See TracChangeset
for help on using the changeset viewer.