Changeset 3690e4 for src/Jobs/WindowGrid_converter.cpp
- 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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Jobs/WindowGrid_converter.cpp
rd1831e r3690e4 50 50 51 51 #include "Fragmentation/Summation/SetValues/SamplingGrid.hpp" 52 #include "Jobs/ChargeSmearer.hpp" 52 53 53 54 void WindowGrid_converter::addGridOntoWindow( … … 178 179 const SamplingGrid &grid, 179 180 const double prefactor, 180 const bool OpenBoundaryConditions) 181 const bool OpenBoundaryConditions, 182 const bool DoSmearCharges) 181 183 { 182 184 #ifndef NDEBUG … … 244 246 } 245 247 248 /// reset grid to zero everywhere 249 246 250 VMG::Grid::iterator griditer = window.Iterators().Local().Begin(); 247 251 // griditer.advance(pre_offset[0]*total[1]*total[2]); 252 for(N[0]=0; N[0] < total[0]; ++N[0]) 253 for(N[1]=0; N[1] < total[1]; ++N[1]) 254 for(N[2]=0; N[2] < total[2]; ++N[2]) { 255 ASSERT( griditer != window.Iterators().Local().End(), 256 "InterfaceVMGJob::addWindowOntoGrid() - griditer is already at end of window."); 257 window(*griditer++) = 0.; 258 } 259 260 #ifndef NDEBUG 261 ASSERT( griditer == window.Iterators().Local().End(), 262 "InterfaceVMGJob::addWindowOntoGrid() - griditer is not at end of window."); 263 #endif 264 265 /// then apply charges onto grid 266 267 griditer = window.Iterators().Local().Begin(); 268 SamplingGrid::sampledvalues_t::const_iterator copyiter = grid.sampled_grid.begin(); 269 const ChargeSmearer &smearer = ChargeSmearer::getInstance(); 270 // NOTE: GridIterator::operator+=()'s implementation in vmg is broken. DON'T USE! 271 // griditer += pre_offset[0] * total[1] * total[2]; 248 272 for(N[0]=0; N[0] < pre_offset[0]; ++N[0]) 249 273 for(N[1]=0; N[1] < total[1]; ++N[1]) … … 251 275 ASSERT( griditer != window.Iterators().Local().End(), 252 276 "InterfaceVMGJob::addWindowOntoGrid() - griditer is already at end of window."); 253 window(*griditer++) = 0.; 254 } 255 SamplingGrid::sampledvalues_t::const_iterator copyiter = grid.sampled_grid.begin(); 277 griditer++; 278 } 256 279 for(N[0]=0; N[0] < length[0]; ++N[0]) { 257 // griditer .advance(pre_offset[1]*total[2]);280 // griditer += pre_offset[1] * total[2]; 258 281 for(N[1]=0; N[1] < pre_offset[1]; ++N[1]) 259 282 for(N[2]=0; N[2] < total[2]; ++N[2]) { 260 283 ASSERT( griditer != window.Iterators().Local().End(), 261 284 "InterfaceVMGJob::addWindowOntoGrid() - griditer is already at end of window."); 262 window(*griditer++) = 0.;285 griditer++; 263 286 } 264 287 for(N[1]=0; N[1] < length[1]; ++N[1]) { 265 // griditer.advance(pre_offset[2]); 266 for(N[2]=0; N[2] < pre_offset[2]; ++N[2]) 267 window(*griditer++) = 0.; 288 // griditer += pre_offset[2]; 289 for(N[2]=0; N[2] < pre_offset[2]; ++N[2]) { 290 griditer++; 291 } 292 268 293 for(N[2]=0; N[2] < length[2]; ++N[2]) { 269 294 ASSERT( griditer != window.Iterators().Local().End(), … … 271 296 ASSERT( copyiter != grid.sampled_grid.end(), 272 297 "InterfaceVMGJob::addWindowOntoGrid() - griditer is already at end of window."); 273 window(*griditer++) += prefactor*(*copyiter++); 274 } 275 // griditer.advance(post_offset[2]); 298 // either smear out charges or not. 299 if (DoSmearCharges) { 300 smearer(window, griditer++, prefactor*(*copyiter++)); 301 } else { 302 window(*griditer++) += prefactor*(*copyiter++); 303 } 304 } 305 // griditer += post_offset[2]; 276 306 for(N[2]=0; N[2] < post_offset[2]; ++N[2]) { 277 307 ASSERT( griditer != window.Iterators().Local().End(), 278 308 "InterfaceVMGJob::addWindowOntoGrid() - griditer is already at end of window."); 279 window(*griditer++) = 0.;309 griditer++; 280 310 } 281 311 } 282 // griditer .advance(post_offset[1]*total[2]);312 // griditer += post_offset[1] * total[2]; 283 313 for(N[1]=0; N[1] < post_offset[1]; ++N[1]) 284 314 for(N[2]=0; N[2] < total[2]; ++N[2]) { 285 315 ASSERT( griditer != window.Iterators().Local().End(), 286 316 "InterfaceVMGJob::addWindowOntoGrid() - griditer is already at end of window."); 287 window(*griditer++) = 0.;288 } 289 } 290 // griditer.advance(post_offset[0]*total[1]*total[2]);317 griditer++; 318 } 319 } 320 // griditer += post_offset[0] * total[1] * total[2]; 291 321 for(N[0]=0; N[0] < post_offset[0]; ++N[0]) 292 322 for(N[1]=0; N[1] < total[1]; ++N[1]) … … 294 324 ASSERT( griditer != window.Iterators().Local().End(), 295 325 "InterfaceVMGJob::addWindowOntoGrid() - griditer is already at end of window."); 296 window(*griditer++) = 0.;326 griditer++; 297 327 } 298 328 #ifndef NDEBUG … … 302 332 "InterfaceVMGJob::addWindowOntoGrid() - copyiter is not at end of window."); 303 333 #endif 304 // LOG(2, "DEBUG: Grid after adding other is " << grid << "."); 334 335 // LOG(2, "DEBUG: Grid after adding other is " << grid << "."); 305 336 }
Note:
See TracChangeset
for help on using the changeset viewer.