Ignore:
Timestamp:
Apr 5, 2013, 12:39:30 PM (13 years ago)
Author:
Julian Iseringhausen <julian.iseringhausen@…>
Children:
4a709e
Parents:
f57182
Message:

Merge stashed open boundary stuff.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/grid/grid_index_translations.hpp

    rf57182 r8180d8  
    3838class Comm;
    3939class Grid;
     40class GridIteratorSet;
    4041
    4142class GridIndexTranslations
    4243{
    4344public:
    44   GridIndexTranslations(const Grid* father_) :
    45     father(father_)
    46   {}
     45  GridIndexTranslations() {}
    4746
    48   Index GlobalToLocal(const Index& index_global) const;
    49   static Index GlobalToFiner(const Index& index_global);
    50   static Index GlobalToCoarser(const Index& index_global);
     47  static bool IsGridPointOf(const Grid& grid, const Index& index_finest);
    5148
    52   static Index GlobalToFiner(const Index& index_global, const int& num_levels);
    53   static Index GlobalToCoarser(const Index& index_global, const int& num_levels);
     49  static Index LocalToGlobal(const Grid& grid, const Index& index_local);
     50  static Index LocalToGlobalFinest(const Grid& grid, const Index& index_local);
    5451
    55   Index LocalToGlobal(const Index& index_local) const;
    56   Index LocalToFiner(const Index& index_local) const;
    57   Index LocalToCoarser(const Index& index_local) const;
     52  static Index GlobalToLocal(const Grid& grid, const Index& index_global);
     53  static Index GlobalToGlobalFinest(const Grid& grid, const Index& index_global);
    5854
    59   Index FinestGlobalToLocal(const Index& index_finest) const;
    60   Index FinestGlobalToGlobal(const Index& index_finest) const;
     55  static Index GlobalFinestToLocal(const Grid& grid, const Index& index_finest);
     56  static Index GlobalFinestToGlobal(const Grid& grid, const Index& index_finest);
    6157
    62   static void FineToCoarse(Index& begin, Index& end);
    63   static void CoarseToFine(Index& begin, Index& end, const Index& size_global);
     58  static void GlobalCoarseToFine(Index& begin, Index& end);
     59  static void GlobalFineToCoarse(Index& begin, Index& end);
     60
     61  static void GetGridAlignment(const Grid& grid_1, GridIteratorSet& bounds_1,
     62                               const Grid& grid_2, GridIteratorSet& bounds_2);
     63
     64  static void GetInnerBoundary(const Grid& grid_coarse, Index& b1_c, Index& b2_c,
     65                               const Grid& grid_fine,   Index& b1_f, Index& b2_f);
     66
     67
     68
     69
    6470
    6571  static Index EndOffset(const Boundary& boundary)
    6672  {
    67     Index offset;
    68 
    69     for (int i=0; i<3; ++i)
    70       offset[i] = (boundary[i] == Open || boundary[i] == Dirichlet ? 1 : 0);
    71 
    72     return offset;
     73    return Index(boundary[0] == Periodic ? 0 : 1,
     74                 boundary[1] == Periodic ? 0 : 1,
     75                 boundary[2] == Periodic ? 0 : 1);
    7376  }
    74 
    75 protected:
    76   const Grid* Father() const {return father;}
    77 
    78 private:
    79   const Grid* father;
    8077};
    8178
Note: See TracChangeset for help on using the changeset viewer.