From 9546a228faa725df3a1956995f5c247ac8c79f51 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Mon, 14 Jan 2019 15:42:21 +0100 Subject: Remove unnecessary managed pointers --- src/refinement/coupler2D.hh | 6 +++--- src/refinement/grid2D.h | 2 -- src/refinement/grid2D.hh | 16 +++------------- 3 files changed, 6 insertions(+), 18 deletions(-) (limited to 'src/refinement') diff --git a/src/refinement/coupler2D.hh b/src/refinement/coupler2D.hh index 1d773f3..3bd2b2f 100644 --- a/src/refinement/coupler2D.hh +++ b/src/refinement/coupler2D.hh @@ -75,7 +75,7 @@ Coupler2D::Coupler2D(Grid2D& coarse, Grid2D stepPhysR = _vertical ? Vector{0, deltaX} : Vector{deltaX, 0}; + const Vector stepPhysR = _vertical ? Vector {0, deltaX} : Vector {deltaX, 0}; for (int i=0; i < _fineSize; ++i) { if (i % 2 == 0) { @@ -186,7 +186,7 @@ void FineCoupler2D::couple() Cell cell; fineLattice.get(finePos, cell); for (int iPop=0; iPop < DESCRIPTOR::q; ++iPop) { - cell[iPop] = fEq[iPop] + this->getScalingFactor() * _c2f_fneq[y][iPop]; + cell[iPop] = fEq[iPop] + this->getScalingFactor() * _c2f_fneq[y][iPop]; } fineLattice.set(finePos, cell); } @@ -309,7 +309,7 @@ void computeRestrictedFneq(const SuperLattice2D& lattice, T restrictedFneq[DESCRIPTOR::q]) { for (int iPop=0; iPop < DESCRIPTOR::q; ++iPop) { - const auto neighbor = latticeR + Vector{0, DESCRIPTOR::c[iPop][0], DESCRIPTOR::c[iPop][1]}; + const auto neighbor = latticeR + Vector {0, DESCRIPTOR::c[iPop][0], DESCRIPTOR::c[iPop][1]}; Cell cell; lattice.get(neighbor, cell); diff --git a/src/refinement/grid2D.h b/src/refinement/grid2D.h index d782651..9a20544 100644 --- a/src/refinement/grid2D.h +++ b/src/refinement/grid2D.h @@ -60,8 +60,6 @@ protected: std::vector>> _coarseCouplers; public: - static std::unique_ptr> make(IndicatorF2D& domainF, int resolution, T tau, int re); - Grid2D(FunctorPtr>&& domainF, int resolution, T tau, int re); UnitConverter& getConverter(); diff --git a/src/refinement/grid2D.hh b/src/refinement/grid2D.hh index aa82240..02fe351 100644 --- a/src/refinement/grid2D.hh +++ b/src/refinement/grid2D.hh @@ -33,16 +33,6 @@ namespace olb { -template class DESCRIPTOR> -std::unique_ptr> Grid2D::make( - IndicatorF2D& domainF, - int resolution, T tau, int re) -{ - return std::unique_ptr>( - new Grid2D(domainF, resolution, tau, re) - ); -} - template class DESCRIPTOR> Grid2D::Grid2D(FunctorPtr>&& domainF, int resolution, T tau, int re): _domainF(std::move(domainF)), @@ -62,7 +52,7 @@ Grid2D::Grid2D(FunctorPtr>&& domainF, int resoluti #else 1 #endif - )), + )), _balancer(new HeuristicLoadBalancer( *_cuboids)), _geometry(new SuperGeometry2D( @@ -191,7 +181,7 @@ RefiningGrid2D& Grid2D::refine( addFineCoupling(fineGrid, origin, extendX); const T coarseDeltaX = getConverter().getPhysDeltaX(); - const Vector innerOrigin = origin + coarseDeltaX; + const Vector innerOrigin = origin + coarseDeltaX; const Vector innerExtendX = extendX - Vector {2*coarseDeltaX,0}; const Vector innerExtendY = extendY - Vector {0,2*coarseDeltaX}; @@ -244,7 +234,7 @@ std::unique_ptr> RefiningGrid2D::getRefinedOverlap const T coarseDeltaX = _parentGrid.getConverter().getPhysDeltaX(); return std::unique_ptr>( - new IndicatorCuboid2D(_extend - 4*coarseDeltaX, _origin + 2*coarseDeltaX)); + new IndicatorCuboid2D(_extend - 4*coarseDeltaX, _origin + 2*coarseDeltaX)); } } -- cgit v1.2.3