Skip to content
Snippets Groups Projects
Commit 9d6dd058 authored by peters's avatar peters
Browse files

Fixed a few compiler warnings.

parent 2209d06b
No related branches found
No related tags found
1 merge request!28Update open source Branch.
...@@ -332,10 +332,10 @@ int main(int argc, char *argv[]) ...@@ -332,10 +332,10 @@ int main(int argc, char *argv[])
convergenceAnalyzer.run(iter); 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"; *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"; *logging::out << logging::Logger::LOGGER_ERROR << e.what() << "\n";
} catch (std::string &s) { } catch (std::string &s) {
......
...@@ -4,9 +4,13 @@ ...@@ -4,9 +4,13 @@
#ifdef __CUDACC__ #ifdef __CUDACC__
#include <cuda_runtime.h> #include <cuda_runtime.h>
#else #else
#ifndef __host__
#define __host__ #define __host__
#endif
#ifndef __device__
#define __device__ #define __device__
#endif #endif
#endif
#include <cmath> #include <cmath>
...@@ -19,7 +23,7 @@ struct BASICS_EXPORT Vec3 { ...@@ -19,7 +23,7 @@ struct BASICS_EXPORT Vec3 {
real x{ c0o1 }, y{ c0o1 }, z{ c0o1 }; 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(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); } __host__ __device__ real length() { return std::sqrt(x * x + y * y + z * z); }
......
...@@ -479,8 +479,6 @@ void GksMeshAdapter::sortFaces() ...@@ -479,8 +479,6 @@ void GksMeshAdapter::sortFaces()
// sort into blocks // sort into blocks
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
std::array<char, 3> orientations = {'x', 'y', 'z'};
for( uint level = 0; level < this->gridBuilder->getNumberOfLevels(); level++ ) for( uint level = 0; level < this->gridBuilder->getNumberOfLevels(); level++ )
{ {
for( uint idx = 0; idx < 3; idx++ ) for( uint idx = 0; idx < 3; idx++ )
...@@ -488,18 +486,14 @@ void GksMeshAdapter::sortFaces() ...@@ -488,18 +486,14 @@ void GksMeshAdapter::sortFaces()
uint start = this->startOfFacesPerLevelXYZ [ 3 * level + idx]; uint start = this->startOfFacesPerLevelXYZ [ 3 * level + idx];
uint end = start + this->numberOfFacesPerLevelXYZ[ 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 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 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 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 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 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 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; uint blockDim = 8;
real dx = this->gridBuilder->getGrid(level)->getDelta(); real dx = this->gridBuilder->getGrid(level)->getDelta();
......
...@@ -117,7 +117,8 @@ public: ...@@ -117,7 +117,8 @@ public:
void fillVelocityLists() void fillVelocityLists()
{ {
for( uint index : this->indices ){ for( uint index : this->indices ) {
(void) index;
this->vxList.push_back(vx); this->vxList.push_back(vx);
this->vyList.push_back(vy); this->vyList.push_back(vy);
this->vzList.push_back(vz); this->vzList.push_back(vz);
......
...@@ -231,6 +231,10 @@ public: ...@@ -231,6 +231,10 @@ public:
return SPtr<Side>(new MZ()); return SPtr<Side>(new MZ());
case SideType::PZ: case SideType::PZ:
return SPtr<Side>(new 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.");
} }
} }
}; };
......
...@@ -80,7 +80,7 @@ void LevelGridBuilder::setPeriodicBoundaryCondition(bool periodic_X, bool period ...@@ -80,7 +80,7 @@ void LevelGridBuilder::setPeriodicBoundaryCondition(bool periodic_X, bool period
void LevelGridBuilder::setNoSlipBoundaryCondition(SideType sideType) 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); 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) ...@@ -162,7 +162,7 @@ std::shared_ptr<Grid> LevelGridBuilder::getGrid(int level, int box)
void LevelGridBuilder::checkLevel(int level) void LevelGridBuilder::checkLevel(int level)
{ {
if (level >= grids.size()) if (level >= (int)grids.size())
{ {
std::cout << "wrong level input... return to caller\n"; std::cout << "wrong level input... return to caller\n";
return; return;
...@@ -199,7 +199,7 @@ void LevelGridBuilder::getVelocityValues(real* vx, real* vy, real* vz, int* indi ...@@ -199,7 +199,7 @@ void LevelGridBuilder::getVelocityValues(real* vx, real* vy, real* vz, int* indi
int allIndicesCounter = 0; int allIndicesCounter = 0;
for (auto boundaryCondition : boundaryConditions[level]->velocityBoundaryConditions) 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; indices[allIndicesCounter] = grids[level]->getSparseIndex(boundaryCondition->indices[i]) +1;
......
...@@ -84,6 +84,8 @@ public: ...@@ -84,6 +84,8 @@ public:
{ {
case Device::CPU: case Device::CPU:
gridStrategy = SPtr<GridStrategy>(new GridCpuStrategy()); break; gridStrategy = SPtr<GridStrategy>(new GridCpuStrategy()); break;
case Device::GPU:
throw std::runtime_error("GPU Device for GridGenerator not supported.");
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment