Changeset 3690e4 for src/Actions
- Timestamp:
- Feb 2, 2016, 5:50:29 PM (9 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:
- 9ae11c
- Parents:
- d1831e (diff), 62d092 (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/FragmentationAction
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/FragmentationAction/AnalyseFragmentationResultsAction.cpp
rd1831e r3690e4 72 72 #include "Fragmentation/Summation/SetValues/Eigenvalues.hpp" 73 73 #include "Fragmentation/Summation/SetValues/Fragment.hpp" 74 #include "Fragmentation/Summation/SetValues/FragmentForces.hpp" 74 75 #include "Fragmentation/Summation/SetValues/Histogram.hpp" 75 76 #include "Fragmentation/Summation/SetValues/IndexedVectors.hpp" … … 240 241 const FragmentationLongRangeResults &results) 241 242 { 242 // print tables (without eigenvalues, they go extra)243 // print tables per keyset(without grids, they go extra) 243 244 244 245 { … … 252 253 } 253 254 255 if (results.hasLongRangeForces()) { 256 const std::string forceresult = 257 writeTable<VMGDataForceMap_t, VMGDataForceVector_t>()( 258 results.Result_ForceLongRange_fused, results.getMaxLevel()); 259 LOG(2, "DEBUG: Force table is \n" << forceresult); 260 std::string filename; 261 filename += FRAGMENTPREFIX + std::string("_VMGForces.dat"); 262 writeToFile(filename, forceresult); 263 } 264 254 265 { 255 266 const std::string gridresult = … … 260 271 filename += FRAGMENTPREFIX + std::string("_LongRangeEnergy.dat"); 261 272 writeToFile(filename, gridresult); 273 } 274 275 if (results.hasLongRangeForces()) { 276 const std::string forceresult = 277 writeTable<VMGDataLongRangeForceMap_t, VMGDataLongRangeForceVector_t >()( 278 results.Result_ForcesLongRangeIntegrated_fused, results.getMaxLevel(), 1); 279 LOG(2, "DEBUG: ForcesLongRange table is \n" << forceresult); 280 std::string filename; 281 filename += FRAGMENTPREFIX + std::string("_LongRangeForces.dat"); 282 writeToFile(filename, forceresult); 262 283 } 263 284 } … … 325 346 326 347 // obtain potential distribution 327 std::map<IndexSet::ptr, std::pair< VMGData Map_t, VMGDataMap_t> >::const_iterator potentialiter328 = longrangeresults.Result_perIndexSet_LongRange .find(index);329 ASSERT( potentialiter != longrangeresults.Result_perIndexSet_LongRange .end(),348 std::map<IndexSet::ptr, std::pair< VMGDataGridMap_t, VMGDataGridMap_t> >::const_iterator potentialiter 349 = longrangeresults.Result_perIndexSet_LongRange_Grid.find(index); 350 ASSERT( potentialiter != longrangeresults.Result_perIndexSet_LongRange_Grid.end(), 330 351 "appendToHomologyFile() - cannot find index "+toString(*index) 331 352 +" in FragmentResults."); 332 353 // add e+n potentials 333 value.potential_distribution = boost::fusion::at_key<VMGDataFused::both_sampled_potential>(potentialiter->second.second); // contributions 354 value.potential_distribution = 355 boost::fusion::at_key<VMGDataFused::both_sampled_potential>(potentialiter->second.second); // contributions 334 356 // // and re-average to zero (integral is times volume_element which we don't need here) 335 357 // const double sum = … … 625 647 if (DoLongrange) { 626 648 if ( const_cast<const World &>(World::getInstance()).getAllAtoms().size() == 0) { 627 STATUS("Please load the full molecule into std::map<JobId_t, VMGData> longrangeData the world before starting this action.");649 STATUS("Please load the full molecule into std::map<JobId_t, VMGData> longrangeData the world before starting this action."); 628 650 return Action::failure; 629 651 } … … 635 657 // remove full solution corresponding to full_sample from map (must be highest ids), has to be treated extra 636 658 std::map<JobId_t, VMGData>::iterator iter = longrangeData.end(); 637 for (size_t i=0;i<full_sample.size();++i) 638 --iter; 659 std::advance(iter, -full_sample.size()); 639 660 std::map<JobId_t, VMGData>::iterator remove_iter = iter; 640 661 std::vector<VMGData> fullsolutionData; 641 662 for (; iter != longrangeData.end(); ++iter) 642 663 fullsolutionData.push_back(iter->second); 643 longrangeData.erase(remove_iter, longrangeData.end()); 664 if (longrangeData.size() > 1) // when there's just a single fragment, it corresponds to full solution 665 longrangeData.erase(remove_iter, longrangeData.end()); 644 666 645 667 // Final phase: sum up and print result -
src/Actions/FragmentationAction/FragmentationAction.cpp
rd1831e r3690e4 259 259 << params.InterOrder.get() << " and distance of " 260 260 << params.distance.get() << "."); 261 const enum HydrogenTreatment treatment = 262 params.HowtoTreatHydrogen.get() ? ExcludeHydrogen : IncludeHydrogen; 263 const double UpperBound = std::max(10., params.distance.get()); 261 264 Interfragmenter fragmenter(TotalGraph); 262 const enum HydrogenTreatment treatment = params.HowtoTreatHydrogen.get() ? ExcludeHydrogen : IncludeHydrogen; 265 266 // check the largest Rcut that causes no additional inter-fragments 267 const double Min_Rcut = 268 fragmenter.findLargestCutoff(params.InterOrder.get(), UpperBound, treatment); 269 270 // if we smear out electronic charges, warn when non-overlapping criterion does not hold 271 if (params.InterOrder.get() < Min_Rcut) 272 ELOG(2, "Inter-order is too low to cause any additional fragments."); 273 274 // then add fragments 263 275 fragmenter(params.InterOrder.get(), params.distance.get(), treatment); 276 264 277 LOG(0, "STATUS: There are now " << TotalGraph.size() << " fragments after interfragmenting."); 265 278 } -
src/Actions/FragmentationAction/FragmentationAutomationAction.cpp
rd1831e r3690e4 260 260 params.DoValenceOnly.get() ? MPQCData::DoSampleValenceOnly : MPQCData::DontSampleValenceOnly, 261 261 params.DoPrintDebug.get(), 262 OpenBoundaryConditions)) { 262 OpenBoundaryConditions, 263 params.DoSmearCharges.get())) { 263 264 STATUS("Could not create long-range jobs for electronic charge distribution."); 264 265 return Action::failure; … … 290 291 params.DoValenceOnly.get() ? MPQCData::DoSampleValenceOnly : MPQCData::DontSampleValenceOnly, 291 292 params.DoPrintDebug.get(), 292 OpenBoundaryConditions)) { 293 OpenBoundaryConditions, 294 params.DoSmearCharges.get())) { 293 295 STATUS("Could not create long-range jobs for nuclei charge distribution."); 294 296 return Action::failure; … … 316 318 destiter->second.both_sampled_potential = srciter->second.sampled_potential; 317 319 destiter->second.nuclei_long = srciter->second.nuclei_long; 320 destiter->second.forces = srciter->second.forces; 321 destiter->second.hasForces = srciter->second.hasForces; 318 322 } 319 323 } -
src/Actions/FragmentationAction/FragmentationAutomationAction.def
rd1831e r3690e4 18 18 // ValueStorage by the token "Z" -> first column: int, Z, "Z" 19 19 // "undefine" if no parameters are required, use (NOPARAM_DEFAULT) for each (undefined) default value 20 #define paramtypes (std::string)(std::string)(boost::filesystem::path)(unsigned int)(unsigned int)(unsigned int)(bool)(boost::filesystem::path)(bool)(bool) 21 #define paramtokens ("server-address")("server-port")("fragment-executable")("grid-level")("near-field-cells")("interpolation-degree")("DoLongrange")("fragment-resultfile")("DoValenceOnly")("DoPrintDebug") 22 #define paramdescriptions ("hostname of server")("controller port of server")("executable to launch on clients")("resolution of multigrid")("number of cells used in smearing out core charge")("interpolation degree for getting the nuclei potential from the grid")("whether to calculate long-range contributions")("parse fragment results from the given file")("whether the sampling uses only the valence electron and nuclei charge")("whether to print grids for debug visualization") 23 #define paramdefaults (PARAM_DEFAULT("127.0.0.1"))(NOPARAM_DEFAULT)(PARAM_DEFAULT("mpqc"))(PARAM_DEFAULT(5))(PARAM_DEFAULT(3))(PARAM_DEFAULT(3))(PARAM_DEFAULT("0"))(PARAM_DEFAULT(""))(PARAM_DEFAULT("0"))(PARAM_DEFAULT("0")) 24 #define paramreferences (host)(port)(executable)(level)(near_field_cells)(interpolation_degree)(DoLongrange)(resultsfile)(DoValenceOnly)(DoPrintDebug) 20 #define paramtypes (std::string)(std::string)(boost::filesystem::path)(unsigned int)(unsigned int)(unsigned int)(bool)(boost::filesystem::path)(bool)(bool)(bool) 21 #define paramtokens ("server-address")("server-port")("fragment-executable")("grid-level")("near-field-cells")("interpolation-degree")("DoLongrange")("fragment-resultfile")("DoValenceOnly")("DoPrintDebug")("DoSmearElectronicCharges") 22 #define paramdescriptions ("hostname of server")("controller port of server")("executable to launch on clients")("resolution of multigrid")("number of cells used in smearing out core charge")("interpolation degree for getting the nuclei potential from the grid")("whether to calculate long-range contributions")("parse fragment results from the given file")("whether the sampling uses only the valence electron and nuclei charge")("whether to print grids for debug visualization")("whether to smear out electronic charge distributions with bsplines or not") 23 #define paramdefaults (PARAM_DEFAULT("127.0.0.1"))(NOPARAM_DEFAULT)(PARAM_DEFAULT("mpqc"))(PARAM_DEFAULT(5))(PARAM_DEFAULT(3))(PARAM_DEFAULT(3))(PARAM_DEFAULT("0"))(PARAM_DEFAULT(""))(PARAM_DEFAULT("0"))(PARAM_DEFAULT("0"))(PARAM_DEFAULT("0")) 24 #define paramreferences (host)(port)(executable)(level)(near_field_cells)(interpolation_degree)(DoLongrange)(resultsfile)(DoValenceOnly)(DoPrintDebug)(DoSmearCharges) 25 25 #define paramvalids \ 26 26 (DummyValidator< std::string >()) \ … … 32 32 (DummyValidator< bool >()) \ 33 33 (DummyValidator< boost::filesystem::path >()) \ 34 (DummyValidator< bool >()) \ 34 35 (DummyValidator< bool >()) \ 35 36 (DummyValidator< bool >())
Note:
See TracChangeset
for help on using the changeset viewer.