Changeset 666e9e
- Timestamp:
- May 7, 2016, 7:05:19 AM (9 years ago)
- Branches:
- Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, 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_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:
- a9099d
- Parents:
- 0ba27c9
- git-author:
- Frederik Heber <heber@…> (02/17/16 18:24:55)
- git-committer:
- Frederik Heber <heber@…> (05/07/16 07:05:19)
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/FragmentationAction/AnalyseFragmentationResultsAction.cpp
r0ba27c9 r666e9e 62 62 63 63 #include "Descriptors/AtomIdDescriptor.hpp" 64 #include "Atom/atom.hpp" 65 #include "Element/element.hpp" 64 66 #include "Fragmentation/Summation/Containers/FragmentationChargeDensity.hpp" 65 67 #include "Fragmentation/Summation/Containers/FragmentationResultContainer.hpp" … … 86 88 #endif 87 89 #include "Helpers/defs.hpp" 90 #include "Potentials/Particles/ParticleRegistry.hpp" 88 91 #include "World.hpp" 89 92 … … 672 675 673 676 // Final phase: sum up and print result 677 IndexedVectors::indices_t implicit_indices; 678 if (params.UseImplicitCharges.get()) { 679 // place all in implicit charges that are not selected but contained in ParticleRegistry 680 const World &world = const_cast<const World &>(World::getInstance()); 681 const ParticleRegistry ®istry = const_cast<const ParticleRegistry &>(ParticleRegistry::getInstance()); 682 const World::ConstAtomComposite &atoms = world.getAllAtoms(); 683 for (World::ConstAtomComposite::const_iterator iter = atoms.begin(); 684 iter != atoms.end(); ++iter) { 685 const atomId_t atomid = (*iter)->getId(); 686 if (!world.isAtomSelected(atomid)) { 687 const std::string &symbol = (*iter)->getElement().getSymbol(); 688 if (registry.isPresentByName(symbol)) 689 implicit_indices.push_back(atomid); 690 } 691 } 692 LOG(2, "INFO: We added " << implicit_indices.size() << " indices due to implicit charges."); 693 } 694 674 695 FragmentationLongRangeResults longrangeresults( 675 696 shortrangedata,longrangeData,keysets, forcekeysets); … … 678 699 longrangeData, 679 700 fullsolutionData, 680 full_sample); 701 full_sample, 702 implicit_indices); 681 703 printReceivedFullResults(longrangeresults); 682 704 … … 698 720 std::map<JobId_t, VMGData> longrangeData; 699 721 FragmentationLongRangeResults longrangeresults( 700 shortrangedata, longrangeData,keysets, forcekeysets);722 shortrangedata, longrangeData, keysets, forcekeysets); 701 723 appendToHomologies(shortrangeresults, longrangeresults, false); 702 724 } -
src/Actions/FragmentationAction/AnalyseFragmentationResultsAction.def
r0ba27c9 r666e9e 15 15 // ValueStorage by the token "Z" -> first column: int, Z, "Z" 16 16 // "undefine" if no parameters are required, use (NOPARAM_DEFAULT) for each (undefined) default value 17 #define paramtypes (boost::filesystem::path)(bool)(std::string) 18 #define paramtokens ("fragment-resultfile")("store-grids")("fragment-prefix") 19 #define paramdescriptions ("parse fragment results from the given file")("whether to store sampled grids in homology files")("prefix of each fragment file") 20 #define paramdefaults (NOPARAM_DEFAULT)(PARAM_DEFAULT("0"))(PARAM_DEFAULT("BondFragment")) 21 #define paramreferences (resultsfile)(DoStoreGrids)(prefix) 17 #define paramtypes (boost::filesystem::path)(bool)(std::string)(bool) 18 #define paramtokens ("fragment-resultfile")("store-grids")("fragment-prefix")("UseImplicitCharges") 19 #define paramdescriptions ("parse fragment results from the given file")("whether to store sampled grids in homology files")("prefix of each fragment file")("whether to model any non-selected atoms by partial charges implicitly") 20 #define paramdefaults (NOPARAM_DEFAULT)(PARAM_DEFAULT("0"))(PARAM_DEFAULT("BondFragment"))(PARAM_DEFAULT("0")) 21 #define paramreferences (resultsfile)(DoStoreGrids)(prefix)(UseImplicitCharges) 22 22 #define paramvalids \ 23 23 (DummyValidator< boost::filesystem::path >()) \ 24 24 (DummyValidator< bool >()) \ 25 (DummyValidator< std::string >()) 25 (DummyValidator< std::string >()) \ 26 (DummyValidator< bool >()) 26 27 27 28 #undef statetypes -
src/Actions/FragmentationAction/FragmentationAutomationAction.cpp
r0ba27c9 r666e9e 261 261 params.DoPrintDebug.get(), 262 262 OpenBoundaryConditions, 263 params.DoSmearCharges.get())) { 263 params.DoSmearCharges.get(), 264 false)) { 264 265 STATUS("Could not create long-range jobs for electronic charge distribution."); 265 266 return Action::failure; … … 292 293 params.DoPrintDebug.get(), 293 294 OpenBoundaryConditions, 294 params.DoSmearCharges.get())) { 295 params.DoSmearCharges.get(), 296 params.UseImplicitCharges.get())) { 295 297 STATUS("Could not create long-range jobs for nuclei charge distribution."); 296 298 return Action::failure; -
src/Actions/FragmentationAction/FragmentationAutomationAction.def
r0ba27c9 r666e9e 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)(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) 20 #define paramtypes (std::string)(std::string)(boost::filesystem::path)(unsigned int)(unsigned int)(unsigned int)(bool)(boost::filesystem::path)(bool)(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")("UseImplicitCharges") 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")("whether to model any non-selected atoms by partial charges implicitly") 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"))(PARAM_DEFAULT("0")) 24 #define paramreferences (host)(port)(executable)(level)(near_field_cells)(interpolation_degree)(DoLongrange)(resultsfile)(DoValenceOnly)(DoPrintDebug)(DoSmearCharges)(UseImplicitCharges) 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 >()) \ -
src/Fragmentation/Automation/VMGFragmentController.cpp
r0ba27c9 r666e9e 47 47 #include "Jobs/VMGJob.hpp" 48 48 #include "molecule.hpp" 49 #include "Potentials/Particles/Particle.hpp" 50 #include "Potentials/Particles/ParticleRegistry.hpp" 49 51 #include "World.hpp" 50 52 … … 77 79 const bool _DoPrintDebug, 78 80 const bool _OpenBoundaryConditions, 79 const bool _DoSmearCharges) 81 const bool _DoSmearCharges, 82 const bool _UseImplicitCharges) 80 83 { 81 84 std::vector<FragmentJob::ptr> jobs; … … 110 113 std::vector< std::vector<double> > positions; 111 114 std::vector<double> charges; 115 const World &world = const_cast<const World &>(World::getInstance()); 116 const ParticleRegistry ®istry = const_cast<const ParticleRegistry &>(ParticleRegistry::getInstance()); 112 117 { 113 const World::ConstAtomComposite &atoms = const_cast<const World &>(World::getInstance()). 114 getAllAtoms(); 118 const World::ConstAtomComposite &atoms = world.getAllAtoms(); 115 119 positions.reserve(atoms.size()); 116 120 charges.reserve(atoms.size()); … … 118 122 for (World::ConstAtomComposite::const_iterator iter = atoms.begin(); 119 123 iter != atoms.end(); ++iter) { 124 // set position for this atom 120 125 const Vector &pos = (*iter)->getPosition(); 121 126 // convert positions to atomic length units 122 for (size_t i=0;i<3;++i) position[i] = pos[i]/AtomicLengthToAngstroem; 123 positions.push_back(position); 124 int charge = (*iter)->getElement().getAtomicNumber(); 125 // subtract core electron charge from nuclei charge if only valence sampled 126 if (_DoValenceOnly == MPQCData::DoSampleValenceOnly) 127 charge -= getCoreElectrons(charge); 128 charges.push_back((double)charge); 127 for (size_t i=0;i<3;++i) 128 position[i] = pos[i]/AtomicLengthToAngstroem; 129 130 // use partial charges ... 131 const atomId_t atomid = (*iter)->getId(); 132 if ((!world.isAtomSelected(atomid)) && (_UseImplicitCharges)) { 133 // ... for all unselected particles ... 134 const std::string &symbol = (*iter)->getElement().getSymbol(); 135 if (registry.isPresentByName(symbol)) { 136 // ... that are present in ParticleRegistry 137 const Particle * const particle = registry.getByName(symbol); 138 LOG(3, "DEBUG: Using implicit charge " << particle->charge << " for atom " << atomid); 139 positions.push_back(position); 140 charges.push_back(particle->charge); 141 } 142 } else { 143 double charge = (*iter)->getElement().getAtomicNumber(); 144 // subtract core electron charge from nuclei charge if only valence sampled 145 if (_DoValenceOnly == MPQCData::DoSampleValenceOnly) 146 charge -= getCoreElectrons(charge); 147 positions.push_back(position); 148 charges.push_back((double)charge); 149 } 129 150 } 130 151 } -
src/Fragmentation/Automation/VMGFragmentController.hpp
r0ba27c9 r666e9e 64 64 * boundary conditions 65 65 * \param _DoSmearCharges whether to smear out electronic charge distributions with bsplines or not 66 * \param _UseImplicitCharges use implicit charges in potential storage if 67 * element is found 66 68 */ 67 69 bool createLongRangeJobs( … … 75 77 const bool _DoPrintDebug, 76 78 const bool _OpenBoundaryConditions = false, 77 const bool _DoSmearCharges = false); 79 const bool _DoSmearCharges = false, 80 const bool _UseImplicitCharges = false); 78 81 79 82 void waitforResults(const size_t NoExpectedResults) -
tests/Python/AllActions/options.dat
r0ba27c9 r666e9e 252 252 unselect-molecules-by-name "water" 253 253 unselect-shape-by-name "cube42" 254 UseImplicitCharges "1" 254 255 verbose "3" 255 256 verlet-integration "forces.dat"
Note:
See TracChangeset
for help on using the changeset viewer.