diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2491deed6600e90b3754b597e03f9fdb3dd2fea1..c2f2659e1e26fe5c06409bae7638f9dd71e61080 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -99,6 +99,37 @@ gcc_9_rebuild: paths: - $CI_PROJECT_DIR/cache + +############################################################################### +gcc_9_cpu_warning_like_errors: + stage: build + + image: irmb/virtualfluids-deps-ubuntu20.04 + + tags: + - gpu + - linux + + before_script: + - export CCACHE_BASEDIR=$CI_PROJECT_DIR + - export CCACHE_DIR=$CI_PROJECT_DIR/cache + - ccache -s + + script: + - mkdir -p $CI_PROJECT_DIR/build + - cd $CI_PROJECT_DIR/build + - rm -r -f ./* + - cmake .. + --preset=cpu_make_ccache + -DBUILD_WARNINGS_AS_ERRORS=ON + - make -j4 + - ccache -s + + cache: + key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG" + paths: + - $CI_PROJECT_DIR/cache + ############################################################################### msvc_16: stage: build diff --git a/3rdParty/googletest/CMakeLists.txt b/3rdParty/googletest/CMakeLists.txt index acc5fb1ed8d37bcc89e9e60aceb28c7400e7cfca..781b60be44fc76ec640fea0444a527c10125e141 100644 --- a/3rdParty/googletest/CMakeLists.txt +++ b/3rdParty/googletest/CMakeLists.txt @@ -1,7 +1,7 @@ # Note: CMake support is community-based. The maintainers do not use CMake # internally. -cmake_minimum_required(VERSION 2.8.8) +cmake_minimum_required(VERSION 2.8.12) if (POLICY CMP0048) cmake_policy(SET CMP0048 NEW) diff --git a/3rdParty/googletest/googlemock/CMakeLists.txt b/3rdParty/googletest/googlemock/CMakeLists.txt index d32b70b5be0e0ae74f5376fb03a2226065ad599a..63cd3c61441ee2ba9177b6b366c069013b0ff4ad 100644 --- a/3rdParty/googletest/googlemock/CMakeLists.txt +++ b/3rdParty/googletest/googlemock/CMakeLists.txt @@ -42,7 +42,7 @@ else() cmake_policy(SET CMP0048 NEW) project(gmock VERSION ${GOOGLETEST_VERSION} LANGUAGES CXX C) endif() -cmake_minimum_required(VERSION 2.6.4) +cmake_minimum_required(VERSION 2.8.12) if (COMMAND set_up_hermetic_build) set_up_hermetic_build() diff --git a/3rdParty/googletest/googletest/CMakeLists.txt b/3rdParty/googletest/googletest/CMakeLists.txt index db292946a59453e09929229c1fbdb3701f2bd6ab..0ef01d22e7216988d86f728a27309d6494e36b1c 100644 --- a/3rdParty/googletest/googletest/CMakeLists.txt +++ b/3rdParty/googletest/googletest/CMakeLists.txt @@ -53,7 +53,7 @@ else() cmake_policy(SET CMP0048 NEW) project(gtest VERSION ${GOOGLETEST_VERSION} LANGUAGES CXX C) endif() -cmake_minimum_required(VERSION 2.6.4) +cmake_minimum_required(VERSION 2.8.12) if (POLICY CMP0063) # Visibility cmake_policy(SET CMP0063 NEW) diff --git a/3rdParty/metis/metis-5.1.1/GKlib/GKlibSystem.cmake b/3rdParty/metis/metis-5.1.1/GKlib/GKlibSystem.cmake index d83b2083c176a3addb3ddb951fd0e44923b18aa6..b8478c5d06fd5f7f1347ef8da75073a90fa5faa1 100644 --- a/3rdParty/metis/metis-5.1.1/GKlib/GKlibSystem.cmake +++ b/3rdParty/metis/metis-5.1.1/GKlib/GKlibSystem.cmake @@ -61,7 +61,9 @@ if(GDB) set(GKlib_COPTS "${GKlib_COPTS} -g") set(GKlib_COPTIONS "${GKlib_COPTIONS} -Werror") else() - set(GKlib_COPTS "-O3") + if(NOT MSVC) + set(GKlib_COPTS "-O3") + endif() endif(GDB) diff --git a/3rdParty/metis/metis-5.1.1/libmetis/CMakeLists.txt b/3rdParty/metis/metis-5.1.1/libmetis/CMakeLists.txt index 356afd750e7bd9aa19f536a6f31bbc29f85bf890..802241df51949274173b3f647cf6a54615947eb5 100644 --- a/3rdParty/metis/metis-5.1.1/libmetis/CMakeLists.txt +++ b/3rdParty/metis/metis-5.1.1/libmetis/CMakeLists.txt @@ -11,7 +11,7 @@ if(UNIX) endif() if(MSVC) - target_compile_options(metis PRIVATE "/w") + target_compile_options(metis PRIVATE "/W0") endif() if(METIS_INSTALL) diff --git a/CMake/compilerflags/AppleClang.cmake b/CMake/compilerflags/AppleClang.cmake index aecc48fa5398c6418c2d47f5af243659128050bc..c7130e5f40fa61a6011c8009b094611ed7f07ed0 100644 --- a/CMake/compilerflags/AppleClang.cmake +++ b/CMake/compilerflags/AppleClang.cmake @@ -16,7 +16,13 @@ list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-fPIC") # position indepe # warnings ############################################################################################################# list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wall") -list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wunreachable-code") +list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wextra") +list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-pedantic") + +if(BUILD_WARNINGS_AS_ERRORS) + list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS -Werror) +endif() list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wno-unused-function") +list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wno-unused-parameter") list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wno-reorder") diff --git a/CMake/compilerflags/Clang.cmake b/CMake/compilerflags/Clang.cmake index 434be42697165ea347b2c2728e9cf836b66650af..9a3de6c56007c26cb90ede287dc6b4fdfa9e2124 100644 --- a/CMake/compilerflags/Clang.cmake +++ b/CMake/compilerflags/Clang.cmake @@ -17,10 +17,19 @@ list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-fPIC") # position indepe # warnings ############################################################################################################# list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wall") +list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wextra") +list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-pedantic") + +if(BUILD_WARNINGS_AS_ERRORS) + list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS -Werror) +endif() + list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wno-unused-function") +list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wno-unused-parameter") list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wno-reorder-ctor") + ############################################################################################################# # linker options ############################################################################################################# diff --git a/CMake/compilerflags/GNU.cmake b/CMake/compilerflags/GNU.cmake index 211f2a040b9c6c71d632fbee8621377d1df63350..2953598d5ff80afa96e04dfe56b021aed8690534 100644 --- a/CMake/compilerflags/GNU.cmake +++ b/CMake/compilerflags/GNU.cmake @@ -26,10 +26,18 @@ endif() # warnings ############################################################################################################# list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wall") +list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wextra") +list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-pedantic") + +if(BUILD_WARNINGS_AS_ERRORS) + list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS -Werror) +endif() + list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wno-unused-function") +list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wno-unused-parameter") list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wno-reorder") -list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wno-sign-compare") list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wno-unknown-pragmas") +list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wno-cast-function-type") ############################################################################################################# # linker options diff --git a/CMake/compilerflags/Intel.cmake b/CMake/compilerflags/Intel.cmake index a53998d93eec146de6158d80bad2302536b2c252..90c73b157b4ef3ec77c4d236bbf698876189c069 100644 --- a/CMake/compilerflags/Intel.cmake +++ b/CMake/compilerflags/Intel.cmake @@ -3,14 +3,14 @@ ############################################################################################################# #LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-O") -#~ LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-wd654") -#~ LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-wd1125") #virtual function override intended -#~ LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-wd1224") #warning directive: This file includes at least one deprecated or antiquated header -#~ LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-wd377") #class "std::auto_ptr<RCF::I_ClientTransport>" has no suitable copy constructor -#~ LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-wd327") #class "std::auto_ptr<RCF::I_ClientTransport>" has no suitable copy constructor -#~ LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-wd327") #class "std::auto_ptr<RCF::I_ClientTransport>" has no suitable copy constructor -#~ -#~ LIST(APPEND CAB_COMPILER_ADDTIONAL_C_COMPILER_FLAGS "-wd266") #function "__GKfree" declared implicitly +#LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-wd654") +#LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-wd1125") #virtual function override intended +#LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-wd1224") #warning directive: This file includes at least one deprecated or antiquated header +#LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-wd377") #class "std::auto_ptr<RCF::I_ClientTransport>" has no suitable copy constructor +#LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-wd327") #class "std::auto_ptr<RCF::I_ClientTransport>" has no suitable copy constructor +#LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-wd327") #class "std::auto_ptr<RCF::I_ClientTransport>" has no suitable copy constructor +# +#LIST(APPEND CAB_COMPILER_ADDTIONAL_C_COMPILER_FLAGS "-wd266") #function "__GKfree" declared implicitly #LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-xHOST -O3 -ip -ipo -fno-alias -mcmodel=medium -qopt-streaming-stores=always") # all diff --git a/CMake/compilerflags/icc190.cmake b/CMake/compilerflags/icc190.cmake deleted file mode 100644 index 31c17961766ef74c7dde9e568c3db0399547381f..0000000000000000000000000000000000000000 --- a/CMake/compilerflags/icc190.cmake +++ /dev/null @@ -1,37 +0,0 @@ -############################################################################################################### -## -## intel190 -## -############################################################################################################### - -MACRO(SET_COMPILER_SPECIFIC_FLAGS_INTERN build_type use64BitOptions) - # auto_ptr warning from mu::Parser - LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-wd1478") - - # main intel compiler flags as CMake-list ("xx;yy;") - LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-xHOST;-O3;-ip;-fno-alias;-mcmodel=medium;-qopt-streaming-stores=always;-qopt-zmm-usage=high") - - #Debug - #LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-g -traceback") - - ############################################################################################################### - ## OpenMP support - ############################################################################################################### - IF(USE_OPENMP) - LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-qopenmp") - LIST(APPEND CAB_ADDITIONAL_LINK_FLAGS "-parallel") - ENDIF() - - ############################################################################################################### - ## mt support - ############################################################################################################### - #LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-pthread") - #LIST(APPEND CAB_COMPILER_ADDTIONAL_C_COMPILER_FLAGS "-pthread") - - ############################################################################################################# - # c++ 11 support - ############################################################################################################# - LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-std=c++11") - LIST(APPEND CAB_COMPILER_ADDTIONAL_C_COMPILER_FLAGS "-std=c++11") - -ENDMACRO(SET_COMPILER_SPECIFIC_FLAGS_INTERN build_type use64BitOptions) diff --git a/CMakeLists.txt b/CMakeLists.txt index cda26a182f11232d2ae72eb82bd99275c3cc5e15..8d743768918b108fcb5d68b6df89f01867c41c0c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,6 +51,7 @@ option(BUILD_VF_CPPCHECK "Add cppcheck to the targets" OFF) option(BUILD_VF_COVERAGE "Add the -coverage compiler flag." OFF) option(BUILD_SHARED_LIBS "" OFF) +option(BUILD_WARNINGS_AS_ERRORS "" OFF) # windows: use multi-threaded dynamically-linked runtime library if(BUILD_SHARED_LIBS) diff --git a/apps/cpu/sphere/sphere.cpp b/apps/cpu/sphere/sphere.cpp index f7f8481d11a14fb458dfde70d72ddd0bcf098276..e5647049cf0ebb6cf3e2a8606a77186e340d85f4 100644 --- a/apps/cpu/sphere/sphere.cpp +++ b/apps/cpu/sphere/sphere.cpp @@ -170,10 +170,6 @@ void run(string configname) SPtr<D3Q27Interactor> addWallYmaxInt(new D3Q27Interactor(addWallYmax, grid, slipBCAdapter, Interactor3D::SOLID)); SPtr<D3Q27Interactor> addWallZmaxInt(new D3Q27Interactor(addWallZmax, grid, slipBCAdapter, Interactor3D::SOLID)); - mu::Parser fct; - fct.SetExpr("U"); - fct.DefineConst("U", uLB); - //inflow SPtr<D3Q27Interactor> inflowInt = SPtr<D3Q27Interactor>(new D3Q27Interactor(geoInflow, grid, velBCAdapter, Interactor3D::SOLID)); diff --git a/src/basics/Core/StringUtilities/StringUtil.h b/src/basics/Core/StringUtilities/StringUtil.h index 5d458f7e4f3362fe5c10dc9ab5252266762d26f5..1927a69bc60bf2467fb09893463b3c9363191890 100644 --- a/src/basics/Core/StringUtilities/StringUtil.h +++ b/src/basics/Core/StringUtilities/StringUtil.h @@ -48,11 +48,11 @@ public: private: StringUtil() = default; - ; + StringUtil(const StringUtil &) = default; - ; + virtual ~StringUtil() = default; - ; + static bool toBool(bool &t, const std::string &input, std::ios_base &(*f)(std::ios_base &)); }; diff --git a/src/basics/basics/parallel/PbMpi.h b/src/basics/basics/parallel/PbMpi.h index 63470c2d82d35ccc22599fc3623e6e1d93354a1a..857ff7b1058b2a773a6b759bbd3dca8105db0a68 100644 --- a/src/basics/basics/parallel/PbMpi.h +++ b/src/basics/basics/parallel/PbMpi.h @@ -287,7 +287,7 @@ inline void sendStringVector(const std::vector<std::string> &v, int dest, int ta /*======================================================================*/ // send a vector of strings inline void receiveStringVector(std::vector<std::string> &v, int dest, int tag, PbMpi::Comm comm); -}; // namespace PbMpi +} // namespace PbMpi /*======================================================================*/ // send a single value of MPI_Datatype diff --git a/src/basics/basics/utilities/UbComparators.h b/src/basics/basics/utilities/UbComparators.h index bc507e456b9603d85d42f8597fe4748a135e51d2..d461e27cb8d5f6026f13b2aea363d563ebed5c5c 100644 --- a/src/basics/basics/utilities/UbComparators.h +++ b/src/basics/basics/utilities/UbComparators.h @@ -170,7 +170,7 @@ struct compareMember { // l.sort( compareConstMethods<Klasse, double, &Klasse::getVal1 >() ); //} -}; // namespace UbComparators +} // namespace UbComparators #endif // UBCOMPARATOR_H diff --git a/src/basics/basics/utilities/UbEqual.h b/src/basics/basics/utilities/UbEqual.h index b3ca9102d585faeac0b2a4e413434d4d0d759282..87955b181ea3efaad4b7f3d2ebc746271ec95bb7 100644 --- a/src/basics/basics/utilities/UbEqual.h +++ b/src/basics/basics/utilities/UbEqual.h @@ -259,7 +259,7 @@ inline bool isUbEqual(const T1 &a, const T2 &b) { using Low = typename UbEqualTrait<T1, T2>::Low; return specific_equal<Low, Low>(static_cast<Low>(a), static_cast<Low>(b)); -}; +} ////////////////////////////////////////////////////////////////////////// // UbEqual-Functor diff --git a/src/basics/basics/utilities/UbLogger.h b/src/basics/basics/utilities/UbLogger.h index d350a763721b4b5fc1c2736fa56e2fff66a3eee0..fc2b118715a0f4afc0251b8ed8e2373a7d488153 100644 --- a/src/basics/basics/utilities/UbLogger.h +++ b/src/basics/basics/utilities/UbLogger.h @@ -228,7 +228,7 @@ inline std::string UbLogger<OutputPolicy>::logTimeString() char buffer[11]; time_t t; time(&t); - tm r = { 0 }; + tm r; // = { 0 }; strftime(buffer, sizeof(buffer), "%X", localtime_r(&t, &r)); struct timeval tv; gettimeofday(&tv, 0); diff --git a/src/basics/basics/utilities/UbSystem.h b/src/basics/basics/utilities/UbSystem.h index 8e676811a152b176efd617a944f4e22ea538721e..0436a360c2b595115824e1b7906214621bd76314 100644 --- a/src/basics/basics/utilities/UbSystem.h +++ b/src/basics/basics/utilities/UbSystem.h @@ -530,7 +530,7 @@ struct select2nd { const result_type &operator()(const argument_type &p) const { return p.second; } }; -}; // namespace UbSystem +} // namespace UbSystem #define UB_STATIC_ASSERT(expr) static_cast<void>(sizeof(UbSystem::ub_static_assert<expr>)); // zum ueberpruefen von STATISCHEN ausdruecken waehrend der compile-zeit diff --git a/src/basics/geometry3d/GbCuboid3D.h b/src/basics/geometry3d/GbCuboid3D.h index f0a0b0f9884999050495156f3c547b26d6398e61..762a08c2696dbf58ea4b726528c89571fc21ab62 100644 --- a/src/basics/geometry3d/GbCuboid3D.h +++ b/src/basics/geometry3d/GbCuboid3D.h @@ -80,7 +80,7 @@ public: void setCenterCoordinates(const double &x1, const double &x2, const double &x3) override; void translate(const double &x1, const double &x2, const double &x3) override; - void rotate(const double &rx1, const double &rx2, const double &rx3) override {} + void rotate(const double &rx1, const double &rx2, const double &rx3) override { (void)rx1; (void)rx2; (void)rx3; } void scale(const double &sx1, const double &sx2, const double &sx3) override; double getLengthX1(); diff --git a/src/basics/geometry3d/GbMeshTools3D.h b/src/basics/geometry3d/GbMeshTools3D.h index 2a93319acb87011e0d63e60378e5db025c1e5a18..5c260e9c65237d2bc8d1482044edc2273fc97905 100644 --- a/src/basics/geometry3d/GbMeshTools3D.h +++ b/src/basics/geometry3d/GbMeshTools3D.h @@ -281,7 +281,7 @@ inline int triBoxOverlap(float boxcenter[3], float boxhalfsize[3], float trivert return 1; /* box and triangle overlaps */ } -}; // namespace GbMeshTools3D +} // namespace GbMeshTools3D #endif diff --git a/src/basics/geometry3d/GbObjectGroup3D.cpp b/src/basics/geometry3d/GbObjectGroup3D.cpp index e83ea5a605f8b77fdff45a8d17301c44f69614dd..4d765691860a9f8ac39d4476a5c28fa92dd7c423 100644 --- a/src/basics/geometry3d/GbObjectGroup3D.cpp +++ b/src/basics/geometry3d/GbObjectGroup3D.cpp @@ -83,7 +83,7 @@ vector<GbTriangle3D *> GbObjectGroup3D::getSurfaceTriangleSet() return allTriangles; } /*=======================================================*/ -void GbObjectGroup3D::addSurfaceTriangleSet(vector<UbTupleFloat3> &nodes, vector<UbTupleInt3> &triangles) {} +void GbObjectGroup3D::addSurfaceTriangleSet(vector<UbTupleFloat3> &/*nodes*/, vector<UbTupleInt3> &/*triangles*/) {} /*=======================================================*/ bool GbObjectGroup3D::hasIntersectionWithDirectedLine(GbPoint3D /*origin*/, GbPoint3D /*direction*/) { return false; } /*=======================================================*/ diff --git a/src/basics/geometry3d/GbObjectGroup3D.h b/src/basics/geometry3d/GbObjectGroup3D.h index a94703dc18a42be5762a876bd03d799b725b0812..51413cbe98dcdce934960ac0f2a230eeaa9798f3 100644 --- a/src/basics/geometry3d/GbObjectGroup3D.h +++ b/src/basics/geometry3d/GbObjectGroup3D.h @@ -89,7 +89,7 @@ public: this->midPoint->translate(x1, x2, x3); this->notifyObserversObjectChanged(); } - void rotate(const double &rx1, const double &rx2, const double &rx3) override + void rotate(const double &/*rx1*/, const double &/*rx2*/, const double &/*rx3*/) override { /* rotation makes no sense*/ } void scale(const double &sx1, const double & /*sx2*/, const double & /*sx3*/) override { this->radius *= sx1; } diff --git a/src/basics/geometry3d/GbTriFaceMesh3D.cpp b/src/basics/geometry3d/GbTriFaceMesh3D.cpp index 59892223a505aa87b1919652b84f89b903d5171f..9c098f14c802a5ac7fba4328d99e412cc6b453f4 100644 --- a/src/basics/geometry3d/GbTriFaceMesh3D.cpp +++ b/src/basics/geometry3d/GbTriFaceMesh3D.cpp @@ -1072,7 +1072,7 @@ void GbTriFaceMesh3D::readMeshFromSTLFileBinary(string filename, bool removeRedu float v[12]; // normal=3, vertices=3*3 = 12 unsigned short uint16; // Every Face is 50 Bytes: Normal(3*float), Vertices(9*float), 2 Bytes Spacer - for (size_t i = 0; i < nFaces; ++i) { + for (int i = 0; i < nFaces; ++i) { for (size_t j = 0; j < 12; ++j) { fread((void *)&v[j], sizeof(float), 1, f); } diff --git a/src/basics/geometry3d/GbVoxelMatrix3D.cpp b/src/basics/geometry3d/GbVoxelMatrix3D.cpp index bc2a89bc8cb7a78ba5c77b528ce48c7223d6698c..d4a047323abea561947abe662ba404dee08b519f 100644 --- a/src/basics/geometry3d/GbVoxelMatrix3D.cpp +++ b/src/basics/geometry3d/GbVoxelMatrix3D.cpp @@ -169,8 +169,8 @@ double GbVoxelMatrix3D::getIntersectionRaytraceFactor(const double &x1, const do int nix3 = UbMath::integerRounding((x3 - minX3) / deltaX3) + ndx3; // test ob nachbar solid - if (nix1 >= 0 && nix2 >= 0 && nix3 >= 0 && nix1 < voxelMatrix.getNX1() && nix2 < voxelMatrix.getNX2() && - nix3 < voxelMatrix.getNX3()) { + if (nix1 >= 0 && nix2 >= 0 && nix3 >= 0 && nix1 < (int)voxelMatrix.getNX1() && nix2 < (int)voxelMatrix.getNX2() && + nix3 < (int)voxelMatrix.getNX3()) { if (UbMath::equal(voxelMatrix(nix1, nix2, nix3), SOLID)) { // return halber abstand der beiden knoten return 0.5 * sqrt((ndx1 * deltaX1) * (ndx1 * deltaX1) + (ndx2 * deltaX2) * (ndx2 * deltaX2) + @@ -183,17 +183,15 @@ double GbVoxelMatrix3D::getIntersectionRaytraceFactor(const double &x1, const do /*=======================================================*/ bool GbVoxelMatrix3D::isPointInGbObject3D(const double &x1p, const double &x2p, const double &x3p) { - // index ermitteln int ix1 = UbMath::integerRounding((x1p - minX1) / deltaX1); int ix2 = UbMath::integerRounding((x2p - minX2) / deltaX2); int ix3 = UbMath::integerRounding((x3p - minX3) / deltaX3); - if (ix1 >= 0 && ix2 >= 0 && ix3 >= 0 && ix1 < voxelMatrix.getNX1() && ix2 < voxelMatrix.getNX2() && - ix3 < voxelMatrix.getNX3()) { + if (ix1 >= 0 && ix2 >= 0 && ix3 >= 0 && ix1 < (int)voxelMatrix.getNX1() && ix2 < (int)voxelMatrix.getNX2() && + ix3 < (int)voxelMatrix.getNX3()) { if (UbMath::equal(voxelMatrix(ix1, ix2, ix3), SOLID)) return true; } - return false; } /*=======================================================*/ diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/BCArray3D.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/BCArray3D.cpp index 87606eecf03943259dfec89a805336d2a3190bfa..88f4a52b2ff0445838af5aade25d9c78ce6809a8 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/BCArray3D.cpp +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/BCArray3D.cpp @@ -63,11 +63,11 @@ void BCArray3D::resize(std::size_t nx1, std::size_t nx2, std::size_t nx3, int va ////////////////////////////////////////////////////////////////////////// bool BCArray3D::validIndices(std::size_t x1, std::size_t x2, std::size_t x3) const { - if (x1 < 0 || x1 >= this->bcindexmatrix.getNX1()) + if (x1 >= this->bcindexmatrix.getNX1()) return false; - if (x2 < 0 || x2 >= this->bcindexmatrix.getNX2()) + if (x2 >= this->bcindexmatrix.getNX2()) return false; - if (x3 < 0 || x3 >= this->bcindexmatrix.getNX3()) + if (x3 >= this->bcindexmatrix.getNX3()) return false; return true; } diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/DensityAndThixotropyBCAlgorithm.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/DensityAndThixotropyBCAlgorithm.cpp index 45b467596bb502037c83e3ef33c3121d01be2975..33af827c68499c6c9454438290fadc5780c5eb93 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/DensityAndThixotropyBCAlgorithm.cpp +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/DensityAndThixotropyBCAlgorithm.cpp @@ -60,15 +60,14 @@ void DensityAndThixotropyBCAlgorithm::applyBC() int nx1 = x1; int nx2 = x2; int nx3 = x3; - int direction = -1; //flag points in direction of fluid - if (bcPtr->hasDensityBoundaryFlag(D3Q27System::E)) { nx1 -= 1; direction = D3Q27System::E; } - else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::W)) { nx1 += 1; direction = D3Q27System::W; } - else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::N)) { nx2 -= 1; direction = D3Q27System::N; } - else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::S)) { nx2 += 1; direction = D3Q27System::S; } - else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::T)) { nx3 -= 1; direction = D3Q27System::T; } - else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::B)) { nx3 += 1; direction = D3Q27System::B; } + if (bcPtr->hasDensityBoundaryFlag(D3Q27System::E)) { nx1 -= 1; } + else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::W)) { nx1 += 1; } + else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::N)) { nx2 -= 1; } + else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::S)) { nx2 += 1; } + else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::T)) { nx3 -= 1; } + else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::B)) { nx3 += 1; } else UB_THROW(UbException(UB_EXARGS, "Danger...no orthogonal BC-Flag on density boundary...")); LBMReal rhoBC = bcPtr->getBoundaryDensity(); diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/SimpleSlipBCAlgorithm.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/SimpleSlipBCAlgorithm.cpp index 380167005abc92d0137fd51fae81cf5fe6df8713..213b58877abc5c2e7e8492783a3cbdfce38518fb 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/SimpleSlipBCAlgorithm.cpp +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/SimpleSlipBCAlgorithm.cpp @@ -29,7 +29,7 @@ void SimpleSlipBCAlgorithm::applyBC() LBMReal f[D3Q27System::ENDF+1]; LBMReal feq[D3Q27System::ENDF+1]; distributions->getDistributionInv(f, x1, x2, x3); - LBMReal rho, vx1, vx2, vx3, drho; + LBMReal vx1, vx2, vx3, drho; calcMacrosFct(f, drho, vx1, vx2, vx3); calcFeqFct(feq, drho, vx1, vx2, vx3); @@ -40,8 +40,6 @@ void SimpleSlipBCAlgorithm::applyBC() vx2 = vx2 - amp * val<2>(normale); //normale zeigt von struktur weg! vx3 = vx3 - amp * val<3>(normale); //normale zeigt von struktur weg! - rho = 1.0+drho*compressibleFactor; - for (int fdir = D3Q27System::FSTARTDIR; fdir<=D3Q27System::FENDDIR; fdir++) { if (bcPtr->hasSlipBoundaryFlag(fdir)) diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/SimpleVelocityBCAlgorithm.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/SimpleVelocityBCAlgorithm.cpp index 9e136e0153a52ebb8b8c598701d4746fc21d4ab3..6529ea85184f5b2d86a977e64008437fe0401491 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/SimpleVelocityBCAlgorithm.cpp +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/SimpleVelocityBCAlgorithm.cpp @@ -61,12 +61,10 @@ void SimpleVelocityBCAlgorithm::applyBC() LBMReal f[D3Q27System::ENDF+1]; LBMReal feq[D3Q27System::ENDF+1]; distributions->getDistributionInv(f, x1, x2, x3); - LBMReal rho, vx1, vx2, vx3, drho; + LBMReal vx1, vx2, vx3, drho; calcMacrosFct(f, drho, vx1, vx2, vx3); calcFeqFct(feq, drho, vx1, vx2, vx3); - rho = 1.0+drho*compressibleFactor; - for (int fdir = D3Q27System::FSTARTDIR; fdir<=D3Q27System::FENDDIR; fdir++) { if (bcPtr->hasVelocityBoundaryFlag(fdir)) diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityAndThixotropyBCAlgorithm.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityAndThixotropyBCAlgorithm.cpp index 5755218278a263cfc9c4114b03e3e2fcd9b9b139..e6a50917f2f710ee4e8f240d54021f3e67a02d57 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityAndThixotropyBCAlgorithm.cpp +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityAndThixotropyBCAlgorithm.cpp @@ -58,15 +58,14 @@ void VelocityAndThixotropyBCAlgorithm::applyBC() int nx1 = x1; int nx2 = x2; int nx3 = x3; - int direction = -1; //flag points in direction of fluid - if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::E)) { nx1 -= 1; direction = D3Q27System::E; } - else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::W)) { nx1 += 1; direction = D3Q27System::W; } - else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::N)) { nx2 -= 1; direction = D3Q27System::N; } - else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::S)) { nx2 += 1; direction = D3Q27System::S; } - else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::T)) { nx3 -= 1; direction = D3Q27System::T; } - else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::B)) { nx3 += 1; direction = D3Q27System::B; } + if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::E)) { nx1 -= 1; } + else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::W)) { nx1 += 1; } + else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::N)) { nx2 -= 1; } + else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::S)) { nx2 += 1; } + else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::T)) { nx3 -= 1; } + else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::B)) { nx3 += 1; } else UB_THROW(UbException(UB_EXARGS, "Danger...no orthogonal BC-Flag on velocity boundary...")); //lambdaBC = bcPtr->getBoundaryThixotropy(); diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityWithDensityAndThixotropyBCAlgorithm.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityWithDensityAndThixotropyBCAlgorithm.cpp index 8f2436b387c1a38e35985738f6b17d45cdc431ef..f72f9bc7fd0dc184539181e719528152c14d4dea 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityWithDensityAndThixotropyBCAlgorithm.cpp +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityWithDensityAndThixotropyBCAlgorithm.cpp @@ -51,15 +51,14 @@ void VelocityWithDensityAndThixotropyBCAlgorithm::applyBC() int nx1 = x1; int nx2 = x2; int nx3 = x3; - int direction = -1; //flag points in direction of fluid - if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::E)) { nx1 -= 1; direction = D3Q27System::E; } - else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::W)) { nx1 += 1; direction = D3Q27System::W; } - else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::N)) { nx2 -= 1; direction = D3Q27System::N; } - else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::S)) { nx2 += 1; direction = D3Q27System::S; } - else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::T)) { nx3 -= 1; direction = D3Q27System::T; } - else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::B)) { nx3 += 1; direction = D3Q27System::B; } + if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::E)) { nx1 -= 1; } + else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::W)) { nx1 += 1; } + else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::N)) { nx2 -= 1; } + else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::S)) { nx2 += 1; } + else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::T)) { nx3 -= 1; } + else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::B)) { nx3 += 1; } else UB_THROW(UbException(UB_EXARGS, "Danger...no orthogonal BC-Flag on velocity boundary...")); for (int fdir = D3Q27System::FSTARTDIR; fdir <= D3Q27System::FENDDIR; fdir++) diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/AverageValuesCoProcessor.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/AverageValuesCoProcessor.cpp index 3684a5791510ed2880ee366403526655f38d7b75..6912d4bb9c3a2034adb33c0e05722cb6d93a01c3 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/AverageValuesCoProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/CoProcessors/AverageValuesCoProcessor.cpp @@ -243,9 +243,6 @@ void AverageValuesCoProcessor::addData(const SPtr<Block3D> block) SPtr<AverageValuesArray3D> av = kernel->getDataSet()->getAverageValues(); // int ghostLayerWidth = kernel->getGhostLayerWidth(); - // knotennummerierung faengt immer bei 0 an! - unsigned int SWB, SEB, NEB, NWB, SWT, SET, NET, NWT; - int minX1 = 0; int minX2 = 0; int minX3 = 0; @@ -313,6 +310,8 @@ void AverageValuesCoProcessor::addData(const SPtr<Block3D> block) maxX2 -= 1; maxX3 -= 1; + int SWB, SEB, NEB, NWB, SWT, SET, NET, NWT; + // cell vector erstellen for (int ix3 = minX3; ix3 <= maxX3; ix3++) { for (int ix2 = minX2; ix2 <= maxX2; ix2++) { @@ -322,7 +321,9 @@ void AverageValuesCoProcessor::addData(const SPtr<Block3D> block) (SWT = nodeNumbers(ix1, ix2, ix3 + 1)) >= 0 && (SET = nodeNumbers(ix1 + 1, ix2, ix3 + 1)) >= 0 && (NET = nodeNumbers(ix1 + 1, ix2 + 1, ix3 + 1)) >= 0 && (NWT = nodeNumbers(ix1, ix2 + 1, ix3 + 1)) >= 0) { - cells.push_back(makeUbTuple(SWB, SEB, NEB, NWB, SWT, SET, NET, NWT)); + cells.push_back(makeUbTuple((unsigned int)SWB, (unsigned int)SEB, (unsigned int)NEB, + (unsigned int)NWB, (unsigned int)SWT, (unsigned int)SET, + (unsigned int)NET, (unsigned int)NWT)); } } } diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/CalculateTorqueCoProcessor.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/CalculateTorqueCoProcessor.cpp index 0976157630976f4cf429e29837e6c8aa6ffc5a10..37e593d868fa76d5c5cedada99f256c0fa8c74c4 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/CalculateTorqueCoProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/CoProcessors/CalculateTorqueCoProcessor.cpp @@ -13,17 +13,17 @@ #include "EsoTwist3D.h" #include "DistributionArray3D.h" -CalculateTorqueCoProcessor::CalculateTorqueCoProcessor( SPtr<Grid3D> grid, SPtr<UbScheduler> s, const std::string &path, SPtr<Communicator> comm) : CoProcessor(grid, s), path(path), comm(comm), forceX1global(0), forceX2global(0), forceX3global(0) +CalculateTorqueCoProcessor::CalculateTorqueCoProcessor( SPtr<Grid3D> grid, SPtr<UbScheduler> s, const std::string &path_, SPtr<Communicator> comm) : CoProcessor(grid, s), path(path_), comm(comm), forceX1global(0), forceX2global(0), forceX3global(0) { if (comm->getProcessID() == comm->getRoot()) { std::ofstream ostr; - std::string fname = path; + std::string fname = path_; ostr.open(fname.c_str(), std::ios_base::out | std::ios_base::app); if(!ostr) { ostr.clear(); - std::string path = UbSystem::getPathFromString(fname); + const std::string path = UbSystem::getPathFromString(fname); if(path.size()>0){ UbSystem::makeDirectory(path); ostr.open(fname.c_str(), std::ios_base::out | std::ios_base::app);} if(!ostr) throw UbException(UB_EXARGS,"couldn't open file "+fname); } diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/MPIIOMigrationBECoProcessor.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/MPIIOMigrationBECoProcessor.cpp index 3c3154127b9f39efabe03b539f1e24a72448c07c..315608fc32549d2dd03524d0bd709df4fb18cd9d 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/MPIIOMigrationBECoProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/CoProcessors/MPIIOMigrationBECoProcessor.cpp @@ -599,7 +599,7 @@ void MPIIOMigrationBECoProcessor::writeBoundaryConds(int step) bcVector[ic].resize(0); indexContainerVector[ic].resize(0); - for (int bc = 0; bc < bcArr->getBCVectorSize(); bc++) { + for (std::size_t bc = 0; bc < bcArr->getBCVectorSize(); bc++) { BoundaryCondition *bouCond = new BoundaryCondition(); if (bcArr->bcvector[bc] == NULL) memset(bouCond, 0, sizeof(BoundaryCondition)); @@ -800,7 +800,7 @@ void MPIIOMigrationBECoProcessor::blocksExchange(int tagN, int ind1, int ind2, i SPtr<Block3D> tempBlock; int tempRank; - for (size_t ind = indexB - indexB; ind < indexE - indexB; ind++) // FIXME: both sides of operator are equivalent + for (int ind = 0; ind < indexE - indexB; ind++) { tempBlock = grid->getBlock(indexB + int(ind)); if (!tempBlock) @@ -1403,7 +1403,7 @@ void MPIIOMigrationBECoProcessor::readBoundaryConds(int step) BCAddMigration bcAddArray; BoundaryCondition *nullBouCond = new BoundaryCondition(); memset(nullBouCond, 0, sizeof(BoundaryCondition)); - BoundaryCondition *bcArray; + BoundaryCondition *bcArray = nullptr; std::vector<SPtr<BoundaryConditions>> bcVector; std::vector<int> indexContainerV; std::vector<int> bcindexmatrixV; @@ -1438,7 +1438,7 @@ void MPIIOMigrationBECoProcessor::readBoundaryConds(int step) bcVector.resize(0); - for (size_t ibc = 0; ibc < bcAddArray.boundCond_count; ibc++) { + for (int ibc = 0; ibc < bcAddArray.boundCond_count; ibc++) { SPtr<BoundaryConditions> bc; if (memcmp(&bcArray[ibc], nullBouCond, sizeof(BoundaryCondition)) == 0) bc = SPtr<BoundaryConditions>(); @@ -1490,8 +1490,7 @@ void MPIIOMigrationBECoProcessor::readBoundaryConds(int step) MPI_File_close(&file_handler); delete nullBouCond; - if (bcArray) - delete bcArray; + delete[] bcArray; delete[] rawDataReceive; delete[] rawDataSend; delete[] requests; diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/MPIIOMigrationCoProcessor.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/MPIIOMigrationCoProcessor.cpp index 94c33e5ba8109e2463da835b6bdcdd4c447c192b..dc894e9a5056633fdc1e4fb29f391b2f11be7f7f 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/MPIIOMigrationCoProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/CoProcessors/MPIIOMigrationCoProcessor.cpp @@ -300,7 +300,7 @@ void MPIIOMigrationCoProcessor::writeDataSet(int step) MPI_Offset write_offset; size_t sizeofOneDataSet = sizeof(DataSetMigration) + doubleCountInBlock * sizeof(double); - for (size_t nb = 0; nb < blocksCount; nb++) { + for (int nb = 0; nb < blocksCount; nb++) { write_offset = (MPI_Offset)(3 * sizeof(dataSetParam) + dataSetArray[nb].globalID * sizeofOneDataSet); MPI_File_write_at(file_handler, write_offset, &dataSetArray[nb], 1, dataSetType, MPI_STATUS_IGNORE); MPI_File_write_at(file_handler, (MPI_Offset)(write_offset + sizeof(DataSetMigration)), @@ -460,7 +460,7 @@ void MPIIOMigrationCoProcessor::write4DArray(int step, Arrays arrayType, std::st MPI_Offset write_offset; size_t sizeofOneDataSet = sizeof(DataSetSmallMigration) + doubleCountInBlock * sizeof(double); - for (size_t nb = 0; nb < blocksCount; nb++) { + for (int nb = 0; nb < blocksCount; nb++) { write_offset = (MPI_Offset)(sizeof(dataSetParam) + dataSetSmallArray[nb].globalID * sizeofOneDataSet); MPI_File_write_at(file_handler, write_offset, &dataSetSmallArray[nb], 1, dataSetSmallType, MPI_STATUS_IGNORE); MPI_File_write_at(file_handler, (MPI_Offset)(write_offset + sizeof(DataSetSmallMigration)), @@ -581,7 +581,7 @@ void MPIIOMigrationCoProcessor::write3DArray(int step, Arrays arrayType, std::st size_t sizeofOneDataSet = sizeof(DataSetSmallMigration) + doubleCountInBlock * sizeof(double); MPI_Offset write_offset; - for (size_t nb = 0; nb < blocksCount; nb++) { + for (int nb = 0; nb < blocksCount; nb++) { write_offset = (MPI_Offset)(sizeof(dataSetParam) + dataSetSmallArray[nb].globalID * sizeofOneDataSet); MPI_File_write_at(file_handler, write_offset, &dataSetSmallArray[nb], 1, dataSetSmallType, MPI_STATUS_IGNORE); MPI_File_write_at(file_handler, (MPI_Offset)(write_offset + sizeof(DataSetSmallMigration)), @@ -1363,7 +1363,7 @@ void MPIIOMigrationCoProcessor::writeBoundaryConds(int step) bcindexmatrixVector[ic].resize(0); indexContainerVector[ic].resize(0); - for (int bc = 0; bc < bcArr->getBCVectorSize(); bc++) { + for (std::size_t bc = 0; bc < bcArr->getBCVectorSize(); bc++) { BoundaryCondition *bouCond = new BoundaryCondition(); if (bcArr->bcvector[bc] == NULL) { memset(bouCond, 0, sizeof(BoundaryCondition)); @@ -1610,7 +1610,7 @@ void MPIIOMigrationCoProcessor::readDataSet(int step) size_t index = 0, vectorSize = 0; std::vector<double> vectorsOfValues1, vectorsOfValues2, vectorsOfValues3; - for (int n = 0; n < blocksCount; n++) { + for (std::size_t n = 0; n < blocksCount; n++) { vectorSize = dataSetParamStr1.nx[0] * dataSetParamStr1.nx[1] * dataSetParamStr1.nx[2] * dataSetParamStr1.nx[3]; vectorsOfValues1.assign(doubleValuesArray.data() + index, doubleValuesArray.data() + index + vectorSize); index += vectorSize; @@ -1779,7 +1779,7 @@ void MPIIOMigrationCoProcessor::readArray(int step, Arrays arrType, std::string size_t nextVectorSize = dataSetParamStr.nx[0] * dataSetParamStr.nx[1] * dataSetParamStr.nx[2] * dataSetParamStr.nx[3]; std::vector<double> vectorsOfValues; - for (int n = 0; n < blocksCount; n++) { + for (std::size_t n = 0; n < blocksCount; n++) { SPtr<Block3D> block = grid->getBlock(dataSetSmallArray[n].globalID); vectorsOfValues.assign(doubleValuesArray.data() + index, doubleValuesArray.data() + index + nextVectorSize); @@ -2559,7 +2559,7 @@ void MPIIOMigrationCoProcessor::readBoundaryConds(int step) indexContainerV.resize(0); bcVector.resize(0); - for (size_t ibc = 0; ibc < bcAddArray[ic].boundCond_count; ibc++) { + for (int ibc = 0; ibc < bcAddArray[ic].boundCond_count; ibc++) { SPtr<BoundaryConditions> bc; if (memcmp(&bcArray[ibc], nullBouCond, sizeof(BoundaryCondition)) == 0) bc = SPtr<BoundaryConditions>(); diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/MPIIORestartCoProcessor.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/MPIIORestartCoProcessor.cpp index abcf2bf7a932e03ea978265baa32f0872d767402..28253ed99af66d1fad0aa409b11bcba5c904ec04 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/MPIIORestartCoProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/CoProcessors/MPIIORestartCoProcessor.cpp @@ -1243,7 +1243,7 @@ void MPIIORestartCoProcessor::writeBoundaryConds(int step) bcAddArray[ic].boundCond_count = 0; // how many BoundaryConditions in this block bcAddArray[ic].indexContainer_count = 0; // how many indexContainer-values in this block - for (int bc = 0; bc < bcArr->getBCVectorSize(); bc++) { + for (std::size_t bc = 0; bc < bcArr->getBCVectorSize(); bc++) { BoundaryCondition *bouCond = new BoundaryCondition(); if (bcArr->bcvector[bc] == NULL) { memset(bouCond, 0, sizeof(BoundaryCondition)); @@ -1301,7 +1301,7 @@ void MPIIORestartCoProcessor::writeBoundaryConds(int step) // how many "big blocks" of BLOCK_SIZE size can by formed int bcBlockCount = (int)(count_boundCond / BLOCK_SIZE); - if (bcBlockCount * BLOCK_SIZE < count_boundCond) + if (bcBlockCount * BLOCK_SIZE < (int)count_boundCond) bcBlockCount += 1; for (int i = (int)count_boundCond; i < bcBlockCount * BLOCK_SIZE; i++) { BoundaryCondition *bouCond = new BoundaryCondition(); @@ -2294,12 +2294,12 @@ void MPIIORestartCoProcessor::readBoundaryConds(int step) std::vector<int> bcindexmatrixV; std::vector<int> indexContainerV; - for (size_t n = 0; n < blocksCount; n++) { + for (int n = 0; n < blocksCount; n++) { bcVector.resize(0); bcindexmatrixV.resize(0); indexContainerV.resize(0); - for (size_t ibc = 0; ibc < bcAddArray[n].boundCond_count; ibc++) { + for (int ibc = 0; ibc < bcAddArray[n].boundCond_count; ibc++) { SPtr<BoundaryConditions> bc; if (memcmp(&bcArray[index], nullBouCond, sizeof(BoundaryCondition)) == 0) bc = SPtr<BoundaryConditions>(); diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/MicrophoneArrayCoProcessor.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/MicrophoneArrayCoProcessor.cpp index 1a5edc27be0644478913fd9e93a84bf34a4a96f1..698528f32fc24a1d1cacc1f7fd7f61c59bd18430 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/MicrophoneArrayCoProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/CoProcessors/MicrophoneArrayCoProcessor.cpp @@ -91,7 +91,7 @@ bool MicrophoneArrayCoProcessor::addMicrophone(Vector3D coords) void MicrophoneArrayCoProcessor::collectData(double step) { - for (int i = 0; i < microphones.size(); i++) { + for (std::size_t i = 0; i < microphones.size(); i++) { LBMReal f[D3Q27System::ENDF + 1]; microphones[i]->distridution->getDistribution(f, val<1>(microphones[i]->nodeIndexes), val<2>(microphones[i]->nodeIndexes), @@ -104,7 +104,7 @@ void MicrophoneArrayCoProcessor::collectData(double step) void MicrophoneArrayCoProcessor::writeFile(double /*step*/) { - for (int i = 0; i < microphones.size(); i++) { + for (std::size_t i = 0; i < microphones.size(); i++) { std::string fname = path + "/mic/mic_" + UbSystem::toString(microphones[i]->id) + ".csv"; std::ofstream ostr; ostr.open(fname.c_str(), std::ios_base::out | std::ios_base::app); diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/QCriterionCoProcessor.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/QCriterionCoProcessor.cpp index 964db423517aff98df43a37e512fb74405736031..28652870f2f1c81dd0d9d6f4fbb014a9626af4e1 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/QCriterionCoProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/CoProcessors/QCriterionCoProcessor.cpp @@ -104,8 +104,6 @@ void QCriterionCoProcessor::addData(const SPtr<Block3D> block) SPtr<BCArray3D> bcArray = kernel->getBCProcessor()->getBCArray(); SPtr<DistributionArray3D> distributions = kernel->getDataSet()->getFdistributions(); - unsigned int SWB, SEB, NEB, NWB, SWT, SET, NET, NWT; - int minX1 = 0; int minX2 = 0; int minX3 = 0; @@ -179,6 +177,9 @@ void QCriterionCoProcessor::addData(const SPtr<Block3D> block) maxX1 -= 1; maxX2 -= 1; maxX3 -= 1; + + int SWB, SEB, NEB, NWB, SWT, SET, NET, NWT; + // cell vector erstellen for (int ix3 = minX3; ix3 <= maxX3; ix3++) { for (int ix2 = minX2; ix2 <= maxX2; ix2++) { @@ -189,7 +190,9 @@ void QCriterionCoProcessor::addData(const SPtr<Block3D> block) (NET = nodeNumbers(ix1 + 1, ix2 + 1, ix3 + 1)) >= 0 && (NWT = nodeNumbers(ix1, ix2 + 1, ix3 + 1)) >= 0) { // for valid points: neighbors are added to cells-vector - cells.push_back(makeUbTuple(SWB, SEB, NEB, NWB, SWT, SET, NET, NWT)); + cells.push_back(makeUbTuple((unsigned int)SWB, (unsigned int)SEB, (unsigned int)NEB, + (unsigned int)NWB, (unsigned int)SWT, (unsigned int)SET, + (unsigned int)NET, (unsigned int)NWT)); } } } diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/TimeAveragedValuesCoProcessor.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/TimeAveragedValuesCoProcessor.cpp index eb702a5484de8ee066690c6981d5a89ad6c4f509..27f25fbfe54f9a48f5ce1b8403c4ce640d4d18ae 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/TimeAveragedValuesCoProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/CoProcessors/TimeAveragedValuesCoProcessor.cpp @@ -252,9 +252,6 @@ void TimeAveragedValuesCoProcessor::addData(const SPtr<Block3D> block) SPtr<AverageValuesArray3D> at = kernel->getDataSet()->getAverageTriplecorrelations(); // int ghostLayerWidth = kernel->getGhostLayerWidth(); - // knotennummerierung faengt immer bei 0 an! - unsigned int SWB, SEB, NEB, NWB, SWT, SET, NET, NWT; - int minX1 = iMinC; int minX2 = iMinC; int minX3 = iMinC; @@ -335,6 +332,8 @@ void TimeAveragedValuesCoProcessor::addData(const SPtr<Block3D> block) maxX2 -= 1; maxX3 -= 1; + int SWB, SEB, NEB, NWB, SWT, SET, NET, NWT; + // cell vector erstellen for (int ix3 = minX3; ix3 <= maxX3; ix3++) { for (int ix2 = minX2; ix2 <= maxX2; ix2++) { @@ -344,7 +343,9 @@ void TimeAveragedValuesCoProcessor::addData(const SPtr<Block3D> block) (SWT = nodeNumbers(ix1, ix2, ix3 + 1)) >= 0 && (SET = nodeNumbers(ix1 + 1, ix2, ix3 + 1)) >= 0 && (NET = nodeNumbers(ix1 + 1, ix2 + 1, ix3 + 1)) >= 0 && (NWT = nodeNumbers(ix1, ix2 + 1, ix3 + 1)) >= 0) { - cells.push_back(makeUbTuple(SWB, SEB, NEB, NWB, SWT, SET, NET, NWT)); + cells.push_back(makeUbTuple((unsigned int)SWB, (unsigned int)SEB, (unsigned int)NEB, + (unsigned int)NWB, (unsigned int)SWT, (unsigned int)SET, + (unsigned int)NET, (unsigned int)NWT)); } } } @@ -355,11 +356,12 @@ void TimeAveragedValuesCoProcessor::calculateAverageValues(double timeSteps) { for (int level = minInitLevel; level <= maxInitLevel; level++) { int i; + const int block_size = (int) blockVector[level].size(); //#ifdef _OPENMP // #pragma omp parallel for //#endif // for(SPtr<Block3D> block : blockVector[level]) - for (i = 0; i < blockVector[level].size(); i++) { + for (i = 0; i < block_size; i++) { SPtr<Block3D> block = blockVector[level][i]; if (block) { SPtr<ILBMKernel> kernel = block->getKernel(); @@ -476,11 +478,12 @@ void TimeAveragedValuesCoProcessor::calculateSubtotal(double step) { for (int level = minInitLevel; level <= maxInitLevel; level++) { int i; + const int block_size = (int) blockVector[level].size(); //#ifdef _OPENMP //#pragma omp for schedule(dynamic) //#endif // for(SPtr<Block3D> block : blockVector[level]) - for (i = 0; i < blockVector[level].size(); i++) { + for (i = 0; i < block_size; i++) { SPtr<Block3D> block = blockVector[level][i]; if (block) { SPtr<ILBMKernel> kernel = block->getKernel(); diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/TurbulenceIntensityCoProcessor.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/TurbulenceIntensityCoProcessor.cpp index 864918f03a194a46c198a64912930b0b8f1859fb..b292d40bfff650a61bebc6c906ad867e7e660d83 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/TurbulenceIntensityCoProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/CoProcessors/TurbulenceIntensityCoProcessor.cpp @@ -114,9 +114,6 @@ void TurbulenceIntensityCoProcessor::addData(const SPtr<Block3D> block) SPtr<AverageValuesArray3D> av = kernel->getDataSet()->getAverageValues(); // int ghostLayerWidth = kernel->getGhostLayerWidth(); - // knotennummerierung faengt immer bei 0 an! - unsigned int SWB, SEB, NEB, NWB, SWT, SET, NET, NWT; - int minX1 = 0; int minX2 = 0; int minX3 = 0; @@ -161,6 +158,9 @@ void TurbulenceIntensityCoProcessor::addData(const SPtr<Block3D> block) } } } + + int SWB, SEB, NEB, NWB, SWT, SET, NET, NWT; + // cell std::vector erstellen for (int ix3 = minX3; ix3 < maxX3 - 1; ix3++) { for (int ix2 = minX2; ix2 < maxX2 - 1; ix2++) { @@ -170,7 +170,9 @@ void TurbulenceIntensityCoProcessor::addData(const SPtr<Block3D> block) (SWT = nodeNumbers(ix1, ix2, ix3 + 1)) >= 0 && (SET = nodeNumbers(ix1 + 1, ix2, ix3 + 1)) >= 0 && (NET = nodeNumbers(ix1 + 1, ix2 + 1, ix3 + 1)) >= 0 && (NWT = nodeNumbers(ix1, ix2 + 1, ix3 + 1)) >= 0) { - cells.push_back(makeUbTuple(SWB, SEB, NEB, NWB, SWT, SET, NET, NWT)); + cells.push_back(makeUbTuple((unsigned int)SWB, (unsigned int)SEB, (unsigned int)NEB, + (unsigned int)NWB, (unsigned int)SWT, (unsigned int)SET, + (unsigned int)NET, (unsigned int)NWT)); } } } diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/WriteBoundaryConditionsCoProcessor.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/WriteBoundaryConditionsCoProcessor.cpp index 88b5b574be4d6beb619a4e56c0bd11281f1fcbf8..e1f45387908b33e0cf9a8dd887f3382304e6c1b4 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/WriteBoundaryConditionsCoProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/CoProcessors/WriteBoundaryConditionsCoProcessor.cpp @@ -167,9 +167,9 @@ void WriteBoundaryConditionsCoProcessor::addDataGeo(SPtr<Block3D> block) maxX2 -= 1; maxX3 -= 1; - for (size_t ix3 = minX3; ix3 <= maxX3; ix3++) { - for (size_t ix2 = minX2; ix2 <= maxX2; ix2++) { - for (size_t ix1 = minX1; ix1 <= maxX1; ix1++) { + for (int ix3 = minX3; ix3 <= maxX3; ix3++) { + for (int ix2 = minX2; ix2 <= maxX2; ix2++) { + for (int ix1 = minX1; ix1 <= maxX1; ix1++) { if (!bcArray->isUndefined(ix1, ix2, ix3)) { // int index = 0; nodeNumbers(ix1, ix2, ix3) = nr++; diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/WriteThixotropyQuantitiesCoProcessor.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/WriteThixotropyQuantitiesCoProcessor.cpp index 27ec00a767b9ca19981f2606b657e0d551e19023..436f6738b01c5f3fa04fc6e2779642c7fff4ad1d 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/WriteThixotropyQuantitiesCoProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/CoProcessors/WriteThixotropyQuantitiesCoProcessor.cpp @@ -174,11 +174,11 @@ void WriteThixotropyQuantitiesCoProcessor::addDataMQ(SPtr<Block3D> block) //D3Q27BoundaryConditionPtr bcPtr; int nr = (int)nodes.size(); - for (size_t ix3 = minX3; ix3 <= maxX3; ix3++) + for (int ix3 = minX3; ix3 <= maxX3; ix3++) { - for (size_t ix2 = minX2; ix2 <= maxX2; ix2++) + for (int ix2 = minX2; ix2 <= maxX2; ix2++) { - for (size_t ix1 = minX1; ix1 <= maxX1; ix1++) + for (int ix1 = minX1; ix1 <= maxX1; ix1++) { if (!bcArray->isUndefined(ix1, ix2, ix3) && !bcArray->isSolid(ix1, ix2, ix3)) { diff --git a/src/cpu/VirtualFluidsCore/Connectors/ConnectorFactory.h b/src/cpu/VirtualFluidsCore/Connectors/ConnectorFactory.h index 65307fe3a8662375092be6626179399a668388b0..3e8828639bebfabbacf62793de954afd17b86026 100644 --- a/src/cpu/VirtualFluidsCore/Connectors/ConnectorFactory.h +++ b/src/cpu/VirtualFluidsCore/Connectors/ConnectorFactory.h @@ -12,9 +12,9 @@ class ConnectorFactory { public: ConnectorFactory() = default; - ; + virtual ~ConnectorFactory() = default; - ; + virtual SPtr<Block3DConnector> createSameLevelDirectConnector(SPtr<Block3D> from, SPtr<Block3D> to, int sendDir) = 0; diff --git a/src/cpu/VirtualFluidsCore/Data/DistributionArray3D.h b/src/cpu/VirtualFluidsCore/Data/DistributionArray3D.h index 593778cd08af4dff957def1dfd837bc2430935bd..fc1c67ad129d6cd7e7f5f9c9cd50ec4c76bfe714 100644 --- a/src/cpu/VirtualFluidsCore/Data/DistributionArray3D.h +++ b/src/cpu/VirtualFluidsCore/Data/DistributionArray3D.h @@ -7,9 +7,9 @@ class DistributionArray3D { public: DistributionArray3D() = default; - ; + virtual ~DistributionArray3D() = default; - ; + virtual size_t getNX1() const = 0; virtual size_t getNX2() const = 0; diff --git a/src/cpu/VirtualFluidsCore/Data/EsoTwist3D.h b/src/cpu/VirtualFluidsCore/Data/EsoTwist3D.h index e7d9b90de4c1490fa4a7d9c3ad0c05600467aa29..319a9200cc204b0f9b869b2e52353e717a89d783 100644 --- a/src/cpu/VirtualFluidsCore/Data/EsoTwist3D.h +++ b/src/cpu/VirtualFluidsCore/Data/EsoTwist3D.h @@ -57,9 +57,9 @@ class EsoTwist3D : public DistributionArray3D { public: EsoTwist3D() = default; - ; + ~EsoTwist3D() override = default; - ; + ////////////////////////////////////////////////////////////////////////// void swap() override = 0; ////////////////////////////////////////////////////////////////////////// diff --git a/src/cpu/VirtualFluidsCore/Data/VoidData3D.h b/src/cpu/VirtualFluidsCore/Data/VoidData3D.h index bab8eca0d62670e65275034cd3b67ace2953a349..12afae57d0f88d01963b4694aca881dd18691f87 100644 --- a/src/cpu/VirtualFluidsCore/Data/VoidData3D.h +++ b/src/cpu/VirtualFluidsCore/Data/VoidData3D.h @@ -7,7 +7,7 @@ class VoidData3D : public EsoTwist3D { public: VoidData3D() = default; - ; + VoidData3D(size_t nx1, size_t nx2, size_t nx3, LBMReal /*value*/) { this->NX1 = nx1; @@ -15,7 +15,7 @@ public: this->NX3 = nx3; } ~VoidData3D() override = default; - ; + size_t getNX1() const override { return NX1; } size_t getNX2() const override { return NX2; } size_t getNX3() const override { return NX3; } diff --git a/src/cpu/VirtualFluidsCore/Grid/BasicCalculator.cpp b/src/cpu/VirtualFluidsCore/Grid/BasicCalculator.cpp index e41e7372502dd7f96b387e4845ac27084321c48a..d55a59b58b026ec46b7cdc3e48aa796ec24d181a 100644 --- a/src/cpu/VirtualFluidsCore/Grid/BasicCalculator.cpp +++ b/src/cpu/VirtualFluidsCore/Grid/BasicCalculator.cpp @@ -64,7 +64,6 @@ void BasicCalculator::calculate() int maxInitLevel = maxLevel - minLevel; int straightStartLevel = minInitLevel; int internalIterations = 1 << (maxInitLevel - minInitLevel); - int forwardStartLevel; int threshold; #ifdef TIMING @@ -82,7 +81,6 @@ void BasicCalculator::calculate() for (int staggeredStep = 1; staggeredStep <= internalIterations; staggeredStep++) { - forwardStartLevel = straightStartLevel; if (staggeredStep == internalIterations) straightStartLevel = minInitLevel; else { diff --git a/src/cpu/VirtualFluidsCore/LBM/RheologyK17LBMKernel.cpp b/src/cpu/VirtualFluidsCore/LBM/RheologyK17LBMKernel.cpp index de780bc0574ce169432007dd9eb257de987249a9..c1fc395c77d84e601e1eb89a081c4978362821ba 100644 --- a/src/cpu/VirtualFluidsCore/LBM/RheologyK17LBMKernel.cpp +++ b/src/cpu/VirtualFluidsCore/LBM/RheologyK17LBMKernel.cpp @@ -648,8 +648,8 @@ void RheologyK17LBMKernel::calculate(int step) LBMReal OxyyMxzz = 8.0 * (omega - 2.0) * (omega + OxxPyyPzz * (3.0 * omega - 7.0)) / (OxxPyyPzz * (56.0 - 42.0 * omega + 9.0 * omega * omega) - 8.0 * omega); LBMReal Oxyz = 24.0 * (omega - 2.0) * (4.0 * omega * omega + omega * OxxPyyPzz * (18.0 - 13.0 * omega) + OxxPyyPzz * OxxPyyPzz * (2.0 + omega * (6.0 * omega - 11.0))) / (16.0 * omega * omega * (omega - 6.0) - 2.0 * omega * OxxPyyPzz * (216.0 + 5.0 * omega * (9.0 * omega - 46.0)) + OxxPyyPzz * OxxPyyPzz * (omega * (3.0 * omega - 10.0) * (15.0 * omega - 28.0) - 48.0)); - LBMReal A = (4.0 * omega * omega + 2.0 * omega * OxxPyyPzz * (omega - 6.0) + OxxPyyPzz * OxxPyyPzz * (omega * (10.0 - 3.0 * omega) - 4.0)) / ((omega - OxxPyyPzz) * (OxxPyyPzz * (2.0 + 3.0 * omega) - 8.0 * omega)); - LBMReal B = (4.0 * omega * OxxPyyPzz * (9.0 * omega - 16.0) - 4.0 * omega * omega - 2.0 * OxxPyyPzz * OxxPyyPzz * (2.0 + 9.0 * omega * (omega - 2.0))) / (3.0 * (omega - OxxPyyPzz) * (OxxPyyPzz * (2.0 + 3.0 * omega) - 8.0 * omega)); + LBMReal A_ = (4.0 * omega * omega + 2.0 * omega * OxxPyyPzz * (omega - 6.0) + OxxPyyPzz * OxxPyyPzz * (omega * (10.0 - 3.0 * omega) - 4.0)) / ((omega - OxxPyyPzz) * (OxxPyyPzz * (2.0 + 3.0 * omega) - 8.0 * omega)); + LBMReal B_ = (4.0 * omega * OxxPyyPzz * (9.0 * omega - 16.0) - 4.0 * omega * omega - 2.0 * OxxPyyPzz * OxxPyyPzz * (2.0 + 9.0 * omega * (omega - 2.0))) / (3.0 * (omega - OxxPyyPzz) * (OxxPyyPzz * (2.0 + 3.0 * omega) - 8.0 * omega)); //relax @@ -771,12 +771,12 @@ void RheologyK17LBMKernel::calculate(int step) //CUMbbc += O4 * (-CUMbbc); //CUMbcb += O4 * (-CUMbcb); //CUMcbb += O4 * (-CUMcbb); - CUMacc = -O4*(one / omega - c1o2) * (dyuy + dzuz) * c2o3 * A + (one - O4) * (CUMacc); - CUMcac = -O4*(one / omega - c1o2) * (dxux + dzuz) * c2o3 * A + (one - O4) * (CUMcac); - CUMcca = -O4*(one / omega - c1o2) * (dyuy + dxux) * c2o3 * A + (one - O4) * (CUMcca); - CUMbbc = -O4*(one / omega - c1o2) * Dxy * c1o3 * B + (one - O4) * (CUMbbc); - CUMbcb = -O4*(one / omega - c1o2) * Dxz * c1o3 * B + (one - O4) * (CUMbcb); - CUMcbb = -O4*(one / omega - c1o2) * Dyz * c1o3 * B + (one - O4) * (CUMcbb); + CUMacc = -O4*(one / omega - c1o2) * (dyuy + dzuz) * c2o3 * A_ + (one - O4) * (CUMacc); + CUMcac = -O4*(one / omega - c1o2) * (dxux + dzuz) * c2o3 * A_ + (one - O4) * (CUMcac); + CUMcca = -O4*(one / omega - c1o2) * (dyuy + dxux) * c2o3 * A_ + (one - O4) * (CUMcca); + CUMbbc = -O4*(one / omega - c1o2) * Dxy * c1o3 * B_ + (one - O4) * (CUMbbc); + CUMbcb = -O4*(one / omega - c1o2) * Dxz * c1o3 * B_ + (one - O4) * (CUMbcb); + CUMcbb = -O4*(one / omega - c1o2) * Dyz * c1o3 * B_ + (one - O4) * (CUMcbb); ////////////////////////////////////////////////////////////////////////// diff --git a/src/cpu/VirtualFluidsCore/Parallel/MPICommunicator.h b/src/cpu/VirtualFluidsCore/Parallel/MPICommunicator.h index 26f814476ad6ad57b0801849535cb5275e9bcadb..3c25cc78f74e7a4efbca436bc0dc07b62ce4fa6e 100644 --- a/src/cpu/VirtualFluidsCore/Parallel/MPICommunicator.h +++ b/src/cpu/VirtualFluidsCore/Parallel/MPICommunicator.h @@ -141,13 +141,11 @@ void MPICommunicator::allGather(std::vector<T> &svalues, std::vector<T> &rvalues if (rvalues.size() == 0) { rvalues.resize(1); - rvalues[0] = -999; // FIXME warning C4245: As svalues and rvalues are of type vector<T> there could be a - // potenial signed/unsigned mismatch storring a negative number + rvalues[0] = 999; } if (scount == 0) { svalues.resize(1); - svalues[0] = -999; // FIXME warning C4245: As svalues and rvalues are of type vector<T> there could be a - // potenial signed/unsigned mismatch storring a negative number + svalues[0] = 999; } MPI_Allgatherv(&svalues[0], scount, mpiDataType, &rvalues[0], &rcounts[0], &displs[0], mpiDataType, comm); diff --git a/src/cpu/VirtualFluidsCore/Parallel/MPIIODataStructures.h b/src/cpu/VirtualFluidsCore/Parallel/MPIIODataStructures.h index 6a21caab66e22a192efb591d7bba81675326f206..2d79817cc0d85a65e3d20d9736f8bf8e55c1a6c6 100644 --- a/src/cpu/VirtualFluidsCore/Parallel/MPIIODataStructures.h +++ b/src/cpu/VirtualFluidsCore/Parallel/MPIIODataStructures.h @@ -165,5 +165,5 @@ struct DSArraysPresence { bool isShearStressValArrayPresent; bool isRelaxationFactorPresent; }; -}; // namespace MPIIODataStructures +} // namespace MPIIODataStructures #endif \ No newline at end of file diff --git a/src/cpu/VirtualFluidsCore/Utilities/MathUtil.hpp b/src/cpu/VirtualFluidsCore/Utilities/MathUtil.hpp index 00556b842a28de2e3e49635def5f04ed451e5053..5c6fe4e8e2b4a02e733d777db9c045bc57f5b6eb 100644 --- a/src/cpu/VirtualFluidsCore/Utilities/MathUtil.hpp +++ b/src/cpu/VirtualFluidsCore/Utilities/MathUtil.hpp @@ -92,6 +92,6 @@ namespace Utilities double y = a * x + b; return y; } -}; +} #endif diff --git a/src/cpu/VirtualFluidsCore/Visitors/InitDistributionsBlockVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/InitDistributionsBlockVisitor.cpp index 8704355286f145efb926e78e8af61e03a310c26c..7ebdfa85e85200a6bd8adf760f13d6742b7e2b2d 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/InitDistributionsBlockVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/InitDistributionsBlockVisitor.cpp @@ -163,11 +163,11 @@ void InitDistributionsBlockVisitor::visit(const SPtr<Grid3D> grid, SPtr<Block3D> LBMReal f[D3Q27System::ENDF+1]; - for(int ix3=0; ix3<bcArray->getNX3(); ix3++) - for(int ix2=0; ix2<bcArray->getNX2(); ix2++) - for(int ix1=0; ix1<bcArray->getNX1(); ix1++) + for(std::size_t ix3=0; ix3<bcArray->getNX3(); ix3++) + for(std::size_t ix2=0; ix2<bcArray->getNX2(); ix2++) + for(std::size_t ix1=0; ix1<bcArray->getNX1(); ix1++) { - Vector3D coords = grid->getNodeCoordinates(block, ix1, ix2, ix3); + Vector3D coords = grid->getNodeCoordinates(block, (int)ix1, (int)ix2, (int)ix3); x1 = coords[0]; x2 = coords[1]; x3 = coords[2]; diff --git a/src/cpu/VirtualFluidsCore/Visitors/InitThixotropyBlockVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/InitThixotropyBlockVisitor.cpp index 17668ba25330dadeb05cc8769f84565b2f5cbe2e..72a81d60f73b8489805b304501eb5d48664672d0 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/InitThixotropyBlockVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/InitThixotropyBlockVisitor.cpp @@ -215,7 +215,7 @@ void InitThixotropyBlockVisitor::setLambda(LBMReal lambda) this->checkFunction(muLambda); } ////////////////////////////////////////////////////////////////////////// -void InitThixotropyBlockVisitor::visit(const SPtr<Grid3D> grid, SPtr<Block3D> block) +void InitThixotropyBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block) { using namespace D3Q27System; @@ -255,9 +255,9 @@ void InitThixotropyBlockVisitor::visit(const SPtr<Grid3D> grid, SPtr<Block3D> bl LBMReal h[D3Q27System::ENDF+1]; - for(int ix3=0; ix3<bcArray->getNX3(); ix3++) - for(int ix2=0; ix2<bcArray->getNX2(); ix2++) - for(int ix1=0; ix1<bcArray->getNX1(); ix1++) + for(std::size_t ix3=0; ix3<bcArray->getNX3(); ix3++) + for(std::size_t ix2=0; ix2<bcArray->getNX2(); ix2++) + for(std::size_t ix1=0; ix1<bcArray->getNX1(); ix1++) { //UbTupleDouble3 coords = grid->getNodeCoordinates(block, ix1, ix2, ix3); //x1 = val<1>(coords); diff --git a/src/cpu/VirtualFluidsCore/Visitors/InitThixotropyBlockVisitor.h b/src/cpu/VirtualFluidsCore/Visitors/InitThixotropyBlockVisitor.h index a026a227b972f49295b26dbbfb630bbf0c7d702e..a9105e027c0fed48dce613b2594d199ba7531f22 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/InitThixotropyBlockVisitor.h +++ b/src/cpu/VirtualFluidsCore/Visitors/InitThixotropyBlockVisitor.h @@ -103,7 +103,7 @@ public: //void initialize(double* f, double x1, double x2, double x3, double vx1, double vx2, double vx3, double rho, UbTupleDouble3 coords, double dx, double o, bool NSE); - void visit(const SPtr<Grid3D> grid, SPtr<Block3D> block); + void visit(SPtr<Grid3D> grid, SPtr<Block3D> block) override; protected: void checkFunction(mu::Parser fct); diff --git a/src/gpu/VirtualFluids_GPU/CMakeLists.txt b/src/gpu/VirtualFluids_GPU/CMakeLists.txt index 06bee95fa2a050a790d91c34b36bf99450b29a14..442efdc1422dc278161d3ad6571f3e52864e90de 100644 --- a/src/gpu/VirtualFluids_GPU/CMakeLists.txt +++ b/src/gpu/VirtualFluids_GPU/CMakeLists.txt @@ -16,8 +16,3 @@ linkBoost(COMPONENTS "serialization") #SET(TPN_WIN32 "/EHsc") #https://stackoverflow.com/questions/6832666/lnk2019-when-including-asio-headers-solution-generated-with-cmake #https://stackoverflow.com/questions/27442885/syntax-error-with-stdnumeric-limitsmax - -IF(MSVC) - vf_get_library_name(library_name) - set_target_properties(${library_name} PROPERTIES LINK_FLAGS "/ignore:4251") -ENDIF(MSVC)