Ignore:
Timestamp:
Jun 8, 2016, 6:12:12 PM (9 years ago)
Author:
Frederik Heber <heber@…>
Children:
e480fc
Parents:
c9b843
git-author:
Frederik Heber <heber@…> (05/26/16 09:51:07)
git-committer:
Frederik Heber <heber@…> (06/08/16 18:12:12)
Message:

FIX: Replaced 3 by NDIM in SamplingGrid which avoids some confusion with numeric grid levels.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Fragmentation/Summation/SetValues/SamplingGrid.hpp

    rc9b843 rc805f7  
    2020#include "boost/serialization/export.hpp"
    2121#include "boost/serialization/vector.hpp"
     22
     23#include "LinearAlgebra/defs.hpp"
    2224
    2325#include "Fragmentation/Summation/SetValues/SamplingGridProperties.hpp"
     
    5153   * \param _sampled_grid sample points
    5254   */
    53   SamplingGrid(const double _begin[3],
    54       const double _end[3],
     55  SamplingGrid(const double _begin[NDIM],
     56      const double _end[NDIM],
    5557      const int _level,
    5658      const sampledvalues_t &_sampled_grid);
     
    6466   * \param _level number of grid points in \f$2^{\mathrm{level}}\f$
    6567   */
    66   SamplingGrid(const double _begin[3],
    67       const double _end[3],
     68  SamplingGrid(const double _begin[NDIM],
     69      const double _end[NDIM],
    6870      const int _level);
    6971
     
    211213   * \param _end_window end of window
    212214   */
    213   void setWindow(const double _begin_window[3], const double _end_window[3]);
     215  void setWindow(const double _begin_window[NDIM], const double _end_window[NDIM]);
    214216
    215217  /** Helper function to convert begin_window and end_window that are w.r.t.
     
    255257   * \param _end end of window
    256258   */
    257   void setDomain(const double _begin[3], const double _end[3]);
     259  void setDomain(const double _begin[NDIM], const double _end[NDIM]);
    258260
    259261  /** Sets the size of the domain.
     
    264266   * \param _end end of domain
    265267   */
    266   void setDomainSize(const double _begin[3], const double _end[3]);
     268  void setDomainSize(const double _begin[NDIM], const double _end[NDIM]);
    267269
    268270  /** Extends the window while keeping the values.
     
    271273   * \param _end_window new end of window
    272274   */
    273   void extendWindow(const double _begin_window[3], const double _end_window[3]);
     275  void extendWindow(const double _begin_window[NDIM], const double _end_window[NDIM]);
    274276
    275277  /** Shrinks the window while keeping the values.
     
    278280   * \param _end_window new end of window
    279281   */
    280   void shrinkWindow(const double _begin_window[3], const double _end_window[3]);
     282  void shrinkWindow(const double _begin_window[NDIM], const double _end_window[NDIM]);
    281283
    282284  /** Adds another (smaller) window onto the one in this instance.
     
    290292   */
    291293  void addOntoWindow(
    292       const double _begin_window[3],
    293       const double _end_window[3],
     294      const double _begin_window[NDIM],
     295      const double _end_window[NDIM],
    294296      const sampledvalues_t &_sampled_grid,
    295297      const double prefactor);
     
    305307   */
    306308  void addIntoWindow(
    307       const double _begin_window[3],
    308       const double _end_window[3],
     309      const double _begin_window[NDIM],
     310      const double _end_window[NDIM],
    309311      const sampledvalues_t &_sampled_grid,
    310312      const double prefactor);
     
    334336   */
    335337  void addWindowOntoWindow(
    336       const double larger_wbegin[3],
    337       const double larger_wend[3],
    338       const double smaller_wbegin[3],
    339       const double smaller_wend[3],
     338      const double larger_wbegin[NDIM],
     339      const double larger_wend[NDIM],
     340      const double smaller_wbegin[NDIM],
     341      const double smaller_wend[NDIM],
    340342      sampledvalues_t &dest_sampled_grid,
    341343      const sampledvalues_t &source_sampled_grid,
     
    360362   * \param _end_window end of window
    361363   */
    362   void setWindowSize(const double _begin_window[3], const double _end_window[3]);
     364  void setWindowSize(const double _begin_window[NDIM], const double _end_window[NDIM]);
    363365
    364366public:
     
    370372
    371373  //!> start of the window relative to SamplingGridProperties::begin and SamplingGridProperties::size
    372   double begin_window[3];
     374  double begin_window[NDIM];
    373375  //!> end of the window relative to SamplingGridProperties::begin and SamplingGridProperties::size
    374   double end_window[3];
     376  double end_window[NDIM];
    375377
    376378private:
     
    384386    ar & boost::serialization::base_object<SamplingGridProperties>(*this);
    385387    ar & const_cast< sampledvalues_t &>(sampled_grid);
    386     for(size_t i=0;i<3;++i) {
     388    for(size_t i=0;i<NDIM;++i) {
    387389      ar & begin_window[i];
    388390      ar & end_window[i];
     
    391393
    392394  //!> static typedef to use in cstor when no initial values are given
    393   static const double zeroOffset[3];
     395  static const double zeroOffset[NDIM];
    394396};
    395397
Note: See TracChangeset for help on using the changeset viewer.