Changeset ce70d25 for src/Actions
- Timestamp:
- Sep 9, 2016, 8:21:34 AM (8 years ago)
- Branches:
- Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_StructOpt_integration_tests, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, 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_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, 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, GeometryObjects, Gui_displays_atomic_force_velocity, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, Ubuntu_1604_changes, stable
- Children:
- 27e6a7
- Parents:
- 945797
- git-author:
- Frederik Heber <heber@…> (09/01/16 20:30:45)
- git-committer:
- Frederik Heber <heber@…> (09/09/16 08:21:34)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/FragmentationAction/AnalyseFragmentationResultsAction.cpp
r945797 rce70d25 288 288 #endif 289 289 290 voidappendToHomologies(290 bool appendToHomologies( 291 291 const FragmentationShortRangeResults &shortrangeresults, 292 292 #if defined(HAVE_JOBMARKET) && defined(HAVE_VMG) … … 317 317 LOG(2, "DEBUG: Created graph " << graph << "."); 318 318 const IndexSet::ptr &index = *iter; 319 if (!(**forceiter).contains(**iter)) { 320 // this caught an error with faulty KeySetsContainer::insert(). 321 // indexset and forceindexset need to be in same order and differ 322 // only in forceindexset contains extra indices for saturation hydrogens 323 ELOG(1, "appendToHomologies() - force index set " << (**forceiter) 324 << " does not contain index set " << (**iter) << "."); 325 return false; 326 } 319 327 320 328 /// we fill the value structure … … 324 332 std::map<IndexSet::ptr, std::pair< MPQCDataFragmentMap_t, MPQCDataFragmentMap_t> >::const_iterator fragmentiter 325 333 = shortrangeresults.Result_perIndexSet_Fragment.find(index); 326 ASSERT( fragmentiter != shortrangeresults.Result_perIndexSet_Fragment.end(), 327 "appendToHomologyFile() - cannot find index "+toString(*index) 328 +" in FragmentResults."); 334 if (fragmentiter == shortrangeresults.Result_perIndexSet_Fragment.end()) { 335 ELOG(1, "appendToHomologyFile() - cannot find index " << (*index) 336 << " in FragmentResults."); 337 return false; 338 } 329 339 value.fragment = boost::fusion::at_key<MPQCDataFused::fragment>(fragmentiter->second.first); 330 340 … … 332 342 std::map<IndexSet::ptr, std::pair< MPQCDataEnergyMap_t, MPQCDataEnergyMap_t> >::const_iterator energyiter 333 343 = shortrangeresults.Result_perIndexSet_Energy.find(index); 334 ASSERT( energyiter != shortrangeresults.Result_perIndexSet_Energy.end(), 335 "appendToHomologyFile() - cannot find index "+toString(*index) 336 +" in FragmentResults."); 344 if (energyiter == shortrangeresults.Result_perIndexSet_Energy.end()) { 345 ELOG(1, "appendToHomologyFile() - cannot find index " << (*index) 346 << " in FragmentResults."); 347 return false; 348 } 337 349 value.energy = boost::fusion::at_key<MPQCDataFused::energy_total>(energyiter->second.second); // contributions 338 350 … … 343 355 std::map<IndexSet::ptr, std::pair< MPQCDataGridMap_t, MPQCDataGridMap_t> >::const_iterator chargeiter 344 356 = longrangeresults.Result_perIndexSet_Grid.find(index); 345 ASSERT( chargeiter != longrangeresults.Result_perIndexSet_Grid.end(), 346 "appendToHomologyFile() - cannot find index "+toString(*index) 347 +" in FragmentResults."); 357 if (chargeiter == longrangeresults.Result_perIndexSet_Grid.end()) { 358 ELOG(1, "appendToHomologyFile() - cannot find index " << (*index) 359 << " in FragmentResults."); 360 return false; 361 } 348 362 value.charge_distribution = boost::fusion::at_key<MPQCDataFused::sampled_grid>(chargeiter->second.second); // contributions 349 363 … … 351 365 std::map<IndexSet::ptr, std::pair< VMGDataGridMap_t, VMGDataGridMap_t> >::const_iterator potentialiter 352 366 = longrangeresults.Result_perIndexSet_LongRange_Grid.find(index); 353 ASSERT( potentialiter != longrangeresults.Result_perIndexSet_LongRange_Grid.end(), 354 "appendToHomologyFile() - cannot find index "+toString(*index) 355 +" in FragmentResults."); 367 if (potentialiter == longrangeresults.Result_perIndexSet_LongRange_Grid.end()) { 368 ELOG(1, "appendToHomologyFile() - cannot find index " << (*index) 369 << " in FragmentResults."); 370 return false; 371 } 356 372 // add e+n potentials 357 373 value.potential_distribution = … … 369 385 // *iter -= offset; 370 386 #else 371 ELOG( 1, "Long-range information in homology desired but long-range analysis capability not compiled in.");387 ELOG(2, "Long-range information in homology desired but long-range analysis capability not compiled in."); 372 388 #endif 373 389 } … … 404 420 } 405 421 } 422 423 return true; 406 424 } 407 425 … … 561 579 562 580 ActionState::ptr FragmentationAnalyseFragmentationResultsAction::performCall() { 581 bool status=true; 563 582 564 583 /// if file is given, parse from file into ResultsContainer … … 575 594 } else { 576 595 ELOG(1, "Given file" << resultsfile.string() << " does not exist."); 596 STATUS("AnalyseFragmentResultsAction failed: missing results file."); 597 return Action::failure; 577 598 } 578 599 } … … 715 736 716 737 // append all keysets to homology file 717 appendToHomologies(shortrangeresults, longrangeresults, params.DoStoreGrids.get());738 status = appendToHomologies(shortrangeresults, longrangeresults, params.DoStoreGrids.get()); 718 739 } else { 719 740 // append all keysets to homology file with short-range info only (without grids) … … 721 742 FragmentationLongRangeResults longrangeresults( 722 743 shortrangedata, longrangeData, keysets, forcekeysets); 723 appendToHomologies(shortrangeresults, longrangeresults, false);744 status = appendToHomologies(shortrangeresults, longrangeresults, false); 724 745 } 725 746 #else … … 729 750 730 751 // append all keysets to homology file with short-range info only (without grids) 731 appendToHomologies(shortrangeresults, false);752 status = appendToHomologies(shortrangeresults, false); 732 753 #endif 733 754 … … 735 756 // container.clear(); 736 757 737 return Action::success; 758 if (status) 759 return Action::success; 760 else { 761 STATUS("AnalyseFragmentResultsAction failed: invalid results, failed to append to homologies."); 762 return Action::failure; 763 } 738 764 } 739 765
Note:
See TracChangeset
for help on using the changeset viewer.