diff --git a/src/gpu/GridGenerator/CMakeLists.txt b/src/gpu/GridGenerator/CMakeLists.txt index 71f72975b1932cbed13969f12f63f214c0c857b5..1aae7675217f96fd80b3926106da4e5d438e0e68 100644 --- a/src/gpu/GridGenerator/CMakeLists.txt +++ b/src/gpu/GridGenerator/CMakeLists.txt @@ -16,4 +16,4 @@ endif() # supress warning 3152: __host__ function redeclared with __host__ __device__, hence treated as a __host__ __device__ function # supress warning 3125, 3127: calling a constexpr __host__ function from a __host__ __device__ function # supress warning 3311: unrecognized #pragma in device code -target_compile_options(${library_name} PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:-Xcudafe "--diag_suppress=3123 --diag_suppress=3126 --diag_suppress=3152 --diag_suppress=3125 --diag_suppress=3127 --diag_suppress=3311">) +target_compile_options(${library_name} PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:-Xcudafe "--diag_suppress=3123 --diag_suppress=3126 --diag_suppress=3152 --diag_suppress=3125 --diag_suppress=3127 --diag_suppress=3311" >) diff --git a/src/gpu/GridGenerator/geometries/TriangularMesh/triangleNeighborFinder/TriangleNeighborFinder.cpp b/src/gpu/GridGenerator/geometries/TriangularMesh/triangleNeighborFinder/TriangleNeighborFinder.cpp index 08fa49fccaecfbc0c2ee6e5ddfd0ee21456a3d6a..4fc0e6dedc287ced661bbea5d1a1f6c30734c70b 100644 --- a/src/gpu/GridGenerator/geometries/TriangularMesh/triangleNeighborFinder/TriangleNeighborFinder.cpp +++ b/src/gpu/GridGenerator/geometries/TriangularMesh/triangleNeighborFinder/TriangleNeighborFinder.cpp @@ -237,12 +237,11 @@ void TriangleNeighborFinder::fillWithNeighborIndices(IntegerPtr2D *neighborIndic void TriangleNeighborFinder::fillWithNeighborAngles(TriangularMesh *geom) const { - int j, row, index, indexNeighbor; + int j, index, indexNeighbor; //#pragma omp parallel for private(j, row, index, indexNeighbor) shared(neighborAngles->ptr) - for (int i = 0; i < indicesOfTriangleNeighbors.size(); i++){ - row = i * 3; + for (int i = 0; i < (int)indicesOfTriangleNeighbors.size(); i++){ geom->triangles[i].alphaAngles[0] = geom->triangles[i].alphaAngles[1] = geom->triangles[i].alphaAngles[2] = 90.0f; - for (j = 0; j < indicesOfTriangleNeighbors[i].size(); j++){ + for (j = 0; j < (int)indicesOfTriangleNeighbors[i].size(); j++){ indexNeighbor = indicesOfTriangleNeighbors[i][j]; index = geom->triangles[i].getCommonEdge(geom->triangles[indexNeighbor]); geom->triangles[i].alphaAngles[index] = geom->triangles[i].getHalfAngleBetweenToAdjacentTriangle(geom->triangles[indexNeighbor]); diff --git a/src/gpu/GridGenerator/grid/BoundaryConditions/Side.cpp b/src/gpu/GridGenerator/grid/BoundaryConditions/Side.cpp index aee2154ccc9c22d752e9e9a94fe1585c73116b4c..00ac6b3ddf7ac4d63dbdbf299d56f8126d6abdc6 100644 --- a/src/gpu/GridGenerator/grid/BoundaryConditions/Side.cpp +++ b/src/gpu/GridGenerator/grid/BoundaryConditions/Side.cpp @@ -75,16 +75,22 @@ void Side::setQs(SPtr<Grid> grid, SPtr<BoundaryCondition> boundaryCondition, uin // correct neighbor coordinates in case of periodic boundaries if( grid->getPeriodicityX() && grid->getFieldEntry( grid->transCoordToIndex( neighborX, y, z ) ) == STOPPER_OUT_OF_GRID_BOUNDARY ) + { if( neighborX > x ) neighborX = grid->getFirstFluidNode( coords, 0, grid->getStartX() ); else neighborX = grid->getLastFluidNode ( coords, 0, grid->getEndX() ); + } if( grid->getPeriodicityY() && grid->getFieldEntry( grid->transCoordToIndex( x, neighborY, z ) ) == STOPPER_OUT_OF_GRID_BOUNDARY ) + { if( neighborY > y ) neighborY = grid->getFirstFluidNode( coords, 1, grid->getStartY() ); else neighborY = grid->getLastFluidNode ( coords, 1, grid->getEndY() ); + } if( grid->getPeriodicityZ() && grid->getFieldEntry( grid->transCoordToIndex( x, y, neighborZ ) ) == STOPPER_OUT_OF_GRID_BOUNDARY ) + { if( neighborZ > z ) neighborZ = grid->getFirstFluidNode( coords, 2, grid->getStartZ() ); else neighborZ = grid->getLastFluidNode ( coords, 2, grid->getEndZ() ); + } uint neighborIndex = grid->transCoordToIndex( neighborX, neighborY, neighborZ ); @@ -116,7 +122,6 @@ void Geometry::addIndices(std::vector<SPtr<Grid> > grids, uint level, SPtr<Bound auto geometryBoundaryCondition = std::dynamic_pointer_cast<GeometryBoundaryCondition>(boundaryCondition); std::vector<real> qNode(grids[level]->getEndDirection() + 1); - bool qFound = false; for (uint index = 0; index < grids[level]->getSize(); index++) { @@ -148,8 +153,6 @@ void Geometry::addIndices(std::vector<SPtr<Grid> > grids, uint level, SPtr<Bound geometryBoundaryCondition->indices.push_back(index); geometryBoundaryCondition->qs.push_back(qNode); geometryBoundaryCondition->patches.push_back( grids[level]->getQPatch(index) ); - - qFound = false; } } diff --git a/src/gpu/VirtualFluids_GPU/Output/DataWriter.h b/src/gpu/VirtualFluids_GPU/Output/DataWriter.h index 0bba66ed8e5d89c4c6560087586b4395c735a445..5e7ee8b30f4647ba9ac24f0583639dd60b2695d5 100644 --- a/src/gpu/VirtualFluids_GPU/Output/DataWriter.h +++ b/src/gpu/VirtualFluids_GPU/Output/DataWriter.h @@ -16,8 +16,8 @@ class CudaMemoryManager; class DataWriter { public: - DataWriter() {} - virtual ~DataWriter() {} + DataWriter() = default; + virtual ~DataWriter() = default; virtual void writeInit(std::shared_ptr<Parameter> para, std::shared_ptr<CudaMemoryManager> cudaManager) = 0; virtual void writeTimestep(std::shared_ptr<Parameter> para, unsigned int timestep) = 0; diff --git a/src/gpu/VirtualFluids_GPU/Output/FileWriter.cpp b/src/gpu/VirtualFluids_GPU/Output/FileWriter.cpp index 7abf61b862968dc3cb78c43a4e19aa63091063d0..a554d63cccbb9a2622f0bbffa143c8a586b88f44 100644 --- a/src/gpu/VirtualFluids_GPU/Output/FileWriter.cpp +++ b/src/gpu/VirtualFluids_GPU/Output/FileWriter.cpp @@ -184,7 +184,6 @@ void FileWriter::writeUnstrucuredGridLT(std::shared_ptr<Parameter> para, int lev unsigned int number1, number2, number3, number4, number5, number6, number7, number8; uint dn1, dn2, dn3, dn4, dn5, dn6, dn7, dn8; bool neighborsAreFluid; - double vxmax = 0; unsigned int startpos = 0; unsigned int endpos = 0; unsigned int sizeOfNodes = 0; @@ -289,7 +288,6 @@ void FileWriter::writeUnstrucuredGridLTConc(std::shared_ptr<Parameter> para, int unsigned int number1, number2, number3, number4, number5, number6, number7, number8; uint dn1, dn2, dn3, dn4, dn5, dn6, dn7, dn8; bool neighborsAreFluid; - double vxmax = 0; unsigned int startpos = 0; unsigned int endpos = 0; unsigned int sizeOfNodes = 0; @@ -396,7 +394,6 @@ void FileWriter::writeUnstrucuredGridMedianLT(std::shared_ptr<Parameter> para, i unsigned int number1, number2, number3, number4, number5, number6, number7, number8; unsigned int dn1, dn2, dn3, dn4, dn5, dn6, dn7, dn8; bool neighborsFluid; - double vxmax = 0; unsigned int startpos = 0; unsigned int endpos = 0; unsigned int sizeOfNodes = 0; @@ -405,7 +402,6 @@ void FileWriter::writeUnstrucuredGridMedianLT(std::shared_ptr<Parameter> para, i //printf("\n test for if... \n"); for (unsigned int part = 0; part < fname.size(); part++) { - vxmax = 0; //printf("\n test in if I... \n"); ////////////////////////////////////////////////////////////////////////// if (((part + 1)*para->getlimitOfNodesForVTK()) > para->getParH(level)->size_Mat_SP) diff --git a/src/gpu/VirtualFluids_GPU/Output/FileWriter.h b/src/gpu/VirtualFluids_GPU/Output/FileWriter.h index 863d3a116ee2b98d954da256f0df70200d444617..7f5c3c2d27f852b72966d3a837952c70a3fcf54e 100644 --- a/src/gpu/VirtualFluids_GPU/Output/FileWriter.h +++ b/src/gpu/VirtualFluids_GPU/Output/FileWriter.h @@ -29,7 +29,7 @@ private: void VIRTUALFLUIDS_GPU_EXPORT writeUnstrucuredGridMedianLTConc(std::shared_ptr<Parameter> para, int level, std::vector<std::string >& fname); bool VIRTUALFLUIDS_GPU_EXPORT isPeriodicCell(std::shared_ptr<Parameter> para, int level, unsigned int number2, unsigned int number1, unsigned int number3, unsigned int number5); - FileWriter(const FileWriter& fileWriter) {}; + FileWriter(const FileWriter& fileWriter) = default; void VIRTUALFLUIDS_GPU_EXPORT writeCollectionFile( std::shared_ptr<Parameter> para, unsigned int timestep ); diff --git a/src/gpu/VirtualFluids_GPU/Particles/Particles.cpp b/src/gpu/VirtualFluids_GPU/Particles/Particles.cpp index 9ec6f2e6485ffab2f9c80e2c583e6b110ae5ad23..5cf30536fba525f5dae9e6a067326408c8f7f558 100644 --- a/src/gpu/VirtualFluids_GPU/Particles/Particles.cpp +++ b/src/gpu/VirtualFluids_GPU/Particles/Particles.cpp @@ -74,7 +74,7 @@ void initParticles(Parameter* para) } ////////////////////////////////////////////////////////////////////////// //set bool "hot wall" - for (unsigned int h = 0; h < para->getParH(lev)->QGeom.kQ; h++) + for (int h = 0; h < para->getParH(lev)->QGeom.kQ; h++) { if (para->getParH(lev)->coordX_SP[para->getParH(lev)->QGeom.k[h]] < para->getStartXHotWall() || para->getParH(lev)->coordX_SP[para->getParH(lev)->QGeom.k[h]] > para->getEndXHotWall()) @@ -104,7 +104,7 @@ void initParticles(Parameter* para) para->getParH(lev)->plp.veloZ[i] = (real)0.0; } ////////////////////////////////////////////////////////////////////////// - real centerX = 1.0f; //uebergabeparameter + // real centerX = 1.0f; //uebergabeparameter real centerY = 10.5f; //uebergabeparameter real centerZ = 10.5f; //uebergabeparameter real diameter = 15.0f;//21.0f; //uebergabeparameter @@ -158,7 +158,7 @@ void initParticles(Parameter* para) ////////////////////////////////////////////////////////////////////////// for (unsigned int i = 0; i < para->getParH(lev)->plp.numberOfParticles; i++) { - for (int ii = 0; ii < tempID.size(); ii++) + for (std::size_t ii = 0; ii < tempID.size(); ii++) { if ((para->getParH(lev)->coordY_SP[tempID[ii]] <= para->getParH(lev)->plp.coordYabsolut[i]) && ((para->getParH(lev)->plp.coordYabsolut[i] - para->getParH(lev)->coordY_SP[tempID[ii]]) <= dx) && @@ -455,7 +455,7 @@ void rearrangeGeometry(Parameter* para, CudaMemoryManager* cudaManager) int counter2 = 0; ////////////////////////////////////////////////////////////////////////// //redefine fluid nodes - for (int index = 0; index < para->getParH(lev)->size_Mat_SP; index++) + for (uint index = 0; index < para->getParH(lev)->size_Mat_SP; index++) { if (para->getParH(lev)->geoSP[index] == GEO_FLUID_OLD) { diff --git a/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessorFactory/PreProcessorFactoryImp.cpp b/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessorFactory/PreProcessorFactoryImp.cpp index ced53f8e29790e32b3476c7c5fdea7f3805c42d1..7bddc1e471b7615e0b83fe37d6d81edf7dfd0c52 100644 --- a/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessorFactory/PreProcessorFactoryImp.cpp +++ b/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessorFactory/PreProcessorFactoryImp.cpp @@ -22,7 +22,7 @@ std::shared_ptr<PreProcessor> PreProcessorFactoryImp::makePreProcessor(std::vect { std::shared_ptr<PreProcessorImp> prePro = PreProcessorImp::getNewInstance(); - for (int i = 0; i < preProcessorTypes.size(); i++) + for (std::size_t i = 0; i < preProcessorTypes.size(); i++) prePro->addStrategy(makePreProcessorStrategy(preProcessorTypes.at(i), para)); return prePro; diff --git a/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessorImp.cpp b/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessorImp.cpp index 0825b41a30fc2304c8b2e6a0ac22654d7d72b1c8..17c5c406d768b53b5191cd8cf18466a21dad98aa 100644 --- a/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessorImp.cpp +++ b/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessorImp.cpp @@ -17,17 +17,17 @@ void PreProcessorImp::addStrategy(std::shared_ptr<PreProcessorStrategy> strategy void PreProcessorImp::init(std::shared_ptr<Parameter> para, int level) { para->getParD(level)->evenOrOdd = false; - for (int i = 0; i < strategies.size(); i++) + for (std::size_t i = 0; i < strategies.size(); i++) strategies.at(i)->init(level); para->getParD(level)->evenOrOdd = true; - for (int i = 0; i < strategies.size(); i++) + for (std::size_t i = 0; i < strategies.size(); i++) strategies.at(i)->init(level); } bool PreProcessorImp::checkParameter() { - for (int i = 0; i < strategies.size(); i++) { + for (std::size_t i = 0; i < strategies.size(); i++) { if (!strategies.at(i)->checkParameter()) return false; } diff --git a/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessorStrategy/InitF3/InitF3_Device.cu b/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessorStrategy/InitF3/InitF3_Device.cu index 60c8dedf96d60e5410ef04ac19fdfdef59780999..3024af8bafa1bc0c6b593bbfef3dda84d2c2f3ab 100644 --- a/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessorStrategy/InitF3/InitF3_Device.cu +++ b/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessorStrategy/InitF3/InitF3_Device.cu @@ -57,7 +57,7 @@ extern "C" __global__ void LB_Init_F3(unsigned int* neighborX, ////////////////////////////////////////////////////////////////////////// //index ////////////////////////////////////////////////////////////////////////// - unsigned int kzero = k; + // unsigned int kzero = k; unsigned int ke = k; unsigned int kw = neighborX[k]; unsigned int kn = k; diff --git a/src/gpu/VirtualFluids_GPU/Temperature/FindQTemp.cpp b/src/gpu/VirtualFluids_GPU/Temperature/FindQTemp.cpp index 5f209e3556457628ed45d91544d9599330ac3ed4..c5f391e5a75bb59ce599a603b7c824a387f4615f 100644 --- a/src/gpu/VirtualFluids_GPU/Temperature/FindQTemp.cpp +++ b/src/gpu/VirtualFluids_GPU/Temperature/FindQTemp.cpp @@ -18,8 +18,8 @@ void findTempPress(Parameter* para) unsigned int nnz = para->getParH(para->getCoarse())->gridNZ; int* geo_mat = para->getParH(para->getCoarse())->geo; unsigned int* kk = para->getParH(para->getCoarse())->k; - real TempBC = para->getTemperatureBC(); - real VelBC = para->getVelocity(); + // real TempBC = para->getTemperatureBC(); + // real VelBC = para->getVelocity(); TempPressforBoundaryConditions Temp = para->getParH(para->getCoarse())->TempPress; Temp.kTemp = 0; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -139,7 +139,7 @@ void findTempVel(Parameter* para) int ny = para->getParH(para->getCoarse())->ny; unsigned int nnx = para->getParH(para->getCoarse())->gridNX; unsigned int nny = para->getParH(para->getCoarse())->gridNY; - unsigned int nnz = para->getParH(para->getCoarse())->gridNZ; + // unsigned int nnz = para->getParH(para->getCoarse())->gridNZ; int* geo_mat = para->getParH(para->getCoarse())->geo; unsigned int* kk = para->getParH(para->getCoarse())->k; real TempBC = para->getTemperatureBC(); @@ -217,7 +217,7 @@ void findKforTempVel(Parameter* para) int ny = para->getParH(para->getCoarse())->ny; unsigned int nnx = para->getParH(para->getCoarse())->gridNX; unsigned int nny = para->getParH(para->getCoarse())->gridNY; - unsigned int nnz = para->getParH(para->getCoarse())->gridNZ; + // unsigned int nnz = para->getParH(para->getCoarse())->gridNZ; int* geo_mat = para->getParH(para->getCoarse())->geo; TempVelforBoundaryConditions Temp = para->getParH(para->getCoarse())->TempVel; Temp.kTemp = 0;