diff options
Preliminarily conclude implementation overview section
Diffstat (limited to 'code')
-rw-r--r-- | code/coarseCoupler2d.cpp | 8 | ||||
-rw-r--r-- | code/coupler2d.cpp | 27 | ||||
-rw-r--r-- | code/fineCoupler2d.cpp | 15 |
3 files changed, 50 insertions, 0 deletions
diff --git a/code/coarseCoupler2d.cpp b/code/coarseCoupler2d.cpp new file mode 100644 index 0000000..9bc5383 --- /dev/null +++ b/code/coarseCoupler2d.cpp @@ -0,0 +1,8 @@ +template <typename T, template<typename> class DESCRIPTOR> +class CoarseCoupler2D : public Coupler2D<T,DESCRIPTOR> { +public: + CoarseCoupler2D(Grid2D<T,DESCRIPTOR>& coarse, Grid2D<T,DESCRIPTOR>& fine, + Vector<T,2> origin, Vector<T,2> extend); + + void couple(); +}; diff --git a/code/coupler2d.cpp b/code/coupler2d.cpp new file mode 100644 index 0000000..7f2b8a8 --- /dev/null +++ b/code/coupler2d.cpp @@ -0,0 +1,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); + +}; diff --git a/code/fineCoupler2d.cpp b/code/fineCoupler2d.cpp new file mode 100644 index 0000000..4cde254 --- /dev/null +++ b/code/fineCoupler2d.cpp @@ -0,0 +1,15 @@ +template <typename T, template<typename> class DESCRIPTOR> +class FineCoupler2D : public Coupler2D<T,DESCRIPTOR> { +private: + std::vector<T> _c2f_rho; + std::vector<Vector<T,2>> _c2f_u; + std::vector<Vector<T,DESCRIPTOR<T>::q>> _c2f_fneq; + +public: + FineCoupler2D(Grid2D<T,DESCRIPTOR>& coarse, Grid2D<T,DESCRIPTOR>& fine, + Vector<T,2> origin, Vector<T,2> extend); + + void store(); + void interpolate(); + void couple(); +}; |