Ignore:
Timestamp:
May 3, 2013, 9:46:45 AM (12 years ago)
Author:
Frederik Heber <heber@…>
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:
a86666
Parents:
5281ff
git-author:
Frederik Heber <heber@…> (04/05/13 15:09:16)
git-committer:
Frederik Heber <heber@…> (05/03/13 09:46:45)
Message:

Split long-range calculations into two parts to overcome E-N-potential problems.

The general problem is that smeared-out nuclei charges cannot interact with
electron charge densities as they always overlap, hence we always make a large
error. The idea then is - as the potential energy is symmetric both
densities - to flip from N-E to E-N, i.\,e. to take the electron potential and
evaluate at nuclei positions instead of smeared-out nuclei charges with
eletronic charge distribution. However, then we need to make two calculations
for the four contributions: E-E, E-N and N-N, N-E (=E-N).

  • new enums SampleParticles_t eventually tells InterfaceVMGJob whether to sample the nuclei charges onto the grid or not.
  • TreatGrid_t tells InterfaceVMGJob whether to actually add the electronic charge onto the grid (this was added but is actually not required anymore).
  • FragmentationAutomationAction::performCall() now creates twice as many long-range jobs. This requires two variables in VMGData for storing integrated long-range energy: electron_long, nuclei_long, as both calculations are combined into a single VMGData instance per fragment.
  • Summation of long-range contributions is split into three instead of formerly two parts: electron (E-E), nuclei (N-N), and mixed (E-N). This allows to easierly check their cancellation. This needs new member in fusion map and name in printKeyNames.
  • naturally, the enums have to be passed a long way: VMGFragmentController, VMGJob, VMGData.
  • VMGData now has serialization version 1 due to new entry.
  • we enhanced documentation in FragmentationLongRangeResults::operator()() of how and what is summed per level.
  • FIX: InterfaceVMGJob::ImportRightHandSide() subtracted grid instead of adding it. Now, we set correct sign of electron charge distribution in MPQC.
  • TESTFIX: Regression test AnalyseFragmentResults now has short- and long-range part. Long-range part is only diff'ed when the compiled code has the capabilities.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/FragmentationAction/FragmentationAutomationAction.cpp

    r5281ff re2925fd  
    153153    vmgcontroller.setPort(params.port.get());
    154154    const size_t NoJobs = shortrangedata.size()+full_sample.size();
    155     vmgcontroller.requestIds(NoJobs);
    156 
    157     // Phase Five: create VMGJobs
     155    vmgcontroller.requestIds(2*NoJobs);
     156
     157    // Phase Five a: create VMGJobs for electronic charge distribution
    158158    const size_t near_field_cells = params.near_field_cells.get();
    159159    const size_t interpolation_degree = params.interpolation_degree.get();
     
    163163        near_field_cells,
    164164        interpolation_degree,
     165        VMGFragmentController::DontSampleParticles,
     166        VMGFragmentController::DoTreatGrid,
    165167        params.DoValenceOnly.get() ? MPQCData::DoSampleValenceOnly : MPQCData::DontSampleValenceOnly,
    166168        params.DoPrintDebug.get()))
    167       // can't use the summed up fragment due to saturation hydrogens
    168 //      summedChargeDensity.getFragment(),
    169169      return Action::failure;
    170170
    171     // Phase Six: calculate result
     171    // Phase Six a: calculate result
    172172    vmgcontroller.waitforResults(NoJobs);
    173173    vmgcontroller.getResults(longrangedata);
     
    175175        "FragmentationFragmentationAutomationAction::performCall() - number of MPQCresults+"
    176176        +toString(full_sample.size())+"="+toString(NoJobs)
    177         +" and VMGresults "+toString(longrangedata.size())+" don't match.");
     177        +" and first VMGresults "+toString(longrangedata.size())+" don't match.");
    178178    Exitflag += vmgcontroller.getExitflag();
     179
     180    {
     181      std::map<JobId_t, VMGData> longrangedata_both;
     182      // Phase Five b: create VMGJobs for nuclei charge distributions
     183      const size_t near_field_cells = params.near_field_cells.get();
     184      const size_t interpolation_degree = params.interpolation_degree.get();
     185      if (!vmgcontroller.createLongRangeJobs(
     186          shortrangedata,
     187          full_sample,
     188          near_field_cells,
     189          interpolation_degree,
     190          VMGFragmentController::DoSampleParticles,
     191          VMGFragmentController::DoTreatGrid,
     192          params.DoValenceOnly.get() ? MPQCData::DoSampleValenceOnly : MPQCData::DontSampleValenceOnly,
     193          params.DoPrintDebug.get()))
     194        return Action::failure;
     195
     196      // Phase Six b: calculate result
     197      vmgcontroller.waitforResults(NoJobs);
     198      vmgcontroller.getResults(longrangedata_both);
     199      ASSERT( NoJobs == longrangedata_both.size(),
     200          "FragmentationFragmentationAutomationAction::performCall() - number of MPQCresults+"
     201          +toString(full_sample.size())+"="+toString(NoJobs)
     202          +" and second VMGresults "+toString(longrangedata_both.size())+" don't match.");
     203      Exitflag += vmgcontroller.getExitflag();
     204
     205      // go through either data and replace nuclei_long with contribution from both
     206      ASSERT( longrangedata.size() == longrangedata_both.size(),
     207          "FragmentationFragmentationAutomationAction::performCall() - longrange results have different sizes.");
     208      std::map<JobId_t, VMGData>::iterator destiter = longrangedata.begin();
     209      std::map<JobId_t, VMGData>::iterator srciter = longrangedata_both.begin();
     210      for (;destiter != longrangedata.end(); ++srciter, ++destiter)
     211        destiter->second.nuclei_long = srciter->second.nuclei_long;
     212    }
    179213  }
    180214
Note: See TracChangeset for help on using the changeset viewer.