diff --git a/.clang-tidy b/.clang-tidy index f0e5933ad55dc18c06f14f2c6ef06dc3226eda22..74d1c6cf5890e3d921b5f8c075c9bdaf1dd6c437 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -4,16 +4,30 @@ Checks: ' -*, boost-*, +-boost-use-ranges, bugprone-*, -bugprone-branch-clone, -bugprone-exception-escape, -bugprone-easily-swappable-parameters, +-bugprone-crtp-constructor-accessibility, +-bugprone-implicit-widening-of-multiplication-result, +-bugprone-macro-parentheses, +-bugprone-narrowing-conversions, +-bugprone-switch-missing-default-case, +-bugprone-assignment-in-if-condition, +-bugprone-reserved-identifier, misc-*, -misc-misplaced-const, +-misc-const-correctness, +-misc-unused-parameters, -misc-no-recursion, -misc-non-private-member-variables-in-classes, +-misc-include-cleaner, +-misc-header-include-cycle, +-misc-use-internal-linkage, +-misc-use-anonymous-namespace, modernize-*, -modernize-use-auto, @@ -23,12 +37,18 @@ modernize-*, -modernize-use-using, -modernize-avoid-bind, -modernize-return-braced-init-list, +-modernize-min-max-use-initializer-list, -modernize-use-transparent-functors, -modernize-redundant-void-arg, -modernize-use-trailing-return-type, +-modernize-use-default-member-init, +-modernize-use-equals-delete, +-modernize-macro-to-enum, -modernize-avoid-c-arrays, -modernize-concat-nested-namespaces, -modernize-use-nodiscard, +-modernize-type-traits, +-modernize-make-shared, mpi-*, -mpi-type-mismatch, @@ -38,25 +58,25 @@ openmp-*, -openmp-use-default-none, performance-*, +-performance-enum-size, +-performance-noexcept-swap, +-performance-move-const-arg, +-performance-unnecessary-value-param, +-performance-avoid-endl, portability-*, -readability-const-return-type, readability-container-size-empty, readability-delete-null-pointer, readability-deleted-default, -readability-isolate-declaration, -readability-misleading-indentation, readability-misplaced-array-index, readability-non-const-parameter, -readability-redundant-access-specifiers, readability-redundant-control-flow, readability-redundant-declaration, readability-redundant-function-ptr-dereference, readability-redundant-preprocessor, readability-redundant-smartptr-get, readability-redundant-string-cstr, -readability-simplify-boolean-expr, readability-simplify-subscript-expr, readability-static-accessed-through-instance, readability-static-definition-in-anonymous-namespace, diff --git a/python/pystencils_walberla/templates/CpuPackInfo.tmpl.cpp b/python/pystencils_walberla/templates/CpuPackInfo.tmpl.cpp index 0191994f3f3a29ef9384b2a2270294be9df59f43..15c5d7bef76b9b51d310ec0a823a4a61c24df833 100644 --- a/python/pystencils_walberla/templates/CpuPackInfo.tmpl.cpp +++ b/python/pystencils_walberla/templates/CpuPackInfo.tmpl.cpp @@ -117,7 +117,7 @@ uint_t {{class_name}}::size(stencil::Direction dir, const IBlock * block) const CellInterval ci; {{field_name}}->getGhostRegion(dir, ci, 1, false); - uint_t elementsPerCell = 0; + uint_t elementsPerCell = uint_t{ 0u }; switch( dir ) { @@ -125,11 +125,11 @@ uint_t {{class_name}}::size(stencil::Direction dir, const IBlock * block) const {%- for dir in direction_set %} case stencil::{{dir}}: {%- endfor %} - elementsPerCell = {{elements}}; + elementsPerCell = uint_t{ {{elements}}u }; break; {% endfor %} default: - elementsPerCell = 0; + elementsPerCell = uint_t{ 0u }; } return ci.numCells() * elementsPerCell * sizeof( {{dtype}} ); } diff --git a/python/pystencils_walberla/templates/GpuPackInfo.tmpl.cpp b/python/pystencils_walberla/templates/GpuPackInfo.tmpl.cpp index 48440b5b4366204157b0486cadf5c14295dbfcc0..6a385fa851f525155d5f919c6de14868627aa11a 100644 --- a/python/pystencils_walberla/templates/GpuPackInfo.tmpl.cpp +++ b/python/pystencils_walberla/templates/GpuPackInfo.tmpl.cpp @@ -17,6 +17,13 @@ //! \\author pystencils //====================================================================================================================== +#include "core/DataTypes.h" +#include "core/cell/CellInterval.h" + +#include "domain_decomposition/IBlock.h" + +#include "stencil/Directions.h" + #include "{{class_name}}.h" {% if target is equalto 'cpu' -%} diff --git a/python/pystencils_walberla/templates/GpuPackInfo.tmpl.h b/python/pystencils_walberla/templates/GpuPackInfo.tmpl.h index fd8fbd90f70d037722521dc869454775f819adba..820c6b8bec516e12f504230024207804d013fec1 100644 --- a/python/pystencils_walberla/templates/GpuPackInfo.tmpl.h +++ b/python/pystencils_walberla/templates/GpuPackInfo.tmpl.h @@ -20,7 +20,6 @@ #pragma once #include "core/DataTypes.h" -#include "core/cell/CellInterval.h" #include "domain_decomposition/IBlock.h" diff --git a/src/blockforest/communication/NonUniformBufferedScheme.h b/src/blockforest/communication/NonUniformBufferedScheme.h index ff1d3ba3b85f97d558378f1125b00816d734307b..0a6a453abacef502f5620d2d9c3c59514e9e8fc6 100644 --- a/src/blockforest/communication/NonUniformBufferedScheme.h +++ b/src/blockforest/communication/NonUniformBufferedScheme.h @@ -851,7 +851,7 @@ void NonUniformBufferedScheme<Stencil>::startCommunicationCoarseToFine( const ui resetBufferSystem( bufferSystem ); - for( auto sender : sendFunctions ) + for( auto const &sender : sendFunctions ) bufferSystem->addSendingFunction( int_c(sender.first), std::bind( NonUniformBufferedScheme<Stencil>::send, std::placeholders::_1, sender.second ) ); for(auto receiver : ranksToReceiveFrom) @@ -996,7 +996,7 @@ void NonUniformBufferedScheme<Stencil>::startCommunicationFineToCoarse( const ui resetBufferSystem( bufferSystem ); - for( auto sender : sendFunctions ) + for( auto const &sender : sendFunctions ) bufferSystem->addSendingFunction( int_c(sender.first), std::bind( NonUniformBufferedScheme<Stencil>::send, std::placeholders::_1, sender.second ) ); for(auto receiver : ranksToReceiveFrom) diff --git a/src/core/Array.h b/src/core/Array.h index c047542d7ab8e8af632c7ce56416f403d395bf2a..dcb69e89bf146de133e64553dec79378970c0d2e 100644 --- a/src/core/Array.h +++ b/src/core/Array.h @@ -46,7 +46,7 @@ public: inline Array( const std::vector<T>& vector ); inline Array( const Array& array ); - ~Array() { if( array_ != nullptr ) delete[] array_; } + ~Array() { delete[] array_; } uint_t size() const { return size_; } bool empty() const { return size_ == 0; } @@ -89,7 +89,7 @@ inline Array<T>::Array( const uint_t n, const T& t ) : array_( n == 0 ? nullptr template< typename T > inline Array<T>::Array( const std::vector<T>& vector ) : - array_( vector.size() == 0 ? nullptr : new T[ vector.size() ] ), size_( vector.size() ) + array_( vector.empty() ? nullptr : new T[ vector.size() ] ), size_( vector.size() ) { for( uint_t i = 0; i != size_; ++i ) array_[i] = vector[i]; diff --git a/src/core/Set.h b/src/core/Set.h index cbc0d5c1196404f4fb71d72492c40a7a326b03c2..de9ca7841336a1282ee99322c0b210830bfa7d46 100644 --- a/src/core/Set.h +++ b/src/core/Set.h @@ -130,7 +130,7 @@ public: inline size_t size() const { return set_.size(); } - inline void swap( Set<T>& set ) { set_.swap( set.set_ ); } + inline void swap( Set<T>& set ) noexcept { set_.swap( set.set_ ); } void toStream( std::ostream& os ) const; inline std::string toString() const; diff --git a/src/core/StringUtility.impl.h b/src/core/StringUtility.impl.h index 02b5f3937216ea5345368505ef8664ec53b1eb34..ac3b298875a0676a5311ca8bac2873f5f1a703d5 100644 --- a/src/core/StringUtility.impl.h +++ b/src/core/StringUtility.impl.h @@ -21,8 +21,6 @@ #pragma once -#include "core/StringUtility.h" - #include <algorithm> #include <cctype> #include <string> diff --git a/src/core/cell/CellInterval.h b/src/core/cell/CellInterval.h index 7b766fa3763bb890aca15b5f5c31e6891c54ee7d..6019ac71ce9a188998e7c13e463796f18df0336c 100644 --- a/src/core/cell/CellInterval.h +++ b/src/core/cell/CellInterval.h @@ -236,6 +236,7 @@ inline bool CellInterval::overlaps( const CellInterval& other ) const if( empty() || other.empty() ) return false; + // NOLINTNEXTLINE(readability-simplify-boolean-expr) return !(other.min_.x() > max_.x() || other.min_.y() > max_.y() || other.min_.z() > max_.z() || other.max_.x() < min_.x() || other.max_.y() < min_.y() || other.max_.z() < min_.z()); } diff --git a/src/core/debug/PrintStacktrace.cpp b/src/core/debug/PrintStacktrace.cpp index 94f2aa89b34c307b5da5f7b54685f7dc7a4ad0b9..6e0a4fef0a4a80a217d20f5818e604e36868e014 100644 --- a/src/core/debug/PrintStacktrace.cpp +++ b/src/core/debug/PrintStacktrace.cpp @@ -42,6 +42,7 @@ void printStacktrace() #include WALBERLA_BACKTRACE_HEADER #include <cstdlib> #include <string> +#include <utility> namespace walberla { namespace debug { @@ -92,12 +93,12 @@ namespace debug { string appName = line.substr( 0, leftBracket ); string bracketPart = line.substr( leftBracket+1, rightBracket - leftBracket -1 ); - string rest = line.substr( rightBracket +1 ); + std::ignore = line.substr( rightBracket +1 ); /*rest*/ // split the bracketPart on plus sign size_t plusPos = bracketPart.find_first_of('+'); string functionName = bracketPart.substr(0, plusPos ); - string offset = bracketPart.substr( plusPos+1 ); + std::ignore = bracketPart.substr( plusPos+1 ); /*offset*/ #endif // try to demangle -> no return code if successful @@ -109,7 +110,7 @@ namespace debug { os << "\t" << appName << " \t " << demangled << endl; } - free (strings); + free (reinterpret_cast<void*>(strings)); } diff --git a/src/core/math/Matrix2.h b/src/core/math/Matrix2.h index 308108649ce4d6583194c73521824be91c99d638..3827333a4aef26fe1c2db7599724181b6df78a84 100644 --- a/src/core/math/Matrix2.h +++ b/src/core/math/Matrix2.h @@ -323,7 +323,7 @@ inline Matrix2<Type>& Matrix2<Type>::operator=( Type set ) // Explicit definition of a copy assignment operator for performance reasons. */ template< typename Type > -inline Matrix2<Type>& Matrix2<Type>::operator=( const Matrix2& set ) +inline Matrix2<Type>& Matrix2<Type>::operator=( const Matrix2& set ) // NOLINT(bugprone-unhandled-self-assignment) { // This implementation is faster than the synthesized default copy assignment operator and // faster than an implementation with the C library function 'memcpy' in combination with a @@ -347,7 +347,7 @@ inline Matrix2<Type>& Matrix2<Type>::operator=( const Matrix2& set ) */ template< typename Type > template< typename Other > -inline Matrix2<Type>& Matrix2<Type>::operator=( const Matrix2<Other>& set ) +inline Matrix2<Type>& Matrix2<Type>::operator=( const Matrix2<Other>& set ) // NOLINT(bugprone-unhandled-self-assignment) { // This implementation is faster than the synthesized default copy assignment operator and // faster than an implementation with the C library function 'memcpy' in combination with a diff --git a/src/core/math/extern/exprtk.h b/src/core/math/extern/exprtk.h index b415b4ba62bd0c0dc1830fd106d562a7a96f4129..aab5062bacc2510e37cf55418eaaa5b46d0005a3 100644 --- a/src/core/math/extern/exprtk.h +++ b/src/core/math/extern/exprtk.h @@ -5209,7 +5209,7 @@ namespace exprtk return std::numeric_limits<T>::quiet_NaN(); } - inline virtual expression_node<T>* branch(const std::size_t& index = 0) const + inline virtual expression_node<T>* branch([[maybe_unused]] const std::size_t& index = 0) const { return reinterpret_cast<expression_ptr>(index * 0); } @@ -14889,6 +14889,8 @@ namespace exprtk { public: + ~T0oT1oT2oT3_sf4() override = default; + typedef typename details::functor_t<T> functor_t; typedef typename functor_t::qfunc_t qfunc_t; typedef T value_type; @@ -18085,7 +18087,7 @@ namespace exprtk return false; else if (symbol_exists(vector_name)) return false; - else if (0 == v.size()) + else if (v.empty()) return false; else return local_data().vector_store.add(vector_name,v); @@ -18099,7 +18101,7 @@ namespace exprtk return false; else if (symbol_exists(vector_name)) return false; - else if (0 == v.size()) + else if (v.empty()) return false; else return local_data().vector_store.add(vector_name,v); @@ -18585,10 +18587,7 @@ namespace exprtk } } - if (results) - { - delete results; - } + delete results; } static inline control_block* create(expression_ptr e) @@ -21419,7 +21418,9 @@ namespace exprtk end_token = current_token(); + #ifdef exprtk_enable_debugging const std::string sub_expr = construct_subexpr(begin_token, end_token); + #endif exprtk_debug(("parse_corpus(%02d) Subexpr: %s\n", static_cast<int>(arg_list.size() - 1), @@ -24456,7 +24457,7 @@ namespace exprtk for (std::size_t i = 0; i < function_definition_list_.size(); ++i) { - if (std::string::npos != function_definition_list_[i].param_seq.find("Z")) + if (std::string::npos != function_definition_list_[i].param_seq.find('Z')) { return true; } @@ -38550,7 +38551,7 @@ namespace exprtk std::memcpy(reinterpret_cast<char*>(&fd), reinterpret_cast<const char*>(&v), - sizeof(fd)); + sizeof(void*)); return fd; } @@ -38611,7 +38612,7 @@ namespace exprtk std::memcpy(reinterpret_cast<char*>(&t ), reinterpret_cast<char*>(&fd), - sizeof(fd)); + sizeof(void*)); return t; } else diff --git a/src/core/mpi/BufferSystem.impl.h b/src/core/mpi/BufferSystem.impl.h index 3715a7ea9f3daf95c0bde6163954ca72159e48d3..b927d242daa869ec294916f0991c6a94e5bce88d 100644 --- a/src/core/mpi/BufferSystem.impl.h +++ b/src/core/mpi/BufferSystem.impl.h @@ -165,21 +165,24 @@ GenericBufferSystem<Rb, Sb> & GenericBufferSystem<Rb, Sb>::operator=( const Gene { WALBERLA_ASSERT( !communicationRunning_, "Can't copy GenericBufferSystem while communication is running" ) - sizeChangesEverytime_ = other.sizeChangesEverytime_; - communicationRunning_ = other.communicationRunning_; - recvInfos_ = other.recvInfos_; - sendInfos_ = other.sendInfos_; + if (&other != this) + { + sizeChangesEverytime_ = other.sizeChangesEverytime_; + communicationRunning_ = other.communicationRunning_; + recvInfos_ = other.recvInfos_; + sendInfos_ = other.sendInfos_; - if( other.currentComm_ == &other.knownSizeComm_ ) - currentComm_ = &knownSizeComm_; - else if ( other.currentComm_ == &other.unknownSizeComm_ ) - currentComm_ = &unknownSizeComm_; - else if ( other.currentComm_ == &other.unknownSizeCommIProbe_ ) - currentComm_ = &unknownSizeCommIProbe_; - else if ( other.currentComm_ == &other.noMPIComm_ ) - currentComm_ = &noMPIComm_; - else - currentComm_ = nullptr; // receiver information not yet set + if( other.currentComm_ == &other.knownSizeComm_ ) + currentComm_ = &knownSizeComm_; + else if ( other.currentComm_ == &other.unknownSizeComm_ ) + currentComm_ = &unknownSizeComm_; + else if ( other.currentComm_ == &other.unknownSizeCommIProbe_ ) + currentComm_ = &unknownSizeCommIProbe_; + else if ( other.currentComm_ == &other.noMPIComm_ ) + currentComm_ = &noMPIComm_; + else + currentComm_ = nullptr; // receiver information not yet set + } return *this; } diff --git a/src/core/mpi/RecvBuffer.h b/src/core/mpi/RecvBuffer.h index 0b3df4abffd48550221cf321c94c4a5c6f95cb77..69c0a26d213176f42b5eba8bf604b0d24915c530 100644 --- a/src/core/mpi/RecvBuffer.h +++ b/src/core/mpi/RecvBuffer.h @@ -400,11 +400,11 @@ GenericRecvBuffer<T>::get( V& value ) // Checking the validity of the read operation - WALBERLA_ASSERT_LESS_EQUAL( cur_ + (sizeof(V) / sizeof(T)), end_ ); + WALBERLA_ASSERT_LESS_EQUAL( cur_ + (sizeof(V) / sizeof(T)), end_ ); // NOLINT(bugprone-sizeof-expression) // Extracting the data value std::memcpy( &value, cur_, sizeof(V) ); - cur_ += sizeof(V) / sizeof(T); + cur_ += sizeof(V) / sizeof(T); // NOLINT(bugprone-sizeof-expression) // Invariants check WALBERLA_ASSERT_LESS_EQUAL( cur_, end_); diff --git a/src/core/mpi/SendBuffer.h b/src/core/mpi/SendBuffer.h index 3fac958a74fec25adb8cb4396845f8a184a4b7eb..f167a4459f5aadb411b30f891bc5bff6b010a41f 100644 --- a/src/core/mpi/SendBuffer.h +++ b/src/core/mpi/SendBuffer.h @@ -449,7 +449,7 @@ 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) ; + size_t count = sizeof(V) / sizeof(T); // NOLINT(bugprone-sizeof-expression) const size_t rest = numeric_cast< size_t >( end_ - cur_ ); // Checking the size of the remaining memory diff --git a/src/core/timing/TimingNode.h b/src/core/timing/TimingNode.h index 0b6326e71096625d30ab69b2c850702473f7c04c..404feb7d5a2308e4f2131f111e0bc8ffd6e87998 100644 --- a/src/core/timing/TimingNode.h +++ b/src/core/timing/TimingNode.h @@ -97,8 +97,11 @@ TimingNode<TP>::TimingNode(const TimingNode<TP>& tn) template< typename TP > // Timing policy TimingNode<TP>& TimingNode<TP>::operator=(const TimingNode<TP>& tn) { - TimingNode<TP> tmp (tn); - tmp.swap(*this); + if (&tn != this) + { + TimingNode<TP> tmp (tn); + tmp.swap(*this); + } return *this; } diff --git a/src/core/timing/TimingTree.h b/src/core/timing/TimingTree.h index 5cf06167e00875f9ead6300ac7f1750d4f9f376a..5584b2be3ca6b6a121b329c01d812d3aece55b55 100644 --- a/src/core/timing/TimingTree.h +++ b/src/core/timing/TimingTree.h @@ -128,8 +128,11 @@ TimingTree<TP>::TimingTree(const TimingTree<TP>& tt) template< typename TP > // Timing policy TimingTree<TP>& TimingTree<TP>::operator=(const TimingTree<TP>& tt) { - TimingTree<TP> tmp (tt); - tmp.swap(*this); + if (&tt != this) + { + TimingTree<TP> tmp (tt); + tmp.swap(*this); + } return *this; } diff --git a/src/core/uid/UIDGenerators.h b/src/core/uid/UIDGenerators.h index 265beeaac89babc29eade08b85a6012157f5377d..3d715c9de807582197070fbc64ca87662b812cac 100644 --- a/src/core/uid/UIDGenerators.h +++ b/src/core/uid/UIDGenerators.h @@ -275,11 +275,11 @@ public: static uint_type firstUID() { return 1; } - static uint_type nextUID( const uint_type /*uid*/ ) { WALBERLA_ASSERT( false ); return 1; } + static uint_type nextUID( [[maybe_unused]] const uint_type uid ) { WALBERLA_ASSERT( false ); return 1; } - static uint_type toIndex( const uint_type uid ) { WALBERLA_ASSERT_EQUAL( uid, 1 ); return 0; } + static uint_type toIndex( [[maybe_unused]] const uint_type uid ) { WALBERLA_ASSERT_EQUAL( uid, 1 ); return 0; } - static uint_type toBitMask( const uint_type uid ) { WALBERLA_ASSERT_EQUAL( uid, 1 ); return 1; } + static uint_type toBitMask( [[maybe_unused]] const uint_type uid ) { WALBERLA_ASSERT_EQUAL( uid, 1 ); return 1; } static const char* getType() { static const char* const type = "singleton generator"; return type; } diff --git a/src/core/waLBerlaBuildInfo.in.cpp b/src/core/waLBerlaBuildInfo.in.cpp index 65fa8887d9c2dec1d6f6e81a3c3a4295f0c687af..29efeaa8fb012fb0417334602e2071d63eaba622 100644 --- a/src/core/waLBerlaBuildInfo.in.cpp +++ b/src/core/waLBerlaBuildInfo.in.cpp @@ -5,6 +5,7 @@ */ //====================================================================================================================== +#include "core/waLBerlaBuildInfo.h" namespace walberla { namespace core { diff --git a/src/domain_decomposition/IBlock.h b/src/domain_decomposition/IBlock.h index 42f73cd4a43c3b55326c991300ec21035c198487..a1641d5a5ac2d2297514fc9da429fe2faee7e5b2 100644 --- a/src/domain_decomposition/IBlock.h +++ b/src/domain_decomposition/IBlock.h @@ -100,8 +100,8 @@ public: template< typename U > const U* get() const { try { thr_(ptr_); } - catch ( U* ptr ) { return ptr; } - catch (...) {} + catch ( U* ptr ) { return ptr; } // NOLINT(misc-throw-by-value-catch-by-reference) + catch (...) {} // NOLINT(bugprone-empty-catch) #ifndef NDEBUG WALBERLA_ABORT( "BlockData access type violation! (The block data you added is of a different type than the block data you are trying to access!)" "\nThe original data type was: " << debug::demangle( typeInfo_ ) << @@ -135,8 +135,8 @@ public: template< typename U > bool isClassOrSubclassOf() const { try { thr_(ptr_); } - catch ( U* ) { return true; } - catch (...) {} + catch ( U* ) { return true; } // NOLINT(misc-throw-by-value-catch-by-reference) + catch (...) {} // NOLINT(bugprone-empty-catch) return false; } @@ -156,7 +156,9 @@ private: # pragma warning( disable : 4670 ) # pragma warning( disable : 4673 ) #endif //_MSC_VER - template< typename T > static void thrower( void* ptr ) { throw static_cast< T* >( ptr ); } + template< typename T > static void thrower( void* ptr ) { + throw static_cast< T* >( ptr ); // NOLINT(misc-throw-by-value-catch-by-reference) + } #ifdef _MSC_VER # pragma warning(pop) #endif //_MSC_VER diff --git a/src/field/adaptors/GhostLayerFieldAdaptor.h b/src/field/adaptors/GhostLayerFieldAdaptor.h index 13ac8f0e289b6bf5300ac70647816a44dbb034f1..e7e4d630a6ed1ea327de70709af98ad3588b3c03 100644 --- a/src/field/adaptors/GhostLayerFieldAdaptor.h +++ b/src/field/adaptors/GhostLayerFieldAdaptor.h @@ -302,7 +302,7 @@ typename GhostLayerFieldAdaptor<Functor,glD>::const_iterator GhostLayerFieldAdap template< typename Functor, uint_t glD > typename GhostLayerFieldAdaptor<Functor,glD>::const_iterator GhostLayerFieldAdaptor<Functor,glD>::beginGhostLayerOnlyXYZ( - stencil::Direction dir, cell_idx_t f ) const + stencil::Direction dir, cell_idx_t /*f*/ ) const { CellInterval ci; getGhostRegion(dir,ci); @@ -326,7 +326,7 @@ typename GhostLayerFieldAdaptor<Functor,glD>::const_iterator GhostLayerFieldAdap template< typename Functor, uint_t glD > typename GhostLayerFieldAdaptor<Functor,glD>::const_iterator GhostLayerFieldAdaptor<Functor,glD>::beginSliceBeforeGhostLayerXYZ( - stencil::Direction dir, cell_idx_t width, cell_idx_t f) const + stencil::Direction dir, cell_idx_t width, cell_idx_t /*f*/) const { CellInterval ci; getSliceBeforeGhostLayer(dir,ci,width); diff --git a/src/field/vtk/FlagFieldMapping.h b/src/field/vtk/FlagFieldMapping.h index 267cee26a392cdf6b652c05f2e6939f5aea22611..e9bfe963b3c577fc7758f595f514dd74fd6b01c0 100644 --- a/src/field/vtk/FlagFieldMapping.h +++ b/src/field/vtk/FlagFieldMapping.h @@ -94,12 +94,12 @@ public: protected: - void configure() { + void configure() override { WALBERLA_ASSERT_NOT_NULLPTR( this->block_ ); field_ = this->block_->template getData< FieldType >( fieldID_ ); } - TargetType evaluate( const cell_idx_t x, const cell_idx_t y, const cell_idx_t z, const cell_idx_t /*f*/ ) + TargetType evaluate( const cell_idx_t x, const cell_idx_t y, const cell_idx_t z, const cell_idx_t /*f*/ ) override { WALBERLA_ASSERT_NOT_NULLPTR( field_ ); if (field_->get(x,y,z) & mask_) { diff --git a/src/field/vtk/VTKWriter.h b/src/field/vtk/VTKWriter.h index 9b2232908b09766e9296c5529ff5dc205ae3a1d9..c9852b7f8bf034af797938161b75252b276f13db 100644 --- a/src/field/vtk/VTKWriter.h +++ b/src/field/vtk/VTKWriter.h @@ -126,13 +126,10 @@ protected: // common case that can be handled faster return numeric_cast<OutputType>( OutputTrait::get( field_->get(x,y,z,0), uint_c(f) ) ); } - else - { - const cell_idx_t fField = f / cell_idx_c( OutputTrait::F_SIZE ); - const cell_idx_t fType = f % cell_idx_c( OutputTrait::F_SIZE ); + const cell_idx_t fField = f / cell_idx_c( OutputTrait::F_SIZE ); + const cell_idx_t fType = f % cell_idx_c( OutputTrait::F_SIZE ); - return numeric_cast<OutputType>( OutputTrait::get( field_->get(x,y,z,fField), uint_c(fType) ) ); - } + return numeric_cast<OutputType>( OutputTrait::get( field_->get(x,y,z,fField), uint_c(fType) ) ); } const ConstBlockDataID bdid_; diff --git a/src/gather/CellGatherPackInfo.impl.h b/src/gather/CellGatherPackInfo.impl.h index 0ff0f32eaeee6778dfef72663148175619f4ac0c..1dc7e14c190f36cc3f3284b009fa44d3084687f8 100644 --- a/src/gather/CellGatherPackInfo.impl.h +++ b/src/gather/CellGatherPackInfo.impl.h @@ -100,7 +100,7 @@ void CellGatherPackInfo<Field_T,CC>::unpackData( mpi::RecvBuffer & buffer ) for( size_t i=0; i< nrPoints; ++i ) { receivedData.emplace_back(std::vector<real_t>(fieldSize+1)); //+1 because we also store t value as first entry - std::vector<real_t> & pointVec = receivedData[receivedData.size()-1]; + std::vector<real_t> & pointVec = receivedData.back(); uint_t t; real_t val; diff --git a/src/gather/CurveGatherPackInfo.impl.h b/src/gather/CurveGatherPackInfo.impl.h index 10d480015f911a61858c682f41613021a6a39178..5c61a90703f143d4ca35338f874c5b348932b849 100644 --- a/src/gather/CurveGatherPackInfo.impl.h +++ b/src/gather/CurveGatherPackInfo.impl.h @@ -186,7 +186,7 @@ void CurveGatherPackInfo<GlF,IP>::unpackData( mpi::RecvBuffer & buffer ) for( size_t i=0; i< nrPoints; ++i ) { receivedData.emplace_back(std::vector<real_t>(fieldSize+1)); //+1 because we also store t value as first entry - std::vector<real_t> & pointVec = receivedData[receivedData.size()-1]; + std::vector<real_t> & pointVec = receivedData.back(); real_t t; real_t val; diff --git a/src/geometry/initializer/BoundarySetterFlagFieldSpecialization.h b/src/geometry/initializer/BoundarySetterFlagFieldSpecialization.h index e154678f0afb0392184d144a8ebe98389cf6bde4..dd5a376ee4649ed4c01a388902c624a23664afc8 100644 --- a/src/geometry/initializer/BoundarySetterFlagFieldSpecialization.h +++ b/src/geometry/initializer/BoundarySetterFlagFieldSpecialization.h @@ -109,13 +109,13 @@ namespace initializer { } template<typename Flag_T> - void BoundarySetter<FlagField<Flag_T> >::setBoundaryConfigBlock( const BoundaryUID & boundaryUID, const Config::BlockHandle & blockHandle ) + void BoundarySetter<FlagField<Flag_T> >::setBoundaryConfigBlock( [[maybe_unused]] const BoundaryUID & boundaryUID, [[maybe_unused]] const Config::BlockHandle & blockHandle ) { WALBERLA_ABORT("Passed boundary information to an initializer that sets up a pure flag field only"); } template<typename Flag_T> - void BoundarySetter<FlagField<Flag_T>>::setBoundaryConfig( const BoundaryUID & boundaryUID, const shared_ptr<BoundaryConfiguration> & conf ) + void BoundarySetter<FlagField<Flag_T>>::setBoundaryConfig( [[maybe_unused]] const BoundaryUID & boundaryUID, [[maybe_unused]] const shared_ptr<BoundaryConfiguration> & conf ) { WALBERLA_ABORT("Passed boundary information to an initializer that sets up a pure flag field only"); } diff --git a/src/geometry/initializer/ScalarFieldFromBody.impl.h b/src/geometry/initializer/ScalarFieldFromBody.impl.h index 7c96eea77189949df6c8e6b3c3f92491406eab27..95ade01e0dc2a71abb82aa07a964484f4c9883e6 100644 --- a/src/geometry/initializer/ScalarFieldFromBody.impl.h +++ b/src/geometry/initializer/ScalarFieldFromBody.impl.h @@ -32,6 +32,8 @@ #include "core/mpi/Reduce.h" #include "core/stringToNum.h" +#include <utility> + namespace walberla { namespace geometry { @@ -60,7 +62,7 @@ namespace initializer { addOrSet = false; auto id = subBlock.getParameter< std::vector<BlockDataID>::size_type > ( "id", 0 ); - std::string shape = subBlock.getParameter< std::string > ( "shape" ); + std::ignore = subBlock.getParameter< std::string > ( "shape" ); std::string expression = subBlock.getParameter< std::string > ( "value" ); try diff --git a/src/gpu/DeviceWrapper.h b/src/gpu/DeviceWrapper.h index 3bdf1be008dbe166565e1f131020f7bb3e53714d..b5270a57c52b9b52092e74340cd185e358a9e00c 100644 --- a/src/gpu/DeviceWrapper.h +++ b/src/gpu/DeviceWrapper.h @@ -66,10 +66,12 @@ namespace gpustubs { "available and shouldn't be called!"); #ifndef __CUDACC__ + //NOLINTBEGIN(bugprone-reserved-identifier) #define __device__ #define __global__ #define __host__ #define __forceinline__ + //NOLINTEND(bugprone-reserved-identifier) #endif using gpuError_t = int; diff --git a/src/lbm/boundary/ParserUBB.h b/src/lbm/boundary/ParserUBB.h index 2a4d8e0876014ff4008ef75ebfc5d81826fbcb6b..8559af959fd29f619b3d2284b8a7453de9fa1db9 100644 --- a/src/lbm/boundary/ParserUBB.h +++ b/src/lbm/boundary/ParserUBB.h @@ -220,19 +220,19 @@ template< typename LatticeModel_T, typename flag_t, bool AdaptVelocityToExternal inline ParserUBB<LatticeModel_T, flag_t, AdaptVelocityToExternalForce, StoreForce>::Parser::Parser( const std::array< std::string, 3 > & equations ) : parsers_(), equations_( equations ), timeDependent_( false ) { - if( equations_[0].length() > 0 ) + if( not equations_[0].empty() ) { parsers_[0].parse( equations_[0] ); if( parsers_[0].symbolExists( "t" ) ) timeDependent_ = true; } - if( equations_[1].length() > 0 ) + if( not equations_[1].empty() ) { parsers_[1].parse( equations_[1] ); if( parsers_[1].symbolExists( "t" ) ) timeDependent_ = true; } - if( equations_[2].length() > 0 ) + if( not equations_[2].empty() ) { parsers_[2].parse( equations_[2] ); if( parsers_[2].symbolExists( "t" ) ) diff --git a/src/lbm/free_surface/boundary/FreeSurfaceBoundaryHandling.impl.h b/src/lbm/free_surface/boundary/FreeSurfaceBoundaryHandling.impl.h index 7a498511ecc060424680d800ab5761013c46bd16..d9bd6420e2035bc5f997a854ac60a96c12aa9efd 100644 --- a/src/lbm/free_surface/boundary/FreeSurfaceBoundaryHandling.impl.h +++ b/src/lbm/free_surface/boundary/FreeSurfaceBoundaryHandling.impl.h @@ -59,6 +59,8 @@ class BoundaryBlockDataHandling : boundary_(boundary) {} + ~BoundaryBlockDataHandling() override = default; + // initialize standard waLBerla boundary handling BoundaryHandling_T* initialize(IBlock* const block) override { diff --git a/src/lbm/free_surface/surface_geometry/CurvatureSweep.impl.h b/src/lbm/free_surface/surface_geometry/CurvatureSweep.impl.h index f6d46d10334e86a23e20593a06de5af1b37e5b2b..1e279596befa20302cfce7bcc4ca97d795a168a7 100644 --- a/src/lbm/free_surface/surface_geometry/CurvatureSweep.impl.h +++ b/src/lbm/free_surface/surface_geometry/CurvatureSweep.impl.h @@ -327,8 +327,8 @@ void CurvatureSweepLocalTriangulation< Stencil_T, FlagField_T, ScalarField_T, Ve { const real_t diff = nIt1->dist2 - nIt2->dist2; - if (diff < real_c(1e-4)) { nIt1->valid = nIt1->wall ? true : false; } - if (diff > real_c(-1e-4)) { nIt2->valid = nIt2->wall ? true : false; } + if (diff < real_c(1e-4)) { nIt1->valid = nIt1->wall; } + if (diff > real_c(-1e-4)) { nIt2->valid = nIt2->wall; } } } } diff --git a/src/lbm/vtk/QCriterion.h b/src/lbm/vtk/QCriterion.h index 946f8f7e0efd8e8cb2079885efde6d0d798cf061..5675c65db614bba4b97386084413d933dd7211d9 100644 --- a/src/lbm/vtk/QCriterion.h +++ b/src/lbm/vtk/QCriterion.h @@ -38,7 +38,7 @@ class QCriterionVTKWriter : public vtk::BlockCellDataWriter< OutputType, 1 > public: QCriterionVTKWriter(const shared_ptr<StructuredBlockStorage> blockStorage, Filter_T & filter, const ConstBlockDataID & velocityFieldId, const std::string & id ) : - vtk::BlockCellDataWriter< OutputType, 1 >(id), blockStorage_(blockStorage), filter_(filter), velocityFieldId_(velocityFieldId), velocityField_(NULL) {} + vtk::BlockCellDataWriter< OutputType, 1 >(id), blockStorage_(blockStorage), filter_(filter), velocityFieldId_(velocityFieldId), velocityField_(nullptr) {} protected: diff --git a/src/lbm_mesapd_coupling/overlapping/shapes/BoxWithOverlap.h b/src/lbm_mesapd_coupling/overlapping/shapes/BoxWithOverlap.h index 9f6e52359289d312c7b2321e2036d272f04de850..8ad69fceef274eb16a6489b6ef8d0b0bb4de4366 100644 --- a/src/lbm_mesapd_coupling/overlapping/shapes/BoxWithOverlap.h +++ b/src/lbm_mesapd_coupling/overlapping/shapes/BoxWithOverlap.h @@ -46,6 +46,8 @@ class BoxWithOverlap : public geometry::AbstractBody : idx_(idx), ac_(ac), box_(box) {} + ~BoxWithOverlap() override = default; + bool contains(const Vector3< real_t >& point) const override { return mesa_pd::isPointInsideBoxBF(mesa_pd::transformPositionFromWFtoBF(idx_, ac_, point), box_.getEdgeLength()); diff --git a/src/lbm_mesapd_coupling/overlapping/shapes/CylindricalBoundaryWithOverlap.h b/src/lbm_mesapd_coupling/overlapping/shapes/CylindricalBoundaryWithOverlap.h index de42d00505e89f8fb4d03af056177e08c49b0d41..f6f5d597c968ce180ced0c0bdfbc3f4924d632cc 100644 --- a/src/lbm_mesapd_coupling/overlapping/shapes/CylindricalBoundaryWithOverlap.h +++ b/src/lbm_mesapd_coupling/overlapping/shapes/CylindricalBoundaryWithOverlap.h @@ -47,6 +47,8 @@ class CylindricalBoundaryWithOverlap : public geometry::AbstractBody : idx_(idx), ac_(ac), cylindricalBoundary_(cylindricalBoundary) {} + ~CylindricalBoundaryWithOverlap() override = default; + bool contains(const Vector3< real_t >& point) const override { return mesa_pd::isPointInsideCylindricalBoundary(point, ac_->getPosition(idx_), cylindricalBoundary_.getRadius(), diff --git a/src/lbm_mesapd_coupling/overlapping/shapes/EllipsoidWithOverlap.h b/src/lbm_mesapd_coupling/overlapping/shapes/EllipsoidWithOverlap.h index 0430419ab8cb9e3eb57461e8861eddac3f682641..295021fe0ee887c9f35204fe91626b2a52bf9e20 100644 --- a/src/lbm_mesapd_coupling/overlapping/shapes/EllipsoidWithOverlap.h +++ b/src/lbm_mesapd_coupling/overlapping/shapes/EllipsoidWithOverlap.h @@ -46,6 +46,8 @@ class EllipsoidWithOverlap : public geometry::AbstractBody : idx_(idx), ac_(ac), ellipsoid_(ellipsoid) {} + ~EllipsoidWithOverlap() override = default; + bool contains(const Vector3< real_t >& point) const override { return mesa_pd::isPointInsideEllipsoidBF(mesa_pd::transformPositionFromWFtoBF(idx_, ac_, point), diff --git a/src/lbm_mesapd_coupling/overlapping/shapes/HalfSpaceWithOverlap.h b/src/lbm_mesapd_coupling/overlapping/shapes/HalfSpaceWithOverlap.h index 3cc6ce13df37d6ef4a44b753c4439851fcc32a9e..555e515991ae750252e15f76e03b1f9984a38392 100644 --- a/src/lbm_mesapd_coupling/overlapping/shapes/HalfSpaceWithOverlap.h +++ b/src/lbm_mesapd_coupling/overlapping/shapes/HalfSpaceWithOverlap.h @@ -46,6 +46,8 @@ class HalfSpaceWithOverlap : public geometry::AbstractBody : idx_(idx), ac_(ac), halfSpace_(halfSpace) {} + ~HalfSpaceWithOverlap() override = default; + bool contains(const Vector3< real_t >& point) const override { return mesa_pd::isPointInsideHalfSpace(point, ac_->getPosition(idx_), halfSpace_.getNormal()); diff --git a/src/lbm_mesapd_coupling/overlapping/shapes/SphereWithOverlap.h b/src/lbm_mesapd_coupling/overlapping/shapes/SphereWithOverlap.h index 84a0db6f05d674db8be17688a2840ba30a689fcf..ad80bdc009acfd4d61699deb4fe6c5fc339d23a5 100644 --- a/src/lbm_mesapd_coupling/overlapping/shapes/SphereWithOverlap.h +++ b/src/lbm_mesapd_coupling/overlapping/shapes/SphereWithOverlap.h @@ -45,6 +45,8 @@ class SphereWithOverlap : public geometry::AbstractBody : idx_(idx), ac_(ac), sphere_(sphere) {} + ~SphereWithOverlap() override = default; + bool contains(const Vector3< real_t >& point) const override { return mesa_pd::isPointInsideSphere(point, ac_->getPosition(idx_), sphere_.getRadius()); diff --git a/src/mesa_pd/vtk/ParticleVtkOutput.cpp b/src/mesa_pd/vtk/ParticleVtkOutput.cpp index 6093eeb30cce7c8fafa526c0c8d52608ae7c41e7..9731e1e68fcc0d9e9b6003f18e1babe689eb2734 100644 --- a/src/mesa_pd/vtk/ParticleVtkOutput.cpp +++ b/src/mesa_pd/vtk/ParticleVtkOutput.cpp @@ -27,6 +27,7 @@ namespace vtk { std::vector< ParticleVtkOutput::Attributes > ParticleVtkOutput::getAttributes() const { std::vector< Attributes > attributes; + attributes.reserve(selectors_.size()); for (const auto& s : selectors_) { attributes.emplace_back( s.second->type_string, s.first, s.second->components ); diff --git a/src/pe/Types.h b/src/pe/Types.h index 463aab78893043c1503bc491b6df181a81fab251..7e45fff691f71fc7c4029709bc434fb18f7d3657 100644 --- a/src/pe/Types.h +++ b/src/pe/Types.h @@ -27,6 +27,7 @@ #include <array> #include <memory> +#include <utility> #include <vector> namespace walberla{ diff --git a/src/pe/raytracing/Raytracer.h b/src/pe/raytracing/Raytracer.h index ed4c6c864bdb3f8fc2d80170dd113bafa3c9d681..ad26fb238d29debb866cc3a9684c5471b8a8021b 100644 --- a/src/pe/raytracing/Raytracer.h +++ b/src/pe/raytracing/Raytracer.h @@ -614,7 +614,7 @@ void Raytracer::generateImage(const size_t timestep, WcTimingTree* tt) { WALBERLA_LOG_WARNING(pixelErrors << " pixel errors found!"); std::stringstream ss; - for (auto it: correctToIncorrectBodyIDsMap) { + for (auto const &it: correctToIncorrectBodyIDsMap) { const BodyID correctBody = it.first; if (it.first != nullptr) { ss << " correct body: " << correctBody->getID() << "(" << correctBody->getHash() << ")"; diff --git a/src/pe/rigidbody/RigidBodyCastIterator.h b/src/pe/rigidbody/RigidBodyCastIterator.h index 3486472b4e501d577edd594b784fbf28d1061b3b..6f3bda568c3a1c28d47c453c67a510c28a19c225 100644 --- a/src/pe/rigidbody/RigidBodyCastIterator.h +++ b/src/pe/rigidbody/RigidBodyCastIterator.h @@ -80,7 +80,7 @@ public: //**Access operators**************************************************************************** /*!\name Access operators */ //@{ - inline reference operator*() {return static_cast<reference>( *(cur_->get()) );} + inline reference operator*() {return static_cast<reference>( **cur_ );} inline pointer operator->() {return static_cast<pointer>( cur_->get() );} //@} //********************************************************************************************** @@ -228,7 +228,7 @@ public: //**Access operators**************************************************************************** /*!\name Access operators */ //@{ - inline reference operator*() {return static_cast<reference>( *(cur_->get()) );} + inline reference operator*() {return static_cast<reference>( **cur_ );} inline pointer operator->() {return static_cast<pointer>( cur_->get() );} //@} //********************************************************************************************** diff --git a/src/python_coupling/export/FieldExport.impl.h b/src/python_coupling/export/FieldExport.impl.h index 3cff65b036969b0a00b8e505c4ea9db9bb8e661f..6d9916c71acfed3519155d2353ddd3a8aec0d937 100644 --- a/src/python_coupling/export/FieldExport.impl.h +++ b/src/python_coupling/export/FieldExport.impl.h @@ -129,6 +129,8 @@ class GhostLayerFieldDataHandling : public field::BlockDataHandling< GhostLayerF alignment_(alignment) {} + ~GhostLayerFieldDataHandling() override = default; + GhostLayerField_T* allocate(IBlock* const block) override { auto blocks = blocks_.lock(); diff --git a/src/stencil/Directions.h b/src/stencil/Directions.h index 5be0d72223712c7cc8f4aa2b991bb9456f09aadb..9071405a2604c49980a3734ba592b3427f70fb90 100644 --- a/src/stencil/Directions.h +++ b/src/stencil/Directions.h @@ -317,7 +317,7 @@ namespace stencil { else if ( axis==1 && !minOrMax ) return N; else if ( axis==2 && minOrMax ) return B; else if ( axis==2 && !minOrMax ) return T; - else return INVALID_DIR; + return INVALID_DIR; } /// Maps (direction,axis) pair to direction @@ -333,7 +333,7 @@ namespace stencil { else if ( axis==1 && !minOrMax ) return N; else if ( axis==2 && minOrMax ) return B; else if ( axis==2 && !minOrMax ) return T; - else return INVALID_DIR; + return INVALID_DIR; } diff --git a/src/vtk/Base64Writer.h b/src/vtk/Base64Writer.h index 43631d2a924381ecbe9a6c14c5ca4de2af349cb4..c9af5528e15ecef564e64419de622745e57228c6 100644 --- a/src/vtk/Base64Writer.h +++ b/src/vtk/Base64Writer.h @@ -75,7 +75,7 @@ public: private: - void encodeblock( unsigned char in[3], unsigned char out[4], int len ) + void encodeblock( unsigned char const in[3], unsigned char out[4], int len ) { static const unsigned char cb64[]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; diff --git a/src/vtk/VTKOutput.cpp b/src/vtk/VTKOutput.cpp index eb66d3970ba811ea258c44fd67a081a814fe2109..1039abe54e946409f8d692b4933e36fda6237f8f 100644 --- a/src/vtk/VTKOutput.cpp +++ b/src/vtk/VTKOutput.cpp @@ -1882,7 +1882,7 @@ void VTKOutput::writeVTHBSeries() { for( std::string line; std::getline(ofs, line); ) { - if( line.find("]") != std::string::npos ) + if( line.find(']') != std::string::npos ) { WALBERLA_ASSERT_GREATER( ofs.tellg(), 0 ); pvdEnd_ = ofs.tellg(); diff --git a/tests/field/FieldOfCustomTypesTest.cpp b/tests/field/FieldOfCustomTypesTest.cpp index 883d7951059cc3fe435fe53725089a4bf1c1e08f..4a7144a4763811433962f4bd64c215e533c6cd49 100644 --- a/tests/field/FieldOfCustomTypesTest.cpp +++ b/tests/field/FieldOfCustomTypesTest.cpp @@ -31,12 +31,6 @@ using namespace walberla; -using std::cout; -using std::endl; - - - - struct MyClass { MyClass() { diff --git a/tests/field/FlagFieldTest.cpp b/tests/field/FlagFieldTest.cpp index 97b9d382ee34b5bfd732756b893faf298eb4de70..4e91c68b1e7cf8feb52ad53613368b644e3e0f12 100644 --- a/tests/field/FlagFieldTest.cpp +++ b/tests/field/FlagFieldTest.cpp @@ -33,10 +33,6 @@ using namespace walberla; namespace wlb = walberla; -using std::vector; -using std::string; -using std::cout; -using std::endl; void registerTest() { @@ -64,7 +60,7 @@ void registerTest() } WALBERLA_CHECK(overFlow); - vector<string> names; + std::vector<std::string> names; names.emplace_back("Flag1"); names.emplace_back("Flag2"); names.emplace_back("Flag3"); @@ -82,7 +78,7 @@ void registerTest() WALBERLA_CHECK_EQUAL( ff.getFlagUID( numeric_cast<FlagField<walberla::uint8_t>::flag_t>( 1 << i ) ), FlagUID(names[i]) ); } - //ff.printRegistered(cout); + //ff.printRegistered(std::cout); } void accessTest() @@ -167,7 +163,7 @@ void printingTest() ff.addFlag(0,1,0,ob); ff.addFlag(1,0,0,ob); - //printSlice( cout,ff, 2,0 ); + //printSlice( std::cout,ff, 2,0 ); } void neighborhoodTest() diff --git a/tests/lbm/evaluations/PermeabilityTest.cpp b/tests/lbm/evaluations/PermeabilityTest.cpp index 2cc1fffafc70721dee63b0143e588542e663dcf0..887c524f329ca54a61e56eab951029faee63192b 100644 --- a/tests/lbm/evaluations/PermeabilityTest.cpp +++ b/tests/lbm/evaluations/PermeabilityTest.cpp @@ -284,8 +284,6 @@ int main( int argc, char ** argv ) else WALBERLA_ABORT( "This app can only be executed with 1, 4, or 8 processes! Aborting ..." ); - std::string collisionModel( "TRT" ); - try { if( std::strcmp( setup.collisionModel.c_str(), "SRT" ) == 0 ) return setupAndExecute< lbm::D3Q19< lbm::collision_model::SRT , false > >( setup ); diff --git a/tests/pe/MinMaxRefinement.cpp b/tests/pe/MinMaxRefinement.cpp index 6cd56cb0962c8a210c7453ef00ccaf0572c5220a..35c75825bedadaf4b670c6315bd13126faeb24ff 100644 --- a/tests/pe/MinMaxRefinement.cpp +++ b/tests/pe/MinMaxRefinement.cpp @@ -109,14 +109,14 @@ int main( int argc, char ** argv ) blockforest.setRefreshPhantomBlockMigrationPreparationFunction( blockforest::DynamicCurveBalance< blockforest::WeightAssignmentFunctor::PhantomBlockWeight >( false, true, false ) ); - createSphere(*globalStorage.get(), forest->getBlockStorage(), storageID, 0, Vec3(1,1,1), 1); - createSphere(*globalStorage.get(), forest->getBlockStorage(), storageID, 0, Vec3(1,1,3), 1); - createSphere(*globalStorage.get(), forest->getBlockStorage(), storageID, 0, Vec3(1,3,1), 1); - createSphere(*globalStorage.get(), forest->getBlockStorage(), storageID, 0, Vec3(1,3,3), 1); - createSphere(*globalStorage.get(), forest->getBlockStorage(), storageID, 0, Vec3(3,1,1), 1); - createSphere(*globalStorage.get(), forest->getBlockStorage(), storageID, 0, Vec3(3,1,3), 1); - createSphere(*globalStorage.get(), forest->getBlockStorage(), storageID, 0, Vec3(3,3,1), 1); - createSphere(*globalStorage.get(), forest->getBlockStorage(), storageID, 0, Vec3(3,3,3), 1); + createSphere(*globalStorage, forest->getBlockStorage(), storageID, 0, Vec3(1,1,1), 1); + createSphere(*globalStorage, forest->getBlockStorage(), storageID, 0, Vec3(1,1,3), 1); + createSphere(*globalStorage, forest->getBlockStorage(), storageID, 0, Vec3(1,3,1), 1); + createSphere(*globalStorage, forest->getBlockStorage(), storageID, 0, Vec3(1,3,3), 1); + createSphere(*globalStorage, forest->getBlockStorage(), storageID, 0, Vec3(3,1,1), 1); + createSphere(*globalStorage, forest->getBlockStorage(), storageID, 0, Vec3(3,1,3), 1); + createSphere(*globalStorage, forest->getBlockStorage(), storageID, 0, Vec3(3,3,1), 1); + createSphere(*globalStorage, forest->getBlockStorage(), storageID, 0, Vec3(3,3,3), 1); WALBERLA_MPI_BARRIER(); WALBERLA_LOG_DEVEL_ON_ROOT( "Refinement 1" ); @@ -152,7 +152,7 @@ int main( int argc, char ** argv ) for (unsigned int i = 0; i < 30; ++i) { - createSphere(*globalStorage.get(), forest->getBlockStorage(), storageID, 0, Vec3(real_t(2.1), real_t(2.1), real_t(2.1)), 1); + createSphere(*globalStorage, forest->getBlockStorage(), storageID, 0, Vec3(real_t(2.1), real_t(2.1), real_t(2.1)), 1); } WALBERLA_MPI_BARRIER(); diff --git a/tests/pe/Refinement.cpp b/tests/pe/Refinement.cpp index 96900a6251fc8972f2ec382cbf98c4311c00eea9..5a8ab40adff62e13f02d81839df4685ad9d63d46 100644 --- a/tests/pe/Refinement.cpp +++ b/tests/pe/Refinement.cpp @@ -164,8 +164,8 @@ int main( int argc, char ** argv ) blockforest.setRefreshPhantomBlockMigrationPreparationFunction( simpleLB ); - createSphere(*globalStorage.get(), forest->getBlockStorage(), storageID, 0, Vec3(5,5,5), 1); - createSphere(*globalStorage.get(), forest->getBlockStorage(), storageID, 0, Vec3(15,6,6), 1); + createSphere(*globalStorage, forest->getBlockStorage(), storageID, 0, Vec3(5,5,5), 1); + createSphere(*globalStorage, forest->getBlockStorage(), storageID, 0, Vec3(15,6,6), 1); SweepTimeloop timeloop( forest->getBlockStorage(), 1 ); timeloop.addFuncBeforeTimeStep( simpleLB, "refreshFunctorName" ); diff --git a/tests/pe/SyncEquivalence.cpp b/tests/pe/SyncEquivalence.cpp index 6c03180186aaf7f4bb42e26bc7930414269ee6c9..1ad70b8322fa2501e87ebc061ff35575d13550e2 100644 --- a/tests/pe/SyncEquivalence.cpp +++ b/tests/pe/SyncEquivalence.cpp @@ -122,7 +122,7 @@ void createSimulation(math::AABB& simulationDomain, IBlock & currentBlock = *blkIt; for (auto it = grid_generator::HCPIterator(currentBlock.getAABB(), Vector3<real_t>(-5,-5,-5), spacing); it != grid_generator::HCPIterator(); ++it) { - SphereID sp = pe::createSphere( *(info.globalBodyStorage.get()), info.forest->getBlockStorage(), info.storageID, static_cast<walberla::id_t>(mpi::MPIManager::instance()->worldRank() * 1000000 + numParticles), *it, radius); + SphereID sp = pe::createSphere( *info.globalBodyStorage, info.forest->getBlockStorage(), info.storageID, static_cast<walberla::id_t>(mpi::MPIManager::instance()->worldRank()) * 1000000u + static_cast<walberla::id_t>(numParticles), *it, radius); Vec3 rndVel(math::realRandom<real_t>(-vMax, vMax, generator), math::realRandom<real_t>(-vMax, vMax, generator), math::realRandom<real_t>(-vMax, vMax, generator)); if (sp != nullptr) sp->setLinearVel(rndVel); if (sp != nullptr) ++numParticles; diff --git a/tests/postprocessing/SphereTriangulate.cpp b/tests/postprocessing/SphereTriangulate.cpp index 325f0ad449a2752c76ab4eff9ef94fea3d4d8267..b74985465fa0d1aeef787a0bfc241b8cc8794672 100644 --- a/tests/postprocessing/SphereTriangulate.cpp +++ b/tests/postprocessing/SphereTriangulate.cpp @@ -38,10 +38,6 @@ using namespace postprocessing; using geometry::TriangleMesh; -using std::cout; -using std::endl; -using std::ofstream; - typedef GhostLayerField<real_t,1> ScalarField; @@ -106,7 +102,7 @@ void singleField() TriangleMesh m; generateIsoSurface(f,0.5,m); - //ofstream file ("out.obj"); + //std::ofstream file ("out.obj"); //writeMeshObj(file,m); } @@ -143,11 +139,11 @@ void multipleFields() generateIsoSurface( **i, real_c(0.5), m, Vector3<real_t>(real_t(1)), uint_t(0), offset ); } - //ofstream file1("meshWithDoubles.obj"); + //std::ofstream file1("meshWithDoubles.obj"); //writeMeshObj(file1,m); size_t verticesRemoved = m.removeDuplicateVertices(); WALBERLA_CHECK_EQUAL(verticesRemoved, expectedDoubles); - //ofstream file2("meshWithoutDoubles.obj"); + //std::ofstream file2("meshWithoutDoubles.obj"); //writeMeshObj(file2,m); } diff --git a/tests/simd/SIMD_Equivalence.cpp b/tests/simd/SIMD_Equivalence.cpp index f90c69f4f119b571740da1ac6b97657ea1e7c6cc..9a86ae0de3974d1d7bb662fcf4245bddc4610cd1 100644 --- a/tests/simd/SIMD_Equivalence.cpp +++ b/tests/simd/SIMD_Equivalence.cpp @@ -166,7 +166,7 @@ void print1( const is1::double4_t& vec) void checkVecEqual ( is0::double4_t a, is1::double4_t b, const std::string & description = "" ) { - if ( description.size() > 0) + if ( not description.empty() ) { double meanError = std::abs( is0::getComponent(a, 0 )- is1::getComponent(b,0 ) ) + std::abs( is0::getComponent(a, 1 )- is1::getComponent(b,1 ) ) + diff --git a/tests/stencil/StencilTest.cpp b/tests/stencil/StencilTest.cpp index 2e282ac625e85c53c1f4edb00c71ed0f67393d7a..3ddee03e389d8a36d8e9647acfb6746a66742045 100644 --- a/tests/stencil/StencilTest.cpp +++ b/tests/stencil/StencilTest.cpp @@ -19,9 +19,6 @@ using namespace walberla; using namespace stencil; -using std::cout; -using std::endl; - template <typename S> void stencilIteration()