From 66b02503f55891c6316433e8853fe7c2e8b570ff Mon Sep 17 00:00:00 2001 From: Martin Bauer <martin.bauer@fau.de> Date: Fri, 5 Jul 2019 13:52:43 +0100 Subject: [PATCH] Interpolator & Distributor: const correctness --- .../interpolators/NearestNeighborFieldInterpolator.h | 4 ++-- src/field/interpolators/TrilinearFieldInterpolator.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/field/interpolators/NearestNeighborFieldInterpolator.h b/src/field/interpolators/NearestNeighborFieldInterpolator.h index 975c55ed..43279021 100644 --- a/src/field/interpolators/NearestNeighborFieldInterpolator.h +++ b/src/field/interpolators/NearestNeighborFieldInterpolator.h @@ -60,13 +60,13 @@ public: inline bool operator==( const OwnType & other ){ return baseField_ == other.baseField_; } template< typename ForwardIterator_T > - inline void get( const Vector3<real_t> & position, ForwardIterator_T interpolationResultBegin ) + inline void get( const Vector3<real_t> & position, ForwardIterator_T interpolationResultBegin ) const { get( position[0], position[1], position[2], interpolationResultBegin ); } template< typename ForwardIterator_T > - inline void get( const real_t & x, const real_t & y, const real_t & z, ForwardIterator_T interpolationResultBegin ) + inline void get( const real_t & x, const real_t & y, const real_t & z, ForwardIterator_T interpolationResultBegin ) const { WALBERLA_ASSERT(block_.getAABB().contains(x,y,z), diff --git a/src/field/interpolators/TrilinearFieldInterpolator.h b/src/field/interpolators/TrilinearFieldInterpolator.h index bdac4ff1..ff962564 100644 --- a/src/field/interpolators/TrilinearFieldInterpolator.h +++ b/src/field/interpolators/TrilinearFieldInterpolator.h @@ -62,16 +62,16 @@ public: } - inline bool operator==( const OwnType & other ){ return baseField_ == other.baseField_; } + inline bool operator==( const OwnType & other ) const { return baseField_ == other.baseField_; } template< typename ForwardIterator_T > - inline void get( const Vector3<real_t> & position, ForwardIterator_T interpolationResultBegin ) + inline void get( const Vector3<real_t> & position, ForwardIterator_T interpolationResultBegin ) const { get( position[0], position[1], position[2], interpolationResultBegin ); } template< typename ForwardIterator_T > - inline void get( const real_t & x, const real_t & y, const real_t & z, ForwardIterator_T interpolationResultBegin ) + inline void get( const real_t & x, const real_t & y, const real_t & z, ForwardIterator_T interpolationResultBegin ) const { WALBERLA_ASSERT(block_.getAABB().contains(x,y,z), "Interpolation position <" << x << ", " << y << ", " << z << "> is not contained inside the block of this interpolator with AABB " << block_.getAABB() << " !"); @@ -166,7 +166,7 @@ public: private: template< typename ForwardIterator_T > - void addWeightedCellValue( ForwardIterator_T interpolationResultBegin, const Cell & curCell, const real_t & weighting ) + void addWeightedCellValue( ForwardIterator_T interpolationResultBegin, const Cell & curCell, const real_t & weighting ) const { for( uint_t f = uint_t(0); f < F_SIZE; ++f ) { -- GitLab