diff --git a/gpu.cmake b/gpu.cmake index b6b46c1e7093cd87df35d0a304e75594f51b36c2..6873ea7ea9da466847ba2fbb9b1739d58c37fb32 100644 --- a/gpu.cmake +++ b/gpu.cmake @@ -31,8 +31,8 @@ IF (BUILD_VF_GPU) #add_subdirectory(targets/apps/LBM/BaselNU) #add_subdirectory(targets/apps/LBM/BaselMultiGPU) - add_subdirectory(apps/gpu/LBM/DrivenCavity) - add_subdirectory(apps/gpu/LBM/SphereGPU) + # add_subdirectory(apps/gpu/LBM/DrivenCavity) + # add_subdirectory(apps/gpu/LBM/SphereGPU) #add_subdirectory(apps/gpu/LBM/WTG_RUB) #add_subdirectory(apps/gpu/LBM/gridGeneratorTest) #add_subdirectory(apps/gpu/LBM/TGV_3D) diff --git a/src/gpu/VirtualFluids_GPU/Parameter/Parameter.cpp b/src/gpu/VirtualFluids_GPU/Parameter/Parameter.cpp index b1fdbdb6cb2bd23ad15c56df21c3a3f702cf84c2..320630031054212138d99ec393dee7a63a460efe 100644 --- a/src/gpu/VirtualFluids_GPU/Parameter/Parameter.cpp +++ b/src/gpu/VirtualFluids_GPU/Parameter/Parameter.cpp @@ -2274,7 +2274,7 @@ unsigned int Parameter::getTimeDoRestart() //! unsigned int Parameter::getTimeStep(int level, unsigned int t, bool isPostCollision) { - assert(level<=this->getMaxLevel()); + if(level>this->getMaxLevel()) throw std::runtime_error("Parameter::getTimeStep: level>this->getMaxLevel()!"); unsigned int tLevel = t; if(level>0) { diff --git a/src/gpu/VirtualFluids_GPU/PreCollisionInteractor/Probes/PlanarAverageProbe.cu b/src/gpu/VirtualFluids_GPU/PreCollisionInteractor/Probes/PlanarAverageProbe.cu index c4ce82b2480fc320c3ce1b2ee3abb84a2a136273..d762717a49d122484bf07970e32df0797be17e7b 100644 --- a/src/gpu/VirtualFluids_GPU/PreCollisionInteractor/Probes/PlanarAverageProbe.cu +++ b/src/gpu/VirtualFluids_GPU/PreCollisionInteractor/Probes/PlanarAverageProbe.cu @@ -189,8 +189,7 @@ std::vector<PostProcessingVariable> PlanarAverageProbe::getPostProcessingVariabl break; default: - printf("Statistic unavailable in PlanarAverageProbe\n"); - assert(false); + throw std::runtime_error("PlanarAverageProbe::getPostProcessingVariables: Statistic unavailable!"); break; } return postProcessingVariables; diff --git a/src/gpu/VirtualFluids_GPU/PreCollisionInteractor/Probes/PlanarAverageProbe.h b/src/gpu/VirtualFluids_GPU/PreCollisionInteractor/Probes/PlanarAverageProbe.h index d2b629ae18f1ed9c8cdf6ec689883f44cb7e76a5..39e129282f937b1131fe3fc2b913a81ae7ceefe4 100644 --- a/src/gpu/VirtualFluids_GPU/PreCollisionInteractor/Probes/PlanarAverageProbe.h +++ b/src/gpu/VirtualFluids_GPU/PreCollisionInteractor/Probes/PlanarAverageProbe.h @@ -40,6 +40,8 @@ #ifndef PlanarAverageProbe_H #define PlanarAverageProbe_H +#include <iostream> + #include "Probe.h" __global__ void moveIndicesInNegNormalDir( uint* pointIndices, uint nPoints, uint* neighborWSB, uint* neighborInplane1, uint* neighborInplane2, real* coordsX, real* coordsY, real* coordsZ ); @@ -72,7 +74,8 @@ public: planeNormal(_planeNormal) { - assert(_planeNormal == 'x' || _planeNormal == 'y' || _planeNormal == 'z'); + if(_planeNormal != 'x' || _planeNormal != 'y' || _planeNormal != 'z') + throw std::runtime_error("PlanarAverageProbe: planeNormal must be 'x', 'y' or 'z'!"); } diff --git a/src/gpu/VirtualFluids_GPU/PreCollisionInteractor/Probes/PlaneProbe.cu b/src/gpu/VirtualFluids_GPU/PreCollisionInteractor/Probes/PlaneProbe.cu index d2b101bc26bb5fd4e173ebaef20333225b4e7467..e18de63c78b6744b3c823e8b50d1a5309c6b7134 100644 --- a/src/gpu/VirtualFluids_GPU/PreCollisionInteractor/Probes/PlaneProbe.cu +++ b/src/gpu/VirtualFluids_GPU/PreCollisionInteractor/Probes/PlaneProbe.cu @@ -64,8 +64,7 @@ std::vector<PostProcessingVariable> PlaneProbe::getPostProcessingVariables(Stati break; default: - printf("Statistic unavailable in PlaneProbe\n"); - assert(false); + throw std::runtime_error("PlaneProbe::getPostProcessingVariables: Statistic unavailable!"); break; } return postProcessingVariables; diff --git a/src/gpu/VirtualFluids_GPU/PreCollisionInteractor/Probes/PointProbe.cu b/src/gpu/VirtualFluids_GPU/PreCollisionInteractor/Probes/PointProbe.cu index 677710ec87ca091b45bdd665db3b58103874634d..cebac1700864a5e0431a6f05e6d0d18b0dcfd3ba 100644 --- a/src/gpu/VirtualFluids_GPU/PreCollisionInteractor/Probes/PointProbe.cu +++ b/src/gpu/VirtualFluids_GPU/PreCollisionInteractor/Probes/PointProbe.cu @@ -62,8 +62,7 @@ std::vector<PostProcessingVariable> PointProbe::getPostProcessingVariables(Stati break; default: - printf("Statistic unavailable in PointProbe\n"); - assert(false); + throw std::runtime_error("PointProbe::getPostProcessingVariables: Statistic unavailable!"); break; } return postProcessingVariables; @@ -114,7 +113,7 @@ void PointProbe::calculateQuantities(SPtr<ProbeStruct> probeStruct, Parameter* p void PointProbe::addProbePointsFromList(std::vector<real>& _pointCoordsX, std::vector<real>& _pointCoordsY, std::vector<real>& _pointCoordsZ) { bool isSameLength = ( (_pointCoordsX.size()==_pointCoordsY.size()) && (_pointCoordsY.size()==_pointCoordsZ.size())); - assert("Probe: point lists have different lengths" && isSameLength); + if (!isSameLength) throw std::runtime_error("Probe::addProbePointsFromList(): point lists have different lengths!"); this->pointCoordsX.insert(this->pointCoordsX.end(), _pointCoordsX.begin(), _pointCoordsX.end()); this->pointCoordsY.insert(this->pointCoordsY.end(), _pointCoordsY.begin(), _pointCoordsY.end()); this->pointCoordsZ.insert(this->pointCoordsZ.end(), _pointCoordsZ.begin(), _pointCoordsZ.end()); diff --git a/src/gpu/VirtualFluids_GPU/PreCollisionInteractor/Probes/Probe.cu b/src/gpu/VirtualFluids_GPU/PreCollisionInteractor/Probes/Probe.cu index 340c6ccac9ad38ddb55874fc4c194b6165d83c75..39f8d46e57cca10b82c99b9aedb606dca732f4ee 100644 --- a/src/gpu/VirtualFluids_GPU/PreCollisionInteractor/Probes/Probe.cu +++ b/src/gpu/VirtualFluids_GPU/PreCollisionInteractor/Probes/Probe.cu @@ -311,7 +311,7 @@ void Probe::free(Parameter* para, CudaMemoryManager* cudaMemoryManager) void Probe::addStatistic(Statistic variable) { - assert(this->isAvailableStatistic(variable)); + if (!this->isAvailableStatistic(variable)) throw std::runtime_error("Probe::addStatistic(): Statistic not available for this probe type!"); this->quantities[int(variable)] = true; switch(variable) diff --git a/src/gpu/VirtualFluids_GPU/PreCollisionInteractor/Probes/Probe.h b/src/gpu/VirtualFluids_GPU/PreCollisionInteractor/Probes/Probe.h index 30a757338c5cf207f6f0e7b7a3106c3bf3273fc8..a83f4d2b614f02fc8e013c6fe3d11f40eadc9924 100644 --- a/src/gpu/VirtualFluids_GPU/PreCollisionInteractor/Probes/Probe.h +++ b/src/gpu/VirtualFluids_GPU/PreCollisionInteractor/Probes/Probe.h @@ -43,6 +43,8 @@ #ifndef Probe_H #define Probe_H +#include <iostream> + #include <cuda.h> #include "PreCollisionInteractor/PreCollisionInteractor.h" @@ -150,7 +152,8 @@ public: outputTimeSeries(_outputTimeSeries), PreCollisionInteractor() { - assert("Output starts before averaging!" && tStartOut>=tStartAvg); + if (_tStartOut<_tStartAvg) throw std::runtime_error("Probe: tStartOut must be larger than tStartAvg!"); + if (_tStartTmpAvg<_tStartAvg) throw std::runtime_error("Probe: tStartTmpAvg must be larger than tStartAvg!"); } void init(Parameter* para, GridProvider* gridProvider, CudaMemoryManager* cudaMemoryManager) override; diff --git a/src/gpu/VirtualFluids_GPU/PreCollisionInteractor/Probes/WallModelProbe.cu b/src/gpu/VirtualFluids_GPU/PreCollisionInteractor/Probes/WallModelProbe.cu index 4bcfce7363a7ddf1496d68c81b13c761e97b4e5f..eb2afbe8f6cde1ec79603d7f7f29416612be41c7 100644 --- a/src/gpu/VirtualFluids_GPU/PreCollisionInteractor/Probes/WallModelProbe.cu +++ b/src/gpu/VirtualFluids_GPU/PreCollisionInteractor/Probes/WallModelProbe.cu @@ -142,8 +142,7 @@ std::vector<PostProcessingVariable> WallModelProbe::getPostProcessingVariables(S break; default: - printf("Statistic unavailable in WallModelProbe\n"); - assert(false); + throw std::runtime_error("WallModelProbe::getPostProcessingVariables: Statistic unavailable!"); break; } return postProcessingVariables; @@ -156,7 +155,8 @@ void WallModelProbe::findPoints(Parameter* para, GridProvider* gridProvider, std std::vector<real>& pointCoordsX_level, std::vector<real>& pointCoordsY_level, std::vector<real>& pointCoordsZ_level, int level) { - assert( para->getParD(level)->stressBC.numberOfBCnodes > 0 && para->getHasWallModelMonitor() ); + if ( para->getParD(level)->stressBC.numberOfBCnodes < 1) throw std::runtime_error("WallModelProbe::findPoints(): stressBC.numberOfBCnodes < 1 !"); + if ( !para->getHasWallModelMonitor()) throw std::runtime_error("WallModelProbe::findPoints(): !para->getHasWallModelMonitor() !"); real dt = para->getTimeRatio(); uint nt = uint((para->getTEnd()-this->tStartAvg)/this->tAvg); @@ -170,7 +170,7 @@ void WallModelProbe::findPoints(Parameter* para, GridProvider* gridProvider, std if(this->evaluatePressureGradient) { - assert(para->getIsBodyForce()); + if (!para->getIsBodyForce()) throw std::runtime_error("WallModelProbe::findPoints(): bodyforce not allocated!"); // Find all fluid nodes for(uint j=1; j<para->getParH(level)->numberOfNodes; j++ ) {