diff --git a/apps/gpu/LidDrivenCavityGPU/LidDrivenCavity.cpp b/apps/gpu/LidDrivenCavityGPU/LidDrivenCavity.cpp index 4697e58ab37f46baa5be6181771d9b72919243bc..4d2fdc51e94df73cbde1ec92e220e8b5ee5b2943 100644 --- a/apps/gpu/LidDrivenCavityGPU/LidDrivenCavity.cpp +++ b/apps/gpu/LidDrivenCavityGPU/LidDrivenCavity.cpp @@ -332,10 +332,10 @@ int main(int argc, char *argv[]) convergenceAnalyzer.run(iter); } } - } catch (const std::bad_alloc e) { + } catch (const std::bad_alloc& e) { *logging::out << logging::Logger::LOGGER_ERROR << "Bad Alloc:" << e.what() << "\n"; - } catch (const std::exception &e) { + } catch (const std::exception& e) { *logging::out << logging::Logger::LOGGER_ERROR << e.what() << "\n"; } catch (std::string &s) { diff --git a/src/basics/Core/VectorTypes.h b/src/basics/Core/VectorTypes.h index 0256a960ddf53a6d4fb8efee8b54e5d4679987f1..3109112b299e5ac169d9f536a4d4e66b7970cff2 100644 --- a/src/basics/Core/VectorTypes.h +++ b/src/basics/Core/VectorTypes.h @@ -4,9 +4,13 @@ #ifdef __CUDACC__ #include <cuda_runtime.h> #else +#ifndef __host__ #define __host__ +#endif +#ifndef __device__ #define __device__ #endif +#endif #include <cmath> @@ -19,7 +23,7 @@ struct BASICS_EXPORT Vec3 { real x{ c0o1 }, y{ c0o1 }, z{ c0o1 }; __host__ __device__ Vec3(real x, real y, real z) : x(x), y(y), z(z) {} - __host__ __device__ Vec3() = default; + Vec3() = default; __host__ __device__ real length() { return std::sqrt(x * x + y * y + z * z); } diff --git a/src/gpu/GksMeshAdapter/GksMeshAdapter.cpp b/src/gpu/GksMeshAdapter/GksMeshAdapter.cpp index 3d044555ef521fea8bce18b13080ff01d5f9b17d..a3dc8d8bd47f0497a6b7d233a10ceebb8ab7ce82 100644 --- a/src/gpu/GksMeshAdapter/GksMeshAdapter.cpp +++ b/src/gpu/GksMeshAdapter/GksMeshAdapter.cpp @@ -479,8 +479,6 @@ void GksMeshAdapter::sortFaces() // sort into blocks //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - std::array<char, 3> orientations = {'x', 'y', 'z'}; - for( uint level = 0; level < this->gridBuilder->getNumberOfLevels(); level++ ) { for( uint idx = 0; idx < 3; idx++ ) @@ -488,18 +486,14 @@ void GksMeshAdapter::sortFaces() uint start = this->startOfFacesPerLevelXYZ [ 3 * level + idx]; uint end = start + this->numberOfFacesPerLevelXYZ[ 3 * level + idx]; - real xMax = (*std::max_element(this->faces.begin() + start, this->faces.begin() + end, [this](MeshFace lhs, MeshFace rhs) { return lhs.faceCenter.x < rhs.faceCenter.x; })).faceCenter.x; - real yMax = (*std::max_element(this->faces.begin() + start, this->faces.begin() + end, [this](MeshFace lhs, MeshFace rhs) { return lhs.faceCenter.y < rhs.faceCenter.y; })).faceCenter.y; - real zMax = (*std::max_element(this->faces.begin() + start, this->faces.begin() + end, [this](MeshFace lhs, MeshFace rhs) { return lhs.faceCenter.z < rhs.faceCenter.z; })).faceCenter.z; + // real xMax = (*std::max_element(this->faces.begin() + start, this->faces.begin() + end, [this](MeshFace /lhs, MeshFace rhs) { return lhs.faceCenter.x < rhs.faceCenter.x; })).faceCenter.x; + // real yMax = (*std::max_element(this->faces.begin() + start, this->faces.begin() + end, [this](MeshFace lhs, MeshFace rhs) { return lhs.faceCenter.y < rhs.faceCenter.y; })).faceCenter.y; + // real zMax = (*std::max_element(this->faces.begin() + start, this->faces.begin() + end, [this](MeshFace lhs, MeshFace rhs) { return lhs.faceCenter.z < rhs.faceCenter.z; })).faceCenter.z; real xMin = (*std::min_element(this->faces.begin() + start, this->faces.begin() + end, [this](MeshFace lhs, MeshFace rhs) { return lhs.faceCenter.x < rhs.faceCenter.x; })).faceCenter.x; real yMin = (*std::min_element(this->faces.begin() + start, this->faces.begin() + end, [this](MeshFace lhs, MeshFace rhs) { return lhs.faceCenter.y < rhs.faceCenter.y; })).faceCenter.y; real zMin = (*std::min_element(this->faces.begin() + start, this->faces.begin() + end, [this](MeshFace lhs, MeshFace rhs) { return lhs.faceCenter.z < rhs.faceCenter.z; })).faceCenter.z; - real xRange = xMax - xMin; - real yRange = yMax - yMin; - real zRange = zMax - zMin; - uint blockDim = 8; real dx = this->gridBuilder->getGrid(level)->getDelta(); diff --git a/src/gpu/GridGenerator/grid/BoundaryConditions/BoundaryCondition.h b/src/gpu/GridGenerator/grid/BoundaryConditions/BoundaryCondition.h index b082e6a7402a606b72d08bc28e9b612fa6661974..6d7ae50da444069769daafb3d36f1c0f3093aafc 100644 --- a/src/gpu/GridGenerator/grid/BoundaryConditions/BoundaryCondition.h +++ b/src/gpu/GridGenerator/grid/BoundaryConditions/BoundaryCondition.h @@ -117,7 +117,8 @@ public: void fillVelocityLists() { - for( uint index : this->indices ){ + for( uint index : this->indices ) { + (void) index; this->vxList.push_back(vx); this->vyList.push_back(vy); this->vzList.push_back(vz); diff --git a/src/gpu/GridGenerator/grid/BoundaryConditions/Side.h b/src/gpu/GridGenerator/grid/BoundaryConditions/Side.h index d8dc9a0e4ac8c2825d49dd19148d53538d027a8e..d8bd6134448c3324fec5fef51db8db85c9a0d84e 100644 --- a/src/gpu/GridGenerator/grid/BoundaryConditions/Side.h +++ b/src/gpu/GridGenerator/grid/BoundaryConditions/Side.h @@ -231,6 +231,10 @@ public: return SPtr<Side>(new MZ()); case SideType::PZ: return SPtr<Side>(new PZ()); + case SideType::GEOMETRY: + throw std::runtime_error("SideFactory::make() - SideType::GEOMETRY not supported."); + default: + throw std::runtime_error("SideFactory::make() - SideType not valid."); } } }; diff --git a/src/gpu/GridGenerator/grid/GridBuilder/LevelGridBuilder.cpp b/src/gpu/GridGenerator/grid/GridBuilder/LevelGridBuilder.cpp index 7cf735197b9fd69c7f85351e659fb31c4818efd6..3b9f91d9ef6e4e2564ff07b24d35630b804d5fa3 100644 --- a/src/gpu/GridGenerator/grid/GridBuilder/LevelGridBuilder.cpp +++ b/src/gpu/GridGenerator/grid/GridBuilder/LevelGridBuilder.cpp @@ -80,7 +80,7 @@ void LevelGridBuilder::setPeriodicBoundaryCondition(bool periodic_X, bool period void LevelGridBuilder::setNoSlipBoundaryCondition(SideType sideType) { - for (int level = 0; level < getNumberOfGridLevels(); level++) + for (uint level = 0; level < getNumberOfGridLevels(); level++) { SPtr<VelocityBoundaryCondition> noSlipBoundaryCondition = VelocityBoundaryCondition::make(0.0, 0.0, 0.0); @@ -162,7 +162,7 @@ std::shared_ptr<Grid> LevelGridBuilder::getGrid(int level, int box) void LevelGridBuilder::checkLevel(int level) { - if (level >= grids.size()) + if (level >= (int)grids.size()) { std::cout << "wrong level input... return to caller\n"; return; @@ -199,7 +199,7 @@ void LevelGridBuilder::getVelocityValues(real* vx, real* vy, real* vz, int* indi int allIndicesCounter = 0; for (auto boundaryCondition : boundaryConditions[level]->velocityBoundaryConditions) { - for(int i = 0; i < boundaryCondition->indices.size(); i++) + for(std::size_t i = 0; i < boundaryCondition->indices.size(); i++) { indices[allIndicesCounter] = grids[level]->getSparseIndex(boundaryCondition->indices[i]) +1; diff --git a/src/gpu/GridGenerator/grid/GridFactory.h b/src/gpu/GridGenerator/grid/GridFactory.h index 5a76d272a3ec045c4abc346d34450ef201733b68..9ebf1e3a13184a9b3aea75694c74e039fc987ad5 100644 --- a/src/gpu/GridGenerator/grid/GridFactory.h +++ b/src/gpu/GridGenerator/grid/GridFactory.h @@ -84,6 +84,8 @@ public: { case Device::CPU: gridStrategy = SPtr<GridStrategy>(new GridCpuStrategy()); break; + case Device::GPU: + throw std::runtime_error("GPU Device for GridGenerator not supported."); } }