Changeset 978234 for src/Fragmentation/Summation/SetValues
- Timestamp:
- Sep 14, 2016, 6:42:52 PM (8 years ago)
- Branches:
- Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, 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_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, 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, 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:
- c6da5e
- Parents:
- e51f2c
- git-author:
- Frederik Heber <heber@…> (05/27/16 18:33:31)
- git-committer:
- Frederik Heber <heber@…> (09/14/16 18:42:52)
- Location:
- src/Fragmentation/Summation/SetValues
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Fragmentation/Summation/SetValues/SamplingGrid.cpp
re51f2c r978234 436 436 size_t *total) const 437 437 { 438 const size_t gridpoints_axis = getGridPointsPerAxis();439 438 const double round_offset = 440 439 (std::numeric_limits<size_t>::round_style == std::round_toward_zero) ? … … 445 444 // the grids have to be compatible (equal level), should always be on 446 445 // discrete grid point locations. 447 const double delta = (double)gridpoints_axis/(end[index] - begin[index]);446 const double delta = getDeltaPerAxis(index); 448 447 // delta is conversion factor from box length to discrete length, i.e. number of points 449 pre_offset[index] = delta*(smaller_wbegin[index] - larger_wbegin[index])+round_offset;450 length[index] = delta*(smaller_wend[index] - smaller_wbegin[index])+round_offset;451 post_offset[index] = delta*(larger_wend[index] - smaller_wend[index])+round_offset;452 total[index] = delta*(larger_wend[index] - larger_wbegin[index])+round_offset;448 pre_offset[index] = (smaller_wbegin[index] - larger_wbegin[index])/delta+round_offset; 449 length[index] = (smaller_wend[index] - smaller_wbegin[index])/delta+round_offset; 450 post_offset[index] = (larger_wend[index] - smaller_wend[index])/delta+round_offset; 451 total[index] = (larger_wend[index] - larger_wbegin[index])/delta+round_offset; 453 452 } else { 454 453 pre_offset[index] = 0; -
src/Fragmentation/Summation/SetValues/SamplingGridProperties_inline.hpp
re51f2c r978234 42 42 const size_t SamplingGridProperties::getGridPointsPerAxis() const 43 43 { 44 return pow(2, level); 44 static size_t s_gridpoints = 1; 45 static int s_level = 0; 46 if (s_level != level) { 47 s_gridpoints = 1 << level; 48 s_level = level; 49 } 50 return s_gridpoints; 45 51 } 46 52
Note:
See TracChangeset
for help on using the changeset viewer.