diff --git a/CMakeLists.txt b/CMakeLists.txt index c200db0290943141460e3c65806089e2143221b7..a552dff404048ae5e83bfb52d9891502523d272c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -100,6 +100,10 @@ ELSE(MSVC) SET( CMAKE_CXX_FLAGS "-include ${CMAKE_BINARY_DIR}/VirtualFluidsDefinitions.h ${CMAKE_CXX_FLAGS}" ) ENDIF(MSVC) +set(CMAKE_CUDA_FLAGS " -arch=sm_60" CACHE STRING "" FORCE) + +set(CMAKE_CUDA_FLAGS_DEBUG " -G" CACHE STRING "" FORCE) + ########################################################################################################################## ### Subdirectories ### diff --git a/src/GksGpu/DataBase/DataBase.cpp b/src/GksGpu/DataBase/DataBase.cpp index e3608732ea509a34f6bf8896178de73283d45196..845f6468b3e359d9457cc24b45ca4f259c38406f 100644 --- a/src/GksGpu/DataBase/DataBase.cpp +++ b/src/GksGpu/DataBase/DataBase.cpp @@ -1,6 +1,9 @@ #include "DataBase.h" #include <string> +#include <cuda.h> +#include <cuda_runtime.h> +#include <helper_cuda.h> #include "DataBaseAllocator.h" #include "DataBaseStruct.h" diff --git a/src/GksMeshAdapter/GksMeshAdapter.cpp b/src/GksMeshAdapter/GksMeshAdapter.cpp index df7f5dc8e4ee83fc1df2535bd9629f825d414ccc..166e237c99fb1eb27167db180e5bc78ffc8f5548 100644 --- a/src/GksMeshAdapter/GksMeshAdapter.cpp +++ b/src/GksMeshAdapter/GksMeshAdapter.cpp @@ -110,6 +110,8 @@ void GksMeshAdapter::findQuadtreeConnectivity() std::vector< SPtr<Grid> > grids = this->gridBuilder->getGrids(); + Distribution dirs = DistributionHelper::getDistribution27(); + for( uint cellIdx = 0; cellIdx < this->cells.size(); cellIdx++ ){ MeshCell& cell = this->cells[ cellIdx ]; @@ -123,7 +125,6 @@ void GksMeshAdapter::findQuadtreeConnectivity() for( uint idx = 0; idx < 8; idx++ ) { - Distribution dirs = DistributionHelper::getDistribution27(); real xSign = dirs.directions[idx + 19][0]; real ySign = dirs.directions[idx + 19][1]; @@ -153,6 +154,8 @@ void GksMeshAdapter::findCellToCellConnectivity() std::vector< SPtr<Grid> > grids = this->gridBuilder->getGrids(); + Distribution dirs = DistributionHelper::getDistribution27(); + for( uint cellIdx = 0; cellIdx < this->cells.size(); cellIdx++ ){ MeshCell& cell = this->cells[ cellIdx ]; @@ -166,8 +169,6 @@ void GksMeshAdapter::findCellToCellConnectivity() { if( idx == DIR_27_ZERO ) continue; - Distribution dirs = DistributionHelper::getDistribution27(); - int xSign = dirs.directions[idx][0]; int ySign = dirs.directions[idx][1]; int zSign = dirs.directions[idx][2]; @@ -190,6 +191,8 @@ void GksMeshAdapter::findCellToCellConnectivity() void GksMeshAdapter::countCells() { + *logging::out << logging::Logger::INFO_INTERMEDIATE << "countCells()" << "\n"; + this->numberOfCellsPerLevel .resize( this->numberOfLevels ); this->numberOfBulkCellsPerLevel.resize( this->numberOfLevels ); this->startOfCellsPerLevel .resize( this->numberOfLevels ); @@ -216,6 +219,8 @@ void GksMeshAdapter::countCells() void GksMeshAdapter::partitionCells() { + *logging::out << logging::Logger::INFO_INTERMEDIATE << "partitionCells()" << "\n"; + for( uint level = 0; level < this->numberOfLevels; level++ ){ std::vector<uint> idxMap( this->cells.size() ); @@ -252,6 +257,8 @@ void GksMeshAdapter::partitionCells() void GksMeshAdapter::refreshCellConnectivity(const std::vector<uint>& idxMap) { + *logging::out << logging::Logger::INFO_INTERMEDIATE << "refreshCellConnectivity()" << "\n"; + for( auto& cell : this->cells ){ for( uint idx = 0; idx < 27; idx++ ) if( cell.cellToCell[ idx ] != INVALID_INDEX ) @@ -291,6 +298,8 @@ void GksMeshAdapter::generateNodes() nodes.reserve( 2 * this->cells.size() ); + Distribution dirs = DistributionHelper::getDistribution27(); + for( uint cellIdx = 0; cellIdx < this->cells.size(); cellIdx++ ){ MeshCell& cell = this->cells[ cellIdx ]; @@ -308,7 +317,6 @@ void GksMeshAdapter::generateNodes() { if( cell.cellToNode[idx] == INVALID_INDEX ) { - Distribution dirs = DistributionHelper::getDistribution27(); real dx = dirs.directions[idx + 19][0] * d; real dy = dirs.directions[idx + 19][1] * d; @@ -321,8 +329,6 @@ void GksMeshAdapter::generateNodes() //// register new node at neighbor cells on same level for (uint idx = 0; idx < 8; idx++) { - Distribution dirs = DistributionHelper::getDistribution27(); - real dxNeighbor = -dirs.directions[idx + 19][0] * d; real dyNeighbor = -dirs.directions[idx + 19][1] * d; real dzNeighbor = -dirs.directions[idx + 19][2] * d; @@ -442,8 +448,8 @@ void GksMeshAdapter::generateFaces() ////////////////////////////////////////////////////////////////////////// - if ( cell.type == FLUID_CFF && neighborCell.type == FLUID_FCF ) newFace.negCellCoarse = cell.parent; - if ( cell.type == FLUID_FCF && neighborCell.type == FLUID_CFF ) newFace.posCellCoarse = neighborCell.parent; + //if ( cell.type == FLUID_CFF && neighborCell.type == FLUID_FCF ) newFace.negCellCoarse = cell.parent; + //if ( cell.type == FLUID_FCF && neighborCell.type == FLUID_CFF ) newFace.posCellCoarse = neighborCell.parent; ////////////////////////////////////////////////////////////////////////// diff --git a/targets/apps/GKS/gksTest/main.cpp b/targets/apps/GKS/gksTest/main.cpp index 2728321547acbccede4b5784f1719fddadeb3b4b..333ae9413203679f2d4f98d1030b22a4b3912929 100644 --- a/targets/apps/GKS/gksTest/main.cpp +++ b/targets/apps/GKS/gksTest/main.cpp @@ -41,7 +41,7 @@ void gksTest( std::string path ) real L = 1.0; - real dx = L / 64.0; + real dx = L / 128.0; real Re = 2.0e3; real U = 0.1; @@ -165,11 +165,11 @@ void gksTest( std::string path ) ////////////////////////////////////////////////////////////////////////// - for( uint iter = 1; iter < 1000000; iter++ ) + for( uint iter = 1; iter < 100000; iter++ ) { TimeStepping::nestedTimeStep(dataBase, parameters, 0); - if( iter % 10000 == 0 ) + if( iter % 1000 == 0 ) { dataBase->copyDataDeviceToHost();