Ignore:
Timestamp:
Feb 15, 2013, 9:51:48 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:
e2404f
Parents:
98f8fe
git-author:
Frederik Heber <heber@…> (12/03/12 09:02:23)
git-committer:
Frederik Heber <heber@…> (02/15/13 09:51:48)
Message:

Rewrote parts of SampingGrid such that a window of non-zero entries is used.

  • this makes the last part final O(N) as so far for the sampled_grid the whole domain has to be used instead of a tiny region around the specific fragment.
  • for this we added extendWindow() and addOntoWindow() including some new member variables that hold the window size.
  • added default cstor that correctly used SampingGridProperties default cstor. Otherwise we got the funny behavior that on some systems the very first job of q MPQCCommandJob (tests/JobMarket/2) is not re-instantiated.
  • unit test extended to cover the new functionality but marked as expected to fail because it is not yet working correctly.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Jobs/Grid/SamplingGrid.hpp

    r98f8fe r1a00bb  
    7575  /** default cstor.
    7676   */
    77   SamplingGrid()
    78   {}
     77  SamplingGrid();
    7978
    8079  virtual ~SamplingGrid();
     
    128127  double integral(const SamplingGrid &weight) const;
    129128
     129  /** Returns the volume of the domain for this sampled function.
     130   *
     131   * @return volume
     132   */
     133  const double getVolume() const;
     134
     135  /** Returns the total number of gridpoints of the discrete mesh covering the (window) volume.
     136   *
     137   * @return number of gridpoints sampled_values should have
     138   */
     139  const size_t getWindowGridPoints() const;
     140
     141  /** Returns the total number of gridpoints of the discrete mesh covering the volume.
     142   *
     143   * @return number of gridpoints sampled_values should have
     144   */
     145  const size_t getTotalGridPoints() const;
     146
     147  /** Returns the number of grid points per axis.
     148   *
     149   * @return number of grid points per unit length
     150   */
     151  const size_t getGridPointsPerAxis() const;
     152
     153  /** Returns the volume of the domain covered by the current window.
     154   *
     155   * @return volume of window
     156   */
     157  const double getWindowVolume() const;
     158
     159  /** Sets the size of the window.
     160   *
     161   * \note also resets the sampled points so far.
     162   *
     163   * \param _begin_window start of new window
     164   * \param _end_window end of window
     165   */
     166  void setWindow(const double _begin_window[3], const double _end_window[3]);
     167
    130168private:
    131   /** Returns the volume of the domain for this sampled function.
    132    *
    133    * @return volume
    134    */
    135   double getVolume() const;
    136 
    137   /** Returns the total number of gridpoints of the discrete mesh covering the (window) volume.
    138    *
    139    * @return number of gridpoints sampled_values should have
    140    */
    141   const size_t getTotalGridPoints() const;
    142 
    143   /** Returns the number of grid points per axis.
    144    *
    145    * @return number of grid points per unit length
    146    */
    147   const size_t getGridPointsPerAxis() const;
    148 
     169  /** Extends the window while keeping the values.
     170   *
     171   * \param _begin_window new start of window
     172   * \param _end_window new end of window
     173   */
     174  void extendWindow(const double _begin_window[3], const double _end_window[3]);
     175
     176  /** Adds another window onto the one in this instance.
     177   *
     178   * \note We assume here that the given window fits on the this one.
     179   *
     180   * \param _begin_window start of other window
     181   * \param _end_window end of other window
     182   * \param _sampled_grid other set of sampled values
     183   */
     184  void addOntoWindow(
     185      const double _begin_window[3],
     186      const double _end_window[3],
     187      const sampledvalues_t &_sampled_grid);
    149188
    150189  /** Helper function that contains all the logic of how to superpose two
     
    158197  void superposeOtherGrids(const SamplingGrid &other, const double prefactor);
    159198
     199  /** Sets the size of the window.
     200   *
     201   * \note also resets the sampled points so far.
     202   *
     203   * \param _begin_window start of new window
     204   * \param _size size of the window
     205   */
     206  void setWindowSize(const double _begin_window[3], const double _size);
     207
     208  /** Sets the size of the window.
     209   *
     210   * \note also resets the sampled points so far.
     211   *
     212   * \param _begin_window start of new window
     213   * \param _end_window end of window
     214   */
     215  void setWindowSize(const double _begin_window[3], const double _end_window[3]);
     216
    160217public:
    161   //!> sample points
     218  /// We do not store the whole grid if many entries are actually zero
     219  /// but only a window wherein the sampled function is non-zero.
     220
     221  //!> sample points of the window
    162222  sampledvalues_t sampled_grid;
     223
     224  //!> start of the window relative to SamplingGridProperties::begin and SamplingGridProperties::size
     225  double begin_window[3];
     226  //!> end of the window relative to SamplingGridProperties::begin and SamplingGridProperties::size
     227  double end_window[3];
    163228
    164229private:
     
    172237    ar & boost::serialization::base_object<SamplingGridProperties>(*this);
    173238    ar & const_cast< sampledvalues_t &>(sampled_grid);
     239    for(size_t i=0;i<3;++i) {
     240      ar & begin_window[i];
     241      ar & end_window[i];
     242    }
    174243  }
     244
     245  //!> static typedef to use in cstor when no initial values are given
     246  static const double zeroOffset[3];
    175247};
    176248
Note: See TracChangeset for help on using the changeset viewer.