diff --git a/CMake/compilerflags/GNU.cmake b/CMake/compilerflags/GNU.cmake index 63eeeb9b05e0c0c75661f93e18190487c0e06578..a196d5d0be1343767f8fe900147b4447e5c547d3 100644 --- a/CMake/compilerflags/GNU.cmake +++ b/CMake/compilerflags/GNU.cmake @@ -33,7 +33,7 @@ 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-unknown-pragmas") - +list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wno-cast-function-type") ############################################################################################################# # linker options 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/CalculateTorqueCoProcessor.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/CalculateTorqueCoProcessor.cpp index 2272fe270a27f1b34d4387c601147f38a0c31313..37e593d868fa76d5c5cedada99f256c0fa8c74c4 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/CalculateTorqueCoProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/CoProcessors/CalculateTorqueCoProcessor.cpp @@ -13,7 +13,7 @@ #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()) {