- Timestamp:
- Jun 8, 2010, 1:49:27 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:
- 8540f0
- Parents:
- 48ab70a
- Location:
- src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/FragmentationAction/FragmentationAction.cpp
r48ab70a re4b5de 25 25 #include "Actions/MapOfActions.hpp" 26 26 27 const char FragmentationFragmentationAction::NAME[] = " subspace-dissect";27 const char FragmentationFragmentationAction::NAME[] = "fragment-mol"; 28 28 29 29 FragmentationFragmentationAction::FragmentationFragmentationAction() : … … 36 36 Action::state_ptr FragmentationFragmentationAction::performCall() { 37 37 Dialog *dialog = UIFactory::getInstance().makeDialog(); 38 clock_t start,end; 39 molecule *mol = NULL; 40 double distance = -1.; 41 int order = 0; 42 config *configuration = World::getInstance().getConfig(); 43 int ExitFlag = 0; 38 44 39 dialog->queryEmpty(NAME, MapOfActions::getInstance().getDescription(NAME)); 45 cout << "pre-dialog"<< endl; 46 dialog->queryMolecule(NAME, &mol, MapOfActions::getInstance().getDescription(NAME)); 47 dialog->queryDouble("distance", &distance, MapOfActions::getInstance().getDescription("distance")); 48 dialog->queryInt("order", &order, MapOfActions::getInstance().getDescription("order")); 40 49 41 50 if(dialog->display()) { 51 cout << "POST-dialog"<< endl; 52 ASSERT(mol != NULL, "No molecule has been picked for fragmentation."); 53 DoLog(0) && (Log() << Verbose(0) << "Fragmenting molecule with bond distance " << distance << " angstroem, order of " << order << "." << endl); 54 DoLog(0) && (Log() << Verbose(0) << "Creating connection matrix..." << endl); 55 start = clock(); 56 mol->CreateAdjacencyList(distance, configuration->GetIsAngstroem(), &BondGraph::CovalentMinMaxDistance, NULL); 57 DoLog(0) && (Log() << Verbose(0) << "Fragmenting molecule with current connection matrix ..." << endl); 58 if (mol->hasBondStructure()) { 59 ExitFlag = mol->FragmentMolecule(order, configuration); 60 } 61 World::getInstance().setExitFlag(ExitFlag); 62 end = clock(); 63 DoLog(0) && (Log() << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl); 42 64 delete dialog; 43 65 return Action::success; -
src/Actions/MapOfActions.cpp
r48ab70a re4b5de 120 120 DescriptionMap["MaxDistance"] = "maximum distance in space"; 121 121 DescriptionMap["molecule-by-id"] = "index of a molecule"; 122 DescriptionMap["order"] = "order of a discretization, dissection, ..."; 122 123 DescriptionMap["output-file"] = "name of the output file"; 123 124 DescriptionMap["periodic"] = "system is constraint to periodic boundary conditions (y/n)"; … … 216 217 TypeMap["MaxDistance"] = Double; 217 218 TypeMap["molecule-by-id"] = Molecule; 219 TypeMap["order"] = Integer; 218 220 TypeMap["output-file"] = String; 219 221 TypeMap["periodic"] = Boolean; … … 241 243 // generic.insert("fastparsing"); 242 244 generic.insert("fill-molecule"); 243 //generic.insert("fragment-mol");245 generic.insert("fragment-mol"); 244 246 generic.insert("help"); 245 247 // generic.insert("linear-interpolate"); … … 285 287 286 288 // hidden arguments 287 // generic.insert("distance"); 288 generic.insert("DoRotate"); 289 generic.insert("distances"); 290 generic.insert("lengths"); 291 generic.insert("MaxDistance"); 292 generic.insert("molecule-by-id"); 289 generic.insert("distance"); 290 generic.insert("DoRotate"); 291 generic.insert("distances"); 292 generic.insert("lengths"); 293 generic.insert("MaxDistance"); 294 generic.insert("molecule-by-id"); 295 generic.insert("order"); 293 296 } 294 297 -
src/UIElements/CommandLineUI/CommandLineWindow.cpp
r48ab70a re4b5de 26 26 #include "Actions/FragmentationAction/DepthFirstSearchAction.hpp" 27 27 #include "Actions/FragmentationAction/SubgraphDissectionAction.hpp" 28 #include "Actions/FragmentationAction/FragmentationAction.hpp" 28 29 #include "Actions/MoleculeAction/BondFileAction.hpp" 29 30 #include "Actions/MoleculeAction/ChangeNameAction.hpp" … … 119 120 { 120 121 new FragmentationDepthFirstSearchAction(); 122 new FragmentationFragmentationAction(); 123 new FragmentationSubgraphDissectionAction(); 121 124 } 122 125 -
src/World.cpp
r48ab70a re4b5de 96 96 }; 97 97 98 int World::getExitFlag() { 99 return ExitFlag; 100 } 101 102 void World::setExitFlag(int flag) { 103 if (ExitFlag < flag) 104 ExitFlag = flag; 105 } 98 106 99 107 /******************** Methods to change World state *********************/ … … 279 287 periode(new periodentafel), 280 288 configuration(new config), 289 ExitFlag(0), 281 290 atoms(), 282 291 currAtomId(0), -
src/World.hpp
r48ab70a re4b5de 142 142 void setDefaultName(char * name); 143 143 144 /* 145 * get the ExitFlag 146 */ 147 int getExitFlag(); 148 149 /* 150 * set the ExitFlag 151 */ 152 void setExitFlag(int flag); 153 144 154 /***** Methods to work with the World *****/ 145 155 … … 244 254 static double *cell_size; 245 255 static char *defaultName; 256 int ExitFlag; 246 257 public: 247 258 AtomSet atoms; -
src/builder.cpp
r48ab70a re4b5de 2237 2237 case 'f': 2238 2238 if (ExitFlag == 0) ExitFlag = 1; 2239 if ((argptr+1 >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1]))) {2239 if ((argptr+1 >= argc) || (argv[argptr][0] == '-')) { 2240 2240 ExitFlag = 255; 2241 2241 DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments for fragmentation: -f <max. bond distance> <bond order>" << endl); 2242 2242 performCriticalExit(); 2243 2243 } else { 2244 DoLog(0) && (Log() << Verbose(0) << "Fragmenting molecule with bond distance " << argv[argptr] << " angstroem, order of " << argv[argptr+1] << "." << endl); 2245 DoLog(0) && (Log() << Verbose(0) << "Creating connection matrix..." << endl); 2246 start = clock(); 2247 mol->CreateAdjacencyList(atof(argv[argptr]), configuration.GetIsAngstroem(), &BondGraph::CovalentMinMaxDistance, NULL); 2248 DoLog(0) && (Log() << Verbose(0) << "Fragmenting molecule with current connection matrix ..." << endl); 2249 if (mol->hasBondStructure()) { 2250 ExitFlag = mol->FragmentMolecule(atoi(argv[argptr+1]), &configuration); 2251 } 2252 end = clock(); 2253 DoLog(0) && (Log() << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl); 2254 argptr+=2; 2244 ArgcList.insert(argptr-1); 2245 ArgcList.insert(argptr); 2246 ArgcList.insert(argptr+1); 2247 ArgcList.insert(argptr+2); 2248 ArgcList.insert(argptr+3); 2249 ArgcList.insert(argptr+4); 2250 argptr+=5; 2255 2251 } 2256 2252 break; … … 2409 2405 // handle arguments by ParseCommandLineOptions() 2410 2406 ExitFlag = ParseCommandLineOptions(argc,argv,World::getInstance().getMolecules(),World::getInstance().getPeriode(),*World::getInstance().getConfig(), &ConfigFileName, ArgcList); 2407 World::getInstance().setExitFlag(ExitFlag); 2411 2408 // copy all remaining arguments to a new argv 2412 2409 Arguments = new char *[ArgcList.size()]; … … 2449 2446 delete[](ConfigFileName); 2450 2447 2448 ExitFlag = World::getInstance().getExitFlag(); 2451 2449 return (ExitFlag == 1 ? 0 : ExitFlag); 2452 2450 }
Note:
See TracChangeset
for help on using the changeset viewer.