diff options
Use available method to align Coupler2D origin to grid
-rw-r--r-- | src/refinement/coupler2D.h | 2 | ||||
-rw-r--r-- | src/refinement/coupler2D.hh | 5 |
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}; |