diff --git a/src/blockforest/BlockForest.cpp b/src/blockforest/BlockForest.cpp index d2b531856e68675c3307c4f77f0b2069f8f6d149..cac66a8cfc7bd50489092a70b76895d3779ad5bc 100644 --- a/src/blockforest/BlockForest.cpp +++ b/src/blockforest/BlockForest.cpp @@ -1200,7 +1200,7 @@ void BlockForest::restoreSnapshot( const SnapshotRestoreFunction & processMappin WALBERLA_ASSERT( blocks_.find( id ) == blocks_.end() ); blocks_[ id ] = std::make_shared< Block >( *this, id, aabb, level, buffer, processMapping ); - Block * block = blocks_[ id ].get(); + auto * block = blocks_[ id ].get(); for(auto & dataItem : blockDataItem_) { auto blockDataHandlingWrapper = dataItem.getDataHandling( block ); @@ -2837,7 +2837,7 @@ void BlockForest::saveToFile( const std::string & filename, FileIOMode fileIOMod { std::vector< bool > suidBoolVec( 8 * suidBytes ); - const Set<SUID> & state = block->getState(); + const auto & state = block->getState(); for(auto suid : state) { WALBERLA_CHECK( suidMap.find( suid ) != suidMap.end(), "Block state SUID missing from SUID list saved to file." diff --git a/src/blockforest/BlockID.h b/src/blockforest/BlockID.h index 46968dfa4fef7e3072a283e3eb09e8910efcc094..a4d970f5de23a001cdeaeb8d176e412dc2188db5 100644 --- a/src/blockforest/BlockID.h +++ b/src/blockforest/BlockID.h @@ -353,7 +353,7 @@ inline std::ostream& BlockID::toStream( std::ostream& os ) const { template< typename Buffer_T > void BlockID::toBuffer( Buffer_T& buffer ) const { - const uint8_t bytes = uint8_t( getUsedBytes() ); + const auto bytes = uint8_t( getUsedBytes() ); buffer << bytes; for( uint8_t i = 0; i != bytes; ++i ) buffer << uint8_c( ( id_ >> ( uint_c(i) * uint_c(8) ) ) & uint_c(255) ); diff --git a/src/blockforest/PhantomBlockForest.cpp b/src/blockforest/PhantomBlockForest.cpp index 303a8b2def34e6b4e2e714b7ae4ee64a796bc5d3..168ae28ce940dd52d5cc999a4044b469ef3e00bc 100644 --- a/src/blockforest/PhantomBlockForest.cpp +++ b/src/blockforest/PhantomBlockForest.cpp @@ -479,7 +479,7 @@ void PhantomBlockForest::migrate( const PhantomBlockDataPackFunction & packBlock phantom->clearNeighborhood(); uint8_t neighbors(0); buffer >> neighbors; - for( uint8_t n = uint8_t(0); n != neighbors; ++n ) + for( auto n = uint8_t(0); n != neighbors; ++n ) { BlockID nId; uint32_t nProcess; diff --git a/src/blockforest/StructuredBlockForest.h b/src/blockforest/StructuredBlockForest.h index 14af31ca27201569f5faf0fd24ed50a8eafa4355..e3dd277d574ce05b34234f7c664c574ce93fe4fd 100644 --- a/src/blockforest/StructuredBlockForest.h +++ b/src/blockforest/StructuredBlockForest.h @@ -258,7 +258,7 @@ inline uint_t StructuredBlockForest::getNumberOfCells( const IBlock& block, cons inline bool StructuredBlockForest::equal( const StructuredBlockStorage* rhs ) const { - const StructuredBlockForest* forest = dynamic_cast< const StructuredBlockForest* >( rhs ); + const auto* forest = dynamic_cast< const StructuredBlockForest* >( rhs ); if( forest != rhs ) return false; diff --git a/src/blockforest/communication/UniformBufferedScheme.h b/src/blockforest/communication/UniformBufferedScheme.h index b47f7c74dceba6616c965284e2a6d250ed976063..e47a1de0f0aa4c534e5ec312026370a4a3900e36 100644 --- a/src/blockforest/communication/UniformBufferedScheme.h +++ b/src/blockforest/communication/UniformBufferedScheme.h @@ -285,7 +285,7 @@ void UniformBufferedScheme<Stencil>::startCommunication() for( auto it = forest->begin(); it != forest->end(); ++it ) { - Block * block = dynamic_cast< Block * >( it.get() ); + auto * block = dynamic_cast< Block * >( it.get() ); if( !selectable::isSetSelected( block->getState(), requiredBlockSelectors_, incompatibleBlockSelectors_ ) ) continue; diff --git a/src/blockforest/loadbalancing/DynamicDiffusive.h b/src/blockforest/loadbalancing/DynamicDiffusive.h index dd2f5345be8dd44e65ef68a51d22d2b930f83ebb..2d90b73586f0fcc81c62e8ee48f3c603e97d5881 100644 --- a/src/blockforest/loadbalancing/DynamicDiffusive.h +++ b/src/blockforest/loadbalancing/DynamicDiffusive.h @@ -281,11 +281,11 @@ bool DynamicDiffusionBalance< PhantomData_T >::operator()( std::vector< std::pai std::vector< double > localWeight( processWeight ); //per level - double flowIterations( double_c( flowIterations_ ) ); + auto flowIterations( double_c( flowIterations_ ) ); if( iteration >= flowIterationsIncreaseStart_ ) flowIterations += double_c( iteration + uint_t(1) - flowIterationsIncreaseStart_ ) * flowIterationsIncrease_; - const uint_t iterations = uint_c( flowIterations + 0.5 ); + const auto iterations = uint_c( flowIterations + 0.5 ); for( uint_t i = uint_t(0); i < iterations; ++i ) { WALBERLA_ASSERT_EQUAL( localWeight.size(), levels ); diff --git a/src/blockforest/loadbalancing/weight_assignment/MetisAssignmentFunctor.h b/src/blockforest/loadbalancing/weight_assignment/MetisAssignmentFunctor.h index 386d5c9d2615c95a6241dbdf9d5cc37b5aa4dd97..eaffd8e3b0a4440956f4f981015002f1708776e0 100644 --- a/src/blockforest/loadbalancing/weight_assignment/MetisAssignmentFunctor.h +++ b/src/blockforest/loadbalancing/weight_assignment/MetisAssignmentFunctor.h @@ -59,9 +59,9 @@ public: WALBERLA_ASSERT_LESS( abs(int_c(block->getLevel()) - int_c(block->getSourceLevel())), 2 ); //all information is provided by info collection - auto infoIt = ic_->find( block->getId() ); + const auto infoIt = ic_->find( block->getId() ); WALBERLA_CHECK_UNEQUAL( infoIt, ic_->end() ); - const double weight = double_c( infoIt->second.computationalWeight ) + baseWeight_; + const auto weight = double_c( infoIt->second.computationalWeight ) + baseWeight_; blockforest::DynamicParMetisBlockInfo info( 0 ); info.setVertexWeight( int64_c(weight) ); info.setVertexSize( int64_c( weight ) ); diff --git a/src/core/Set.h b/src/core/Set.h index de9ca7841336a1282ee99322c0b210830bfa7d46..e594155e31cd377d094a0ccfdf1b809cfcd10feb 100644 --- a/src/core/Set.h +++ b/src/core/Set.h @@ -140,7 +140,7 @@ public: inline const_iterator end() const { return set_.end(); } inline iterator end() { return set_.end(); } - + inline const std::set<T> & get() const { return set_; } inline std::set<T> & get() { return set_; } @@ -206,8 +206,8 @@ void Set<T>::toStream( std::ostream& os ) const { os << "{ "; - for( const_iterator it = begin(); it != end(); ++it ) { - const_iterator next = it; + for( auto it = begin(); it != end(); ++it ) { + auto next = it; os << (*it) << ( ( ++next == end() ) ? " " : ", " ); } diff --git a/src/core/config/Config.h b/src/core/config/Config.h index 99bf453955244e47afb86109aa496986c06b9a8d..09519af030235143a3040381cf9772010142a49f 100644 --- a/src/core/config/Config.h +++ b/src/core/config/Config.h @@ -838,7 +838,7 @@ inline Config::size_type Config::Block::getNumBlocks() const template< typename Type > inline Config::Parameter<Type> Config::Block::getParameter( std::string key ) const { - Map::const_iterator it = params_.find( key ); + const auto it = params_.find( key ); if( it != params_.end() ) { Type tmp; @@ -880,7 +880,7 @@ inline Config::Parameter<T> Config::Block::getParameter( const std::string& key, template<> inline Config::Parameter<std::string> Config::Block::getParameter<std::string>( std::string key ) const { - Map::const_iterator it = params_.find( key ); + const auto it = params_.find( key ); if( it != params_.end() ) return Parameter<std::string>( it->second, noerror, key ); @@ -901,7 +901,7 @@ inline Config::Parameter<std::string> Config::Block::getParameter<std::string>( template<> inline Config::Parameter<bool> Config::Block::getParameter<bool>( std::string key ) const { - Map::const_iterator it = params_.find( key ); + const auto it = params_.find( key ); if( it != params_.end() ) { @@ -941,7 +941,7 @@ inline Config::Parameter<bool> Config::Block::getParameter<bool>( std::string ke template<> inline Config::Parameter<unsigned int> Config::Block::getParameter<unsigned int>( std::string key ) const { - Map::const_iterator it = params_.find( key ); + const auto it = params_.find( key ); if( it != params_.end() ) { int tmp; diff --git a/src/core/debug/CheckFunctions.impl.h b/src/core/debug/CheckFunctions.impl.h index 61e48bf7e93073a2183c25788d3e189b45dede90..a72d73a548624052e123a51f94e8c1c1b6cf93d2 100644 --- a/src/core/debug/CheckFunctions.impl.h +++ b/src/core/debug/CheckFunctions.impl.h @@ -106,8 +106,8 @@ inline bool check_float_equal( const T & lhs, const U & rhs ) using LowType = typename math::MathTrait<T, U>::Low; - LowType low_lhs = static_cast<LowType>( lhs ); - LowType low_rhs = static_cast<LowType>( rhs ); + auto const low_lhs = static_cast<LowType>( lhs ); + auto const low_rhs = static_cast<LowType>( rhs ); return floatIsEqual( low_lhs, low_rhs ) || floatIsEqual( ( low_lhs - low_rhs ) / low_lhs, LowType(0) ); } @@ -120,8 +120,8 @@ inline bool check_float_unequal( const T & lhs, const U & rhs ) using LowType = typename math::MathTrait<T, U>::Low; - LowType low_lhs = static_cast<LowType>( lhs ); - LowType low_rhs = static_cast<LowType>( rhs ); + auto const low_lhs = static_cast<LowType>( lhs ); + auto const low_rhs = static_cast<LowType>( rhs ); return !floatIsEqual( low_lhs, low_rhs ) && !floatIsEqual( ( low_lhs - low_rhs ) / low_lhs, LowType(0) ); } @@ -135,8 +135,8 @@ inline bool check_float_equal_eps( const T & lhs, const U & rhs, using LowType = typename math::MathTrait<T, U>::Low; - LowType low_lhs = static_cast<LowType>( lhs ); - LowType low_rhs = static_cast<LowType>( rhs ); + auto const low_lhs = static_cast<LowType>( lhs ); + auto const low_rhs = static_cast<LowType>( rhs ); return floatIsEqual( low_lhs, low_rhs, epsilon ) || floatIsEqual( ( low_lhs - low_rhs ) / low_lhs, LowType(0), epsilon ); } @@ -150,8 +150,8 @@ inline bool check_float_unequal_eps( const T & lhs, const U & rhs, using LowType = typename math::MathTrait<T, U>::Low; - LowType low_lhs = static_cast<LowType>( lhs ); - LowType low_rhs = static_cast<LowType>( rhs ); + auto const low_lhs = static_cast<LowType>( lhs ); + auto const low_rhs = static_cast<LowType>( rhs ); return !floatIsEqual( low_lhs, low_rhs, epsilon ) && !floatIsEqual( ( low_lhs - low_rhs ) / low_lhs, LowType(0), epsilon ); } diff --git a/src/core/mpi/SendBuffer.h b/src/core/mpi/SendBuffer.h index d0663d2b8a900056d158560309b2b30b007f1256..db38485be121fdab9c358e3a3086623f78c04a2c 100644 --- a/src/core/mpi/SendBuffer.h +++ b/src/core/mpi/SendBuffer.h @@ -449,8 +449,8 @@ GenericSendBuffer<T,G>::put( V value ) static_assert( sizeof(V) >= sizeof(T), "Type that is stored has to be bigger than T" ); static_assert( sizeof(V) % sizeof(T) == 0, "V has to be divisible by T "); - size_t count = sizeof(V) / sizeof(T); // NOLINT(bugprone-sizeof-expression) - const size_t rest = numeric_cast< size_t >( end_ - cur_ ); + const auto count = sizeof(V) / sizeof(T); // NOLINT(bugprone-sizeof-expression) + const auto rest = numeric_cast< size_t >( end_ - cur_ ); // Checking the size of the remaining memory if( rest < count ) { @@ -516,7 +516,7 @@ template< typename T // Element type , typename G > // Growth policy T * GenericSendBuffer<T,G>::forward( uint_t elements ) { - const size_t rest = numeric_cast< size_t >( end_ - cur_ ); + const auto rest = numeric_cast< size_t >( end_ - cur_ ); // Checking the size of the remaining memory if( rest < elements ) { diff --git a/src/core/uid/UID.h b/src/core/uid/UID.h index 89a270e4cbe23ae5c17819d20d3dc43f6aeba22e..52d3747df3f0cac287d652841154a2f8ddde66f7 100644 --- a/src/core/uid/UID.h +++ b/src/core/uid/UID.h @@ -210,7 +210,7 @@ void UID<T>::init( const std::string& identifier, const bool newUid, const bool } else { // if another UID with the same identifier already exists this UID is chosen, otherwise a new UID is created - typename std::map< std::string, uint_type >::iterator it = stringToUid().find( identifier ); + auto it = stringToUid().find( identifier ); if( it == stringToUid().end() ) { @@ -291,7 +291,7 @@ UID<T> UID<T>::getOrConstruct( const std::string& identifier ) { WALBERLA_ASSERT( !identifier.empty() ); - typename std::map< std::string, uint_type >::iterator it = stringToUid().find( identifier ); + auto it = stringToUid().find( identifier ); if( it == stringToUid().end() ) { diff --git a/src/domain_decomposition/IBlock.h b/src/domain_decomposition/IBlock.h index e84c8f697729cb7278e8cc56ffb39bbef2083895..7e42d602629910f6fff2dac57f35ef23ddaf8b49 100644 --- a/src/domain_decomposition/IBlock.h +++ b/src/domain_decomposition/IBlock.h @@ -61,7 +61,7 @@ private: Data( T* data ) : data_( data ) {} ~Data() override { delete data_; } bool operator==( const DataBase& rhs ) const override { - const Data<T>* rhsData = dynamic_cast< const Data<T>* >( &rhs ); + const auto* rhsData = dynamic_cast< const Data<T>* >( &rhs ); return ( rhsData == &rhs ) && ( *data_ == *(rhsData->data_) ); // every object that is registered as block data // must be comparable with "==" ! } @@ -260,7 +260,7 @@ public: inline const T* uncheckedFastGetData( const BlockDataID & index ) const; template< typename T > inline T* uncheckedFastGetData( const BlockDataID & index ); - + protected: IBlock( BlockStorage& storage, const AABB& aabb, const IBlockID::IDType& id, const bool local = true ); diff --git a/src/field/Field.impl.h b/src/field/Field.impl.h index c77743c8a3eac7379c4e084f63a64ea8f3e8a1b9..44de8c1ef81a564d49e61fc2df38dbb80f8cdae6 100644 --- a/src/field/Field.impl.h +++ b/src/field/Field.impl.h @@ -204,8 +204,8 @@ namespace field { res->valuesWithOffset_ = res->values_ + offset; WALBERLA_ASSERT ( hasSameSize ( *res ) ); - WALBERLA_ASSERT ( hasSameAllocSize( *res ) ); - + WALBERLA_ASSERT ( hasSameAllocSize( *res ) ); + return res; } @@ -919,9 +919,9 @@ namespace field { // take care of proper thread<->memory assignment (first-touch allocation policy !) WALBERLA_FOR_ALL_CELLS_XYZ( this, - for( uint_t f = uint_t(0); f < fSize_; ++f ) + for( auto f = uint_t(0); f < fSize_; ++f ) get(x,y,z,f) = value; - + ) // WALBERLA_FOR_ALL_CELLS_XYZ #ifdef WALBERLA_CXX_COMPILER_IS_CLANG #pragma clang diagnostic pop @@ -939,7 +939,7 @@ namespace field { void Field<T,fSize_>::set (const std::vector<T> & fValues) { WALBERLA_ASSERT(fValues.size() == fSize_); - + #ifdef WALBERLA_CXX_COMPILER_IS_CLANG #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wunknown-pragmas" @@ -948,9 +948,9 @@ namespace field { // take care of proper thread<->memory assignment (first-touch allocation policy !) WALBERLA_FOR_ALL_CELLS_XYZ( this, - for( uint_t f = uint_t(0); f < fSize_; ++f ) + for( auto f = uint_t(0); f < fSize_; ++f ) get(x,y,z,f) = fValues[f]; - + ) // WALBERLA_FOR_ALL_CELLS_XYZ #ifdef WALBERLA_CXX_COMPILER_IS_CLANG #pragma clang diagnostic pop diff --git a/src/field/FlagField.impl.h b/src/field/FlagField.impl.h index 795809cba2349d0ecd34cbe7b424442e8d22b89b..c53ea813c91ed56bebbe3b45b3f72c381bc2202e 100644 --- a/src/field/FlagField.impl.h +++ b/src/field/FlagField.impl.h @@ -78,7 +78,7 @@ namespace field { template<typename T> FlagField<T>::~FlagField() { - uint_t const refs = Field<T,1>::referenceCount(); + const auto refs = Field<T,1>::referenceCount(); if( refs == 1 ) // last field that uses this data delete data_; } @@ -101,7 +101,7 @@ namespace field { template<typename T> inline FlagField<T> * FlagField<T>::clone() const { - FlagField<T> * ff = dynamic_cast<FlagField<T>* > ( GhostLayerField<T,1>::clone() ); + auto * ff = dynamic_cast<FlagField<T>* > ( GhostLayerField<T,1>::clone() ); // make a deep copy of Registration data, reference counting is done by FieldAllocator ff->data_ = new RegistrationData( *data_ ); return ff; @@ -110,7 +110,7 @@ namespace field { template<typename T> inline FlagField<T> * FlagField<T>::cloneUninitialized() const { - FlagField<T> * ff = dynamic_cast<FlagField<T>* > ( GhostLayerField<T,1>::cloneUninitialized() ); + auto * ff = dynamic_cast<FlagField<T>* > ( GhostLayerField<T,1>::cloneUninitialized() ); // make a deep copy of Registration data, reference counting is done by FieldAllocator ff->data_ = new RegistrationData(); return ff; @@ -213,7 +213,7 @@ namespace field { throw std::runtime_error( "Not enough space in flag_type for additional flags." ); - flag_t f = flag_t(T(1) << data_->nextFreeBit); + auto f = flag_t(T(1) << data_->nextFreeBit); data_->uidToFlag[uid] = f; data_->flagToUID[data_->nextFreeBit] = uid; @@ -248,7 +248,7 @@ namespace field { throw std::runtime_error("Already registered flag " + data_->flagToUID[bitNr].getIdentifier() + " at the given position of FlagField."); - flag_t f = flag_t(T(1) << bitNr); + auto f = flag_t(T(1) << bitNr); data_->uidToFlag[uid] = f; data_->flagToUID[bitNr] = uid; data_->usedMask = static_cast< flag_t >( data_->usedMask | f ); diff --git a/src/field/GhostLayerField.impl.h b/src/field/GhostLayerField.impl.h index bd7c2f9dc27247b365fd4bff422e1da6eca94798..f948bbb1613c0795f2e3d110715e9646b9576928 100644 --- a/src/field/GhostLayerField.impl.h +++ b/src/field/GhostLayerField.impl.h @@ -201,9 +201,9 @@ namespace field { // take care of proper thread<->memory assignment (first-touch allocation policy !) WALBERLA_FOR_ALL_CELLS_INCLUDING_GHOST_LAYER_XYZ( this, - for( uint_t f = uint_t(0); f < fSize_; ++f ) + for( auto f = uint_t(0); f < fSize_; ++f ) this->get(x,y,z,f) = value; - + ) // WALBERLA_FOR_ALL_CELLS_INCLUDING_GHOST_LAYER_XYZ #ifdef WALBERLA_CXX_COMPILER_IS_CLANG #pragma clang diagnostic pop @@ -218,7 +218,7 @@ namespace field { void GhostLayerField<T,fSize_>::setWithGhostLayer (const std::vector<T> & fValues) { WALBERLA_ASSERT(fValues.size() == fSize_); - + #ifdef WALBERLA_CXX_COMPILER_IS_CLANG #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wunknown-pragmas" @@ -227,9 +227,9 @@ namespace field { // take care of proper thread<->memory assignment (first-touch allocation policy !) WALBERLA_FOR_ALL_CELLS_INCLUDING_GHOST_LAYER_XYZ( this, - for( uint_t f = uint_t(0); f < fSize_; ++f ) + for( auto f = uint_t(0); f < fSize_; ++f ) this->get(x,y,z,f) = fValues[f]; - + ) // WALBERLA_FOR_ALL_CELLS_INCLUDING_GHOST_LAYER_XYZ #ifdef WALBERLA_CXX_COMPILER_IS_CLANG #pragma clang diagnostic pop diff --git a/src/field/allocation/FieldAllocator.h b/src/field/allocation/FieldAllocator.h index 22267404bf8aeb7e4e0f0d9ea2106bfab9ff8055..a66bf83f0667cfe3c889d063f51e1b546de0062e 100644 --- a/src/field/allocation/FieldAllocator.h +++ b/src/field/allocation/FieldAllocator.h @@ -76,7 +76,7 @@ namespace field { uint_t & allocSize1, uint_t & allocSize2, uint_t & allocSize3) { T * mem = allocateMemory(size0,size1,size2,size3,allocSize1,allocSize2,allocSize3); - BaseType * bmem = reinterpret_cast<BaseType *>(mem); + auto * bmem = reinterpret_cast<BaseType *>(mem); #ifdef WALBERLA_THREAD_SAFE_FIELD_ALLOCATION #ifdef _OPENMP #pragma omp critical( walberla_field_allocator_refcount ) @@ -101,7 +101,7 @@ namespace field { T * allocate ( uint_t allocSize ) { T * mem = allocateMemory( allocSize ); - BaseType * bmem = reinterpret_cast<BaseType *>(mem); + auto * bmem = reinterpret_cast<BaseType *>(mem); #ifdef WALBERLA_THREAD_SAFE_FIELD_ALLOCATION #ifdef _OPENMP @@ -125,7 +125,7 @@ namespace field { */ void incrementReferenceCount( T * mem ) { - BaseType * bmem = reinterpret_cast<BaseType *>(mem); + auto * bmem = reinterpret_cast<BaseType *>(mem); #ifdef WALBERLA_THREAD_SAFE_FIELD_ALLOCATION #ifdef _OPENMP @@ -151,7 +151,7 @@ namespace field { */ bool decrementReferenceCount( T * mem ) { - BaseType * bmem = reinterpret_cast<BaseType *>(mem); + auto * bmem = reinterpret_cast<BaseType *>(mem); bool memoryFreed = false; uint_t refCount = 0; @@ -179,7 +179,7 @@ namespace field { uint_t referenceCount ( T * mem ) const { - BaseType * bmem = reinterpret_cast<BaseType *>(mem); + auto * bmem = reinterpret_cast<BaseType *>(mem); uint_t refCount = 0; #ifdef WALBERLA_THREAD_SAFE_FIELD_ALLOCATION #ifdef _OPENMP @@ -265,7 +265,7 @@ namespace field { // placement new new (ptr) T[ size ]; - T * ret = reinterpret_cast<T*>( ptr ); + auto * ret = reinterpret_cast<T*>( ptr ); #ifdef _OPENMP #pragma omp critical( walberla_field_aligned_allocator_nrOfElements ) diff --git a/src/field/blockforest/BlockDataHandling.h b/src/field/blockforest/BlockDataHandling.h index e43831ffa59ca0548f3802026423ef296cc1f14b..c4ccb37ee4203203d3fe246c5adb382a2b9e988b 100644 --- a/src/field/blockforest/BlockDataHandling.h +++ b/src/field/blockforest/BlockDataHandling.h @@ -51,8 +51,8 @@ public: Field_T * initialize( IBlock * const block ) override { - Field_T * field = allocate( block ); - + auto * field = allocate( block ); + if( initFunction_ ) initFunction_( field, block ); @@ -68,7 +68,7 @@ public: Field_T * deserializeCoarseToFine( Block * const block ) override { return reallocate( block ); } Field_T * deserializeFineToCoarse( Block * const block ) override { return reallocate( block ); } - + void deserialize( IBlock * const block, const BlockDataID & id, mpi::RecvBuffer & buffer ) override; void deserializeCoarseToFine( Block * const block, const BlockDataID & id, mpi::RecvBuffer & buffer ) override; @@ -99,7 +99,7 @@ protected: else { WALBERLA_CHECK( (zSize & uint_t(1)) == uint_t(0), "The z-size of your field must be divisible by 2." ) } } - + InitializationFunction_T initFunction_; }; // class BlockDataHandling @@ -109,7 +109,7 @@ protected: template< typename Field_T, bool Pseudo2D > inline void BlockDataHandling< Field_T, Pseudo2D >::serialize( IBlock * const block, const BlockDataID & id, mpi::SendBuffer & buffer ) { - Field_T * field = block->template getData< Field_T >(id); + auto * field = block->template getData< Field_T >(id); WALBERLA_ASSERT_NOT_NULLPTR( field ) #ifndef NDEBUG @@ -125,30 +125,30 @@ inline void BlockDataHandling< Field_T, Pseudo2D >::serialize( IBlock * const bl template< typename Field_T, bool Pseudo2D > void BlockDataHandling< Field_T, Pseudo2D >::serializeCoarseToFine( Block * const block, const BlockDataID & id, mpi::SendBuffer & buffer, const uint_t child ) { - Field_T * field = block->template getData< Field_T >(id); + auto * field = block->template getData< Field_T >(id); WALBERLA_ASSERT_NOT_NULLPTR( field ) - const uint_t xSize = field->xSize(); - const uint_t ySize = field->ySize(); - const uint_t zSize = field->zSize(); - const uint_t fSize = field->fSize(); + const auto xSize = field->xSize(); + const auto ySize = field->ySize(); + const auto zSize = field->zSize(); + const auto fSize = field->fSize(); sizeCheck( xSize, ySize, zSize ); #ifndef NDEBUG buffer << child << ( xSize / uint_t(2) ) << ( ySize / uint_t(2) ) << ( Pseudo2D ? zSize : ( zSize / uint_t(2) ) ) << fSize; #endif - const cell_idx_t zBegin = Pseudo2D ? cell_idx_t(0) : ( (child & uint_t(4)) ? ( cell_idx_c( zSize ) / cell_idx_t(2) ) : cell_idx_t(0) ); - const cell_idx_t zEnd = Pseudo2D ? cell_idx_t(1) : ( (child & uint_t(4)) ? cell_idx_c( zSize ) : ( cell_idx_c( zSize ) / cell_idx_t(2) ) ); - for( cell_idx_t z = zBegin; z < zEnd; ++z ) + const auto zBegin = Pseudo2D ? cell_idx_t(0) : ( (child & uint_t(4)) ? ( cell_idx_c( zSize ) / cell_idx_t(2) ) : cell_idx_t(0) ); + const auto zEnd = Pseudo2D ? cell_idx_t(1) : ( (child & uint_t(4)) ? cell_idx_c( zSize ) : ( cell_idx_c( zSize ) / cell_idx_t(2) ) ); + for( auto z = zBegin; z < zEnd; ++z ) { - const cell_idx_t yEnd = (child & uint_t(2)) ? cell_idx_c( ySize ) : ( cell_idx_c( ySize ) / cell_idx_t(2) ); - for( cell_idx_t y = (child & uint_t(2)) ? ( cell_idx_c( ySize ) / cell_idx_t(2) ) : cell_idx_t(0); y < yEnd; ++y ) + const auto yEnd = (child & uint_t(2)) ? cell_idx_c( ySize ) : ( cell_idx_c( ySize ) / cell_idx_t(2) ); + for( auto y = (child & uint_t(2)) ? ( cell_idx_c( ySize ) / cell_idx_t(2) ) : cell_idx_t(0); y < yEnd; ++y ) { - const cell_idx_t xEnd = (child & uint_t(1)) ? cell_idx_c( xSize ) : ( cell_idx_c( xSize ) / cell_idx_t(2) ); - for( cell_idx_t x = (child & uint_t(1)) ? ( cell_idx_c( xSize ) / cell_idx_t(2) ) : cell_idx_t(0); x < xEnd; ++x ) + const auto xEnd = (child & uint_t(1)) ? cell_idx_c( xSize ) : ( cell_idx_c( xSize ) / cell_idx_t(2) ); + for( auto x = (child & uint_t(1)) ? ( cell_idx_c( xSize ) / cell_idx_t(2) ) : cell_idx_t(0); x < xEnd; ++x ) { - for( uint_t f = uint_t(0); f < fSize; ++f ) + for( auto f = uint_t(0); f < fSize; ++f ) buffer << field->get(x,y,z,f); } } @@ -160,23 +160,23 @@ void BlockDataHandling< Field_T, Pseudo2D >::serializeCoarseToFine( Block * cons template< typename Field_T, bool Pseudo2D > void BlockDataHandling< Field_T, Pseudo2D >::serializeFineToCoarse( Block * const block, const BlockDataID & id, mpi::SendBuffer & buffer ) { - Field_T * field = block->template getData< Field_T >(id); + auto * field = block->template getData< Field_T >(id); WALBERLA_ASSERT_NOT_NULLPTR( field ) - const uint_t xSize = field->xSize(); - const uint_t ySize = field->ySize(); - const uint_t zSize = field->zSize(); - const uint_t fSize = field->fSize(); + const auto xSize = field->xSize(); + const auto ySize = field->ySize(); + const auto zSize = field->zSize(); + const auto fSize = field->fSize(); sizeCheck( xSize, ySize, zSize ); #ifndef NDEBUG buffer << block->getId().getBranchId() << ( xSize / uint_t(2) ) << ( ySize / uint_t(2) ) << ( Pseudo2D ? zSize : ( zSize / uint_t(2) ) ) << fSize; #endif - for( cell_idx_t z = cell_idx_t(0); z < cell_idx_c( zSize ); z += cell_idx_t(2) ) { - for( cell_idx_t y = cell_idx_t(0); y < cell_idx_c( ySize ); y += cell_idx_t(2) ) { - for( cell_idx_t x = cell_idx_t(0); x < cell_idx_c( xSize ); x += cell_idx_t(2) ) { - for( uint_t f = uint_t(0); f < fSize; ++f ) + for( auto z = cell_idx_t(0); z < cell_idx_c( zSize ); z += cell_idx_t(2) ) { + for( auto y = cell_idx_t(0); y < cell_idx_c( ySize ); y += cell_idx_t(2) ) { + for( auto x = cell_idx_t(0); x < cell_idx_c( xSize ); x += cell_idx_t(2) ) { + for( auto f = uint_t(0); f < fSize; ++f ) { Value_T result = field->get( x, y, z, f ); result = static_cast< Value_T >( result + field->get( x + cell_idx_t(1), y , z , f ) ); @@ -202,13 +202,13 @@ void BlockDataHandling< Field_T, Pseudo2D >::serializeFineToCoarse( Block * cons template< typename Field_T, bool Pseudo2D > inline void BlockDataHandling< Field_T, Pseudo2D >::deserialize( IBlock * const block, const BlockDataID & id, mpi::RecvBuffer & buffer ) { - Field_T * field = block->template getData< Field_T >( id ); + auto * field = block->template getData< Field_T >( id ); #ifndef NDEBUG - uint_t xSender( uint_t(0) ); - uint_t ySender( uint_t(0) ); - uint_t zSender( uint_t(0) ); - uint_t fSender( uint_t(0) ); + auto xSender( uint_t(0) ); + auto ySender( uint_t(0) ); + auto zSender( uint_t(0) ); + auto fSender( uint_t(0) ); buffer >> xSender >> ySender >> zSender >> fSender; WALBERLA_ASSERT_EQUAL( xSender, field->xSize() ) WALBERLA_ASSERT_EQUAL( ySender, field->ySize() ) @@ -225,20 +225,20 @@ inline void BlockDataHandling< Field_T, Pseudo2D >::deserialize( IBlock * const template< typename Field_T, bool Pseudo2D > void BlockDataHandling< Field_T, Pseudo2D >::deserializeCoarseToFine( Block * const block, const BlockDataID & id, mpi::RecvBuffer & buffer ) { - Field_T * field = block->template getData< Field_T >( id ); + auto * field = block->template getData< Field_T >( id ); - const uint_t xSize = field->xSize(); - const uint_t ySize = field->ySize(); - const uint_t zSize = field->zSize(); - const uint_t fSize = field->fSize(); + const auto xSize = field->xSize(); + const auto ySize = field->ySize(); + const auto zSize = field->zSize(); + const auto fSize = field->fSize(); sizeCheck( xSize, ySize, zSize ); #ifndef NDEBUG - uint_t branchId( uint_t(0) ); - uint_t xSender( uint_t(0) ); - uint_t ySender( uint_t(0) ); - uint_t zSender( uint_t(0) ); - uint_t fSender( uint_t(0) ); + auto branchId( uint_t(0) ); + auto xSender( uint_t(0) ); + auto ySender( uint_t(0) ); + auto zSender( uint_t(0) ); + auto fSender( uint_t(0) ); buffer >> branchId >> xSender >> ySender >> zSender >> fSender; WALBERLA_ASSERT_EQUAL( branchId, block->getId().getBranchId() ) WALBERLA_ASSERT_EQUAL( xSender, xSize / uint_t(2) ) @@ -250,10 +250,10 @@ void BlockDataHandling< Field_T, Pseudo2D >::deserializeCoarseToFine( Block * co WALBERLA_ASSERT_EQUAL( fSender, fSize ) #endif - for( cell_idx_t z = cell_idx_t(0); z < cell_idx_c( zSize ); z += cell_idx_t(2) ) { - for( cell_idx_t y = cell_idx_t(0); y < cell_idx_c( ySize ); y += cell_idx_t(2) ) { - for( cell_idx_t x = cell_idx_t(0); x < cell_idx_c( xSize ); x += cell_idx_t(2) ) { - for( uint_t f = uint_t(0); f < fSize; ++f ) + for( auto z = cell_idx_t(0); z < cell_idx_c( zSize ); z += cell_idx_t(2) ) { + for( auto y = cell_idx_t(0); y < cell_idx_c( ySize ); y += cell_idx_t(2) ) { + for( auto x = cell_idx_t(0); x < cell_idx_c( xSize ); x += cell_idx_t(2) ) { + for( auto f = uint_t(0); f < fSize; ++f ) { Value_T value; buffer >> value; @@ -280,20 +280,20 @@ void BlockDataHandling< Field_T, Pseudo2D >::deserializeCoarseToFine( Block * co template< typename Field_T, bool Pseudo2D > void BlockDataHandling< Field_T, Pseudo2D >::deserializeFineToCoarse( Block * const block, const BlockDataID & id, mpi::RecvBuffer & buffer, const uint_t child ) { - Field_T * field = block->template getData< Field_T >( id ); + auto * field = block->template getData< Field_T >( id ); - const uint_t xSize = field->xSize(); - const uint_t ySize = field->ySize(); - const uint_t zSize = field->zSize(); - const uint_t fSize = field->fSize(); + const auto xSize = field->xSize(); + const auto ySize = field->ySize(); + const auto zSize = field->zSize(); + const auto fSize = field->fSize(); sizeCheck( xSize, ySize, zSize ); #ifndef NDEBUG - uint_t branchId( uint_t(0) ); - uint_t xSender( uint_t(0) ); - uint_t ySender( uint_t(0) ); - uint_t zSender( uint_t(0) ); - uint_t fSender( uint_t(0) ); + auto branchId( uint_t(0) ); + auto xSender( uint_t(0) ); + auto ySender( uint_t(0) ); + auto zSender( uint_t(0) ); + auto fSender( uint_t(0) ); buffer >> branchId >> xSender >> ySender >> zSender >> fSender; WALBERLA_ASSERT_EQUAL( branchId, child ) WALBERLA_ASSERT_EQUAL( xSender, xSize / uint_t(2) ) @@ -307,15 +307,15 @@ void BlockDataHandling< Field_T, Pseudo2D >::deserializeFineToCoarse( Block * co const cell_idx_t zBegin = Pseudo2D ? cell_idx_t(0) : ( (child & uint_t(4)) ? ( cell_idx_c( zSize ) / cell_idx_t(2) ) : cell_idx_t(0) ); const cell_idx_t zEnd = Pseudo2D ? cell_idx_t(1) : ( (child & uint_t(4)) ? cell_idx_c( zSize ) : ( cell_idx_c( zSize ) / cell_idx_t(2) ) ); - for( cell_idx_t z = zBegin; z < zEnd; ++z ) + for( auto z = zBegin; z < zEnd; ++z ) { const cell_idx_t yEnd = (child & uint_t(2)) ? cell_idx_c( ySize ) : ( cell_idx_c( ySize ) / cell_idx_t(2) ); - for( cell_idx_t y = (child & uint_t(2)) ? ( cell_idx_c( ySize ) / cell_idx_t(2) ) : cell_idx_t(0); y < yEnd; ++y ) + for( auto y = (child & uint_t(2)) ? ( cell_idx_c( ySize ) / cell_idx_t(2) ) : cell_idx_t(0); y < yEnd; ++y ) { const cell_idx_t xEnd = (child & uint_t(1)) ? cell_idx_c( xSize ) : ( cell_idx_c( xSize ) / cell_idx_t(2) ); - for( cell_idx_t x = (child & uint_t(1)) ? ( cell_idx_c( xSize ) / cell_idx_t(2) ) : cell_idx_t(0); x < xEnd; ++x ) + for( auto x = (child & uint_t(1)) ? ( cell_idx_c( xSize ) / cell_idx_t(2) ) : cell_idx_t(0); x < xEnd; ++x ) { - for( uint_t f = uint_t(0); f < fSize; ++f ) + for( auto f = uint_t(0); f < fSize; ++f ) buffer >> field->get(x,y,z,f); } } @@ -438,7 +438,7 @@ protected: { auto blocks = blocks_.lock(); WALBERLA_CHECK_NOT_NULLPTR( blocks, "Trying to access 'DefaultBlockDataHandling' for a block storage object that doesn't exist anymore" ) - const Vector3< uint_t > size = calculateSize_( blocks, block ); + const auto size = calculateSize_( blocks, block ); return internal::allocate< GhostLayerField_T >( size[0], size[1], size[2], nrOfGhostLayers_, initValue_, layout_, alloc_ ); } @@ -447,7 +447,7 @@ protected: { auto blocks = blocks_.lock(); WALBERLA_CHECK_NOT_NULLPTR( blocks, "Trying to access 'DefaultBlockDataHandling' for a block storage object that doesn't exist anymore" ) - const Vector3< uint_t > size = calculateSize_( blocks, block ); + const auto size = calculateSize_( blocks, block ); return internal::allocate< GhostLayerField_T >( size[0], size[1], size[2], nrOfGhostLayers_, layout_, alloc_ ); } @@ -505,9 +505,9 @@ public: { auto blocks = blocks_.lock(); WALBERLA_CHECK_NOT_NULLPTR( blocks, "Trying to access 'AlwaysInitializeBlockDataHandling' for a block storage object that doesn't exist anymore" ) - Vector3<uint_t> size = calculateSize_( blocks, block ); - GhostLayerField_T * field = internal::allocate< GhostLayerField_T >( size[0], size[1], size[2], - nrOfGhostLayers_, initValue_, layout_, alloc_ ); + const auto size = calculateSize_( blocks, block ); + auto * field = internal::allocate< GhostLayerField_T >( size[0], size[1], size[2], + nrOfGhostLayers_, initValue_, layout_, alloc_ ); if( initFunction_ ) initFunction_( field, block ); @@ -544,7 +544,7 @@ public: Field_T * initialize( IBlock * const block ) override { - const Field_T * toClone = block->template getData< Field_T >( fieldToClone_ ); + const auto * toClone = block->template getData< Field_T >( fieldToClone_ ); return toClone->clone(); } @@ -570,7 +570,7 @@ public: typename Field_T::FlattenedField * initialize( IBlock * const block ) override { - const Field_T * toClone = block->template getData< Field_T >( fieldToClone_ ); + const auto * toClone = block->template getData< Field_T >( fieldToClone_ ); return toClone->flattenedShallowCopy(); } diff --git a/src/field/communication/PackInfo.h b/src/field/communication/PackInfo.h index 108860eb3af81bf8c6fa74786fadd58b3b7d2150..1763e7d835c0121f730716160292aee9d5399dda 100644 --- a/src/field/communication/PackInfo.h +++ b/src/field/communication/PackInfo.h @@ -74,7 +74,7 @@ protected: template<typename GhostLayerField_T> void PackInfo<GhostLayerField_T>::unpackData(IBlock * receiver, stencil::Direction dir, mpi::RecvBuffer & buffer) { - GhostLayerField_T * f = receiver->getData< GhostLayerField_T >( bdId_ ); + auto * f = receiver->getData< GhostLayerField_T >( bdId_ ); WALBERLA_ASSERT_NOT_NULLPTR(f); uint_t nrOfGhostLayers = numberOfGhostLayersToCommunicate( f ); @@ -96,8 +96,8 @@ void PackInfo<GhostLayerField_T>::unpackData(IBlock * receiver, stencil::Directi template<typename GhostLayerField_T> void PackInfo<GhostLayerField_T>::communicateLocal(const IBlock * sender, IBlock * receiver, stencil::Direction dir) { - const GhostLayerField_T * sf = sender ->getData< GhostLayerField_T >( bdId_ ); - GhostLayerField_T * rf = receiver->getData< GhostLayerField_T >( bdId_ ); + const auto * sf = sender ->getData< GhostLayerField_T >( bdId_ ); + auto * rf = receiver->getData< GhostLayerField_T >( bdId_ ); WALBERLA_ASSERT_EQUAL(sf->xSize(), rf->xSize()); WALBERLA_ASSERT_EQUAL(sf->ySize(), rf->ySize()); @@ -121,7 +121,7 @@ void PackInfo<GhostLayerField_T>::communicateLocal(const IBlock * sender, IBlock template<typename GhostLayerField_T> void PackInfo<GhostLayerField_T>::packDataImpl(const IBlock * sender, stencil::Direction dir, mpi::SendBuffer & outBuffer) const { - const GhostLayerField_T * f = sender->getData< GhostLayerField_T >( bdId_ ); + const auto * f = sender->getData< GhostLayerField_T >( bdId_ ); WALBERLA_ASSERT_NOT_NULLPTR(f); #ifndef NDEBUG diff --git a/src/field/iterators/IteratorMacros.h b/src/field/iterators/IteratorMacros.h index ed5b98711891b1f35ee3bbeef15520bf039bf7a0..ed4c72c4c59f4d3ecc6c11ea8c445686db673bb7 100644 --- a/src/field/iterators/IteratorMacros.h +++ b/src/field/iterators/IteratorMacros.h @@ -108,7 +108,7 @@ //! \code //! WALBERLA_FOR_ALL_CELLS_YZ( ptrToField, //! -//! for( ::walberla::cell_idx_t x = ::walberla::cell_idx_t(0); x < ::walberla::cell_idx_c( ptrToField->xSize() ); x += ::walberla::cell_idx_t(2) ) +//! for( auto x = ::walberla::cell_idx_t(0); x < ::walberla::cell_idx_c( ptrToField->xSize() ); x += ::walberla::cell_idx_t(2) ) //! ptrToField->get(x,y,z) += 42; //! ) //! \endcode @@ -153,17 +153,17 @@ #define WALBERLA_FOR_ALL_CELLS_XYZ_OMP( field, omp, CODE ) \ { WALBERLA_ASSERT_NOT_NULLPTR_1( (field) ); \ - const ::walberla::cell_idx_t xSize__ = ::walberla::cell_idx_c( (field)->xSize() ); \ - const ::walberla::cell_idx_t ySize__ = ::walberla::cell_idx_c( (field)->ySize() ); \ - const ::walberla::cell_idx_t zSize__ = ::walberla::cell_idx_c( (field)->zSize() ); \ + const auto xSize__ = ::walberla::cell_idx_c( (field)->xSize() ); \ + const auto ySize__ = ::walberla::cell_idx_c( (field)->ySize() ); \ + const auto zSize__ = ::walberla::cell_idx_c( (field)->zSize() ); \ if( zSize__ >= ySize__ ) \ { \ const int izSize = ::walberla::int_c( zSize__ ); \ __pragma(omp) \ for( int iz = 0; iz < izSize; ++iz ) { \ - ::walberla::cell_idx_t z = ::walberla::cell_idx_c( iz ); \ - for( ::walberla::cell_idx_t y = ::walberla::cell_idx_t(0); y < ySize__; ++y ) { \ - for( ::walberla::cell_idx_t x = ::walberla::cell_idx_t(0); x < xSize__; ++x ) \ + auto z = ::walberla::cell_idx_c( iz ); \ + for( auto y = ::walberla::cell_idx_t(0); y < ySize__; ++y ) { \ + for( auto x = ::walberla::cell_idx_t(0); x < xSize__; ++x ) \ { \ CODE \ } \ @@ -175,9 +175,9 @@ const int iySize = ::walberla::int_c( ySize__ ); \ __pragma(omp) \ for( int iy = 0; iy < iySize; ++iy ) { \ - ::walberla::cell_idx_t y = ::walberla::cell_idx_c( iy ); \ - for( ::walberla::cell_idx_t z = ::walberla::cell_idx_t(0); z < zSize__; ++z ) { \ - for( ::walberla::cell_idx_t x = ::walberla::cell_idx_t(0); x < xSize__; ++x ) \ + auto y = ::walberla::cell_idx_c( iy ); \ + for( auto z = ::walberla::cell_idx_t(0); z < zSize__; ++z ) { \ + for( auto x = ::walberla::cell_idx_t(0); x < xSize__; ++x ) \ { \ CODE \ } \ @@ -191,9 +191,9 @@ const int izMax = ::walberla::int_c( interval.zMax() ); \ __pragma(omp) \ for( int iz = ::walberla::int_c( interval.zMin() ); iz <= izMax; ++iz ) { \ - ::walberla::cell_idx_t z = ::walberla::cell_idx_c( iz ); \ - for( ::walberla::cell_idx_t y = interval.yMin(); y <= interval.yMax(); ++y ) { \ - for( ::walberla::cell_idx_t x = interval.xMin(); x <= interval.xMax(); ++x ) \ + auto z = ::walberla::cell_idx_c( iz ); \ + for( auto y = interval.yMin(); y <= interval.yMax(); ++y ) { \ + for( auto x = interval.xMin(); x <= interval.xMax(); ++x ) \ { \ CODE \ } \ @@ -205,9 +205,9 @@ const int iyMax = ::walberla::int_c( interval.yMax() ); \ __pragma(omp) \ for( int iy = ::walberla::int_c( interval.yMin() ); iy <= iyMax; ++iy ) { \ - ::walberla::cell_idx_t y = ::walberla::cell_idx_c( iy ); \ - for( ::walberla::cell_idx_t z = interval.zMin(); z <= interval.zMax(); ++z ) { \ - for( ::walberla::cell_idx_t x = interval.xMin(); x <= interval.xMax(); ++x ) \ + auto y = ::walberla::cell_idx_c( iy ); \ + for( auto z = interval.zMin(); z <= interval.zMax(); ++z ) { \ + for( auto x = interval.xMin(); x <= interval.xMax(); ++x ) \ { \ CODE \ } \ @@ -219,10 +219,10 @@ #define WALBERLA_FOR_ALL_CELLS_INCLUDING_GHOST_LAYER_XYZ_OMP_4( field, gl, omp, CODE ) \ { WALBERLA_ASSERT_NOT_NULLPTR_1( (field) ); \ WALBERLA_ASSERT_GREATER_EQUAL_2( (field)->nrOfGhostLayers(), gl ); \ - const ::walberla::cell_idx_t xSize__ = ::walberla::cell_idx_c( (field)->xSize() ); \ - const ::walberla::cell_idx_t ySize__ = ::walberla::cell_idx_c( (field)->ySize() ); \ - const ::walberla::cell_idx_t zSize__ = ::walberla::cell_idx_c( (field)->zSize() ); \ - const ::walberla::cell_idx_t gl__ = ::walberla::cell_idx_c( gl ); \ + const auto xSize__ = ::walberla::cell_idx_c( (field)->xSize() ); \ + const auto ySize__ = ::walberla::cell_idx_c( (field)->ySize() ); \ + const auto zSize__ = ::walberla::cell_idx_c( (field)->zSize() ); \ + const auto gl__ = ::walberla::cell_idx_c( gl ); \ if( zSize__ >= ySize__ ) \ { \ const int izSize = ::walberla::int_c( zSize__ ); \ @@ -230,9 +230,9 @@ for( int iz = 0; iz < izSize; ++iz ) { \ if( iz == 0 ) \ { \ - for( ::walberla::cell_idx_t z = -gl__; z < ::walberla::cell_idx_t(0); ++z ) { \ - for( ::walberla::cell_idx_t y = -gl__; y < (ySize__ + gl__); ++y ) { \ - for( ::walberla::cell_idx_t x = -gl__; x < (xSize__ + gl__); ++x ) \ + for( auto z = -gl__; z < ::walberla::cell_idx_t(0); ++z ) { \ + for( auto y = -gl__; y < (ySize__ + gl__); ++y ) { \ + for( auto x = -gl__; x < (xSize__ + gl__); ++x ) \ { \ CODE \ } \ @@ -240,9 +240,9 @@ } \ } \ { \ - ::walberla::cell_idx_t z = ::walberla::cell_idx_c( iz ); \ - for( ::walberla::cell_idx_t y = -gl__; y < (ySize__ + gl__); ++y ) { \ - for( ::walberla::cell_idx_t x = -gl__; x < (xSize__ + gl__); ++x ) \ + auto z = ::walberla::cell_idx_c( iz ); \ + for( auto y = -gl__; y < (ySize__ + gl__); ++y ) { \ + for( auto x = -gl__; x < (xSize__ + gl__); ++x ) \ { \ CODE \ } \ @@ -250,9 +250,9 @@ } \ if( iz == (izSize - 1) ) \ { \ - for( ::walberla::cell_idx_t z = zSize__; z < (zSize__ + gl__); ++z ) { \ - for( ::walberla::cell_idx_t y = -gl__; y < (ySize__ + gl__); ++y ) { \ - for( ::walberla::cell_idx_t x = -gl__; x < (xSize__ + gl__); ++x ) \ + for( auto z = zSize__; z < (zSize__ + gl__); ++z ) { \ + for( auto y = -gl__; y < (ySize__ + gl__); ++y ) { \ + for( auto x = -gl__; x < (xSize__ + gl__); ++x ) \ { \ CODE \ } \ @@ -268,9 +268,9 @@ for( int iy = 0; iy < iySize; ++iy ) { \ if( iy == 0 ) \ { \ - for( ::walberla::cell_idx_t y = -gl__; y < ::walberla::cell_idx_t(0); ++y ) { \ - for( ::walberla::cell_idx_t z = -gl__; z < (zSize__ + gl__); ++z ) { \ - for( ::walberla::cell_idx_t x = -gl__; x < (xSize__ + gl__); ++x ) \ + for( auto y = -gl__; y < ::walberla::cell_idx_t(0); ++y ) { \ + for( auto z = -gl__; z < (zSize__ + gl__); ++z ) { \ + for( auto x = -gl__; x < (xSize__ + gl__); ++x ) \ { \ CODE \ } \ @@ -278,9 +278,9 @@ } \ } \ { \ - ::walberla::cell_idx_t y = ::walberla::cell_idx_c( iy ); \ - for( ::walberla::cell_idx_t z = -gl__; z < (zSize__ + gl__); ++z ) { \ - for( ::walberla::cell_idx_t x = -gl__; x < (xSize__ + gl__); ++x ) \ + auto y = ::walberla::cell_idx_c( iy ); \ + for( auto z = -gl__; z < (zSize__ + gl__); ++z ) { \ + for( auto x = -gl__; x < (xSize__ + gl__); ++x ) \ { \ CODE \ } \ @@ -288,9 +288,9 @@ } \ if( iy == (iySize - 1) ) \ { \ - for( ::walberla::cell_idx_t y = ySize__; y < (ySize__ + gl__); ++y ) { \ - for( ::walberla::cell_idx_t z = -gl__; z < (zSize__ + gl__); ++z ) { \ - for( ::walberla::cell_idx_t x = -gl__; x < (xSize__ + gl__); ++x ) \ + for( auto y = ySize__; y < (ySize__ + gl__); ++y ) { \ + for( auto z = -gl__; z < (zSize__ + gl__); ++z ) { \ + for( auto x = -gl__; x < (xSize__ + gl__); ++x ) \ { \ CODE \ } \ @@ -302,15 +302,15 @@ #define WALBERLA_FOR_ALL_CELLS_YZ_OMP( field, omp, CODE ) \ { WALBERLA_ASSERT_NOT_NULLPTR_1( (field) ); \ - const ::walberla::cell_idx_t ySize__ = ::walberla::cell_idx_c( (field)->ySize() ); \ - const ::walberla::cell_idx_t zSize__ = ::walberla::cell_idx_c( (field)->zSize() ); \ + const auto ySize__ = ::walberla::cell_idx_c( (field)->ySize() ); \ + const auto zSize__ = ::walberla::cell_idx_c( (field)->zSize() ); \ if( zSize__ >= ySize__ ) \ { \ const int izSize = ::walberla::int_c( zSize__ ); \ __pragma(omp) \ for( int iz = 0; iz < izSize; ++iz ) { \ - ::walberla::cell_idx_t z = ::walberla::cell_idx_c( iz ); \ - for( ::walberla::cell_idx_t y = ::walberla::cell_idx_t(0); y < ySize__; ++y ) \ + auto z = ::walberla::cell_idx_c( iz ); \ + for( auto y = ::walberla::cell_idx_t(0); y < ySize__; ++y ) \ { \ CODE \ } \ @@ -321,8 +321,8 @@ const int iySize = ::walberla::int_c( ySize__ ); \ __pragma(omp) \ for( int iy = 0; iy < iySize; ++iy ) { \ - ::walberla::cell_idx_t y = ::walberla::cell_idx_c( iy ); \ - for( ::walberla::cell_idx_t z = ::walberla::cell_idx_t(0); z < zSize__; ++z ) \ + auto y = ::walberla::cell_idx_c( iy ); \ + for( auto z = ::walberla::cell_idx_t(0); z < zSize__; ++z ) \ { \ CODE \ } \ @@ -335,8 +335,8 @@ const int izMax = ::walberla::int_c( interval.zMax() ); \ __pragma(omp) \ for( int iz = ::walberla::int_c( interval.zMin() ); iz <= izMax; ++iz ) { \ - ::walberla::cell_idx_t z = ::walberla::cell_idx_c( iz ); \ - for( ::walberla::cell_idx_t y = interval.yMin(); y <= interval.yMax(); ++y ) \ + auto z = ::walberla::cell_idx_c( iz ); \ + for( auto y = interval.yMin(); y <= interval.yMax(); ++y ) \ { \ CODE \ } \ @@ -347,8 +347,8 @@ const int iyMax = ::walberla::int_c( interval.yMax() ); \ __pragma(omp) \ for( int iy = ::walberla::int_c( interval.yMin() ); iy <= iyMax; ++iy ) { \ - ::walberla::cell_idx_t y = ::walberla::cell_idx_c( iy ); \ - for( ::walberla::cell_idx_t z = interval.zMin(); z <= interval.zMax(); ++z ) \ + auto y = ::walberla::cell_idx_c( iy ); \ + for( auto z = interval.zMin(); z <= interval.zMax(); ++z ) \ { \ CODE \ } \ @@ -359,9 +359,9 @@ #define WALBERLA_FOR_ALL_CELLS_INCLUDING_GHOST_LAYER_YZ_OMP_4( field, gl, omp, CODE ) \ { WALBERLA_ASSERT_NOT_NULLPTR_1( (field) ); \ WALBERLA_ASSERT_GREATER_EQUAL_2( (field)->nrOfGhostLayers(), gl ); \ - const ::walberla::cell_idx_t ySize__ = ::walberla::cell_idx_c( (field)->ySize() ); \ - const ::walberla::cell_idx_t zSize__ = ::walberla::cell_idx_c( (field)->zSize() ); \ - const ::walberla::cell_idx_t gl__ = ::walberla::cell_idx_c( gl ); \ + const auto ySize__ = ::walberla::cell_idx_c( (field)->ySize() ); \ + const auto zSize__ = ::walberla::cell_idx_c( (field)->zSize() ); \ + const auto gl__ = ::walberla::cell_idx_c( gl ); \ if( zSize__ >= ySize__ ) \ { \ const int izSize = ::walberla::int_c( zSize__ ); \ @@ -369,24 +369,24 @@ for( int iz = 0; iz < izSize; ++iz ) { \ if( iz == 0 ) \ { \ - for( ::walberla::cell_idx_t z = -gl__; z < ::walberla::cell_idx_t(0); ++z ) { \ - for( ::walberla::cell_idx_t y = -gl__; y < (ySize__ + gl__); ++y ) \ + for( auto z = -gl__; z < ::walberla::cell_idx_t(0); ++z ) { \ + for( auto y = -gl__; y < (ySize__ + gl__); ++y ) \ { \ CODE \ } \ } \ } \ { \ - ::walberla::cell_idx_t z = ::walberla::cell_idx_c( iz ); \ - for( ::walberla::cell_idx_t y = -gl__; y < (ySize__ + gl__); ++y ) \ + auto z = ::walberla::cell_idx_c( iz ); \ + for( auto y = -gl__; y < (ySize__ + gl__); ++y ) \ { \ CODE \ } \ } \ if( iz == (izSize - 1) ) \ { \ - for( ::walberla::cell_idx_t z = zSize__; z < (zSize__ + gl__); ++z ) { \ - for( ::walberla::cell_idx_t y = -gl__; y < (ySize__ + gl__); ++y ) \ + for( auto z = zSize__; z < (zSize__ + gl__); ++z ) { \ + for( auto y = -gl__; y < (ySize__ + gl__); ++y ) \ { \ CODE \ } \ @@ -401,24 +401,24 @@ for( int iy = 0; iy < iySize; ++iy ) { \ if( iy == 0 ) \ { \ - for( ::walberla::cell_idx_t y = -gl__; y < ::walberla::cell_idx_t(0); ++y ) { \ - for( ::walberla::cell_idx_t z = -gl__; z < (zSize__ + gl__); ++z ) \ + for( auto y = -gl__; y < ::walberla::cell_idx_t(0); ++y ) { \ + for( auto z = -gl__; z < (zSize__ + gl__); ++z ) \ { \ CODE \ } \ } \ } \ { \ - ::walberla::cell_idx_t y = ::walberla::cell_idx_c( iy ); \ - for( ::walberla::cell_idx_t z = -gl__; z < (zSize__ + gl__); ++z ) \ + auto y = ::walberla::cell_idx_c( iy ); \ + for( auto z = -gl__; z < (zSize__ + gl__); ++z ) \ { \ CODE \ } \ } \ if( iy == (iySize - 1) ) \ { \ - for( ::walberla::cell_idx_t y = ySize__; y < (ySize__ + gl__); ++y ) { \ - for( ::walberla::cell_idx_t z = -gl__; z < (zSize__ + gl__); ++z ) \ + for( auto y = ySize__; y < (ySize__ + gl__); ++y ) { \ + for( auto z = -gl__; z < (zSize__ + gl__); ++z ) \ { \ CODE \ } \ @@ -430,15 +430,15 @@ // Do not call this macro, call 'WALBERLA_FOR_ALL_CELLS_OMP' (using the same signature) instead #define WALBERLA_FOR_ALL_CELLS_OMP_4( it0, f0, omp, CODE ) \ { WALBERLA_ASSERT_NOT_NULLPTR_1( (f0) ); \ - const ::walberla::cell_idx_t xSize__ = ::walberla::cell_idx_c( (f0)->xSize() ); \ - const ::walberla::cell_idx_t ySize__ = ::walberla::cell_idx_c( (f0)->ySize() ); \ - const ::walberla::cell_idx_t zSize__ = ::walberla::cell_idx_c( (f0)->zSize() ); \ + const auto xSize__ = ::walberla::cell_idx_c( (f0)->xSize() ); \ + const auto ySize__ = ::walberla::cell_idx_c( (f0)->ySize() ); \ + const auto zSize__ = ::walberla::cell_idx_c( (f0)->zSize() ); \ if( zSize__ >= ySize__ ) \ { \ const int izSize = ::walberla::int_c( zSize__ ); \ __pragma(omp) \ for( int iz = 0; iz < izSize; ++iz ) { \ - const ::walberla::cell_idx_t z = ::walberla::cell_idx_c( iz ); \ + const auto z = ::walberla::cell_idx_c( iz ); \ const CellInterval interval( ::walberla::cell_idx_t(0), ::walberla::cell_idx_t(0), z, xSize__ - ::walberla::cell_idx_t(1), ySize__ - ::walberla::cell_idx_t(1), z ); \ auto it0 = (f0)->beginSliceXYZ( interval ); \ for(/* see above */; it0 != (f0)->end(); ++it0) \ @@ -452,7 +452,7 @@ const int iySize = ::walberla::int_c( ySize__ ); \ __pragma(omp) \ for( int iy = 0; iy < iySize; ++iy ) { \ - const ::walberla::cell_idx_t y = ::walberla::cell_idx_c( iy ); \ + const auto y = ::walberla::cell_idx_c( iy ); \ const CellInterval interval( ::walberla::cell_idx_t(0), y, ::walberla::cell_idx_t(0), xSize__ - ::walberla::cell_idx_t(1), y, zSize__ - ::walberla::cell_idx_t(1) ); \ auto it0 = (f0)->beginSliceXYZ( interval ); \ for(/* see above */; it0 != (f0)->end(); ++it0) \ @@ -467,15 +467,15 @@ { WALBERLA_ASSERT_NOT_NULLPTR_1( (f0) ); \ WALBERLA_ASSERT_NOT_NULLPTR_1( (f1) ); \ WALBERLA_ASSERT_EQUAL_2( (f0)->xyzSize(), (f1)->xyzSize() ); \ - const ::walberla::cell_idx_t xSize__ = ::walberla::cell_idx_c( (f0)->xSize() ); \ - const ::walberla::cell_idx_t ySize__ = ::walberla::cell_idx_c( (f0)->ySize() ); \ - const ::walberla::cell_idx_t zSize__ = ::walberla::cell_idx_c( (f0)->zSize() ); \ + const auto xSize__ = ::walberla::cell_idx_c( (f0)->xSize() ); \ + const auto ySize__ = ::walberla::cell_idx_c( (f0)->ySize() ); \ + const auto zSize__ = ::walberla::cell_idx_c( (f0)->zSize() ); \ if( zSize__ >= ySize__ ) \ { \ const int izSize = ::walberla::int_c( zSize__ ); \ __pragma(omp) \ for( int iz = 0; iz < izSize; ++iz ) { \ - const ::walberla::cell_idx_t z = ::walberla::cell_idx_c( iz ); \ + const auto z = ::walberla::cell_idx_c( iz ); \ const CellInterval interval( ::walberla::cell_idx_t(0), ::walberla::cell_idx_t(0), z, xSize__ - ::walberla::cell_idx_t(1), ySize__ - ::walberla::cell_idx_t(1), z ); \ auto it0 = (f0)->beginSliceXYZ( interval ); \ auto it1 = (f1)->beginSliceXYZ( interval ); \ @@ -491,7 +491,7 @@ const int iySize = ::walberla::int_c( ySize__ ); \ __pragma(omp) \ for( int iy = 0; iy < iySize; ++iy ) { \ - const ::walberla::cell_idx_t y = ::walberla::cell_idx_c( iy ); \ + const auto y = ::walberla::cell_idx_c( iy ); \ const CellInterval interval( ::walberla::cell_idx_t(0), y, ::walberla::cell_idx_t(0), xSize__ - ::walberla::cell_idx_t(1), y, zSize__ - ::walberla::cell_idx_t(1) ); \ auto it0 = (f0)->beginSliceXYZ( interval ); \ auto it1 = (f1)->beginSliceXYZ( interval ); \ @@ -510,15 +510,15 @@ WALBERLA_ASSERT_NOT_NULLPTR_1( (f2) ); \ WALBERLA_ASSERT_EQUAL_2( (f0)->xyzSize(), (f1)->xyzSize() ); \ WALBERLA_ASSERT_EQUAL_2( (f0)->xyzSize(), (f2)->xyzSize() ); \ - const ::walberla::cell_idx_t xSize__ = ::walberla::cell_idx_c( (f0)->xSize() ); \ - const ::walberla::cell_idx_t ySize__ = ::walberla::cell_idx_c( (f0)->ySize() ); \ - const ::walberla::cell_idx_t zSize__ = ::walberla::cell_idx_c( (f0)->zSize() ); \ + const auto xSize__ = ::walberla::cell_idx_c( (f0)->xSize() ); \ + const auto ySize__ = ::walberla::cell_idx_c( (f0)->ySize() ); \ + const auto zSize__ = ::walberla::cell_idx_c( (f0)->zSize() ); \ if( zSize__ >= ySize__ ) \ { \ const int izSize = ::walberla::int_c( zSize__ ); \ __pragma(omp) \ for( int iz = 0; iz < izSize; ++iz ) { \ - const ::walberla::cell_idx_t z = ::walberla::cell_idx_c( iz ); \ + const auto z = ::walberla::cell_idx_c( iz ); \ const CellInterval interval( ::walberla::cell_idx_t(0), ::walberla::cell_idx_t(0), z, xSize__ - ::walberla::cell_idx_t(1), ySize__ - ::walberla::cell_idx_t(1), z ); \ auto it0 = (f0)->beginSliceXYZ( interval ); \ auto it1 = (f1)->beginSliceXYZ( interval ); \ @@ -536,7 +536,7 @@ const int iySize = ::walberla::int_c( ySize__ ); \ __pragma(omp) \ for( int iy = 0; iy < iySize; ++iy ) { \ - const ::walberla::cell_idx_t y = ::walberla::cell_idx_c( iy ); \ + const auto y = ::walberla::cell_idx_c( iy ); \ const CellInterval interval( ::walberla::cell_idx_t(0), y, ::walberla::cell_idx_t(0), xSize__ - ::walberla::cell_idx_t(1), y, zSize__ - ::walberla::cell_idx_t(1) ); \ auto it0 = (f0)->beginSliceXYZ( interval ); \ auto it1 = (f1)->beginSliceXYZ( interval ); \ @@ -559,15 +559,15 @@ WALBERLA_ASSERT_EQUAL_2( (f0)->xyzSize(), (f1)->xyzSize() ); \ WALBERLA_ASSERT_EQUAL_2( (f0)->xyzSize(), (f2)->xyzSize() ); \ WALBERLA_ASSERT_EQUAL_2( (f0)->xyzSize(), (f3)->xyzSize() ); \ - const ::walberla::cell_idx_t xSize__ = ::walberla::cell_idx_c( (f0)->xSize() ); \ - const ::walberla::cell_idx_t ySize__ = ::walberla::cell_idx_c( (f0)->ySize() ); \ - const ::walberla::cell_idx_t zSize__ = ::walberla::cell_idx_c( (f0)->zSize() ); \ + const auto xSize__ = ::walberla::cell_idx_c( (f0)->xSize() ); \ + const auto ySize__ = ::walberla::cell_idx_c( (f0)->ySize() ); \ + const auto zSize__ = ::walberla::cell_idx_c( (f0)->zSize() ); \ if( zSize__ >= ySize__ ) \ { \ const int izSize = ::walberla::int_c( zSize__ ); \ __pragma(omp) \ for( int iz = 0; iz < izSize; ++iz ) { \ - const ::walberla::cell_idx_t z = ::walberla::cell_idx_c( iz ); \ + const auto z = ::walberla::cell_idx_c( iz ); \ const CellInterval interval( ::walberla::cell_idx_t(0), ::walberla::cell_idx_t(0), z, xSize__ - ::walberla::cell_idx_t(1), ySize__ - ::walberla::cell_idx_t(1), z ); \ auto it0 = (f0)->beginSliceXYZ( interval ); \ auto it1 = (f1)->beginSliceXYZ( interval ); \ @@ -587,7 +587,7 @@ const int iySize = ::walberla::int_c( ySize__ ); \ __pragma(omp) \ for( int iy = 0; iy < iySize; ++iy ) { \ - const ::walberla::cell_idx_t y = ::walberla::cell_idx_c( iy ); \ + const auto y = ::walberla::cell_idx_c( iy ); \ const CellInterval interval( ::walberla::cell_idx_t(0), y, ::walberla::cell_idx_t(0), xSize__ - ::walberla::cell_idx_t(1), y, zSize__ - ::walberla::cell_idx_t(1) ); \ auto it0 = (f0)->beginSliceXYZ( interval ); \ auto it1 = (f1)->beginSliceXYZ( interval ); \ @@ -614,15 +614,15 @@ WALBERLA_ASSERT_EQUAL_2( (f0)->xyzSize(), (f2)->xyzSize() ); \ WALBERLA_ASSERT_EQUAL_2( (f0)->xyzSize(), (f3)->xyzSize() ); \ WALBERLA_ASSERT_EQUAL_2( (f0)->xyzSize(), (f4)->xyzSize() ); \ - const ::walberla::cell_idx_t xSize__ = ::walberla::cell_idx_c( (f0)->xSize() ); \ - const ::walberla::cell_idx_t ySize__ = ::walberla::cell_idx_c( (f0)->ySize() ); \ - const ::walberla::cell_idx_t zSize__ = ::walberla::cell_idx_c( (f0)->zSize() ); \ + const auto xSize__ = ::walberla::cell_idx_c( (f0)->xSize() ); \ + const auto ySize__ = ::walberla::cell_idx_c( (f0)->ySize() ); \ + const auto zSize__ = ::walberla::cell_idx_c( (f0)->zSize() ); \ if( zSize__ >= ySize__ ) \ { \ const int izSize = ::walberla::int_c( zSize__ ); \ __pragma(omp) \ for( int iz = 0; iz < izSize; ++iz ) { \ - const ::walberla::cell_idx_t z = ::walberla::cell_idx_c( iz ); \ + const auto z = ::walberla::cell_idx_c( iz ); \ const CellInterval interval( ::walberla::cell_idx_t(0), ::walberla::cell_idx_t(0), z, xSize__ - ::walberla::cell_idx_t(1), ySize__ - ::walberla::cell_idx_t(1), z ); \ auto it0 = (f0)->beginSliceXYZ( interval ); \ auto it1 = (f1)->beginSliceXYZ( interval ); \ @@ -644,7 +644,7 @@ const int iySize = ::walberla::int_c( ySize__ ); \ __pragma(omp) \ for( int iy = 0; iy < iySize; ++iy ) { \ - const ::walberla::cell_idx_t y = ::walberla::cell_idx_c( iy ); \ + const auto y = ::walberla::cell_idx_c( iy ); \ const CellInterval interval( ::walberla::cell_idx_t(0), y, ::walberla::cell_idx_t(0), xSize__ - ::walberla::cell_idx_t(1), y, zSize__ - ::walberla::cell_idx_t(1) ); \ auto it0 = (f0)->beginSliceXYZ( interval ); \ auto it1 = (f1)->beginSliceXYZ( interval ); \ @@ -675,15 +675,15 @@ WALBERLA_ASSERT_EQUAL_2( (f0)->xyzSize(), (f3)->xyzSize() ); \ WALBERLA_ASSERT_EQUAL_2( (f0)->xyzSize(), (f4)->xyzSize() ); \ WALBERLA_ASSERT_EQUAL_2( (f0)->xyzSize(), (f5)->xyzSize() ); \ - const ::walberla::cell_idx_t xSize__ = ::walberla::cell_idx_c( (f0)->xSize() ); \ - const ::walberla::cell_idx_t ySize__ = ::walberla::cell_idx_c( (f0)->ySize() ); \ - const ::walberla::cell_idx_t zSize__ = ::walberla::cell_idx_c( (f0)->zSize() ); \ + const auto xSize__ = ::walberla::cell_idx_c( (f0)->xSize() ); \ + const auto ySize__ = ::walberla::cell_idx_c( (f0)->ySize() ); \ + const auto zSize__ = ::walberla::cell_idx_c( (f0)->zSize() ); \ if( zSize__ >= ySize__ ) \ { \ const int izSize = ::walberla::int_c( zSize__ ); \ __pragma(omp) \ for( int iz = 0; iz < izSize; ++iz ) { \ - const ::walberla::cell_idx_t z = ::walberla::cell_idx_c( iz ); \ + const auto z = ::walberla::cell_idx_c( iz ); \ const CellInterval interval( ::walberla::cell_idx_t(0), ::walberla::cell_idx_t(0), z, xSize__ - ::walberla::cell_idx_t(1), ySize__ - ::walberla::cell_idx_t(1), z ); \ auto it0 = (f0)->beginSliceXYZ( interval ); \ auto it1 = (f1)->beginSliceXYZ( interval ); \ @@ -707,7 +707,7 @@ const int iySize = ::walberla::int_c( ySize__ ); \ __pragma(omp) \ for( int iy = 0; iy < iySize; ++iy ) { \ - const ::walberla::cell_idx_t y = ::walberla::cell_idx_c( iy ); \ + const auto y = ::walberla::cell_idx_c( iy ); \ const CellInterval interval( ::walberla::cell_idx_t(0), y, ::walberla::cell_idx_t(0), xSize__ - ::walberla::cell_idx_t(1), y, zSize__ - ::walberla::cell_idx_t(1) ); \ auto it0 = (f0)->beginSliceXYZ( interval ); \ auto it1 = (f1)->beginSliceXYZ( interval ); \ @@ -742,15 +742,15 @@ WALBERLA_ASSERT_EQUAL_2( (f0)->xyzSize(), (f4)->xyzSize() ); \ WALBERLA_ASSERT_EQUAL_2( (f0)->xyzSize(), (f5)->xyzSize() ); \ WALBERLA_ASSERT_EQUAL_2( (f0)->xyzSize(), (f6)->xyzSize() ); \ - const ::walberla::cell_idx_t xSize__ = ::walberla::cell_idx_c( (f0)->xSize() ); \ - const ::walberla::cell_idx_t ySize__ = ::walberla::cell_idx_c( (f0)->ySize() ); \ - const ::walberla::cell_idx_t zSize__ = ::walberla::cell_idx_c( (f0)->zSize() ); \ + const auto xSize__ = ::walberla::cell_idx_c( (f0)->xSize() ); \ + const auto ySize__ = ::walberla::cell_idx_c( (f0)->ySize() ); \ + const auto zSize__ = ::walberla::cell_idx_c( (f0)->zSize() ); \ if( zSize__ >= ySize__ ) \ { \ const int izSize = ::walberla::int_c( zSize__ ); \ __pragma(omp) \ for( int iz = 0; iz < izSize; ++iz ) { \ - const ::walberla::cell_idx_t z = ::walberla::cell_idx_c( iz ); \ + const auto z = ::walberla::cell_idx_c( iz ); \ const CellInterval interval( ::walberla::cell_idx_t(0), ::walberla::cell_idx_t(0), z, xSize__ - ::walberla::cell_idx_t(1), ySize__ - ::walberla::cell_idx_t(1), z ); \ auto it0 = (f0)->beginSliceXYZ( interval ); \ auto it1 = (f1)->beginSliceXYZ( interval ); \ @@ -776,7 +776,7 @@ const int iySize = ::walberla::int_c( ySize__ ); \ __pragma(omp) \ for( int iy = 0; iy < iySize; ++iy ) { \ - const ::walberla::cell_idx_t y = ::walberla::cell_idx_c( iy ); \ + const auto y = ::walberla::cell_idx_c( iy ); \ const CellInterval interval( ::walberla::cell_idx_t(0), y, ::walberla::cell_idx_t(0), xSize__ - ::walberla::cell_idx_t(1), y, zSize__ - ::walberla::cell_idx_t(1) ); \ auto it0 = (f0)->beginSliceXYZ( interval ); \ auto it1 = (f1)->beginSliceXYZ( interval ); \ @@ -815,15 +815,15 @@ WALBERLA_ASSERT_EQUAL_2( (f0)->xyzSize(), (f5)->xyzSize() ); \ WALBERLA_ASSERT_EQUAL_2( (f0)->xyzSize(), (f6)->xyzSize() ); \ WALBERLA_ASSERT_EQUAL_2( (f0)->xyzSize(), (f7)->xyzSize() ); \ - const ::walberla::cell_idx_t xSize__ = ::walberla::cell_idx_c( (f0)->xSize() ); \ - const ::walberla::cell_idx_t ySize__ = ::walberla::cell_idx_c( (f0)->ySize() ); \ - const ::walberla::cell_idx_t zSize__ = ::walberla::cell_idx_c( (f0)->zSize() ); \ + const auto xSize__ = ::walberla::cell_idx_c( (f0)->xSize() ); \ + const auto ySize__ = ::walberla::cell_idx_c( (f0)->ySize() ); \ + const auto zSize__ = ::walberla::cell_idx_c( (f0)->zSize() ); \ if( zSize__ >= ySize__ ) \ { \ const int izSize = ::walberla::int_c( zSize__ ); \ __pragma(omp) \ for( int iz = 0; iz < izSize; ++iz ) { \ - const ::walberla::cell_idx_t z = ::walberla::cell_idx_c( iz ); \ + const auto z = ::walberla::cell_idx_c( iz ); \ const CellInterval interval( ::walberla::cell_idx_t(0), ::walberla::cell_idx_t(0), z, xSize__ - ::walberla::cell_idx_t(1), ySize__ - ::walberla::cell_idx_t(1), z ); \ auto it0 = (f0)->beginSliceXYZ( interval ); \ auto it1 = (f1)->beginSliceXYZ( interval ); \ @@ -851,7 +851,7 @@ const int iySize = ::walberla::int_c( ySize__ ); \ __pragma(omp) \ for( int iy = 0; iy < iySize; ++iy ) { \ - const ::walberla::cell_idx_t y = ::walberla::cell_idx_c( iy ); \ + const auto y = ::walberla::cell_idx_c( iy ); \ const CellInterval interval( ::walberla::cell_idx_t(0), y, ::walberla::cell_idx_t(0), xSize__ - ::walberla::cell_idx_t(1), y, zSize__ - ::walberla::cell_idx_t(1) ); \ auto it0 = (f0)->beginSliceXYZ( interval ); \ auto it1 = (f1)->beginSliceXYZ( interval ); \ @@ -879,17 +879,17 @@ #define WALBERLA_FOR_ALL_CELLS_XYZ_OMP( field, omp, CODE ) \ { WALBERLA_ASSERT_NOT_NULLPTR_1( (field) ); \ - const ::walberla::cell_idx_t xSize__ = ::walberla::cell_idx_c( (field)->xSize() ); \ - const ::walberla::cell_idx_t ySize__ = ::walberla::cell_idx_c( (field)->ySize() ); \ - const ::walberla::cell_idx_t zSize__ = ::walberla::cell_idx_c( (field)->zSize() ); \ + const auto xSize__ = ::walberla::cell_idx_c( (field)->xSize() ); \ + const auto ySize__ = ::walberla::cell_idx_c( (field)->ySize() ); \ + const auto zSize__ = ::walberla::cell_idx_c( (field)->zSize() ); \ if( zSize__ >= ySize__ ) \ { \ const int izSize = ::walberla::int_c( zSize__ ); \ _Pragma(#omp) \ for( int iz = 0; iz < izSize; ++iz ) { \ - ::walberla::cell_idx_t z = ::walberla::cell_idx_c( iz ); \ - for( ::walberla::cell_idx_t y = ::walberla::cell_idx_t(0); y < ySize__; ++y ) { \ - for( ::walberla::cell_idx_t x = ::walberla::cell_idx_t(0); x < xSize__; ++x ) \ + auto z = ::walberla::cell_idx_c( iz ); \ + for( auto y = ::walberla::cell_idx_t(0); y < ySize__; ++y ) { \ + for( auto x = ::walberla::cell_idx_t(0); x < xSize__; ++x ) \ { \ CODE \ } \ @@ -901,9 +901,9 @@ const int iySize = ::walberla::int_c( ySize__ ); \ _Pragma(#omp) \ for( int iy = 0; iy < iySize; ++iy ) { \ - ::walberla::cell_idx_t y = ::walberla::cell_idx_c( iy ); \ - for( ::walberla::cell_idx_t z = ::walberla::cell_idx_t(0); z < zSize__; ++z ) { \ - for( ::walberla::cell_idx_t x = ::walberla::cell_idx_t(0); x < xSize__; ++x ) \ + auto y = ::walberla::cell_idx_c( iy ); \ + for( auto z = ::walberla::cell_idx_t(0); z < zSize__; ++z ) { \ + for( auto x = ::walberla::cell_idx_t(0); x < xSize__; ++x ) \ { \ CODE \ } \ @@ -917,9 +917,9 @@ const int izMax = ::walberla::int_c( interval.zMax() ); \ _Pragma(#omp) \ for( int iz = ::walberla::int_c( interval.zMin() ); iz <= izMax; ++iz ) { \ - ::walberla::cell_idx_t z = ::walberla::cell_idx_c( iz ); \ - for( ::walberla::cell_idx_t y = interval.yMin(); y <= interval.yMax(); ++y ) { \ - for( ::walberla::cell_idx_t x = interval.xMin(); x <= interval.xMax(); ++x ) \ + auto z = ::walberla::cell_idx_c( iz ); \ + for( auto y = interval.yMin(); y <= interval.yMax(); ++y ) { \ + for( auto x = interval.xMin(); x <= interval.xMax(); ++x ) \ { \ CODE \ } \ @@ -931,9 +931,9 @@ const int iyMax = ::walberla::int_c( interval.yMax() ); \ _Pragma(#omp) \ for( int iy = ::walberla::int_c( interval.yMin() ); iy <= iyMax; ++iy ) { \ - ::walberla::cell_idx_t y = ::walberla::cell_idx_c( iy ); \ - for( ::walberla::cell_idx_t z = interval.zMin(); z <= interval.zMax(); ++z ) { \ - for( ::walberla::cell_idx_t x = interval.xMin(); x <= interval.xMax(); ++x ) \ + auto y = ::walberla::cell_idx_c( iy ); \ + for( auto z = interval.zMin(); z <= interval.zMax(); ++z ) { \ + for( auto x = interval.xMin(); x <= interval.xMax(); ++x ) \ { \ CODE \ } \ @@ -945,10 +945,10 @@ #define WALBERLA_FOR_ALL_CELLS_INCLUDING_GHOST_LAYER_XYZ_OMP_4( field, gl, omp, CODE ) \ { WALBERLA_ASSERT_NOT_NULLPTR_1( (field) ); \ WALBERLA_ASSERT_GREATER_EQUAL_2( (field)->nrOfGhostLayers(), gl ); \ - const ::walberla::cell_idx_t xSize__ = ::walberla::cell_idx_c( (field)->xSize() ); \ - const ::walberla::cell_idx_t ySize__ = ::walberla::cell_idx_c( (field)->ySize() ); \ - const ::walberla::cell_idx_t zSize__ = ::walberla::cell_idx_c( (field)->zSize() ); \ - const ::walberla::cell_idx_t gl__ = ::walberla::cell_idx_c( gl ); \ + const auto xSize__ = ::walberla::cell_idx_c( (field)->xSize() ); \ + const auto ySize__ = ::walberla::cell_idx_c( (field)->ySize() ); \ + const auto zSize__ = ::walberla::cell_idx_c( (field)->zSize() ); \ + const auto gl__ = ::walberla::cell_idx_c( gl ); \ if( zSize__ >= ySize__ ) \ { \ const int izSize = ::walberla::int_c( zSize__ ); \ @@ -956,9 +956,9 @@ for( int iz = 0; iz < izSize; ++iz ) { \ if( iz == 0 ) \ { \ - for( ::walberla::cell_idx_t z = -gl__; z < ::walberla::cell_idx_t(0); ++z ) { \ - for( ::walberla::cell_idx_t y = -gl__; y < (ySize__ + gl__); ++y ) { \ - for( ::walberla::cell_idx_t x = -gl__; x < (xSize__ + gl__); ++x ) \ + for( auto z = -gl__; z < ::walberla::cell_idx_t(0); ++z ) { \ + for( auto y = -gl__; y < (ySize__ + gl__); ++y ) { \ + for( auto x = -gl__; x < (xSize__ + gl__); ++x ) \ { \ CODE \ } \ @@ -966,9 +966,9 @@ } \ } \ { \ - ::walberla::cell_idx_t z = ::walberla::cell_idx_c( iz ); \ - for( ::walberla::cell_idx_t y = -gl__; y < (ySize__ + gl__); ++y ) { \ - for( ::walberla::cell_idx_t x = -gl__; x < (xSize__ + gl__); ++x ) \ + auto z = ::walberla::cell_idx_c( iz ); \ + for( auto y = -gl__; y < (ySize__ + gl__); ++y ) { \ + for( auto x = -gl__; x < (xSize__ + gl__); ++x ) \ { \ CODE \ } \ @@ -976,9 +976,9 @@ } \ if( iz == (izSize - 1) ) \ { \ - for( ::walberla::cell_idx_t z = zSize__; z < (zSize__ + gl__); ++z ) { \ - for( ::walberla::cell_idx_t y = -gl__; y < (ySize__ + gl__); ++y ) { \ - for( ::walberla::cell_idx_t x = -gl__; x < (xSize__ + gl__); ++x ) \ + for( auto z = zSize__; z < (zSize__ + gl__); ++z ) { \ + for( auto y = -gl__; y < (ySize__ + gl__); ++y ) { \ + for( auto x = -gl__; x < (xSize__ + gl__); ++x ) \ { \ CODE \ } \ @@ -994,9 +994,9 @@ for( int iy = 0; iy < iySize; ++iy ) { \ if( iy == 0 ) \ { \ - for( ::walberla::cell_idx_t y = -gl__; y < ::walberla::cell_idx_t(0); ++y ) { \ - for( ::walberla::cell_idx_t z = -gl__; z < (zSize__ + gl__); ++z ) { \ - for( ::walberla::cell_idx_t x = -gl__; x < (xSize__ + gl__); ++x ) \ + for( auto y = -gl__; y < ::walberla::cell_idx_t(0); ++y ) { \ + for( auto z = -gl__; z < (zSize__ + gl__); ++z ) { \ + for( auto x = -gl__; x < (xSize__ + gl__); ++x ) \ { \ CODE \ } \ @@ -1004,9 +1004,9 @@ } \ } \ { \ - ::walberla::cell_idx_t y = ::walberla::cell_idx_c( iy ); \ - for( ::walberla::cell_idx_t z = -gl__; z < (zSize__ + gl__); ++z ) { \ - for( ::walberla::cell_idx_t x = -gl__; x < (xSize__ + gl__); ++x ) \ + auto y = ::walberla::cell_idx_c( iy ); \ + for( auto z = -gl__; z < (zSize__ + gl__); ++z ) { \ + for( auto x = -gl__; x < (xSize__ + gl__); ++x ) \ { \ CODE \ } \ @@ -1014,9 +1014,9 @@ } \ if( iy == (iySize - 1) ) \ { \ - for( ::walberla::cell_idx_t y = ySize__; y < (ySize__ + gl__); ++y ) { \ - for( ::walberla::cell_idx_t z = -gl__; z < (zSize__ + gl__); ++z ) { \ - for( ::walberla::cell_idx_t x = -gl__; x < (xSize__ + gl__); ++x ) \ + for( auto y = ySize__; y < (ySize__ + gl__); ++y ) { \ + for( auto z = -gl__; z < (zSize__ + gl__); ++z ) { \ + for( auto x = -gl__; x < (xSize__ + gl__); ++x ) \ { \ CODE \ } \ @@ -1028,15 +1028,15 @@ #define WALBERLA_FOR_ALL_CELLS_YZ_OMP( field, omp, CODE ) \ { WALBERLA_ASSERT_NOT_NULLPTR_1( (field) ); \ - const ::walberla::cell_idx_t ySize__ = ::walberla::cell_idx_c( (field)->ySize() ); \ - const ::walberla::cell_idx_t zSize__ = ::walberla::cell_idx_c( (field)->zSize() ); \ + const auto ySize__ = ::walberla::cell_idx_c( (field)->ySize() ); \ + const auto zSize__ = ::walberla::cell_idx_c( (field)->zSize() ); \ if( zSize__ >= ySize__ ) \ { \ const int izSize = ::walberla::int_c( zSize__ ); \ _Pragma(#omp) \ for( int iz = 0; iz < izSize; ++iz ) { \ - ::walberla::cell_idx_t z = ::walberla::cell_idx_c( iz ); \ - for( ::walberla::cell_idx_t y = ::walberla::cell_idx_t(0); y < ySize__; ++y ) \ + auto z = ::walberla::cell_idx_c( iz ); \ + for( auto y = ::walberla::cell_idx_t(0); y < ySize__; ++y ) \ { \ CODE \ } \ @@ -1047,8 +1047,8 @@ const int iySize = ::walberla::int_c( ySize__ ); \ _Pragma(#omp) \ for( int iy = 0; iy < iySize; ++iy ) { \ - ::walberla::cell_idx_t y = ::walberla::cell_idx_c( iy ); \ - for( ::walberla::cell_idx_t z = ::walberla::cell_idx_t(0); z < zSize__; ++z ) \ + auto y = ::walberla::cell_idx_c( iy ); \ + for( auto z = ::walberla::cell_idx_t(0); z < zSize__; ++z ) \ { \ CODE \ } \ @@ -1061,8 +1061,8 @@ const int izMax = ::walberla::int_c( interval.zMax() ); \ _Pragma(#omp) \ for( int iz = ::walberla::int_c( interval.zMin() ); iz <= izMax; ++iz ) { \ - ::walberla::cell_idx_t z = ::walberla::cell_idx_c( iz ); \ - for( ::walberla::cell_idx_t y = interval.yMin(); y <= interval.yMax(); ++y ) \ + auto z = ::walberla::cell_idx_c( iz ); \ + for( auto y = interval.yMin(); y <= interval.yMax(); ++y ) \ { \ CODE \ } \ @@ -1073,8 +1073,8 @@ const int iyMax = ::walberla::int_c( interval.yMax() ); \ _Pragma(#omp) \ for( int iy = ::walberla::int_c( interval.yMin() ); iy <= iyMax; ++iy ) { \ - ::walberla::cell_idx_t y = ::walberla::cell_idx_c( iy ); \ - for( ::walberla::cell_idx_t z = interval.zMin(); z <= interval.zMax(); ++z ) \ + auto y = ::walberla::cell_idx_c( iy ); \ + for( auto z = interval.zMin(); z <= interval.zMax(); ++z ) \ { \ CODE \ } \ @@ -1085,9 +1085,9 @@ #define WALBERLA_FOR_ALL_CELLS_INCLUDING_GHOST_LAYER_YZ_OMP_4( field, gl, omp, CODE ) \ { WALBERLA_ASSERT_NOT_NULLPTR_1( (field) ); \ WALBERLA_ASSERT_GREATER_EQUAL_2( (field)->nrOfGhostLayers(), gl ); \ - const ::walberla::cell_idx_t ySize__ = ::walberla::cell_idx_c( (field)->ySize() ); \ - const ::walberla::cell_idx_t zSize__ = ::walberla::cell_idx_c( (field)->zSize() ); \ - const ::walberla::cell_idx_t gl__ = ::walberla::cell_idx_c( gl ); \ + const auto ySize__ = ::walberla::cell_idx_c( (field)->ySize() ); \ + const auto zSize__ = ::walberla::cell_idx_c( (field)->zSize() ); \ + const auto gl__ = ::walberla::cell_idx_c( gl ); \ if( zSize__ >= ySize__ ) \ { \ const int izSize = ::walberla::int_c( zSize__ ); \ @@ -1095,24 +1095,24 @@ for( int iz = 0; iz < izSize; ++iz ) { \ if( iz == 0 ) \ { \ - for( ::walberla::cell_idx_t z = -gl__; z < ::walberla::cell_idx_t(0); ++z ) { \ - for( ::walberla::cell_idx_t y = -gl__; y < (ySize__ + gl__); ++y ) \ + for( auto z = -gl__; z < ::walberla::cell_idx_t(0); ++z ) { \ + for( auto y = -gl__; y < (ySize__ + gl__); ++y ) \ { \ CODE \ } \ } \ } \ { \ - ::walberla::cell_idx_t z = ::walberla::cell_idx_c( iz ); \ - for( ::walberla::cell_idx_t y = -gl__; y < (ySize__ + gl__); ++y ) \ + auto z = ::walberla::cell_idx_c( iz ); \ + for( auto y = -gl__; y < (ySize__ + gl__); ++y ) \ { \ CODE \ } \ } \ if( iz == (izSize - 1) ) \ { \ - for( ::walberla::cell_idx_t z = zSize__; z < (zSize__ + gl__); ++z ) { \ - for( ::walberla::cell_idx_t y = -gl__; y < (ySize__ + gl__); ++y ) \ + for( auto z = zSize__; z < (zSize__ + gl__); ++z ) { \ + for( auto y = -gl__; y < (ySize__ + gl__); ++y ) \ { \ CODE \ } \ @@ -1127,24 +1127,24 @@ for( int iy = 0; iy < iySize; ++iy ) { \ if( iy == 0 ) \ { \ - for( ::walberla::cell_idx_t y = -gl__; y < ::walberla::cell_idx_t(0); ++y ) { \ - for( ::walberla::cell_idx_t z = -gl__; z < (zSize__ + gl__); ++z ) \ + for( auto y = -gl__; y < ::walberla::cell_idx_t(0); ++y ) { \ + for( auto z = -gl__; z < (zSize__ + gl__); ++z ) \ { \ CODE \ } \ } \ } \ { \ - ::walberla::cell_idx_t y = ::walberla::cell_idx_c( iy ); \ - for( ::walberla::cell_idx_t z = -gl__; z < (zSize__ + gl__); ++z ) \ + auto y = ::walberla::cell_idx_c( iy ); \ + for( auto z = -gl__; z < (zSize__ + gl__); ++z ) \ { \ CODE \ } \ } \ if( iy == (iySize - 1) ) \ { \ - for( ::walberla::cell_idx_t y = ySize__; y < (ySize__ + gl__); ++y ) { \ - for( ::walberla::cell_idx_t z = -gl__; z < (zSize__ + gl__); ++z ) \ + for( auto y = ySize__; y < (ySize__ + gl__); ++y ) { \ + for( auto z = -gl__; z < (zSize__ + gl__); ++z ) \ { \ CODE \ } \ @@ -1156,15 +1156,15 @@ // Do not call this macro, call 'WALBERLA_FOR_ALL_CELLS_OMP' (using the same signature) instead #define WALBERLA_FOR_ALL_CELLS_OMP_4( it0, f0, omp, CODE ) \ { WALBERLA_ASSERT_NOT_NULLPTR_1( (f0) ); \ - const ::walberla::cell_idx_t xSize__ = ::walberla::cell_idx_c( (f0)->xSize() ); \ - const ::walberla::cell_idx_t ySize__ = ::walberla::cell_idx_c( (f0)->ySize() ); \ - const ::walberla::cell_idx_t zSize__ = ::walberla::cell_idx_c( (f0)->zSize() ); \ + const auto xSize__ = ::walberla::cell_idx_c( (f0)->xSize() ); \ + const auto ySize__ = ::walberla::cell_idx_c( (f0)->ySize() ); \ + const auto zSize__ = ::walberla::cell_idx_c( (f0)->zSize() ); \ if( zSize__ >= ySize__ ) \ { \ const int izSize = ::walberla::int_c( zSize__ ); \ _Pragma(#omp) \ for( int iz = 0; iz < izSize; ++iz ) { \ - const ::walberla::cell_idx_t z = ::walberla::cell_idx_c( iz ); \ + const auto z = ::walberla::cell_idx_c( iz ); \ const CellInterval interval( ::walberla::cell_idx_t(0), ::walberla::cell_idx_t(0), z, xSize__ - ::walberla::cell_idx_t(1), ySize__ - ::walberla::cell_idx_t(1), z ); \ auto it0 = (f0)->beginSliceXYZ( interval ); \ for(/* see above */; it0 != (f0)->end(); ++it0) \ @@ -1178,7 +1178,7 @@ const int iySize = ::walberla::int_c( ySize__ ); \ _Pragma(#omp) \ for( int iy = 0; iy < iySize; ++iy ) { \ - const ::walberla::cell_idx_t y = ::walberla::cell_idx_c( iy ); \ + const auto y = ::walberla::cell_idx_c( iy ); \ const CellInterval interval( ::walberla::cell_idx_t(0), y, ::walberla::cell_idx_t(0), xSize__ - ::walberla::cell_idx_t(1), y, zSize__ - ::walberla::cell_idx_t(1) ); \ auto it0 = (f0)->beginSliceXYZ( interval ); \ for(/* see above */; it0 != (f0)->end(); ++it0) \ @@ -1193,15 +1193,15 @@ { WALBERLA_ASSERT_NOT_NULLPTR_1( (f0) ); \ WALBERLA_ASSERT_NOT_NULLPTR_1( (f1) ); \ WALBERLA_ASSERT_EQUAL_2( (f0)->xyzSize(), (f1)->xyzSize() ); \ - const ::walberla::cell_idx_t xSize__ = ::walberla::cell_idx_c( (f0)->xSize() ); \ - const ::walberla::cell_idx_t ySize__ = ::walberla::cell_idx_c( (f0)->ySize() ); \ - const ::walberla::cell_idx_t zSize__ = ::walberla::cell_idx_c( (f0)->zSize() ); \ + const auto xSize__ = ::walberla::cell_idx_c( (f0)->xSize() ); \ + const auto ySize__ = ::walberla::cell_idx_c( (f0)->ySize() ); \ + const auto zSize__ = ::walberla::cell_idx_c( (f0)->zSize() ); \ if( zSize__ >= ySize__ ) \ { \ const int izSize = ::walberla::int_c( zSize__ ); \ _Pragma(#omp) \ for( int iz = 0; iz < izSize; ++iz ) { \ - const ::walberla::cell_idx_t z = ::walberla::cell_idx_c( iz ); \ + const auto z = ::walberla::cell_idx_c( iz ); \ const CellInterval interval( ::walberla::cell_idx_t(0), ::walberla::cell_idx_t(0), z, xSize__ - ::walberla::cell_idx_t(1), ySize__ - ::walberla::cell_idx_t(1), z ); \ auto it0 = (f0)->beginSliceXYZ( interval ); \ auto it1 = (f1)->beginSliceXYZ( interval ); \ @@ -1217,7 +1217,7 @@ const int iySize = ::walberla::int_c( ySize__ ); \ _Pragma(#omp) \ for( int iy = 0; iy < iySize; ++iy ) { \ - const ::walberla::cell_idx_t y = ::walberla::cell_idx_c( iy ); \ + const auto y = ::walberla::cell_idx_c( iy ); \ const CellInterval interval( ::walberla::cell_idx_t(0), y, ::walberla::cell_idx_t(0), xSize__ - ::walberla::cell_idx_t(1), y, zSize__ - ::walberla::cell_idx_t(1) ); \ auto it0 = (f0)->beginSliceXYZ( interval ); \ auto it1 = (f1)->beginSliceXYZ( interval ); \ @@ -1236,15 +1236,15 @@ WALBERLA_ASSERT_NOT_NULLPTR_1( (f2) ); \ WALBERLA_ASSERT_EQUAL_2( (f0)->xyzSize(), (f1)->xyzSize() ); \ WALBERLA_ASSERT_EQUAL_2( (f0)->xyzSize(), (f2)->xyzSize() ); \ - const ::walberla::cell_idx_t xSize__ = ::walberla::cell_idx_c( (f0)->xSize() ); \ - const ::walberla::cell_idx_t ySize__ = ::walberla::cell_idx_c( (f0)->ySize() ); \ - const ::walberla::cell_idx_t zSize__ = ::walberla::cell_idx_c( (f0)->zSize() ); \ + const auto xSize__ = ::walberla::cell_idx_c( (f0)->xSize() ); \ + const auto ySize__ = ::walberla::cell_idx_c( (f0)->ySize() ); \ + const auto zSize__ = ::walberla::cell_idx_c( (f0)->zSize() ); \ if( zSize__ >= ySize__ ) \ { \ const int izSize = ::walberla::int_c( zSize__ ); \ _Pragma(#omp) \ for( int iz = 0; iz < izSize; ++iz ) { \ - const ::walberla::cell_idx_t z = ::walberla::cell_idx_c( iz ); \ + const auto z = ::walberla::cell_idx_c( iz ); \ const CellInterval interval( ::walberla::cell_idx_t(0), ::walberla::cell_idx_t(0), z, xSize__ - ::walberla::cell_idx_t(1), ySize__ - ::walberla::cell_idx_t(1), z ); \ auto it0 = (f0)->beginSliceXYZ( interval ); \ auto it1 = (f1)->beginSliceXYZ( interval ); \ @@ -1262,7 +1262,7 @@ const int iySize = ::walberla::int_c( ySize__ ); \ _Pragma(#omp) \ for( int iy = 0; iy < iySize; ++iy ) { \ - const ::walberla::cell_idx_t y = ::walberla::cell_idx_c( iy ); \ + const auto y = ::walberla::cell_idx_c( iy ); \ const CellInterval interval( ::walberla::cell_idx_t(0), y, ::walberla::cell_idx_t(0), xSize__ - ::walberla::cell_idx_t(1), y, zSize__ - ::walberla::cell_idx_t(1) ); \ auto it0 = (f0)->beginSliceXYZ( interval ); \ auto it1 = (f1)->beginSliceXYZ( interval ); \ @@ -1285,15 +1285,15 @@ WALBERLA_ASSERT_EQUAL_2( (f0)->xyzSize(), (f1)->xyzSize() ); \ WALBERLA_ASSERT_EQUAL_2( (f0)->xyzSize(), (f2)->xyzSize() ); \ WALBERLA_ASSERT_EQUAL_2( (f0)->xyzSize(), (f3)->xyzSize() ); \ - const ::walberla::cell_idx_t xSize__ = ::walberla::cell_idx_c( (f0)->xSize() ); \ - const ::walberla::cell_idx_t ySize__ = ::walberla::cell_idx_c( (f0)->ySize() ); \ - const ::walberla::cell_idx_t zSize__ = ::walberla::cell_idx_c( (f0)->zSize() ); \ + const auto xSize__ = ::walberla::cell_idx_c( (f0)->xSize() ); \ + const auto ySize__ = ::walberla::cell_idx_c( (f0)->ySize() ); \ + const auto zSize__ = ::walberla::cell_idx_c( (f0)->zSize() ); \ if( zSize__ >= ySize__ ) \ { \ const int izSize = ::walberla::int_c( zSize__ ); \ _Pragma(#omp) \ for( int iz = 0; iz < izSize; ++iz ) { \ - const ::walberla::cell_idx_t z = ::walberla::cell_idx_c( iz ); \ + const auto z = ::walberla::cell_idx_c( iz ); \ const CellInterval interval( ::walberla::cell_idx_t(0), ::walberla::cell_idx_t(0), z, xSize__ - ::walberla::cell_idx_t(1), ySize__ - ::walberla::cell_idx_t(1), z ); \ auto it0 = (f0)->beginSliceXYZ( interval ); \ auto it1 = (f1)->beginSliceXYZ( interval ); \ @@ -1313,7 +1313,7 @@ const int iySize = ::walberla::int_c( ySize__ ); \ _Pragma(#omp) \ for( int iy = 0; iy < iySize; ++iy ) { \ - const ::walberla::cell_idx_t y = ::walberla::cell_idx_c( iy ); \ + const auto y = ::walberla::cell_idx_c( iy ); \ const CellInterval interval( ::walberla::cell_idx_t(0), y, ::walberla::cell_idx_t(0), xSize__ - ::walberla::cell_idx_t(1), y, zSize__ - ::walberla::cell_idx_t(1) ); \ auto it0 = (f0)->beginSliceXYZ( interval ); \ auto it1 = (f1)->beginSliceXYZ( interval ); \ @@ -1340,15 +1340,15 @@ WALBERLA_ASSERT_EQUAL_2( (f0)->xyzSize(), (f2)->xyzSize() ); \ WALBERLA_ASSERT_EQUAL_2( (f0)->xyzSize(), (f3)->xyzSize() ); \ WALBERLA_ASSERT_EQUAL_2( (f0)->xyzSize(), (f4)->xyzSize() ); \ - const ::walberla::cell_idx_t xSize__ = ::walberla::cell_idx_c( (f0)->xSize() ); \ - const ::walberla::cell_idx_t ySize__ = ::walberla::cell_idx_c( (f0)->ySize() ); \ - const ::walberla::cell_idx_t zSize__ = ::walberla::cell_idx_c( (f0)->zSize() ); \ + const auto xSize__ = ::walberla::cell_idx_c( (f0)->xSize() ); \ + const auto ySize__ = ::walberla::cell_idx_c( (f0)->ySize() ); \ + const auto zSize__ = ::walberla::cell_idx_c( (f0)->zSize() ); \ if( zSize__ >= ySize__ ) \ { \ const int izSize = ::walberla::int_c( zSize__ ); \ _Pragma(#omp) \ for( int iz = 0; iz < izSize; ++iz ) { \ - const ::walberla::cell_idx_t z = ::walberla::cell_idx_c( iz ); \ + const auto z = ::walberla::cell_idx_c( iz ); \ const CellInterval interval( ::walberla::cell_idx_t(0), ::walberla::cell_idx_t(0), z, xSize__ - ::walberla::cell_idx_t(1), ySize__ - ::walberla::cell_idx_t(1), z ); \ auto it0 = (f0)->beginSliceXYZ( interval ); \ auto it1 = (f1)->beginSliceXYZ( interval ); \ @@ -1370,7 +1370,7 @@ const int iySize = ::walberla::int_c( ySize__ ); \ _Pragma(#omp) \ for( int iy = 0; iy < iySize; ++iy ) { \ - const ::walberla::cell_idx_t y = ::walberla::cell_idx_c( iy ); \ + const auto y = ::walberla::cell_idx_c( iy ); \ const CellInterval interval( ::walberla::cell_idx_t(0), y, ::walberla::cell_idx_t(0), xSize__ - ::walberla::cell_idx_t(1), y, zSize__ - ::walberla::cell_idx_t(1) ); \ auto it0 = (f0)->beginSliceXYZ( interval ); \ auto it1 = (f1)->beginSliceXYZ( interval ); \ @@ -1401,15 +1401,15 @@ WALBERLA_ASSERT_EQUAL_2( (f0)->xyzSize(), (f3)->xyzSize() ); \ WALBERLA_ASSERT_EQUAL_2( (f0)->xyzSize(), (f4)->xyzSize() ); \ WALBERLA_ASSERT_EQUAL_2( (f0)->xyzSize(), (f5)->xyzSize() ); \ - const ::walberla::cell_idx_t xSize__ = ::walberla::cell_idx_c( (f0)->xSize() ); \ - const ::walberla::cell_idx_t ySize__ = ::walberla::cell_idx_c( (f0)->ySize() ); \ - const ::walberla::cell_idx_t zSize__ = ::walberla::cell_idx_c( (f0)->zSize() ); \ + const auto xSize__ = ::walberla::cell_idx_c( (f0)->xSize() ); \ + const auto ySize__ = ::walberla::cell_idx_c( (f0)->ySize() ); \ + const auto zSize__ = ::walberla::cell_idx_c( (f0)->zSize() ); \ if( zSize__ >= ySize__ ) \ { \ const int izSize = ::walberla::int_c( zSize__ ); \ _Pragma(#omp) \ for( int iz = 0; iz < izSize; ++iz ) { \ - const ::walberla::cell_idx_t z = ::walberla::cell_idx_c( iz ); \ + const auto z = ::walberla::cell_idx_c( iz ); \ const CellInterval interval( ::walberla::cell_idx_t(0), ::walberla::cell_idx_t(0), z, xSize__ - ::walberla::cell_idx_t(1), ySize__ - ::walberla::cell_idx_t(1), z ); \ auto it0 = (f0)->beginSliceXYZ( interval ); \ auto it1 = (f1)->beginSliceXYZ( interval ); \ @@ -1433,7 +1433,7 @@ const int iySize = ::walberla::int_c( ySize__ ); \ _Pragma(#omp) \ for( int iy = 0; iy < iySize; ++iy ) { \ - const ::walberla::cell_idx_t y = ::walberla::cell_idx_c( iy ); \ + const auto y = ::walberla::cell_idx_c( iy ); \ const CellInterval interval( ::walberla::cell_idx_t(0), y, ::walberla::cell_idx_t(0), xSize__ - ::walberla::cell_idx_t(1), y, zSize__ - ::walberla::cell_idx_t(1) ); \ auto it0 = (f0)->beginSliceXYZ( interval ); \ auto it1 = (f1)->beginSliceXYZ( interval ); \ @@ -1468,15 +1468,15 @@ WALBERLA_ASSERT_EQUAL_2( (f0)->xyzSize(), (f4)->xyzSize() ); \ WALBERLA_ASSERT_EQUAL_2( (f0)->xyzSize(), (f5)->xyzSize() ); \ WALBERLA_ASSERT_EQUAL_2( (f0)->xyzSize(), (f6)->xyzSize() ); \ - const ::walberla::cell_idx_t xSize__ = ::walberla::cell_idx_c( (f0)->xSize() ); \ - const ::walberla::cell_idx_t ySize__ = ::walberla::cell_idx_c( (f0)->ySize() ); \ - const ::walberla::cell_idx_t zSize__ = ::walberla::cell_idx_c( (f0)->zSize() ); \ + const auto xSize__ = ::walberla::cell_idx_c( (f0)->xSize() ); \ + const auto ySize__ = ::walberla::cell_idx_c( (f0)->ySize() ); \ + const auto zSize__ = ::walberla::cell_idx_c( (f0)->zSize() ); \ if( zSize__ >= ySize__ ) \ { \ const int izSize = ::walberla::int_c( zSize__ ); \ _Pragma(#omp) \ for( int iz = 0; iz < izSize; ++iz ) { \ - const ::walberla::cell_idx_t z = ::walberla::cell_idx_c( iz ); \ + const auto z = ::walberla::cell_idx_c( iz ); \ const CellInterval interval( ::walberla::cell_idx_t(0), ::walberla::cell_idx_t(0), z, xSize__ - ::walberla::cell_idx_t(1), ySize__ - ::walberla::cell_idx_t(1), z ); \ auto it0 = (f0)->beginSliceXYZ( interval ); \ auto it1 = (f1)->beginSliceXYZ( interval ); \ @@ -1502,7 +1502,7 @@ const int iySize = ::walberla::int_c( ySize__ ); \ _Pragma(#omp) \ for( int iy = 0; iy < iySize; ++iy ) { \ - const ::walberla::cell_idx_t y = ::walberla::cell_idx_c( iy ); \ + const auto y = ::walberla::cell_idx_c( iy ); \ const CellInterval interval( ::walberla::cell_idx_t(0), y, ::walberla::cell_idx_t(0), xSize__ - ::walberla::cell_idx_t(1), y, zSize__ - ::walberla::cell_idx_t(1) ); \ auto it0 = (f0)->beginSliceXYZ( interval ); \ auto it1 = (f1)->beginSliceXYZ( interval ); \ @@ -1541,15 +1541,15 @@ WALBERLA_ASSERT_EQUAL_2( (f0)->xyzSize(), (f5)->xyzSize() ); \ WALBERLA_ASSERT_EQUAL_2( (f0)->xyzSize(), (f6)->xyzSize() ); \ WALBERLA_ASSERT_EQUAL_2( (f0)->xyzSize(), (f7)->xyzSize() ); \ - const ::walberla::cell_idx_t xSize__ = ::walberla::cell_idx_c( (f0)->xSize() ); \ - const ::walberla::cell_idx_t ySize__ = ::walberla::cell_idx_c( (f0)->ySize() ); \ - const ::walberla::cell_idx_t zSize__ = ::walberla::cell_idx_c( (f0)->zSize() ); \ + const auto xSize__ = ::walberla::cell_idx_c( (f0)->xSize() ); \ + const auto ySize__ = ::walberla::cell_idx_c( (f0)->ySize() ); \ + const auto zSize__ = ::walberla::cell_idx_c( (f0)->zSize() ); \ if( zSize__ >= ySize__ ) \ { \ const int izSize = ::walberla::int_c( zSize__ ); \ _Pragma(#omp) \ for( int iz = 0; iz < izSize; ++iz ) { \ - const ::walberla::cell_idx_t z = ::walberla::cell_idx_c( iz ); \ + const auto z = ::walberla::cell_idx_c( iz ); \ const CellInterval interval( ::walberla::cell_idx_t(0), ::walberla::cell_idx_t(0), z, xSize__ - ::walberla::cell_idx_t(1), ySize__ - ::walberla::cell_idx_t(1), z ); \ auto it0 = (f0)->beginSliceXYZ( interval ); \ auto it1 = (f1)->beginSliceXYZ( interval ); \ @@ -1577,7 +1577,7 @@ const int iySize = ::walberla::int_c( ySize__ ); \ _Pragma(#omp) \ for( int iy = 0; iy < iySize; ++iy ) { \ - const ::walberla::cell_idx_t y = ::walberla::cell_idx_c( iy ); \ + const auto y = ::walberla::cell_idx_c( iy ); \ const CellInterval interval( ::walberla::cell_idx_t(0), y, ::walberla::cell_idx_t(0), xSize__ - ::walberla::cell_idx_t(1), y, zSize__ - ::walberla::cell_idx_t(1) ); \ auto it0 = (f0)->beginSliceXYZ( interval ); \ auto it1 = (f1)->beginSliceXYZ( interval ); \ @@ -1607,12 +1607,12 @@ #define WALBERLA_FOR_ALL_CELLS_XYZ_OMP( field, omp, CODE ) \ { WALBERLA_ASSERT_NOT_NULLPTR_1( (field) ); \ - const ::walberla::cell_idx_t xSize__ = ::walberla::cell_idx_c( (field)->xSize() ); \ - const ::walberla::cell_idx_t ySize__ = ::walberla::cell_idx_c( (field)->ySize() ); \ - const ::walberla::cell_idx_t zSize__ = ::walberla::cell_idx_c( (field)->zSize() ); \ - for( ::walberla::cell_idx_t z = ::walberla::cell_idx_t(0); z < zSize__; ++z ) { \ - for( ::walberla::cell_idx_t y = ::walberla::cell_idx_t(0); y < ySize__; ++y ) { \ - for( ::walberla::cell_idx_t x = ::walberla::cell_idx_t(0); x < xSize__; ++x ) \ + const auto xSize__ = ::walberla::cell_idx_c( (field)->xSize() ); \ + const auto ySize__ = ::walberla::cell_idx_c( (field)->ySize() ); \ + const auto zSize__ = ::walberla::cell_idx_c( (field)->zSize() ); \ + for( auto z = ::walberla::cell_idx_t(0); z < zSize__; ++z ) { \ + for( auto y = ::walberla::cell_idx_t(0); y < ySize__; ++y ) { \ + for( auto x = ::walberla::cell_idx_t(0); x < xSize__; ++x ) \ { \ CODE \ } \ @@ -1620,9 +1620,9 @@ } } #define WALBERLA_FOR_ALL_CELLS_IN_INTERVAL_XYZ_OMP( interval, omp, CODE ) \ - { for( ::walberla::cell_idx_t z = interval.zMin(); z <= interval.zMax(); ++z ) { \ - for( ::walberla::cell_idx_t y = interval.yMin(); y <= interval.yMax(); ++y ) { \ - for( ::walberla::cell_idx_t x = interval.xMin(); x <= interval.xMax(); ++x ) \ + { for( auto z = interval.zMin(); z <= interval.zMax(); ++z ) { \ + for( auto y = interval.yMin(); y <= interval.yMax(); ++y ) { \ + for( auto x = interval.xMin(); x <= interval.xMax(); ++x ) \ { \ CODE \ } \ @@ -1633,13 +1633,13 @@ #define WALBERLA_FOR_ALL_CELLS_INCLUDING_GHOST_LAYER_XYZ_OMP_4( field, gl, omp, CODE ) \ { WALBERLA_ASSERT_NOT_NULLPTR_1( (field) ); \ WALBERLA_ASSERT_GREATER_EQUAL_2( (field)->nrOfGhostLayers(), gl ); \ - const ::walberla::cell_idx_t xSize__ = ::walberla::cell_idx_c( (field)->xSize() ); \ - const ::walberla::cell_idx_t ySize__ = ::walberla::cell_idx_c( (field)->ySize() ); \ - const ::walberla::cell_idx_t zSize__ = ::walberla::cell_idx_c( (field)->zSize() ); \ - const ::walberla::cell_idx_t gl__ = ::walberla::cell_idx_c( gl ); \ - for( ::walberla::cell_idx_t z = -gl__; z < (zSize__ + gl__); ++z ) { \ - for( ::walberla::cell_idx_t y = -gl__; y < (ySize__ + gl__); ++y ) { \ - for( ::walberla::cell_idx_t x = -gl__; x < (xSize__ + gl__); ++x ) \ + const auto xSize__ = ::walberla::cell_idx_c( (field)->xSize() ); \ + const auto ySize__ = ::walberla::cell_idx_c( (field)->ySize() ); \ + const auto zSize__ = ::walberla::cell_idx_c( (field)->zSize() ); \ + const auto gl__ = ::walberla::cell_idx_c( gl ); \ + for( auto z = -gl__; z < (zSize__ + gl__); ++z ) { \ + for( auto y = -gl__; y < (ySize__ + gl__); ++y ) { \ + for( auto x = -gl__; x < (xSize__ + gl__); ++x ) \ { \ CODE \ } \ @@ -1648,18 +1648,18 @@ #define WALBERLA_FOR_ALL_CELLS_YZ_OMP( field, omp, CODE ) \ { WALBERLA_ASSERT_NOT_NULLPTR_1( (field) ); \ - const ::walberla::cell_idx_t ySize__ = ::walberla::cell_idx_c( (field)->ySize() ); \ - const ::walberla::cell_idx_t zSize__ = ::walberla::cell_idx_c( (field)->zSize() ); \ - for( ::walberla::cell_idx_t z = ::walberla::cell_idx_t(0); z < zSize__; ++z ) { \ - for( ::walberla::cell_idx_t y = ::walberla::cell_idx_t(0); y < ySize__; ++y ) \ + const auto ySize__ = ::walberla::cell_idx_c( (field)->ySize() ); \ + const auto zSize__ = ::walberla::cell_idx_c( (field)->zSize() ); \ + for( auto z = ::walberla::cell_idx_t(0); z < zSize__; ++z ) { \ + for( auto y = ::walberla::cell_idx_t(0); y < ySize__; ++y ) \ { \ CODE \ } \ } } #define WALBERLA_FOR_ALL_CELLS_IN_INTERVAL_YZ_OMP( interval, omp, CODE ) \ - { for( ::walberla::cell_idx_t z = interval.zMin(); z <= interval.zMax(); ++z ) { \ - for( ::walberla::cell_idx_t y = interval.yMin(); y <= interval.yMax(); ++y ) \ + { for( auto z = interval.zMin(); z <= interval.zMax(); ++z ) { \ + for( auto y = interval.yMin(); y <= interval.yMax(); ++y ) \ { \ CODE \ } \ @@ -1669,11 +1669,11 @@ #define WALBERLA_FOR_ALL_CELLS_INCLUDING_GHOST_LAYER_YZ_OMP_4( field, gl, omp, CODE ) \ { WALBERLA_ASSERT_NOT_NULLPTR_1( (field) ); \ WALBERLA_ASSERT_GREATER_EQUAL_2( (field)->nrOfGhostLayers(), gl ); \ - const ::walberla::cell_idx_t ySize__ = ::walberla::cell_idx_c( (field)->ySize() ); \ - const ::walberla::cell_idx_t zSize__ = ::walberla::cell_idx_c( (field)->zSize() ); \ - const ::walberla::cell_idx_t gl__ = ::walberla::cell_idx_c( gl ); \ - for( ::walberla::cell_idx_t z = -gl__; z < (zSize__ + gl__); ++z ) { \ - for( ::walberla::cell_idx_t y = -gl__; y < (ySize__ + gl__); ++y ) \ + const auto ySize__ = ::walberla::cell_idx_c( (field)->ySize() ); \ + const auto zSize__ = ::walberla::cell_idx_c( (field)->zSize() ); \ + const auto gl__ = ::walberla::cell_idx_c( gl ); \ + for( auto z = -gl__; z < (zSize__ + gl__); ++z ) { \ + for( auto y = -gl__; y < (ySize__ + gl__); ++y ) \ { \ CODE \ } \ diff --git a/src/field/vtk/FlagFieldCellFilter.h b/src/field/vtk/FlagFieldCellFilter.h index 939a8f8aa6bdd56674de9f8e42a60588e60f47b0..4c940b50945abc71b43a06388fef71a150e659fa 100644 --- a/src/field/vtk/FlagFieldCellFilter.h +++ b/src/field/vtk/FlagFieldCellFilter.h @@ -47,7 +47,7 @@ public: void operator()( CellSet& filteredCells, const IBlock& block, const StructuredBlockStorage& storage, const uint_t ghostLayers = uint_t(0) ) const { - const FlagField_T* flagField = block.getData< FlagField_T >( flagField_ ); + const auto* flagField = block.getData< FlagField_T >( flagField_ ); WALBERLA_ASSERT_NOT_NULLPTR( flagField ); std::vector< FlagUID > existingFlags; diff --git a/src/gather/CellGatherPackInfo.impl.h b/src/gather/CellGatherPackInfo.impl.h index da23d416175fa4b9c3883ca40368aca23e87f280..b2fc5d51e995ac1034231ac464a12faf24d6ff3c 100644 --- a/src/gather/CellGatherPackInfo.impl.h +++ b/src/gather/CellGatherPackInfo.impl.h @@ -36,7 +36,7 @@ CellGatherPackInfo<Field_T,CC>::CellGatherPackInfo( const shared_ptr<StructuredB for ( auto & block : *bs ) { uint_t cellNr = 0; - Samples & s = localSamplePoints_[ &block ]; + auto & s = localSamplePoints_[ &block ]; for( const auto & cell : containerOfGlobalCells ) { Cell localCell; @@ -60,16 +60,16 @@ template< typename Field_T, typename CC> void CellGatherPackInfo<Field_T,CC>::packData ( const IBlock * sender, mpi::SendBuffer & outBuffer ) { - auto i = localSamplePoints_.find( sender ); + const auto it = localSamplePoints_.find( sender ); - if(i == localSamplePoints_.end() ) //nothing to send + if(it == localSamplePoints_.end() ) //nothing to send return; - const std::vector<uint_t> & cellNumbers = i->second.globalCellNr; - const CellVector & cells = i->second.cells; + const auto & cellNumbers = it->second.globalCellNr; + const auto & cells = it->second.cells; WALBERLA_ASSERT_EQUAL( cells.size(), cellNumbers.size() ); - auto field = sender->getData<Field_T>( fieldID_ ); + const auto * field = sender->getData<Field_T>( fieldID_ ); const size_t fieldSize = Field_T::F_SIZE; @@ -100,7 +100,7 @@ void CellGatherPackInfo<Field_T,CC>::unpackData( mpi::RecvBuffer & buffer ) for( size_t i=0; i< nrPoints; ++i ) { receivedData.emplace_back(fieldSize+1); //+1 because we also store t value as first entry - std::vector<real_t> & pointVec = receivedData.back(); + auto & pointVec = receivedData.back(); uint_t t; real_t val; diff --git a/src/gather/CurveGatherPackInfo.impl.h b/src/gather/CurveGatherPackInfo.impl.h index bf032617ac17b4d91291aefa72805980c823b838..4377d03c3bd39100a07faf1143a5e7d292224dac 100644 --- a/src/gather/CurveGatherPackInfo.impl.h +++ b/src/gather/CurveGatherPackInfo.impl.h @@ -115,7 +115,7 @@ void CurveGatherPackInfo<GlF,IP>::addSample( real_t t, const RealVec3 & p ) } // Find block for global coordinate and translate sample to local cell coordinates - IBlock * block = blocks_->getBlock( p[0], p[1], p[2] ); + auto * block = blocks_->getBlock( p[0], p[1], p[2] ); if ( ! block ) // non-local block return; @@ -128,7 +128,7 @@ void CurveGatherPackInfo<GlF,IP>::addSample( real_t t, const RealVec3 & p ) pLocal[1] /= blocks_->dy(); pLocal[2] /= blocks_->dz(); - Samples & s = localSamplePoints_[ block ]; + auto & s = localSamplePoints_[ block ]; s.t.push_back(t); s.coord.push_back( pLocal ); } @@ -147,16 +147,16 @@ void CurveGatherPackInfo<GlF,IP>::addSample( real_t t, const RealVec3 & p ) template< typename GlF, typename Interpolator> void CurveGatherPackInfo<GlF,Interpolator>::packData( const IBlock * sender, mpi::SendBuffer & outBuffer ) { - auto i = localSamplePoints_.find( sender ); + const auto it = localSamplePoints_.find( sender ); - if(i == localSamplePoints_.end() ) //nothing to send + if( it == localSamplePoints_.end() ) //nothing to send return; - const std::vector<RealVec3> & points = i->second.coord; - const std::vector<real_t> & t = i->second.t; + const auto & points = it->second.coord; + const auto & t = it->second.t; WALBERLA_ASSERT_EQUAL(t.size(), points.size() ); - const GlF* field = sender->getData<GlF>( fieldID_ ); + const auto* field = sender->getData<GlF>( fieldID_ ); Interpolator ip ( *field ); const size_t fieldSize = Interpolator::F_SIZE; @@ -186,7 +186,7 @@ void CurveGatherPackInfo<GlF,IP>::unpackData( mpi::RecvBuffer & buffer ) for( size_t i=0; i< nrPoints; ++i ) { receivedData.emplace_back(fieldSize+1); //+1 because we also store t value as first entry - std::vector<real_t> & pointVec = receivedData.back(); + auto & pointVec = receivedData.back(); real_t t; real_t val; diff --git a/src/gpu/FieldCopy.h b/src/gpu/FieldCopy.h index 1880357037c74a59f51aef2654c27ae307911999..2f2de84b31d02e9cba0fa7187d918843026c2f92 100644 --- a/src/gpu/FieldCopy.h +++ b/src/gpu/FieldCopy.h @@ -42,8 +42,8 @@ namespace gpu { for ( auto blockIt = blocks->begin(); blockIt != blocks->end(); ++blockIt ) { - DstType * dst = blockIt->getData<DstType>( dstID ); - const SrcType * src = blockIt->getData<SrcType>( srcID ); + auto * dst = blockIt->getData<DstType>( dstID ); + const auto * src = blockIt->getData<SrcType>( srcID ); fieldCpy( *dst, *src ); } } @@ -60,8 +60,8 @@ namespace gpu template<typename DstType, typename SrcType> void fieldCpySweepFunction( BlockDataID dstID, ConstBlockDataID srcID, IBlock * block ) { - DstType * dst = block->getData<DstType>( dstID ); - const SrcType * src = block->getData<SrcType>( srcID ); + auto * dst = block->getData<DstType>( dstID ); + const auto * src = block->getData<SrcType>( srcID ); fieldCpy( *dst, *src ); } diff --git a/src/gpu/GPUField.impl.h b/src/gpu/GPUField.impl.h index c982ea7d555757e4dc0a6045731c79bd3660ed9e..ec74bc5fa7274783bd34e10894288605107663f2 100644 --- a/src/gpu/GPUField.impl.h +++ b/src/gpu/GPUField.impl.h @@ -238,8 +238,8 @@ bool GPUField<T>::hasSameAllocSize( const GPUField<T> & other ) const template <typename T> GPUField<T> * GPUField<T>::cloneUninitialized() const { - GPUField<T> * res = new GPUField<T>( xSize(), ySize(), zSize(), fSize(), - nrOfGhostLayers(), layout(), isPitchedMem() ); + auto * res = new GPUField<T>( xSize(), ySize(), zSize(), fSize(), + nrOfGhostLayers(), layout(), isPitchedMem() ); WALBERLA_ASSERT( hasSameAllocSize( *res ) ) WALBERLA_ASSERT( hasSameSize( *res ) ) diff --git a/src/gpu/communication/MemcpyPackInfo.impl.h b/src/gpu/communication/MemcpyPackInfo.impl.h index 2110933cda5322828f40cc14b471be5c6a309bfe..7119461b03e6bca802b79127dc99416023ad44bd 100644 --- a/src/gpu/communication/MemcpyPackInfo.impl.h +++ b/src/gpu/communication/MemcpyPackInfo.impl.h @@ -21,9 +21,9 @@ void MemcpyPackInfo< GPUFieldType >::pack(stencil::Direction dir, unsigned char // Extract field data pointer from the block const GPUFieldType * fieldPtr = block->getData< GPUFieldType >( pdfsID ); WALBERLA_ASSERT_NOT_NULLPTR( fieldPtr ) - // - cell_idx_t nrOfGhostLayers = cell_idx_c( numberOfGhostLayersToCommunicate( fieldPtr ) ); - CellInterval fieldCi = field::getSliceBeforeGhostLayer( *fieldPtr, dir, nrOfGhostLayers, false ); + // + auto nrOfGhostLayers = cell_idx_c( numberOfGhostLayersToCommunicate( fieldPtr ) ); + auto fieldCi = field::getSliceBeforeGhostLayer( *fieldPtr, dir, nrOfGhostLayers, false ); // Base offsets into the buffer and GPUField, respectively auto dstOffset = std::make_tuple( uint_c(0), uint_c(0), uint_c(0), uint_c(0) ); @@ -41,10 +41,10 @@ void MemcpyPackInfo< GPUFieldType >::pack(stencil::Direction dir, unsigned char const uint_t dstAllocSizeZ = fieldCi.zSize(); const uint_t srcAllocSizeZ = fieldPtr->zAllocSize(); - gpuPitchedPtr byteBufferPitchedPtr = make_gpuPitchedPtr( byte_buffer, - fieldCi.xSize() * sizeof(typename GPUFieldType::value_type), - fieldCi.xSize() * sizeof(typename GPUFieldType::value_type), - fieldCi.ySize() ); + auto byteBufferPitchedPtr = make_gpuPitchedPtr( byte_buffer, + fieldCi.xSize() * sizeof(typename GPUFieldType::value_type), + fieldCi.xSize() * sizeof(typename GPUFieldType::value_type), + fieldCi.ySize() ); copyDevToDevFZYX( byteBufferPitchedPtr, fieldPtr->pitchedPtr(), dstOffset, srcOffset, dstAllocSizeZ, srcAllocSizeZ, sizeof(typename GPUFieldType::value_type), @@ -55,10 +55,10 @@ void MemcpyPackInfo< GPUFieldType >::pack(stencil::Direction dir, unsigned char const uint_t dstAllocSizeZ = fieldCi.ySize(); const uint_t srcAllocSizeZ = fieldPtr->yAllocSize(); - gpuPitchedPtr byteBufferPitchedPtr = make_gpuPitchedPtr( byte_buffer, - fieldPtr->fSize() * sizeof(typename GPUFieldType::value_type), - fieldPtr->fSize() * sizeof(typename GPUFieldType::value_type), - fieldCi.xSize() ); + auto byteBufferPitchedPtr = make_gpuPitchedPtr( byte_buffer, + fieldPtr->fSize() * sizeof(typename GPUFieldType::value_type), + fieldPtr->fSize() * sizeof(typename GPUFieldType::value_type), + fieldCi.xSize() ); copyDevToDevZYXF( byteBufferPitchedPtr, fieldPtr->pitchedPtr(), dstOffset, srcOffset, dstAllocSizeZ, srcAllocSizeZ, sizeof(typename GPUFieldType::value_type), intervalSize, stream ); @@ -72,19 +72,19 @@ void MemcpyPackInfo< GPUFieldType >::communicateLocal( stencil::Direction dir, c // Extract field data pointer from the block - const GPUFieldType * senderFieldPtr = sender->getData< GPUFieldType >( pdfsID ); - const GPUFieldType * receiverFieldPtr = receiver->getData< GPUFieldType >( pdfsID ); + const auto * senderFieldPtr = sender->getData< GPUFieldType >( pdfsID ); + const auto * receiverFieldPtr = receiver->getData< GPUFieldType >( pdfsID ); WALBERLA_ASSERT_NOT_NULLPTR( senderFieldPtr ) WALBERLA_ASSERT_NOT_NULLPTR( receiverFieldPtr ) // - cell_idx_t nrOfGhostLayers = cell_idx_c( numberOfGhostLayersToCommunicate( senderFieldPtr ) ); + auto nrOfGhostLayers = cell_idx_c( numberOfGhostLayersToCommunicate( senderFieldPtr ) ); WALBERLA_ASSERT_EQUAL(nrOfGhostLayers, cell_idx_c( numberOfGhostLayersToCommunicate( receiverFieldPtr ))) WALBERLA_ASSERT_EQUAL(senderFieldPtr->layout(), receiverFieldPtr->layout() ) WALBERLA_ASSERT_EQUAL(senderFieldPtr->fSize(), receiverFieldPtr->fSize() ) - CellInterval senderCi = field::getSliceBeforeGhostLayer( *senderFieldPtr, dir, nrOfGhostLayers, false ); - CellInterval receiverCi = field::getGhostRegion( *receiverFieldPtr, stencil::inverseDir[dir], nrOfGhostLayers, false ); + auto senderCi = field::getSliceBeforeGhostLayer( *senderFieldPtr, dir, nrOfGhostLayers, false ); + auto receiverCi = field::getGhostRegion( *receiverFieldPtr, stencil::inverseDir[dir], nrOfGhostLayers, false ); // Base offsets into the buffer and GPUField, respectively auto srcOffset = std::make_tuple( uint_c(senderCi.xMin() + nrOfGhostLayers), @@ -128,12 +128,12 @@ template<typename GPUFieldType> void MemcpyPackInfo< GPUFieldType >::unpack(stencil::Direction dir, unsigned char * byte_buffer, IBlock * block, gpuStream_t stream) { - GPUFieldType * fieldPtr = block->getData< GPUFieldType >( pdfsID ); + auto * fieldPtr = block->getData< GPUFieldType >( pdfsID ); WALBERLA_ASSERT_NOT_NULLPTR(fieldPtr) - cell_idx_t nrOfGhostLayers = cell_idx_c( numberOfGhostLayersToCommunicate( fieldPtr ) ); + auto nrOfGhostLayers = cell_idx_c( numberOfGhostLayersToCommunicate( fieldPtr ) ); - CellInterval fieldCi = field::getGhostRegion( *fieldPtr, dir, nrOfGhostLayers, false ); + auto fieldCi = field::getGhostRegion( *fieldPtr, dir, nrOfGhostLayers, false ); auto dstOffset = std::make_tuple( uint_c(fieldCi.xMin() + nrOfGhostLayers), uint_c(fieldCi.yMin() + nrOfGhostLayers), uint_c(fieldCi.zMin() + nrOfGhostLayers), @@ -147,10 +147,10 @@ void MemcpyPackInfo< GPUFieldType >::unpack(stencil::Direction dir, unsigned cha const uint_t dstAllocSizeZ = fieldPtr->zAllocSize(); const uint_t srcAllocSizeZ = fieldCi.zSize(); - gpuPitchedPtr byteBufferPitchedPtr = make_gpuPitchedPtr( byte_buffer, - fieldCi.xSize() * sizeof(typename GPUFieldType::value_type), - fieldCi.xSize() * sizeof(typename GPUFieldType::value_type), - fieldCi.ySize() ); + auto byteBufferPitchedPtr = make_gpuPitchedPtr( byte_buffer, + fieldCi.xSize() * sizeof(typename GPUFieldType::value_type), + fieldCi.xSize() * sizeof(typename GPUFieldType::value_type), + fieldCi.ySize() ); copyDevToDevFZYX( fieldPtr->pitchedPtr(), byteBufferPitchedPtr, dstOffset, srcOffset, dstAllocSizeZ, srcAllocSizeZ, sizeof(typename GPUFieldType::value_type), @@ -160,10 +160,10 @@ void MemcpyPackInfo< GPUFieldType >::unpack(stencil::Direction dir, unsigned cha { const uint_t dstAllocSizeY = fieldPtr->yAllocSize(); const uint_t srcAllocSizeY = fieldCi.ySize(); - gpuPitchedPtr byteBufferPitchedPtr = make_gpuPitchedPtr( byte_buffer, - fieldPtr->fSize() * sizeof(typename GPUFieldType::value_type), - fieldPtr->fSize() * sizeof(typename GPUFieldType::value_type), - fieldCi.xSize() ); + auto byteBufferPitchedPtr = make_gpuPitchedPtr( byte_buffer, + fieldPtr->fSize() * sizeof(typename GPUFieldType::value_type), + fieldPtr->fSize() * sizeof(typename GPUFieldType::value_type), + fieldCi.xSize() ); copyDevToDevZYXF( fieldPtr->pitchedPtr(), byteBufferPitchedPtr, dstOffset, srcOffset, dstAllocSizeY, srcAllocSizeY, sizeof(typename GPUFieldType::value_type), intervalSize, stream ); @@ -176,7 +176,7 @@ uint_t MemcpyPackInfo< GPUFieldType >::size(stencil::Direction dir, IBlock * blo auto pdfs = block->getData< GPUFieldType >(pdfsID); CellInterval ci; - cell_idx_t nrOfGhostLayers = cell_idx_c( numberOfGhostLayersToCommunicate( pdfs ) ); + auto nrOfGhostLayers = cell_idx_c( numberOfGhostLayersToCommunicate( pdfs ) ); pdfs->getGhostRegion(dir, ci, nrOfGhostLayers, false); /* diff --git a/src/lbm/evaluations/Permeability.impl.h b/src/lbm/evaluations/Permeability.impl.h index 3f2a41f5b6df0348ca5150b1b209e45d07268f0d..2779b54370142c89aa13422ec889324ca7f11de7 100644 --- a/src/lbm/evaluations/Permeability.impl.h +++ b/src/lbm/evaluations/Permeability.impl.h @@ -91,21 +91,21 @@ void Permeability<PdfField_T, BoundaryHandling_T>::operator()() if( ( time_ - 1u ) % interval_ != 0 || time_ <= 1 ) return; - // holds required local quantities - std::vector<real_t> params( 6, 0.0 ); - real_t & u = params[0]; // flow velocity along flow axis - real_t & rho = params[1]; // fluid density - real_t & p0 = params[2]; // fluid pressure (density) in cross section 0 - real_t & v0 = params[3]; // fluid velocity along flow axis in cross section 0 - real_t & p1 = params[4]; // fluid pressure (density) in cross section 1 - real_t & v1 = params[5]; // fluid velocity along flow axis in cross section 1 + // holds required local quantities + std::vector<real_t> params( 6, 0.0 ); + auto & u = params[0]; // flow velocity along flow axis + auto & rho = params[1]; // fluid density + auto & p0 = params[2]; // fluid pressure (density) in cross section 0 + auto & v0 = params[3]; // fluid velocity along flow axis in cross section 0 + auto & p1 = params[4]; // fluid pressure (density) in cross section 1 + auto & v1 = params[5]; // fluid velocity along flow axis in cross section 1 // calculate required quantities on each block for( const auto &block : *blocks_ ) { - const PdfField * pdfField = block.template getData<PdfField>( pdfFieldId_ ); - const BoundaryHandling * bHandling = block.template getData<BoundaryHandling>( boundaryHandlingId_ ); - const FlagField * flagField = bHandling->getFlagField(); + const auto * pdfField = block.template getData<PdfField>( pdfFieldId_ ); + const auto * bHandling = block.template getData<BoundaryHandling>( boundaryHandlingId_ ); + const auto * flagField = bHandling->getFlagField(); WALBERLA_ASSERT_NOT_NULLPTR( pdfField ); WALBERLA_ASSERT_NOT_NULLPTR( bHandling ); @@ -256,8 +256,8 @@ void Permeability<PdfField_T, BoundaryHandling_T>::initSampleVolume() for( const auto &block : *blocks_ ) { - const BoundaryHandling * bHandling = block.template getData<BoundaryHandling>( boundaryHandlingId_ ); - const FlagField * flagField = bHandling->getFlagField(); + const auto * bHandling = block.template getData<BoundaryHandling>( boundaryHandlingId_ ); + const auto * flagField = bHandling->getFlagField(); WALBERLA_ASSERT_NOT_NULLPTR( bHandling ); WALBERLA_ASSERT_NOT_NULLPTR( flagField ); diff --git a/src/mesa_pd/sorting/HilbertCompareFunctor.cpp b/src/mesa_pd/sorting/HilbertCompareFunctor.cpp index 984ad0c6629a9dc72e6c2b7bc3a18fe9e0d4dd00..4dbdac6d39a04ac75cfaa674f57d9eba460115d3 100644 --- a/src/mesa_pd/sorting/HilbertCompareFunctor.cpp +++ b/src/mesa_pd/sorting/HilbertCompareFunctor.cpp @@ -71,7 +71,7 @@ std::vector< math::Vector3<uint_t> > generateHilbertCurve(const uint_t size) while( !stack.empty() ) { - const Node node = stack.top(); + const auto node = stack.top(); uint_t hilbertIndex = orientation.top(); stack.pop();