Changeset d9d028 for src


Ignore:
Timestamp:
Aug 15, 2013, 8:41:17 AM (11 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:
ee9018
Parents:
27ef5c
git-author:
Frederik Heber <heber@…> (07/26/13 12:24:17)
git-committer:
Frederik Heber <heber@…> (08/15/13 08:41:17)
Message:

FIX: addGridOntoWindow() now working, too.

  • with this open boundary calculation runs through smoothly, including all asserts do not fail. Also, we did check the sampled density on the grid.
  • results are not checked so far, but accuracy is according to Julian only second order. Hence, we must not expect too much.
Location:
src/Jobs
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/Jobs/WindowGrid_converter.cpp

    r27ef5c rd9d028  
    5454    VMG::Grid &grid,
    5555    SamplingGrid &window,
    56     const double prefactor)
     56    const double prefactor,
     57    const bool OpenBoundaryConditions)
    5758{
    5859#ifndef NDEBUG
     
    104105  SamplingGrid::sampledvalues_t::iterator griditer = window.sampled_grid.begin();
    105106  std::advance(griditer, pre_offset[0]*total[1]*total[2]);
     107
    106108  VMG::Grid::iterator copyiter = grid.Iterators().Local().Begin();
     109  const VMG::Index size = grid.Local().Size();
     110  if (OpenBoundaryConditions)
     111    for(N[0]=0; N[0] < size[0]/4; ++N[0])
     112      for(N[1]=0; N[1] < size[1]; ++N[1])
     113        for(N[2]=0; N[2] < size[2]; ++N[2]) {
     114          ASSERT( copyiter != grid.Iterators().Local().End(),
     115              "InterfaceVMGJob::addGridOntoWindow() - copyiter is already at end of window.");
     116          ++copyiter;
     117        }
    107118  for(N[0]=0; N[0] < length[0]; ++N[0]) {
    108119    std::advance(griditer, pre_offset[1]*total[2]);
     120    if (OpenBoundaryConditions)
     121      for(N[1]=0; N[1] < size[1]/4; ++N[1])
     122        for(N[2]=0; N[2] < size[2]; ++N[2]) {
     123          ASSERT( copyiter != grid.Iterators().Local().End(),
     124              "InterfaceVMGJob::addGridOntoWindow() - copyiter is already at end of window.");
     125          ++copyiter;
     126        }
    109127    for(N[1]=0; N[1] < length[1]; ++N[1]) {
    110128      std::advance(griditer, pre_offset[2]);
     129      if (OpenBoundaryConditions)
     130        for(N[2]=0; N[2] < size[2]/4; ++N[2]) {
     131          ASSERT( copyiter != grid.Iterators().Local().End(),
     132              "InterfaceVMGJob::addGridOntoWindow() - copyiter is already at end of window.");
     133          ++copyiter;
     134        }
    111135      for(N[2]=0; N[2] < length[2]; ++N[2]) {
    112136        ASSERT( griditer != window.sampled_grid.end(),
    113137            "InterfaceVMGJob::addGridOntoWindow() - griditer is already at end of window.");
    114138        ASSERT( copyiter != grid.Iterators().Local().End(),
    115             "InterfaceVMGJob::addGridOntoWindow() - griditer is already at end of window.");
     139            "InterfaceVMGJob::addGridOntoWindow() - copyiter is already at end of window.");
    116140        *griditer++ += prefactor*grid(*copyiter++);
    117141      }
    118142      std::advance(griditer, post_offset[2]);
     143      if (OpenBoundaryConditions)
     144        for(N[2]=0; N[2] < size[2] - size[2]/4 - length[2]; ++N[2]) {
     145          ASSERT( copyiter != grid.Iterators().Local().End(),
     146              "InterfaceVMGJob::addGridOntoWindow() - copyiter is already at end of window.");
     147          ++copyiter;
     148        }
    119149    }
    120150    std::advance(griditer, post_offset[1]*total[2]);
    121   }
     151    if (OpenBoundaryConditions)
     152      for(N[1]=0; N[1] < size[1] - size[1]/4 - length[1]; ++N[1])
     153        for(N[2]=0; N[2] < size[2]; ++N[2]) {
     154          ASSERT( copyiter != grid.Iterators().Local().End(),
     155              "InterfaceVMGJob::addGridOntoWindow() - copyiter is already at end of window.");
     156          ++copyiter;
     157        }
     158  }
     159  if (OpenBoundaryConditions)
     160    for(N[0]=0; N[0] < size[0] - size[0]/4 - length[0]; ++N[0])
     161      for(N[1]=0; N[1] < size[1]; ++N[1])
     162        for(N[2]=0; N[2] < size[2]; ++N[2]) {
     163          ASSERT( copyiter != grid.Iterators().Local().End(),
     164              "InterfaceVMGJob::addGridOntoWindow() - copyiter is already at end of window.");
     165          ++copyiter;
     166        }
    122167#ifndef NDEBUG
    123168  std::advance(griditer, post_offset[0]*total[1]*total[2]);
  • src/Jobs/WindowGrid_converter.hpp

    r27ef5c rd9d028  
    2727   * @param grid grid with non-zero window
    2828   * @param prefactor factor for each added value, e.g. -1. makes a subtraction
     29   * @param OpenBoundaryConditions states whether we have open (true) or
     30   *        periodic (false) boundary conditions
    2931   */
    3032  void addGridOntoWindow(
    3133      VMG::Grid& grid,
    3234      SamplingGrid &window,
    33       const double prefactor);
     35      const double prefactor,
     36      const bool OpenBoundaryConditions = false);
    3437
    3538  /** Helper function to copy non-zero window in SamplingGrid onto VMG's Grid.
Note: See TracChangeset for help on using the changeset viewer.