aboutsummaryrefslogtreecommitdiff
path: root/code/coupler2d.cpp
blob: 7f2b8a824c496bfa1bf63da7dddde6a662002e3b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
template <typename T, template<typename> class DESCRIPTOR>
class Coupler2D {
protected:
  Grid2D<T,DESCRIPTOR>& _coarse;
  Grid2D<T,DESCRIPTOR>& _fine;

  const int  _coarseSize;
  const int  _fineSize;
  const bool _vertical;

  Vector<T,2> _physOrigin;

  const Vector<int,3>& getFineLatticeR(int y) const;
  const Vector<int,3>& getCoarseLatticeR(int y) const;

  T getScalingFactor() const;
  T getInvScalingFactor() const;

private:
  std::vector<Vector<int,3>> _coarseLatticeR;
  std::vector<Vector<int,3>> _fineLatticeR;

public:
  Coupler2D(Grid2D<T,DESCRIPTOR>& coarse, Grid2D<T,DESCRIPTOR>& fine,
            Vector<T,2> origin, Vector<T,2> extend);

};