summaryrefslogtreecommitdiff
path: root/src/refinement
diff options
context:
space:
mode:
authorAdrian Kummerlaender2019-01-14 16:40:28 +0100
committerAdrian Kummerlaender2019-06-24 15:17:09 +0200
commitd493a9507efb3100cdf2a354c75879bfb6341f62 (patch)
tree8596a2632d7ae1b3d233bbd3b6a2e91e67146c4c /src/refinement
parent6403bbf816f6256ade8569114441386ece29d4a5 (diff)
downloadgrid_refinement_openlb-d493a9507efb3100cdf2a354c75879bfb6341f62.tar
grid_refinement_openlb-d493a9507efb3100cdf2a354c75879bfb6341f62.tar.gz
grid_refinement_openlb-d493a9507efb3100cdf2a354c75879bfb6341f62.tar.bz2
grid_refinement_openlb-d493a9507efb3100cdf2a354c75879bfb6341f62.tar.lz
grid_refinement_openlb-d493a9507efb3100cdf2a354c75879bfb6341f62.tar.xz
grid_refinement_openlb-d493a9507efb3100cdf2a354c75879bfb6341f62.tar.zst
grid_refinement_openlb-d493a9507efb3100cdf2a354c75879bfb6341f62.zip
Use available method to align Coupler2D origin to grid
Diffstat (limited to 'src/refinement')
-rw-r--r--src/refinement/coupler2D.h2
-rw-r--r--src/refinement/coupler2D.hh5
2 files changed, 2 insertions, 5 deletions
diff --git a/src/refinement/coupler2D.h b/src/refinement/coupler2D.h
index 60a5cab..db8ac15 100644
--- a/src/refinement/coupler2D.h
+++ b/src/refinement/coupler2D.h
@@ -39,7 +39,7 @@ protected:
const int _fineSize;
const bool _vertical;
- Vector<T,2> _physOrigin;
+ const Vector<T,2> _physOrigin;
const Vector<int,3>& getFineLatticeR(int y) const;
const Vector<int,3>& getCoarseLatticeR(int y) const;
diff --git a/src/refinement/coupler2D.hh b/src/refinement/coupler2D.hh
index 3bd2b2f..1726df4 100644
--- a/src/refinement/coupler2D.hh
+++ b/src/refinement/coupler2D.hh
@@ -62,6 +62,7 @@ Coupler2D<T,DESCRIPTOR>::Coupler2D(Grid2D<T,DESCRIPTOR>& coarse, Grid2D<T,DESCRI
_coarseSize(floor(extend.norm() / coarse.getConverter().getPhysDeltaX() + 0.5)+1),
_fineSize(2*_coarseSize-1),
_vertical(util::nearZero(extend[0])),
+ _physOrigin(_coarse.alignOriginToGrid(origin)),
_coarseLatticeR(_coarseSize),
_fineLatticeR(_fineSize)
{
@@ -70,10 +71,6 @@ Coupler2D<T,DESCRIPTOR>::Coupler2D(Grid2D<T,DESCRIPTOR>& coarse, Grid2D<T,DESCRI
const auto& coarseGeometry = _coarse.getCuboidGeometry();
const auto& fineGeometry = _fine.getCuboidGeometry();
- Vector<int,3> tmpLatticeOrigin{};
- coarseGeometry.getLatticeR(origin, tmpLatticeOrigin);
- _physOrigin = coarseGeometry.getPhysR(tmpLatticeOrigin.toStdVector());
-
const T deltaX = _fine.getConverter().getPhysDeltaX();
const Vector<T,2> stepPhysR = _vertical ? Vector<T,2> {0, deltaX} : Vector<T,2> {deltaX, 0};