Changeset e5ebaf
- Timestamp:
- Jul 9, 2013, 6:21:05 AM (11 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:
- f73351
- Parents:
- ec5d0c
- git-author:
- Frederik Heber <heber@…> (06/18/13 14:29:50)
- git-committer:
- Frederik Heber <heber@…> (07/09/13 06:21:05)
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/FragmentationAction/AnalyseFragmentationResultsAction.cpp
rec5d0c re5ebaf 41 41 #include "CodePatterns/MemDebug.hpp" 42 42 43 #include <boost/foreach.hpp> 43 44 #include <boost/mpl/remove.hpp> 44 45 … … 58 59 #endif 59 60 61 #include "Descriptors/AtomIdDescriptor.hpp" 60 62 #include "Fragmentation/Summation/Containers/FragmentationChargeDensity.hpp" 61 63 #include "Fragmentation/Summation/Containers/FragmentationLongRangeResults.hpp" … … 79 81 #include "Fragmentation/Summation/Containers/VMGData_printKeyNames.hpp" 80 82 #endif 83 #include "Helpers/defs.hpp" 81 84 #include "World.hpp" 82 85 … … 248 251 IndexSetContainer::Container_t::const_iterator iter = Indices.begin(); 249 252 IndexSetContainer::Container_t::const_iterator forceiter = ForceIndices.begin(); 253 250 254 /// go through all fragments 251 255 for (;iter != Indices.end(); ++iter, ++forceiter) // go through each IndexSet … … 338 342 const KeySetsContainer &forcekeysets = container.getForceKeySets(); 339 343 const bool DoLongrange = container.areFullRangeResultsPresent(); 344 const bool IsAngstroem = true; 340 345 341 346 if (keysets.KeySets.empty()) { … … 347 352 shortrangeresults(shortrangedata); 348 353 printReceivedShortResults(shortrangeresults); 354 355 // adding obtained forces 356 if ( World::getInstance().getAllAtoms().size() != 0) { 357 const IndexedVectors::indexedvectors_t forces = 358 boost::fusion::at_key<MPQCDataFused::forces>( 359 shortrangeresults.Result_Force_fused.back() 360 ).getVectors(); 361 ; 362 for(IndexedVectors::indexedvectors_t::const_iterator iter = forces.begin(); 363 iter != forces.end(); ++iter) { 364 const IndexedVectors::index_t &index = iter->first; 365 const IndexedVectors::vector_t &forcevector = iter->second; 366 ASSERT( forcevector.size() == NDIM, 367 "printReceivedShortResults() - obtained force vector has incorrect dimension."); 368 // note that mpqc calculates a gradient, hence force pointing into opposite direction 369 // we have to mind different units here: MPQC has a_o, while we may have angstroem 370 Vector ForceVector(-forcevector[0], -forcevector[1], -forcevector[2]); 371 if (IsAngstroem) 372 for (size_t i=0;i<NDIM;++i) 373 ForceVector[i] *= AtomicLengthToAngstroem; 374 atom *_atom = World::getInstance().getAtom(AtomById(index)); 375 if(_atom != NULL) 376 _atom->setAtomicForce(_atom->getAtomicForce() + ForceVector); 377 else 378 ELOG(2, "Could not find atom to id " << index << "."); 379 } 380 } else { 381 LOG(1, "INFO: Full molecule not loaded, hence will not add forces to atoms."); 382 } 349 383 350 384 #ifdef HAVE_VMG -
src/Fragmentation/Summation/SetValues/IndexedVectors.hpp
rec5d0c re5ebaf 95 95 } 96 96 97 /** Const getter to index vectors. 98 * 99 * \return const reference to indexed vectors 100 */ 101 const indexedvectors_t& getVectors() const 102 { return vectors; } 103 97 104 private: 98 105 /** Helper function that contains all the logic of how to superpose two -
tests/regression/Fragmentation/AnalyseFragmentationResults/testsuite-fragmentation-analyse-fragment-results.at
rec5d0c re5ebaf 37 37 AT_CLEANUP 38 38 39 AT_SETUP([Fragmentation - Analyse short-range fragmentation results with forces]) 40 AT_KEYWORDS([fragmentation analyse-fragment-results forces]) 41 42 file=BondFragmentShortRangeResults.dat 43 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Fragmentation/AnalyseFragmentationResults/pre/$file $file], 0) 44 AT_CHECK([chmod u+w $file], 0, [ignore], [ignore]) 45 AT_CHECK([../../molecuilder -i ${abs_top_srcdir}/tests/regression/Fragmentation/AnalyseFragmentationResults/pre/alkane-3.pdb -o tremolo --set-tremolo-atomdata "Id type x=3 u=3 F=3" --reset 1 --analyse-fragment-results --fragment-resultfile $file], 0, [ignore], [ignore]) 46 AT_CHECK([diff alkane-3.data ${abs_top_srcdir}/tests/regression/Fragmentation/AnalyseFragmentationResults/post/alkane-3.data], 0, [ignore], [ignore]) 47 48 AT_CLEANUP 49 39 50 # 40 51 # BondFragmentLongRangeResults.dat is created like this: … … 47 58 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Fragmentation/AnalyseFragmentationResults/pre/$file $file], 0) 48 59 AT_CHECK([chmod u+w $file], 0, [ignore], [ignore]) 49 AT_CHECK([../../molecuilder -i ${abs_top_srcdir}/tests/regression/Fragmentation/AnalyseFragmentationResults/pre/alkane-3.pdb --analyse-fragment-results --fragment-resultfile $file], 0, [ignore], [stderr]) 60 AT_CHECK([../../molecuilder -i ${abs_top_srcdir}/tests/regression/Fragmentation/AnalyseFragmentationResults/pre/alkane-3.pdb -o tremolo --set-tremolo-atomdata "Id type x=3 u=3 F=3" --reset 1 --analyse-fragment-results --fragment-resultfile $file], 0, [ignore], [stderr]) 61 AT_CHECK([diff alkane-3.data ${abs_top_srcdir}/tests/regression/Fragmentation/AnalyseFragmentationResults/post/alkane-3.data], 0, [ignore], [ignore]) 50 62 AT_CHECK([output=BondFragment_Energy.dat; diff $output ${abs_top_srcdir}/tests/regression/Fragmentation/AnalyseFragmentationResults/post/LongRange/$output], 0, [ignore], [ignore]) 51 63 AT_CHECK([output=BondFragment_Forces.dat; diff $output ${abs_top_srcdir}/tests/regression/Fragmentation/AnalyseFragmentationResults/post/LongRange/$output], 0, [ignore], [ignore])
Note:
See TracChangeset
for help on using the changeset viewer.