From 3eb08eec72e6a5b585ee6c0eb2821d2da9d9242c Mon Sep 17 00:00:00 2001
From: "TESLA01\\soerenpeters" <peters@irmb.tu-bs.de>
Date: Mon, 5 Oct 2020 14:03:10 +0200
Subject: [PATCH] Add msvc warning level W4 and removed most of the warnings.
 Some of the warnings are suppressed (see MSVC.cmake)

---
 CMake/compilerflags/MSVC.cmake                | 15 +++++
 apps/cpu/LaminarTubeFlow/ltf.cpp              |  2 +-
 src/basics/geometry3d/GbSphere3D.cpp          |  2 +-
 src/basics/geometry3d/GbTriFaceMesh3D.cpp     |  6 +-
 src/basics/geometry3d/GbTriangularMesh3D.cpp  | 14 +++--
 src/basics/geometry3d/GbVoxelMatrix3D.cpp     | 59 ++++++++++---------
 .../KdTree/KdSplitCandidateManager.h          |  2 +-
 .../KdTree/splitalgorithms/KdSAHSplit.h       |  2 +-
 .../ThinWallNoSlipBCAlgorithm.cpp             |  2 +-
 .../CoProcessors/AdjustForcingCoProcessor.cpp |  4 +-
 .../CalculateForcesCoProcessor.cpp            |  4 +-
 .../CoProcessors/IntegrateValuesHelper.cpp    |  4 +-
 .../MPIIOMigrationBECoProcessor.cpp           | 53 +++++++++--------
 .../MPIIOMigrationCoProcessor.cpp             | 38 ++++++------
 .../CoProcessors/MPIIORestartCoProcessor.cpp  | 36 +++++------
 .../PressureDifferenceCoProcessor.cpp         |  4 +-
 .../CoProcessors/TimeseriesCoProcessor.cpp    |  4 +-
 .../Connectors/D3Q27ETFCOffVectorConnector.h  | 16 ++---
 src/cpu/VirtualFluidsCore/Grid/Calculator.cpp |  8 +--
 .../D3Q27TriFaceMeshInteractor.cpp            | 12 ++--
 ...ibleCumulant4thOrderViscosityLBMKernel.cpp |  1 +
 .../LBM/CumulantK17LBMKernel.cpp              |  1 +
 .../Parallel/MPICommunicator.h                |  4 +-
 .../Utilities/ChangeRandomQs.hpp              |  2 +-
 .../Utilities/CheckpointConverter.cpp         |  4 +-
 .../ChangeBoundaryDensityBlockVisitor.cpp     |  2 +-
 ...tributionsWithInterpolationGridVisitor.cpp |  6 +-
 27 files changed, 164 insertions(+), 143 deletions(-)

diff --git a/CMake/compilerflags/MSVC.cmake b/CMake/compilerflags/MSVC.cmake
index 256cb3341..937d9f4d5 100644
--- a/CMake/compilerflags/MSVC.cmake
+++ b/CMake/compilerflags/MSVC.cmake
@@ -8,7 +8,22 @@ list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-MP")     # enable multi-
 #############################################################################################################
 # warnings
 #############################################################################################################
+list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "/W4") # highest warning level
+
+# With W4 the following warnings appear many times. As long they are not eliminated they are suppressed:
+list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "/wd4458") # C4458: declaration of 'XXX' hides class member
+list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "/wd4100") # C4100: 'XXX': unreferenced formal parameter
+list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "/wd4505") # C4505: 'XXX': unreferenced local function has been removed
+list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "/wd4244") # C4244: '=': conversion from 'int' to 'char', possible loss of data, triggered by algorithm(2216,24)
+list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "/wd4310") # C4310: cast truncates constant value, triggerd by muParserbase.h
+list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "/wd4127") # C4127: conditional expression is constant: e.g. sizeof(int)
+
+# Urgent FIXME: This warning should be activated and fixed:
+list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "/wd4701") # C4701: potentially uninitialized local variable 'lMaxX3' used
+
+
 list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "/wd4251") # disable needs to have dll interface
+list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "/wd4005") # disable macro redefinition (triggered by metis.h)
 
 #############################################################################################################
 # preprocessor definitions
diff --git a/apps/cpu/LaminarTubeFlow/ltf.cpp b/apps/cpu/LaminarTubeFlow/ltf.cpp
index 7ab9d3c42..63cabd4f8 100644
--- a/apps/cpu/LaminarTubeFlow/ltf.cpp
+++ b/apps/cpu/LaminarTubeFlow/ltf.cpp
@@ -301,7 +301,7 @@ void run(string configname)
       //omp_set_num_threads(numOfThreads);
       numOfThreads = 1;
       SPtr<UbScheduler> stepGhostLayer(visSch);
-      SPtr<Calculator> calculator(new BasicCalculator(grid, stepGhostLayer, endTime));
+      SPtr<Calculator> calculator(new BasicCalculator(grid, stepGhostLayer, int(endTime)));
       calculator->addCoProcessor(npr);
       calculator->addCoProcessor(pp);
       calculator->addCoProcessor(migCoProcessor);
