aboutsummaryrefslogtreecommitdiff
path: root/code
diff options
context:
space:
mode:
authorAdrian Kummerlaender2019-01-14 16:25:06 +0100
committerAdrian Kummerlaender2019-01-14 16:25:32 +0100
commitfc006b5b5012520e730e84f80651a3eea0f8dd3c (patch)
treeb05dbb2cfe1f7e212d2126c320a20beada627a86 /code
parent2d1333f43844b3dca1b93ab04adc98bbd5ee8571 (diff)
downloadgrid_refinement_bsc_thesis-fc006b5b5012520e730e84f80651a3eea0f8dd3c.tar
grid_refinement_bsc_thesis-fc006b5b5012520e730e84f80651a3eea0f8dd3c.tar.gz
grid_refinement_bsc_thesis-fc006b5b5012520e730e84f80651a3eea0f8dd3c.tar.bz2
grid_refinement_bsc_thesis-fc006b5b5012520e730e84f80651a3eea0f8dd3c.tar.lz
grid_refinement_bsc_thesis-fc006b5b5012520e730e84f80651a3eea0f8dd3c.tar.xz
grid_refinement_bsc_thesis-fc006b5b5012520e730e84f80651a3eea0f8dd3c.tar.zst
grid_refinement_bsc_thesis-fc006b5b5012520e730e84f80651a3eea0f8dd3c.zip
Preliminarily conclude implementation overview section
Diffstat (limited to 'code')
-rw-r--r--code/coarseCoupler2d.cpp8
-rw-r--r--code/coupler2d.cpp27
-rw-r--r--code/fineCoupler2d.cpp15
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();
+};