diff --git a/src/basics/geometry3d/GbSphere3D.cpp b/src/basics/geometry3d/GbSphere3D.cpp
index a9d8886df..c6614534e 100644
--- a/src/basics/geometry3d/GbSphere3D.cpp
+++ b/src/basics/geometry3d/GbSphere3D.cpp
@@ -415,7 +415,7 @@ void GbSphere3D::addSurfaceTriangleSet(vector<UbTupleFloat3>& nodes, vector<UbTu
       float deltaPhi = (float)UbMath::PI/(float)segments;
       float phiX1a,phiX1b,phiX3a,phiX3b;
       float x1a,x2a,x3a,x1b,x2b,x3b,x1c,x2c,x3c,x1d,x2d,x3d;
-      int nodeNr = nodes.size();
+      int nodeNr = int(nodes.size());
       for(phiX3a=(float)(0.5*UbMath::PI); phiX3a > (float)(-1.5*UbMath::PI); phiX3a-=deltaPhi)
       {
          for(phiX1a=0.0; phiX1a<UbMath::PI; phiX1a+=deltaPhi)
diff --git a/src/basics/geometry3d/GbTriFaceMesh3D.cpp b/src/basics/geometry3d/GbTriFaceMesh3D.cpp
index 82aa12f4f..cfeeffc8e 100644
--- a/src/basics/geometry3d/GbTriFaceMesh3D.cpp
+++ b/src/basics/geometry3d/GbTriFaceMesh3D.cpp
@@ -585,7 +585,7 @@ vector<GbTriangle3D*> GbTriFaceMesh3D::getSurfaceTriangleSet()
 /*=======================================================*/
 void GbTriFaceMesh3D::addSurfaceTriangleSet(vector<UbTupleFloat3>& pts, vector<UbTupleInt3>& tris)
 {
-   int nodeNr = pts.size();
+   int nodeNr = int(pts.size());
    for(int i=0; i<(int)this->triangles->size(); i++)
    {
       Vertex& v1 = (*nodes)[(*triangles)[i].v1];
@@ -751,7 +751,7 @@ bool GbTriFaceMesh3D::isPointInGbObject3D(const double& x1, const double& x2, co
       {
          //UBLOG(logINFO, "GbTriFaceMesh3D.isPointInGbObject3D.INTERSECT_EDGE");
 
-         if (counter>20) {return(iSec1&1);  UBLOG(logINFO, "NACH 100 Iterationen Eps umsetzen aufgegeben!");}
+         if (counter>20) {return(iSec1&1);  /*UBLOG(logINFO, "NACH 100 Iterationen Eps umsetzen aufgegeben!");*/}
          return this->isPointInGbObject3D(x1, x2, x3,(counter+1)); 
       }
       else if( iSec1 == Kd::Intersection::INTERSECT_EDGE)
@@ -768,7 +768,7 @@ bool GbTriFaceMesh3D::isPointInGbObject3D(const double& x1, const double& x2, co
          {
             //UBLOG(logINFO, "GbTriFaceMesh3D.isPointInGbObject3D.iSec1&1 != iSec2&1");
 
-            if (counter>20) {return(iSec1&1);  UBLOG(logINFO, "NACH 100 Iterationen Eps umsetzen aufgegeben!");}
+            if (counter>20) {return(iSec1&1); /* UBLOG(logINFO, "NACH 100 Iterationen Eps umsetzen aufgegeben!");*/}
             return this->isPointInGbObject3D(x1, x2, x3,(counter+1));
          }
          return iSec1&1;
diff --git a/src/basics/geometry3d/GbTriangularMesh3D.cpp b/src/basics/geometry3d/GbTriangularMesh3D.cpp
index 1970956e3..8c1cd4905 100644
--- a/src/basics/geometry3d/GbTriangularMesh3D.cpp
+++ b/src/basics/geometry3d/GbTriangularMesh3D.cpp
@@ -1283,9 +1283,10 @@ double GbTriangularMesh3D::AreaSign( GbVector3D& a, GbVector3D& b, GbVector3D& c
 
    return area2;
    /* The area should be an integer. */
-   if      ( area2 >  0.5 ) return  1;
-   else if ( area2 < -0.5 ) return -1;
-   else                     return  0;
+   // FIXME: unrechable code
+   //if      ( area2 >  0.5 ) return  1;
+   //else if ( area2 < -0.5 ) return -1;
+   //else                     return  0;
 }                            
 
 char    GbTriangularMesh3D::SegTriInt( GbTriangle3D* T, GbVector3D& q, GbVector3D& r, GbVector3D& p )
@@ -1402,9 +1403,10 @@ double GbTriangularMesh3D::VolumeSign( GbVector3D& a, GbVector3D& b, GbVector3D&
 
 
    /* The volume should be an integer. */
-   if      ( vol > 0.5 )   return  1;
-   else if ( vol < -0.5 )  return -1;
-   else                    return  0;
+   // FIXME: unreachable code
+   //if      ( vol > 0.5 )   return  1;
+   //else if ( vol < -0.5 )  return -1;
+   //else                    return  0;
 }
 
 bool GbTriangularMesh3D::BoxTest(GbTriangle3D* triangle, GbVector3D& PointQ, GbVector3D& PointR)
diff --git a/src/basics/geometry3d/GbVoxelMatrix3D.cpp b/src/basics/geometry3d/GbVoxelMatrix3D.cpp
index 74878b64c..5d4bdf2d5 100644
--- a/src/basics/geometry3d/GbVoxelMatrix3D.cpp
+++ b/src/basics/geometry3d/GbVoxelMatrix3D.cpp
@@ -273,35 +273,36 @@ bool GbVoxelMatrix3D::isPointInGbObject3D(const double& x1p, const double& x2p,
 bool GbVoxelMatrix3D::isCellInsideGbObject3D(const double& x1p1, const double& x2p1, const double& x3p1, const double& x1p2, const double& x2p2, const double& x3p2)
 {
    return false;
-   //dass h�ngt von der Konfigration ab, aber meist ist der Block gr�sser wie etliche Poren ...
-
-      //indizes ermitteln
-   int startix1 = (int)std::floor((x1p1-minX1)/deltaX1+1E-13);
-   int startix2 = (int)std::floor((x2p1-minX2)/deltaX2+1E-13);
-   int startix3 = (int)std::floor((x3p1-minX3)/deltaX3+1E-13);
-
-   if (startix1<0) return false;
-   if (startix2<0) return false;
-   if (startix3<0) return false;
-
-   int maxiX1 = (int)voxelMatrix.getNX1()-1;
-   int maxiX2 = (int)voxelMatrix.getNX2()-1;
-   int maxiX3 = (int)voxelMatrix.getNX3()-1;
-
-   int endix1 = (int)std::ceil((x1p2-minX1)/deltaX1-1E-13);
-   int endix2 = (int)std::ceil((x2p2-minX2)/deltaX2-1E-13);
-   int endix3 = (int)std::ceil((x3p2-minX3)/deltaX3-1E-13);
-
-   if (endix1>maxiX1) return false;
-   if (endix2>maxiX2) return false;
-   if (endix3>maxiX3) return false;
-
-   for (int ix3 = startix3; ix3<=endix3; ix3++)
-      for (int ix2 = startix2; ix2<=endix2; ix2++)
-         for (int ix1 = startix1; ix1<=endix1; ix1++)
-            if (UbMath::equal(voxelMatrix(ix1, ix2, ix3), FLUID))
-               return false;
-   return true;
+   //FIXME: unreachable cide
+   ////dass haengt von der Konfigration ab, aber meist ist der Block groesser wie etliche Poren ...
+
+   //   //indizes ermitteln
+   //int startix1 = (int)std::floor((x1p1-minX1)/deltaX1+1E-13);
+   //int startix2 = (int)std::floor((x2p1-minX2)/deltaX2+1E-13);
+   //int startix3 = (int)std::floor((x3p1-minX3)/deltaX3+1E-13);
+
+   //if (startix1<0) return false;
+   //if (startix2<0) return false;
+   //if (startix3<0) return false;
+
+   //int maxiX1 = (int)voxelMatrix.getNX1()-1;
+   //int maxiX2 = (int)voxelMatrix.getNX2()-1;
+   //int maxiX3 = (int)voxelMatrix.getNX3()-1;
+
+   //int endix1 = (int)std::ceil((x1p2-minX1)/deltaX1-1E-13);
+   //int endix2 = (int)std::ceil((x2p2-minX2)/deltaX2-1E-13);
+   //int endix3 = (int)std::ceil((x3p2-minX3)/deltaX3-1E-13);
+
+   //if (endix1>maxiX1) return false;
+   //if (endix2>maxiX2) return false;
+   //if (endix3>maxiX3) return false;
+
+   //for (int ix3 = startix3; ix3<=endix3; ix3++)
+   //   for (int ix2 = startix2; ix2<=endix2; ix2++)
+   //      for (int ix1 = startix1; ix1<=endix1; ix1++)
+   //         if (UbMath::equal(voxelMatrix(ix1, ix2, ix3), FLUID))
+   //            return false;
+   //return true;
 }
 /*=======================================================*/
 bool GbVoxelMatrix3D::isCellCuttingGbObject3D(const double& x1a, const double& x2a, const double& x3a, const double& x1b, const double& x2b, const double& x3b)
diff --git a/src/basics/geometry3d/KdTree/KdSplitCandidateManager.h b/src/basics/geometry3d/KdTree/KdSplitCandidateManager.h
index d9747848f..0139434eb 100644
--- a/src/basics/geometry3d/KdTree/KdSplitCandidateManager.h
+++ b/src/basics/geometry3d/KdTree/KdSplitCandidateManager.h
@@ -21,7 +21,7 @@ namespace Kd
 
       }
       /* ======================================================================================= */
-      SplitCandidate<T>& operator[] (const int& i) 
+      SplitCandidate<T>& operator[] (const std::size_t& i)
       { 
          #ifdef DEBUG
             return splitCandidatesVec.at(i);
diff --git a/src/basics/geometry3d/KdTree/splitalgorithms/KdSAHSplit.h b/src/basics/geometry3d/KdTree/splitalgorithms/KdSAHSplit.h
index 31f3b6e84..686ff1c9a 100644
--- a/src/basics/geometry3d/KdTree/splitalgorithms/KdSAHSplit.h
+++ b/src/basics/geometry3d/KdTree/splitalgorithms/KdSAHSplit.h
@@ -45,7 +45,7 @@ namespace Kd
                if (i == 0) 
                {
                   sc[i].nl = sc.objects_starting_outside_left + sc.objects_fully_outside_node;
-                  sc[i].nr = node.getTriFaces()->size() - sc[0].np - sc[0].ending;
+                  sc[i].nr = int(node.getTriFaces()->size()) - sc[0].np - sc[0].ending;
                } 
                else 
                {
diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/ThinWallNoSlipBCAlgorithm.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/ThinWallNoSlipBCAlgorithm.cpp
index 9143af429..ba8b1323b 100644
--- a/src/cpu/VirtualFluidsCore/BoundaryConditions/ThinWallNoSlipBCAlgorithm.cpp
+++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/ThinWallNoSlipBCAlgorithm.cpp
@@ -40,7 +40,7 @@ void ThinWallNoSlipBCAlgorithm::applyBC()
          if (pass == 1)
          {
             LBMReal q = bcPtr->getQ(invDir);
-            LBMReal fReturn = ((1.0 - q) / (1.0 + q))*0.5*(f[invDir] - f[fdir] + (f[invDir] + f[fdir] - collFactor*(feq[fdir] + feq[invDir])) / (1.0 - collFactor));
+            fReturn = ((1.0 - q) / (1.0 + q))*0.5*(f[invDir] - f[fdir] + (f[invDir] + f[fdir] - collFactor*(feq[fdir] + feq[invDir])) / (1.0 - collFactor));
             //distributionsTemp->setDistributionForDirection(fReturn, x1 + D3Q27System::DX1[invDir], x2 + D3Q27System::DX2[invDir], x3 + D3Q27System::DX3[invDir], fdir);
             fTemp[fdir] = fReturn;
          }
diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/AdjustForcingCoProcessor.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/AdjustForcingCoProcessor.cpp
index 50498d93e..eda63069e 100644
--- a/src/cpu/VirtualFluidsCore/CoProcessors/AdjustForcingCoProcessor.cpp
+++ b/src/cpu/VirtualFluidsCore/CoProcessors/AdjustForcingCoProcessor.cpp
@@ -52,8 +52,8 @@ AdjustForcingCoProcessor::AdjustForcingCoProcessor(SPtr<Grid3D> grid, SPtr<UbSch
       if (!ostr)
       {
          ostr.clear();
-         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); }
+         std::string file_path = UbSystem::getPathFromString(fname);
+         if (file_path.size() > 0) { UbSystem::makeDirectory(file_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);
       }
       ostr << "step;volume;vx1average;forcing\n";
diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/CalculateForcesCoProcessor.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/CalculateForcesCoProcessor.cpp
index 7ed5957b8..97a745830 100644
--- a/src/cpu/VirtualFluidsCore/CoProcessors/CalculateForcesCoProcessor.cpp
+++ b/src/cpu/VirtualFluidsCore/CoProcessors/CalculateForcesCoProcessor.cpp
@@ -30,8 +30,8 @@ CalculateForcesCoProcessor::CalculateForcesCoProcessor( SPtr<Grid3D> grid, SPtr<
       if(!ostr)
       { 
          ostr.clear();
-         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);}
+         std::string file_path = UbSystem::getPathFromString(fname);
+         if(file_path.size()>0){ UbSystem::makeDirectory(file_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);
       }
       ostr.width(12);
diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/IntegrateValuesHelper.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/IntegrateValuesHelper.cpp
index 793013dc3..84e5b810f 100644
--- a/src/cpu/VirtualFluidsCore/CoProcessors/IntegrateValuesHelper.cpp
+++ b/src/cpu/VirtualFluidsCore/CoProcessors/IntegrateValuesHelper.cpp
@@ -66,10 +66,10 @@ void IntegrateValuesHelper::init(int level)
 
    double numSolids = 0.0;
    double numFluids = 0.0;
-   for (int level = minInitLevel; level <= maxInitLevel; level++)
+   for (int level_it = minInitLevel; level_it <= maxInitLevel; level_it++)
    {
       std::vector<SPtr<Block3D>> blockVector;
-      grid->getBlocks(level, gridRank, blockVector);
+      grid->getBlocks(level_it, gridRank, blockVector);
       for(SPtr<Block3D> block : blockVector)
       {
          CalcNodes cn;
diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/MPIIOMigrationBECoProcessor.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/MPIIOMigrationBECoProcessor.cpp
index df63e8a5b..3f29498a1 100644
--- a/src/cpu/VirtualFluidsCore/CoProcessors/MPIIOMigrationBECoProcessor.cpp
+++ b/src/cpu/VirtualFluidsCore/CoProcessors/MPIIOMigrationBECoProcessor.cpp
@@ -580,20 +580,20 @@ void MPIIOMigrationBECoProcessor::writeBoundaryConds(int step)
                bouCond->velocityBoundaryFlags = bcArr->bcvector[bc]->getVelocityBoundary();
                bouCond->densityBoundaryFlags = bcArr->bcvector[bc]->getDensityBoundary();
                bouCond->wallModelBoundaryFlags = bcArr->bcvector[bc]->getWallModelBoundary();
-               bouCond->bcVelocityX1 = bcArr->bcvector[bc]->getBoundaryVelocityX1();
-               bouCond->bcVelocityX2 = bcArr->bcvector[bc]->getBoundaryVelocityX2();
-               bouCond->bcVelocityX3 = bcArr->bcvector[bc]->getBoundaryVelocityX3();
-               bouCond->bcDensity = bcArr->bcvector[bc]->getBoundaryDensity();
-               bouCond->bcLodiDensity = bcArr->bcvector[bc]->getDensityLodiDensity();
-               bouCond->bcLodiVelocityX1 = bcArr->bcvector[bc]->getDensityLodiVelocityX1();
-               bouCond->bcLodiVelocityX2 = bcArr->bcvector[bc]->getDensityLodiVelocityX2();
-               bouCond->bcLodiVelocityX3 = bcArr->bcvector[bc]->getDensityLodiVelocityX3();
-               bouCond->bcLodiLentgh = bcArr->bcvector[bc]->getDensityLodiLength();
-               bouCond->nx1 = bcArr->bcvector[bc]->nx1;
-               bouCond->nx2 = bcArr->bcvector[bc]->nx2;
-               bouCond->nx3 = bcArr->bcvector[bc]->nx3;
+               bouCond->bcVelocityX1 = (float) bcArr->bcvector[bc]->getBoundaryVelocityX1();
+               bouCond->bcVelocityX2 = (float) bcArr->bcvector[bc]->getBoundaryVelocityX2();
+               bouCond->bcVelocityX3 = (float) bcArr->bcvector[bc]->getBoundaryVelocityX3();
+               bouCond->bcDensity = (float) bcArr->bcvector[bc]->getBoundaryDensity();
+               bouCond->bcLodiDensity = (float) bcArr->bcvector[bc]->getDensityLodiDensity();
+               bouCond->bcLodiVelocityX1 = (float) bcArr->bcvector[bc]->getDensityLodiVelocityX1();
+               bouCond->bcLodiVelocityX2 = (float) bcArr->bcvector[bc]->getDensityLodiVelocityX2();
+               bouCond->bcLodiVelocityX3 = (float) bcArr->bcvector[bc]->getDensityLodiVelocityX3();
+               bouCond->bcLodiLentgh = (float) bcArr->bcvector[bc]->getDensityLodiLength();
+               bouCond->nx1 = (float) bcArr->bcvector[bc]->nx1;
+               bouCond->nx2 = (float) bcArr->bcvector[bc]->nx2;
+               bouCond->nx3 = (float) bcArr->bcvector[bc]->nx3;
                for (int iq = 0; iq<26; iq++)
-                  bouCond->q[iq] = bcArr->bcvector[bc]->getQ(iq);
+                  bouCond->q[iq] = (float) bcArr->bcvector[bc]->getQ(iq);
                bouCond->algorithmType = bcArr->bcvector[bc]->getBcAlgorithmType();
             }
 
@@ -765,7 +765,7 @@ void MPIIOMigrationBECoProcessor::blocksExchange(int tagN, int ind1, int ind2, i
    
    for(size_t ind = indexB - indexB; ind < indexE - indexB; ind++)
    {
-      tempBlock = grid->getBlock(indexB + ind);
+      tempBlock = grid->getBlock(indexB + int(ind));
       if(!tempBlock)  throw UbException(UB_EXARGS,"MPIIOMigrationBECoProcessor::blocksExchange -- null block pointer!!!" );
 
       tempRank = tempBlock->getRank();
@@ -901,7 +901,7 @@ void MPIIOMigrationBECoProcessor::readDataSet(int step)
       myBlocksCount = blocksPerProcess + (blocksCountAll - blocksPerProcess * size);
 
    int indexB = rank * blocksPerProcess;  // the first "my" block
-   int indexE = indexB + myBlocksCount;   // the latest "my" block
+   int indexE = indexB + int(myBlocksCount);   // the latest "my" block
 
    double start, finish;
    if (comm->isRoot()) start = MPI_Wtime();
@@ -920,11 +920,11 @@ void MPIIOMigrationBECoProcessor::readDataSet(int step)
       dataSetParamStr3.nx[0] * dataSetParamStr3.nx[1] * dataSetParamStr3.nx[2] * dataSetParamStr3.nx[3];
    std::vector<double> doubleValuesArray(myBlocksCount * doubleCountInBlock); // double-values in all blocks 
 
-   MPI_Type_contiguous(doubleCountInBlock, MPI_DOUBLE, &dataSetDoubleType);
+   MPI_Type_contiguous(int(doubleCountInBlock), MPI_DOUBLE, &dataSetDoubleType);
    MPI_Type_commit(&dataSetDoubleType);
 
    MPI_Offset read_offset = (MPI_Offset)(3 * sizeof(dataSetParam)) + (MPI_Offset)(indexB * doubleCountInBlock * sizeof(double));
-   MPI_File_read_at(file_handler, read_offset, &doubleValuesArray[0], myBlocksCount, dataSetDoubleType, MPI_STATUS_IGNORE);
+   MPI_File_read_at(file_handler, read_offset, &doubleValuesArray[0], int(myBlocksCount), dataSetDoubleType, MPI_STATUS_IGNORE);
 
    MPI_File_close(&file_handler);
    MPI_Type_free(&dataSetDoubleType);
@@ -941,7 +941,7 @@ void MPIIOMigrationBECoProcessor::readDataSet(int step)
    for (int r = 0; r < size; r++)
       rawDataReceive[r].resize(0);
 
-   blocksExchange(MESSAGE_TAG, indexB, indexE, doubleCountInBlock, doubleValuesArray, rawDataReceive);
+   blocksExchange(MESSAGE_TAG, indexB, indexE, int(doubleCountInBlock), doubleValuesArray, rawDataReceive);
    
    if (comm->isRoot())
    {
@@ -1071,7 +1071,7 @@ void MPIIOMigrationBECoProcessor::readArray(int step, Arrays arrType, std::strin
       myBlocksCount = blocksPerProcess + (blocksCountAll - blocksPerProcess * size);
 
    int indexB = rank * blocksPerProcess;  // the first "my" block
-   int indexE = indexB + myBlocksCount;   // the latest "my" block
+   int indexE = indexB + int(myBlocksCount);   // the latest "my" block
 
    MPI_File file_handler;
    std::string filename = path + "/mpi_io_cp/mpi_io_cp_" + UbSystem::toString(step) + fname;
@@ -1083,11 +1083,11 @@ void MPIIOMigrationBECoProcessor::readArray(int step, Arrays arrType, std::strin
    size_t doubleCountInBlock = dataSetParamStr.nx[0] * dataSetParamStr.nx[1] * dataSetParamStr.nx[2] * dataSetParamStr.nx[3];
    std::vector<double> doubleValuesArray(myBlocksCount * doubleCountInBlock); // double-values in all blocks
 
-   MPI_Type_contiguous(doubleCountInBlock, MPI_DOUBLE, &dataSetDoubleType);
+   MPI_Type_contiguous(int(doubleCountInBlock), MPI_DOUBLE, &dataSetDoubleType);
    MPI_Type_commit(&dataSetDoubleType);
 
    MPI_Offset read_offset = (MPI_Offset)(sizeof(dataSetParam)) + (MPI_Offset)(indexB) * (MPI_Offset)(doubleCountInBlock) * (MPI_Offset)(sizeof(double));
-   MPI_File_read_at(file_handler, read_offset, &doubleValuesArray[0], myBlocksCount, dataSetDoubleType, MPI_STATUS_IGNORE);
+   MPI_File_read_at(file_handler, read_offset, &doubleValuesArray[0], int(myBlocksCount), dataSetDoubleType, MPI_STATUS_IGNORE);
 
    MPI_File_close(&file_handler);
    MPI_Type_free(&dataSetDoubleType);
@@ -1104,7 +1104,7 @@ void MPIIOMigrationBECoProcessor::readArray(int step, Arrays arrType, std::strin
    for (int r = 0; r < size; r++)
      rawDataReceive[r].resize(0);
 
-   blocksExchange(MESSAGE_TAG + int(arrType), indexB, indexE, doubleCountInBlock, doubleValuesArray, rawDataReceive);
+   blocksExchange(MESSAGE_TAG + int(arrType), indexB, indexE, int(doubleCountInBlock), doubleValuesArray, rawDataReceive);
 
    if (comm->isRoot())
    {
@@ -1203,7 +1203,7 @@ void MPIIOMigrationBECoProcessor::readBoundaryConds(int step)
       myBlocksCount = blocksPerProcess + (blocksCountAll - blocksPerProcess * size);
   
    int indexB = rank * blocksPerProcess;  // the first "my" block
-   int indexE = indexB + myBlocksCount;   // the latest "my" block
+   int indexE = indexB + int(myBlocksCount);   // the latest "my" block
    
    std::vector<int> bcindexmatrixVAll;
 
@@ -1220,7 +1220,7 @@ void MPIIOMigrationBECoProcessor::readBoundaryConds(int step)
    MPI_Type_commit(&bcindexmatrixType);
 
    MPI_Offset read_offset = (MPI_Offset)(sizeof(int)) + (MPI_Offset)(indexB) * (MPI_Offset)(sizeOfBIM) * (MPI_Offset)(sizeof(int));
-   MPI_File_read_at(file_handler, read_offset, &bcindexmatrixVAll[0], myBlocksCount, bcindexmatrixType, MPI_STATUS_IGNORE);
+   MPI_File_read_at(file_handler, read_offset, &bcindexmatrixVAll[0], int(myBlocksCount), bcindexmatrixType, MPI_STATUS_IGNORE);
 
    MPI_File_close(&file_handler);
    MPI_Type_free(&bcindexmatrixType);
@@ -1277,7 +1277,7 @@ void MPIIOMigrationBECoProcessor::readBoundaryConds(int step)
    {
       if (r != rank)
       {
- 		 rds = rawDataSend[r].size();
+ 		 rds = int(rawDataSend[r].size());
          intBlockCount = (int)(rds / SEND_BLOCK_SIZE);
          if (intBlockCount * SEND_BLOCK_SIZE < rds)
             intBlockCount += 1;
@@ -1416,7 +1416,8 @@ void MPIIOMigrationBECoProcessor::readBoundaryConds(int step)
    MPI_File_close(&file_handler);
 
    delete nullBouCond;
-   delete bcArray;
+   if(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 40e6541a0..e989bbf62 100644
--- a/src/cpu/VirtualFluidsCore/CoProcessors/MPIIOMigrationCoProcessor.cpp
+++ b/src/cpu/VirtualFluidsCore/CoProcessors/MPIIOMigrationCoProcessor.cpp
@@ -81,7 +81,7 @@ void MPIIOMigrationCoProcessor::process(double step)
       writeDataSet((int)step);
       writeBoundaryConds((int)step);
 
-      writeCpTimeStep(step);
+      writeCpTimeStep((int)step);
 
       if (comm->isRoot()) UBLOG(logINFO, "Save check point - end");
    }
@@ -247,7 +247,7 @@ void MPIIOMigrationCoProcessor::writeDataSet(int step)
    }
 
    // register new MPI-type depending on the block-specific information
-   MPI_Type_contiguous(doubleCountInBlock, MPI_DOUBLE, &dataSetDoubleType);
+   MPI_Type_contiguous(int(doubleCountInBlock), MPI_DOUBLE, &dataSetDoubleType);
    MPI_Type_commit(&dataSetDoubleType);
 
    if (comm->isRoot())
@@ -409,7 +409,7 @@ void MPIIOMigrationCoProcessor::write4DArray(int step, Arrays arrayType, std::st
    }
 
    // register new MPI-types depending on the block-specific information
-   MPI_Type_contiguous(doubleCountInBlock, MPI_DOUBLE, &dataSetDoubleType);
+   MPI_Type_contiguous(int(doubleCountInBlock), MPI_DOUBLE, &dataSetDoubleType);
    MPI_Type_commit(&dataSetDoubleType);
 
    if (comm->isRoot())
@@ -521,7 +521,7 @@ void MPIIOMigrationCoProcessor::write3DArray(int step, Arrays arrayType, std::st
    }
 
    // register new MPI-types depending on the block-specific information
-   MPI_Type_contiguous(doubleCountInBlock, MPI_DOUBLE, &dataSetDoubleType);
+   MPI_Type_contiguous(int(doubleCountInBlock), MPI_DOUBLE, &dataSetDoubleType);
    MPI_Type_commit(&dataSetDoubleType);
 
    if (comm->isRoot())
@@ -1308,20 +1308,20 @@ void MPIIOMigrationCoProcessor::writeBoundaryConds(int step)
                bouCond->velocityBoundaryFlags = bcArr->bcvector[bc]->getVelocityBoundary();
                bouCond->densityBoundaryFlags = bcArr->bcvector[bc]->getDensityBoundary();
                bouCond->wallModelBoundaryFlags = bcArr->bcvector[bc]->getWallModelBoundary();
-               bouCond->bcVelocityX1 = bcArr->bcvector[bc]->getBoundaryVelocityX1();
-               bouCond->bcVelocityX2 = bcArr->bcvector[bc]->getBoundaryVelocityX2();
-               bouCond->bcVelocityX3 = bcArr->bcvector[bc]->getBoundaryVelocityX3();
-               bouCond->bcDensity = bcArr->bcvector[bc]->getBoundaryDensity();
-               bouCond->bcLodiDensity = bcArr->bcvector[bc]->getDensityLodiDensity();
-               bouCond->bcLodiVelocityX1 = bcArr->bcvector[bc]->getDensityLodiVelocityX1();
-               bouCond->bcLodiVelocityX2 = bcArr->bcvector[bc]->getDensityLodiVelocityX2();
-               bouCond->bcLodiVelocityX3 = bcArr->bcvector[bc]->getDensityLodiVelocityX3();
-               bouCond->bcLodiLentgh = bcArr->bcvector[bc]->getDensityLodiLength();
-               bouCond->nx1 = bcArr->bcvector[bc]->nx1;
-               bouCond->nx2 = bcArr->bcvector[bc]->nx2;
-               bouCond->nx3 = bcArr->bcvector[bc]->nx3;
+               bouCond->bcVelocityX1 = (float) bcArr->bcvector[bc]->getBoundaryVelocityX1();
+               bouCond->bcVelocityX2 = (float) bcArr->bcvector[bc]->getBoundaryVelocityX2();
+               bouCond->bcVelocityX3 = (float) bcArr->bcvector[bc]->getBoundaryVelocityX3();
+               bouCond->bcDensity = (float) bcArr->bcvector[bc]->getBoundaryDensity();
+               bouCond->bcLodiDensity = (float) bcArr->bcvector[bc]->getDensityLodiDensity();
+               bouCond->bcLodiVelocityX1 = (float) bcArr->bcvector[bc]->getDensityLodiVelocityX1();
+               bouCond->bcLodiVelocityX2 = (float) bcArr->bcvector[bc]->getDensityLodiVelocityX2();
+               bouCond->bcLodiVelocityX3 = (float) bcArr->bcvector[bc]->getDensityLodiVelocityX3();
+               bouCond->bcLodiLentgh = (float) bcArr->bcvector[bc]->getDensityLodiLength();
+               bouCond->nx1 = (float) bcArr->bcvector[bc]->nx1;
+               bouCond->nx2 = (float) bcArr->bcvector[bc]->nx2;
+               bouCond->nx3 = (float) bcArr->bcvector[bc]->nx3;
                for (int iq = 0; iq<26; iq++)
-                  bouCond->q[iq] = bcArr->bcvector[bc]->getQ(iq);
+                  bouCond->q[iq] = (float) bcArr->bcvector[bc]->getQ(iq);
                bouCond->algorithmType = bcArr->bcvector[bc]->getBcAlgorithmType();
             }
 
@@ -1503,7 +1503,7 @@ void MPIIOMigrationCoProcessor::readDataSet(int step)
    std::vector<double> doubleValuesArray(blocksCount * doubleCountInBlock); // double-values in all blocks 
 
    // define MPI_types depending on the block-specific information
-   MPI_Type_contiguous(doubleCountInBlock, MPI_DOUBLE, &dataSetDoubleType);
+   MPI_Type_contiguous(int(doubleCountInBlock), MPI_DOUBLE, &dataSetDoubleType);
    MPI_Type_commit(&dataSetDoubleType);
 
    size_t ic = 0;
@@ -1658,7 +1658,7 @@ void MPIIOMigrationCoProcessor::readArray(int step, Arrays arrType, std::string
    std::vector<double> doubleValuesArray(blocksCount * doubleCountInBlock); // double-values in all blocks
 
    // define MPI_types depending on the block-specific information
-   MPI_Type_contiguous(doubleCountInBlock, MPI_DOUBLE, &dataSetDoubleType);
+   MPI_Type_contiguous(int(doubleCountInBlock), MPI_DOUBLE, &dataSetDoubleType);
    MPI_Type_commit(&dataSetDoubleType);
 
    size_t ic = 0;
diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/MPIIORestartCoProcessor.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/MPIIORestartCoProcessor.cpp
index 6e9322809..b7bcb0464 100644
--- a/src/cpu/VirtualFluidsCore/CoProcessors/MPIIORestartCoProcessor.cpp
+++ b/src/cpu/VirtualFluidsCore/CoProcessors/MPIIORestartCoProcessor.cpp
@@ -1212,24 +1212,24 @@ void MPIIORestartCoProcessor::writeBoundaryConds(int step)
             else
             {
                bouCond->noslipBoundaryFlags = bcArr->bcvector[bc]->getNoSlipBoundary();
-               bouCond->slipBoundaryFlags = bcArr->bcvector[bc]->getSlipBoundary();
+               bouCond->slipBoundaryFlags =  bcArr->bcvector[bc]->getSlipBoundary();
                bouCond->velocityBoundaryFlags = bcArr->bcvector[bc]->getVelocityBoundary();
                bouCond->densityBoundaryFlags = bcArr->bcvector[bc]->getDensityBoundary();
                bouCond->wallModelBoundaryFlags = bcArr->bcvector[bc]->getWallModelBoundary();
-               bouCond->bcVelocityX1 = bcArr->bcvector[bc]->getBoundaryVelocityX1();
-               bouCond->bcVelocityX2 = bcArr->bcvector[bc]->getBoundaryVelocityX2();
-               bouCond->bcVelocityX3 = bcArr->bcvector[bc]->getBoundaryVelocityX3();
-               bouCond->bcDensity = bcArr->bcvector[bc]->getBoundaryDensity();
-               bouCond->bcLodiDensity = bcArr->bcvector[bc]->getDensityLodiDensity();
-               bouCond->bcLodiVelocityX1 = bcArr->bcvector[bc]->getDensityLodiVelocityX1();
-               bouCond->bcLodiVelocityX2 = bcArr->bcvector[bc]->getDensityLodiVelocityX2();
-               bouCond->bcLodiVelocityX3 = bcArr->bcvector[bc]->getDensityLodiVelocityX3();
-               bouCond->bcLodiLentgh = bcArr->bcvector[bc]->getDensityLodiLength();
-               bouCond->nx1 = bcArr->bcvector[bc]->nx1;
-               bouCond->nx2 = bcArr->bcvector[bc]->nx2;
-               bouCond->nx3 = bcArr->bcvector[bc]->nx3;
+               bouCond->bcVelocityX1 = (float) bcArr->bcvector[bc]->getBoundaryVelocityX1();
+               bouCond->bcVelocityX2 = (float) bcArr->bcvector[bc]->getBoundaryVelocityX2();
+               bouCond->bcVelocityX3 = (float) bcArr->bcvector[bc]->getBoundaryVelocityX3();
+               bouCond->bcDensity = (float) bcArr->bcvector[bc]->getBoundaryDensity();
+               bouCond->bcLodiDensity = (float) bcArr->bcvector[bc]->getDensityLodiDensity();
+               bouCond->bcLodiVelocityX1 = (float) bcArr->bcvector[bc]->getDensityLodiVelocityX1();
+               bouCond->bcLodiVelocityX2 = (float) bcArr->bcvector[bc]->getDensityLodiVelocityX2();
+               bouCond->bcLodiVelocityX3 = (float) bcArr->bcvector[bc]->getDensityLodiVelocityX3();
+               bouCond->bcLodiLentgh = (float) bcArr->bcvector[bc]->getDensityLodiLength();
+               bouCond->nx1 = (float) bcArr->bcvector[bc]->nx1;
+               bouCond->nx2 = (float) bcArr->bcvector[bc]->nx2;
+               bouCond->nx3 = (float) bcArr->bcvector[bc]->nx3;
                for (int iq = 0; iq<26; iq++)
-                  bouCond->q[iq] = bcArr->bcvector[bc]->getQ(iq);
+                  bouCond->q[iq] = (float) bcArr->bcvector[bc]->getQ(iq);
                bouCond->algorithmType = bcArr->bcvector[bc]->getBcAlgorithmType();
             }
 
@@ -1410,23 +1410,23 @@ void MPIIORestartCoProcessor::readDataSet(int step)
    double doubleCountInBlock = dataSetParamStr1.nx[0] * dataSetParamStr1.nx[1] * dataSetParamStr1.nx[2] * dataSetParamStr1.nx[3] +
       dataSetParamStr2.nx[0] * dataSetParamStr2.nx[1] * dataSetParamStr2.nx[2] * dataSetParamStr2.nx[3] +
       dataSetParamStr3.nx[0] * dataSetParamStr3.nx[1] * dataSetParamStr3.nx[2] * dataSetParamStr3.nx[3];
-   std::vector<double> doubleValuesArray(blocksCount * doubleCountInBlock); // double-values in all blocks
+   std::vector<double> doubleValuesArray(size_t(blocksCount * doubleCountInBlock)); // double-values in all blocks
 
    //   define MPI_types depending on the block-specific information
-   MPI_Type_contiguous(doubleCountInBlock, MPI_DOUBLE, &dataSetDoubleType);
+   MPI_Type_contiguous(int(doubleCountInBlock), MPI_DOUBLE, &dataSetDoubleType);
    MPI_Type_commit(&dataSetDoubleType);
 
    if (size > 1)
    {
       if (rank == 0)
       {
-         next_read_offset = read_offset + 3 * sizeof(dataSetParam) + blocksCount * (sizeof(DataSetRestart) + doubleCountInBlock * sizeof(double));
+         next_read_offset = read_offset + 3 * sizeof(dataSetParam) + blocksCount * (sizeof(DataSetRestart) + size_t(doubleCountInBlock) * sizeof(double));
          MPI_Send(&next_read_offset, 1, MPI_LONG_LONG_INT, 1, 5, MPI_COMM_WORLD);
       }
       else
       {
          MPI_Recv(&read_offset, 1, MPI_LONG_LONG_INT, rank - 1, 5, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
-         next_read_offset = read_offset + 3 * sizeof(dataSetParam) + blocksCount * (sizeof(DataSetRestart) + doubleCountInBlock * sizeof(double));
+         next_read_offset = read_offset + 3 * sizeof(dataSetParam) + blocksCount * (sizeof(DataSetRestart) + size_t(doubleCountInBlock) * sizeof(double));
          if (rank < size - 1)
             MPI_Send(&next_read_offset, 1, MPI_LONG_LONG_INT, rank + 1, 5, MPI_COMM_WORLD);
       }
diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/PressureDifferenceCoProcessor.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/PressureDifferenceCoProcessor.cpp
index 3d2b91865..6de9989b6 100644
--- a/src/cpu/VirtualFluidsCore/CoProcessors/PressureDifferenceCoProcessor.cpp
+++ b/src/cpu/VirtualFluidsCore/CoProcessors/PressureDifferenceCoProcessor.cpp
@@ -35,8 +35,8 @@ PressureDifferenceCoProcessor::PressureDifferenceCoProcessor(SPtr<Grid3D> grid,
       if(!ostr)
       { 
          ostr.clear();
-         std::string path = UbSystem::getPathFromString(fname);
-         if(path.size()>0){ UbSystem::makeDirectory(path); ostr.open(fname.c_str(), std::ios_base::out);}
+         std::string file_path = UbSystem::getPathFromString(fname);
+         if(file_path.size()>0){ UbSystem::makeDirectory(file_path); ostr.open(fname.c_str(), std::ios_base::out);}
          if(!ostr) throw UbException(UB_EXARGS,"couldn't open file "+fname);
       }
       ostr << "step" << "\t" << "nodes1" << "\t" << "nodes2" << "\t";
diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/TimeseriesCoProcessor.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/TimeseriesCoProcessor.cpp
index 62ca723e8..c3297d04e 100644
--- a/src/cpu/VirtualFluidsCore/CoProcessors/TimeseriesCoProcessor.cpp
+++ b/src/cpu/VirtualFluidsCore/CoProcessors/TimeseriesCoProcessor.cpp
@@ -34,8 +34,8 @@ TimeseriesCoProcessor::TimeseriesCoProcessor(SPtr<Grid3D> grid, SPtr<UbScheduler
       if(!ostr)
       { 
          ostr.clear();
-         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); }
+         std::string file_path = UbSystem::getPathFromString(fname);
+         if (file_path.size()>0) { UbSystem::makeDirectory(file_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);
       }
       ostr << "step;rho;vx;vy;vz;volume\n";
diff --git a/src/cpu/VirtualFluidsCore/Connectors/D3Q27ETFCOffVectorConnector.h b/src/cpu/VirtualFluidsCore/Connectors/D3Q27ETFCOffVectorConnector.h
index a82f13c04..397a9c27c 100644
--- a/src/cpu/VirtualFluidsCore/Connectors/D3Q27ETFCOffVectorConnector.h
+++ b/src/cpu/VirtualFluidsCore/Connectors/D3Q27ETFCOffVectorConnector.h
@@ -245,10 +245,10 @@ void D3Q27ETFCOffVectorConnector< VectorTransmitter>::fillSendVectors()
    ///////////////////////////////////////
    ///DEBUG
 #ifdef _DEBUG
-   if (block.lock()->getGlobalID() == 2558)
-   {
-      int test = 0;
-   }
+   //if (block.lock()->getGlobalID() == 2558)
+   //{
+   //   int test = 0;
+   //}
 #endif
    //////////////
 
@@ -265,10 +265,10 @@ void D3Q27ETFCOffVectorConnector< VectorTransmitter>::fillSendVectors()
       ///////////////////////////////////////
       ///DEBUG
 #ifdef _DEBUG
-      if (block.lock()->getGlobalID() == 2516)
-      {
-         int test = 0;
-      }
+      //if (block.lock()->getGlobalID() == 2516)
+      //{
+      //   int test = 0;
+      //}
 #endif
       //////////////
 		//getLocalMinMax(lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, none);
diff --git a/src/cpu/VirtualFluidsCore/Grid/Calculator.cpp b/src/cpu/VirtualFluidsCore/Grid/Calculator.cpp
index 45de9261c..9a314f066 100644
--- a/src/cpu/VirtualFluidsCore/Grid/Calculator.cpp
+++ b/src/cpu/VirtualFluidsCore/Grid/Calculator.cpp
@@ -140,11 +140,11 @@ void Calculator::initRemoteConnectors()
       grid->getBlocks(l, blockVector);
       for(SPtr<Block3D> block : blockVector)
       {
-         int l = block->getLevel();
-         block->pushBackRemoteSameLevelConnectors(remoteConns[l]);
+         int block_level = block->getLevel();
+         block->pushBackRemoteSameLevelConnectors(remoteConns[block_level]);
 
-         block->pushBackRemoteInterpolationConnectorsCF(remoteInterConnsCF[l]);
-         block->pushBackRemoteInterpolationConnectorsFC(remoteInterConnsFC[l]);
+         block->pushBackRemoteInterpolationConnectorsCF(remoteInterConnsCF[block_level]);
+         block->pushBackRemoteInterpolationConnectorsFC(remoteInterConnsFC[block_level]);
       }
    }
 
diff --git a/src/cpu/VirtualFluidsCore/Interactors/D3Q27TriFaceMeshInteractor.cpp b/src/cpu/VirtualFluidsCore/Interactors/D3Q27TriFaceMeshInteractor.cpp
index 90c644674..77f91b95c 100644
--- a/src/cpu/VirtualFluidsCore/Interactors/D3Q27TriFaceMeshInteractor.cpp
+++ b/src/cpu/VirtualFluidsCore/Interactors/D3Q27TriFaceMeshInteractor.cpp
@@ -1399,13 +1399,13 @@ void D3Q27TriFaceMeshInteractor::refineBlockGridToLevel(int level, double startD
                halfBoxSize[1] = (float)(0.5*(blockMaxX[1]-blockMinX[1]));
                halfBoxSize[2] = (float)(0.5*(blockMaxX[2]-blockMinX[2]));
 
-               GbTriFaceMesh3D::Vertex& v1 = nodes[triangle.v1];
-               GbTriFaceMesh3D::Vertex& v2 = nodes[triangle.v2];
-               GbTriFaceMesh3D::Vertex& v3 = nodes[triangle.v3];
+               GbTriFaceMesh3D::Vertex& v1_ = nodes[triangle.v1];
+               GbTriFaceMesh3D::Vertex& v2_ = nodes[triangle.v2];
+               GbTriFaceMesh3D::Vertex& v3_ = nodes[triangle.v3];
 
-               triPoints[0][0] = v1.x; triPoints[0][1] = v1.y; triPoints[0][2] = v1.z; 
-               triPoints[1][0] = v2.x; triPoints[1][1] = v2.y; triPoints[1][2] = v2.z; 
-               triPoints[2][0] = v3.x; triPoints[2][1] = v3.y; triPoints[2][2] = v3.z; 
+               triPoints[0][0] = v1_.x; triPoints[0][1] = v1_.y; triPoints[0][2] = v1_.z; 
+               triPoints[1][0] = v2_.x; triPoints[1][1] = v2_.y; triPoints[1][2] = v2_.z; 
+               triPoints[2][0] = v3_.x; triPoints[2][1] = v3_.y; triPoints[2][2] = v3_.z; 
 
                //wenn block dreick schneidet, dann muss er verfeinert werden
                if( GbMeshTools3D::triBoxOverlap(boxCenter,halfBoxSize,triPoints) )
diff --git a/src/cpu/VirtualFluidsCore/LBM/CompressibleCumulant4thOrderViscosityLBMKernel.cpp b/src/cpu/VirtualFluidsCore/LBM/CompressibleCumulant4thOrderViscosityLBMKernel.cpp
index 3d59e6329..055b0f770 100644
--- a/src/cpu/VirtualFluidsCore/LBM/CompressibleCumulant4thOrderViscosityLBMKernel.cpp
+++ b/src/cpu/VirtualFluidsCore/LBM/CompressibleCumulant4thOrderViscosityLBMKernel.cpp
@@ -120,6 +120,7 @@ void CompressibleCumulant4thOrderViscosityLBMKernel::calculate(int step)
    //LBMReal B = (four + twentyeight*omega - fourteen*omega*omega) / (six - twentyone*omega + fiveteen*omega*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));
+   //FIXME:  warning C4459: declaration of 'B' hides global declaration (message : see declaration of 'D3Q27System::B' )
    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));
 
    for (int x3 = minX3; x3 < maxX3; x3++)
diff --git a/src/cpu/VirtualFluidsCore/LBM/CumulantK17LBMKernel.cpp b/src/cpu/VirtualFluidsCore/LBM/CumulantK17LBMKernel.cpp
index 072d8cd90..92387c298 100644
--- a/src/cpu/VirtualFluidsCore/LBM/CumulantK17LBMKernel.cpp
+++ b/src/cpu/VirtualFluidsCore/LBM/CumulantK17LBMKernel.cpp
@@ -332,6 +332,7 @@ void CumulantK17LBMKernel::calculate(int step)
 			      //! with simplifications assuming \f$\omega_2 = 1.0\f$ (modify for different bulk viscosity).
 			      //!
 			      LBMReal A = (c4 + c2*omega - c3*omega*omega) / (c2 - c7*omega + c5*omega*omega);
+                  //FIXME:  warning C4459: declaration of 'B' hides global declaration (message : see declaration of 'D3Q27System::B' )
 			      LBMReal B = (c4 + c28*omega - c14*omega*omega) / (c6 - c21*omega + c15*omega*omega);
 
 			      ////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/cpu/VirtualFluidsCore/Parallel/MPICommunicator.h b/src/cpu/VirtualFluidsCore/Parallel/MPICommunicator.h
index c0fcf1cfc..e88eb42b3 100644
--- a/src/cpu/VirtualFluidsCore/Parallel/MPICommunicator.h
+++ b/src/cpu/VirtualFluidsCore/Parallel/MPICommunicator.h
@@ -134,12 +134,12 @@ void MPICommunicator::allGather(std::vector<T>& svalues, std::vector<T>& rvalues
    if (rvalues.size() == 0)
    {
       rvalues.resize(1);
-      rvalues[0] = -999;
+      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
    }
    if (scount == 0)
    {
       svalues.resize(1);
-      svalues[0] = -999;
+      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
    }
 
    MPI_Allgatherv(&svalues[0], scount, mpiDataType, &rvalues[0], &rcounts[0], &displs[0], mpiDataType, comm);
diff --git a/src/cpu/VirtualFluidsCore/Utilities/ChangeRandomQs.hpp b/src/cpu/VirtualFluidsCore/Utilities/ChangeRandomQs.hpp
index 029143dca..db7c73c93 100644
--- a/src/cpu/VirtualFluidsCore/Utilities/ChangeRandomQs.hpp
+++ b/src/cpu/VirtualFluidsCore/Utilities/ChangeRandomQs.hpp
@@ -27,7 +27,7 @@ namespace Utilities
                   if (bc->hasNoSlipBoundaryFlag(fdir))
                   {
                      const int invDir = D3Q27System::INVDIR[fdir];
-                     float q = bc->getQ(invDir);
+                     float q = (float) bc->getQ(invDir);
                      //double r = (double)UbRandom::rand(-50, 50);
                      float r = (float)UbRandom::rand(-10, 10);
                      float q_temp = q + q/r;
diff --git a/src/cpu/VirtualFluidsCore/Utilities/CheckpointConverter.cpp b/src/cpu/VirtualFluidsCore/Utilities/CheckpointConverter.cpp
index f10790453..9bf7278bc 100644
--- a/src/cpu/VirtualFluidsCore/Utilities/CheckpointConverter.cpp
+++ b/src/cpu/VirtualFluidsCore/Utilities/CheckpointConverter.cpp
@@ -323,7 +323,7 @@ void CheckpointConverter::convertDataSet(int step, int procCount)
       // read data
       MPI_File_read_at(file_handlerR, (MPI_Offset)(read_offset + 3 * sizeof(dataSetParam)), dataSetReadArray, blocksCount, dataSetTypeRead, MPI_STATUS_IGNORE);
       MPI_File_read_at(file_handlerR, (MPI_Offset)(read_offset + 3 * sizeof(dataSetParam) + blocksCount * sizeof(DataSetRestart)), 
-         &doubleValuesArray[0], blocksCount * doubleCountInBlock, MPI_DOUBLE, MPI_STATUS_IGNORE);
+         &doubleValuesArray[0], int(blocksCount * doubleCountInBlock), MPI_DOUBLE, MPI_STATUS_IGNORE);
 
       // offset to read the data of the next process
       read_offset = read_offset + (MPI_Offset)(3 * sizeof(dataSetParam) + blocksCount * (sizeof(DataSetRestart) + doubleCountInBlock * sizeof(double)));
@@ -349,7 +349,7 @@ void CheckpointConverter::convertDataSet(int step, int procCount)
          write_offset = (MPI_Offset)(3 * sizeof(dataSetParam) + dataSetWriteArray[nb].globalID * sizeofOneDataSet);
          MPI_File_write_at(file_handlerW, write_offset, &dataSetWriteArray[nb], 1, dataSetTypeWrite, MPI_STATUS_IGNORE);
          MPI_File_write_at(file_handlerW, (MPI_Offset)(write_offset + sizeof(DataSetMigration)), &doubleValuesArray[nb * doubleCountInBlock],
-            doubleCountInBlock, MPI_DOUBLE, MPI_STATUS_IGNORE);
+            int(doubleCountInBlock), MPI_DOUBLE, MPI_STATUS_IGNORE);
       }
 
       delete[] dataSetReadArray;
diff --git a/src/cpu/VirtualFluidsCore/Visitors/ChangeBoundaryDensityBlockVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/ChangeBoundaryDensityBlockVisitor.cpp
index d8facc637..077dadeab 100644
--- a/src/cpu/VirtualFluidsCore/Visitors/ChangeBoundaryDensityBlockVisitor.cpp
+++ b/src/cpu/VirtualFluidsCore/Visitors/ChangeBoundaryDensityBlockVisitor.cpp
@@ -47,7 +47,7 @@ void ChangeBoundaryDensityBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> b
                   {
                      if (bcPtr->hasDensityBoundary())
                      {
-                        float bcDensity = bcPtr->getBoundaryDensity();
+                        float bcDensity = (float) bcPtr->getBoundaryDensity();
                         if (bcDensity == oldBoundaryDensity)
                         {
                            bcPtr->setBoundaryDensity(newBoundaryDensity);
diff --git a/src/cpu/VirtualFluidsCore/Visitors/InitDistributionsWithInterpolationGridVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/InitDistributionsWithInterpolationGridVisitor.cpp
index 8043b8140..bc6963c18 100644
--- a/src/cpu/VirtualFluidsCore/Visitors/InitDistributionsWithInterpolationGridVisitor.cpp
+++ b/src/cpu/VirtualFluidsCore/Visitors/InitDistributionsWithInterpolationGridVisitor.cpp
@@ -66,7 +66,7 @@ void InitDistributionsWithInterpolationGridVisitor::visit(SPtr<Grid3D> grid)
             Vector3D coords = newGrid->getNodeCoordinates(newBlock, 1, 1, 1);
 
             UbTupleInt3 oldGridBlockIndexes = oldGrid->getBlockIndexes(coords[0], coords[1], coords[2], newlevel-1);
-            SPtr<Block3D> oldBlock = oldGrid->getBlock(val<1>(oldGridBlockIndexes), val<2>(oldGridBlockIndexes), val<3>(oldGridBlockIndexes), newlevel-1);
+            oldBlock = oldGrid->getBlock(val<1>(oldGridBlockIndexes), val<2>(oldGridBlockIndexes), val<3>(oldGridBlockIndexes), newlevel-1);
 
             if (oldBlock)
             {
@@ -84,8 +84,8 @@ void InitDistributionsWithInterpolationGridVisitor::visit(SPtr<Grid3D> grid)
             }
             else
             {
-               UbTupleInt3 oldGridBlockIndexes = oldGrid->getBlockIndexes(coords[0], coords[1], coords[2], newlevel+1);
-               SPtr<Block3D> oldBlock = oldGrid->getBlock(val<1>(oldGridBlockIndexes), val<2>(oldGridBlockIndexes), val<3>(oldGridBlockIndexes), newlevel+1);
+               oldGridBlockIndexes = oldGrid->getBlockIndexes(coords[0], coords[1], coords[2], newlevel+1);
+               oldBlock = oldGrid->getBlock(val<1>(oldGridBlockIndexes), val<2>(oldGridBlockIndexes), val<3>(oldGridBlockIndexes), newlevel+1);
                if (oldBlock)
                {
                   int oldBlockRank = oldBlock->getRank();
-- 
GitLab