diff --git a/src/basics/Core/Input/ConfigData/ConfigData.h b/src/basics/Core/Input/ConfigData/ConfigData.h index acd5ee053b6f1972e7e36751c15387e16d976688..16f789ef9f0104ce12caa630bc00181d80f06fa6 100644 --- a/src/basics/Core/Input/ConfigData/ConfigData.h +++ b/src/basics/Core/Input/ConfigData/ConfigData.h @@ -9,6 +9,8 @@ class ConfigData { public: + virtual ~ConfigData() = default; + virtual real getViscosity() = 0; virtual uint getNumberOfDevices() = 0; virtual std::vector<uint> getDevices() = 0; diff --git a/src/basics/Core/VectorTypes.h b/src/basics/Core/VectorTypes.h index dd4b26779c594ca4bdb9a0f57268ce879026a3fb..5bb4f9d2a0411fb21e62bc99f4b113fa5c324664 100644 --- a/src/basics/Core/VectorTypes.h +++ b/src/basics/Core/VectorTypes.h @@ -16,10 +16,10 @@ #include "RealConstants.h" struct BASICS_EXPORT Vec3 { - real x, y, z; + 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() : x(c0o1), y(c0o1), z(c0o1) {} + __host__ __device__ Vec3() {} __host__ __device__ real length() { return std::sqrt( x*x + y*y + z*z ); diff --git a/src/basics/basics/container/CbVector.h b/src/basics/basics/container/CbVector.h index e6b07f8f5754b236bd0d5af4ba01e22237b38d3c..49d39c30ccf26039129aea42811adf9313d0bedd 100644 --- a/src/basics/basics/container/CbVector.h +++ b/src/basics/basics/container/CbVector.h @@ -73,8 +73,8 @@ public: /*==========================================================*/ CbVector( CbVectorAllocator<value_type>* const& allocator = new CbVectorAllocatorStd<value_type> ) : ptrData(NULL) - , dataSize(0) - , allocator(allocator) + , + allocator(allocator) { this->allocator->alloc(*this,0,value_type()); } @@ -205,7 +205,7 @@ public: private: value_type* ptrData; - size_type dataSize; + size_type dataSize{0}; CbVectorAllocator<value_type>* allocator; CbVector<value_type>(const CbVector<value_type>& src); //CbVector<value_type>& operator=(const CbVector<value_type>& src); diff --git a/src/basics/basics/utilities/UbException.h b/src/basics/basics/utilities/UbException.h index 35c40eed71b47c0280c577da9cd368a235941fc1..7c625c33f73fb92ae4d3aa1a7a20c822276f16a0 100644 --- a/src/basics/basics/utilities/UbException.h +++ b/src/basics/basics/utilities/UbException.h @@ -109,11 +109,11 @@ public: } ////////////////////////////////////////////////////////////////////////// //destructor - ~UbException() throw() override = default; + ~UbException() noexcept override = default; ////////////////////////////////////////////////////////////////////////// //virtual public methods //returns exception-string - const char* what() const throw() override + const char* what() const noexcept override { exceptionString = this->toString(); return exceptionString.c_str(); //ansonsten ist das Verhalten anschliessend undefiniert! diff --git a/src/basics/basics/utilities/UbTiming.h b/src/basics/basics/utilities/UbTiming.h index 71e95ce6aa5ff9a7d59b69092c2e251dcd930f19..b3d5d034a565804fc400050ee6e64406fbb8a8c7 100644 --- a/src/basics/basics/utilities/UbTiming.h +++ b/src/basics/basics/utilities/UbTiming.h @@ -223,8 +223,8 @@ class UbTimer { public: UbTimer(const bool& storeLapTimes = false) - : name("unamed"), isMeasuring(false), storeLapTimes(storeLapTimes) - , startTime(0.0), totalTime(0.0), lapTime(0.0) + : name("unamed"), storeLapTimes(storeLapTimes) + { } @@ -355,12 +355,12 @@ public: protected: std::string name; - bool isMeasuring; + bool isMeasuring{false}; bool storeLapTimes; - double startTime; - double totalTime; - double lapTime; + double startTime{0.0}; + double totalTime{0.0}; + double lapTime{0.0}; std::vector<double> lapTimes; }; diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/BCAdapter.h b/src/cpu/VirtualFluidsCore/BoundaryConditions/BCAdapter.h index a58eab73751641759c903db56536befe463f8a00..f1e868db147dfe5258208fdbc01c5b3a6a339e5c 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/BCAdapter.h +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/BCAdapter.h @@ -46,9 +46,7 @@ class BCAdapter { public: BCAdapter() - : secondaryBcOption(0) - , type(0) - , algorithmType(-1) + { } //! \param secondaryBcOption additional option of boundary conditions @@ -77,12 +75,12 @@ public: char getBcAlgorithmType() {return algorithmType;} protected: - short secondaryBcOption; + short secondaryBcOption{0}; - char type; + char type{0}; SPtr<BCAlgorithm> algorithm; - char algorithmType; + char algorithmType{-1}; static const char TIMEDEPENDENT = 1<<0;//'1'; static const char TIMEPERIODIC = 1<<1;//'2'; diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/BCAlgorithm.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/BCAlgorithm.cpp index 7ec1efcc307e9cd288853faf72601306d9b89bd6..3c84b521b70c285229400ed504feb0abc1116726 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/BCAlgorithm.cpp +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/BCAlgorithm.cpp @@ -38,7 +38,7 @@ #include "BCArray3D.h" -BCAlgorithm::BCAlgorithm() : compressible(false) +BCAlgorithm::BCAlgorithm() { } diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/BCAlgorithm.h b/src/cpu/VirtualFluidsCore/BoundaryConditions/BCAlgorithm.h index 6addd98e450d674df5fffbea4a22c90a4faa44ea..03ff681b4f1f6e0d6fc6661a68f360e4ce24e1ad 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/BCAlgorithm.h +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/BCAlgorithm.h @@ -74,7 +74,7 @@ public: virtual void applyBC() = 0; protected: - bool compressible; + bool compressible{false}; char type; bool preCollision; diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/BoundaryConditions.h b/src/cpu/VirtualFluidsCore/BoundaryConditions/BoundaryConditions.h index 981624ce7b610e6b6288d12d87b52b3efa65525e..eafba30165401da13f9e21d1d2842f2ca46c38e4 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/BoundaryConditions.h +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/BoundaryConditions.h @@ -48,24 +48,7 @@ class BoundaryConditions { public: BoundaryConditions() - : noslipBoundaryFlags(0) - , slipBoundaryFlags(0) - , velocityBoundaryFlags(0) - , densityBoundaryFlags(0) - , wallModelBoundaryFlags(0) - , bcVelocityX1(0.0f) - , bcVelocityX2(0.0f) - , bcVelocityX3(0.0f) - , bcDensity(0.0f) - , bcLodiDensity(0.0f) - , bcLodiVelocityX1(0.0f) - , bcLodiVelocityX2(0.0f) - , bcLodiVelocityX3(0.0f) - , bcLodiLentgh(0.0f) - , nx1(0.0f) - , nx2(0.0f) - , nx3(0.0f) - , algorithmType(-1) + { UB_STATIC_ASSERT( sizeof(long long) >= 8); UB_STATIC_ASSERT( (sizeof(long long)*8) >= (D3Q27System::FENDDIR+1)*BoundaryConditions::optionDigits ); @@ -258,26 +241,26 @@ public: protected: LBMReal q[D3Q27System::FENDDIR+1]; - long long noslipBoundaryFlags; - long long slipBoundaryFlags; - long long velocityBoundaryFlags; - long long densityBoundaryFlags; - long long wallModelBoundaryFlags; + long long noslipBoundaryFlags{0}; + long long slipBoundaryFlags{0}; + long long velocityBoundaryFlags{0}; + long long densityBoundaryFlags{0}; + long long wallModelBoundaryFlags{0}; - LBMReal bcVelocityX1; - LBMReal bcVelocityX2; - LBMReal bcVelocityX3; - LBMReal bcDensity; + LBMReal bcVelocityX1{0.0f}; + LBMReal bcVelocityX2{0.0f}; + LBMReal bcVelocityX3{0.0f}; + LBMReal bcDensity{0.0f}; - LBMReal bcLodiDensity; - LBMReal bcLodiVelocityX1; - LBMReal bcLodiVelocityX2; - LBMReal bcLodiVelocityX3; - LBMReal bcLodiLentgh; + LBMReal bcLodiDensity{0.0f}; + LBMReal bcLodiVelocityX1{0.0f}; + LBMReal bcLodiVelocityX2{0.0f}; + LBMReal bcLodiVelocityX3{0.0f}; + LBMReal bcLodiLentgh{0.0f}; - LBMReal nx1,nx2,nx3; + LBMReal nx1{0.0f},nx2{0.0f},nx3{0.0f}; - char algorithmType; + char algorithmType{-1}; }; #endif diff --git a/src/cpu/VirtualFluidsCore/Connectors/Block3DConnector.h b/src/cpu/VirtualFluidsCore/Connectors/Block3DConnector.h index bffa38f7ddd5f57fd545aa351bcc63d5b272f985..7a6eb8eb03ca96710f2a094542a4a8d833b43eb3 100644 --- a/src/cpu/VirtualFluidsCore/Connectors/Block3DConnector.h +++ b/src/cpu/VirtualFluidsCore/Connectors/Block3DConnector.h @@ -46,7 +46,7 @@ class Block3DConnector { public: - Block3DConnector() : sendDir(-1) {} + Block3DConnector() {} Block3DConnector(const int& sendDir) : sendDir(sendDir) {} virtual ~Block3DConnector() = default; //!Iniitializes connector @@ -76,7 +76,7 @@ public: virtual int getSendDir() const { return sendDir; } protected: - int sendDir; + int sendDir{-1}; }; #endif //BLOCK3DCONNECTOR_H diff --git a/src/cpu/VirtualFluidsCore/Grid/Block3D.cpp b/src/cpu/VirtualFluidsCore/Grid/Block3D.cpp index 8c44f2e600ff5683a94aec246b4ebc0dbbcdade2..1f24b8ebc1de34162b9770785ee60c97c51ab266 100644 --- a/src/cpu/VirtualFluidsCore/Grid/Block3D.cpp +++ b/src/cpu/VirtualFluidsCore/Grid/Block3D.cpp @@ -40,16 +40,7 @@ int Block3D::counter = 0; ////////////////////////////////////////////////////////////////////////// -Block3D::Block3D() : x1(0),x2(0),x3(0) - ,active(true) - ,globalID(-1) - ,rank(-1),part(-1) - ,interpolationFlagCF(0) - ,interpolationFlagFC(0) - ,level(-1) - ,bundle(-1) - ,lrank(-1) - ,localID(-1) +Block3D::Block3D() { } ////////////////////////////////////////////////////////////////////////// diff --git a/src/cpu/VirtualFluidsCore/Grid/Block3D.h b/src/cpu/VirtualFluidsCore/Grid/Block3D.h index 38c8a3a4051527b6ae84faa43704d6cba2b62bd3..da7fb5ae4eabf9b3e3c19f5ca022ac4d0cd2acb5 100644 --- a/src/cpu/VirtualFluidsCore/Grid/Block3D.h +++ b/src/cpu/VirtualFluidsCore/Grid/Block3D.h @@ -138,26 +138,26 @@ public: static void setMaxGlobalID(int c) { counter = 0; } private: - int x1; - int x2; - int x3; + int x1{0}; + int x2{0}; + int x3{0}; - bool active; + bool active{true}; - int interpolationFlagCF; - int interpolationFlagFC; + int interpolationFlagCF{0}; + int interpolationFlagFC{0}; SPtr<LBMKernel> kernel; std::vector<SPtr<Block3DConnector> > connectors; std::map<int, int> weight; - int bundle; - int rank; - int lrank; - int globalID; - int localID; - int part; - int level; + int bundle{-1}; + int rank{-1}; + int lrank{-1}; + int globalID{-1}; + int localID{-1}; + int part{-1}; + int level{-1}; static int counter; }; diff --git a/src/cpu/VirtualFluidsCore/Grid/Grid3D.cpp b/src/cpu/VirtualFluidsCore/Grid/Grid3D.cpp index ac4577abfcb3b4dc3b453c9b9f6181a9fcca96b2..128c9d393a4f7573461ac124b1d3fe54a9e294e8 100644 --- a/src/cpu/VirtualFluidsCore/Grid/Grid3D.cpp +++ b/src/cpu/VirtualFluidsCore/Grid/Grid3D.cpp @@ -49,20 +49,8 @@ using namespace std; -Grid3D::Grid3D() : - rank(0), - bundle(0), - orgDeltaX(1.0), - periodicX1(false), - periodicX2(false), - periodicX3(false), - timeStep(0.0), - blockNx1(0), - blockNx2(0), - blockNx3(0), - nx1(0), - nx2(0), - nx3(0) +Grid3D::Grid3D() + { levelSet.resize(Grid3DSystem::MAXLEVEL+1); } diff --git a/src/cpu/VirtualFluidsCore/Grid/Grid3D.h b/src/cpu/VirtualFluidsCore/Grid/Grid3D.h index 16e64d43b8cf543108d3079a7db69b39f407df1c..192405647b7d09fea3975602a2c85d144efe8212 100644 --- a/src/cpu/VirtualFluidsCore/Grid/Grid3D.h +++ b/src/cpu/VirtualFluidsCore/Grid/Grid3D.h @@ -249,25 +249,25 @@ private: BlockIDMap blockIdMap; Interactor3DSet interactors; - int rank; - int bundle; + int rank{0}; + int bundle{0}; - bool periodicX1; - bool periodicX2; - bool periodicX3; + bool periodicX1{false}; + bool periodicX2{false}; + bool periodicX3{false}; - int blockNx1; - int blockNx2; - int blockNx3; + int blockNx1{0}; + int blockNx2{0}; + int blockNx3{0}; - int nx1; - int nx2; - int nx3; + int nx1{0}; + int nx2{0}; + int nx3{0}; SPtr<CoordinateTransformation3D> trafo; - double orgDeltaX; + double orgDeltaX{1.0}; - double timeStep; + double timeStep{0.0}; }; diff --git a/src/cpu/VirtualFluidsCore/LBM/LBMKernel.cpp b/src/cpu/VirtualFluidsCore/LBM/LBMKernel.cpp index ec1bb4049181b613542fc66953a8f0e34859182a..bddb8984a057f332255e76d8c2fff87688df323c 100644 --- a/src/cpu/VirtualFluidsCore/LBM/LBMKernel.cpp +++ b/src/cpu/VirtualFluidsCore/LBM/LBMKernel.cpp @@ -37,11 +37,8 @@ #include "Block3D.h" #include "BCArray3D.h" -LBMKernel::LBMKernel() : ghostLayerWidth(1), - deltaT(1.0), - withForcing(false), - withSpongeLayer(false), - compressible(false) +LBMKernel::LBMKernel() + { this->setForcingX1(0.0); this->setForcingX2(0.0); diff --git a/src/cpu/VirtualFluidsCore/LBM/LBMKernel.h b/src/cpu/VirtualFluidsCore/LBM/LBMKernel.h index c8b9bc4ebc94170538b282720f59f05b2d2122d6..6a141dfc162504039abb8e9f3c32cb9afb08ddff 100644 --- a/src/cpu/VirtualFluidsCore/LBM/LBMKernel.h +++ b/src/cpu/VirtualFluidsCore/LBM/LBMKernel.h @@ -110,19 +110,19 @@ protected: SPtr<DataSet3D> dataSet; SPtr<BCProcessor> bcProcessor; LBMReal collFactor; - int ghostLayerWidth; - bool compressible; + int ghostLayerWidth{1}; + bool compressible{false}; //forcing - bool withForcing; + bool withForcing{false}; mu::Parser muForcingX1; mu::Parser muForcingX2; mu::Parser muForcingX3; int ix1, ix2, ix3; - LBMReal deltaT; + LBMReal deltaT{1.0}; //sponge layer - bool withSpongeLayer; + bool withSpongeLayer{false}; mu::Parser muSpongeLayer; WPtr<Block3D> block; diff --git a/src/cpu/VirtualFluidsCore/LBM/LBMUnitConverter.h b/src/cpu/VirtualFluidsCore/LBM/LBMUnitConverter.h index 58f5aedba8bea1bdc43bff4f358446d3f43cdeb6..3b588282de428b4805497e01b1797a55b315e4f3 100644 --- a/src/cpu/VirtualFluidsCore/LBM/LBMUnitConverter.h +++ b/src/cpu/VirtualFluidsCore/LBM/LBMUnitConverter.h @@ -66,10 +66,8 @@ public: enum WORLD_MATERIAL { WATER = 0, SEAWWATER = 1, AIR_20C = 2, OIL = 3 }; - LBMUnitConverter() : factorLengthLbToW(1.0), - factorTimeLbToW(1.0), - factorMassLbToW(1.0), - refRhoLb(1.0) + LBMUnitConverter() + { } @@ -180,10 +178,10 @@ public: } protected: - double factorLengthLbToW; - double factorTimeLbToW; - double factorMassLbToW; - double refRhoLb; + double factorLengthLbToW{1.0}; + double factorTimeLbToW{1.0}; + double factorMassLbToW{1.0}; + double refRhoLb{1.0}; double factorTimeWithoutDx; }; diff --git a/src/cpu/VirtualFluidsCore/Visitors/Block3DVisitor.h b/src/cpu/VirtualFluidsCore/Visitors/Block3DVisitor.h index e1e50969cf819d59f4a199738d5673b1a74b3d9c..f916d5f1db0f1559c7ded6deaae50a436ac23e2a 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/Block3DVisitor.h +++ b/src/cpu/VirtualFluidsCore/Visitors/Block3DVisitor.h @@ -43,7 +43,7 @@ class Grid3D; class Block3DVisitor { public: - Block3DVisitor() : startLevel(-1), stopLevel(-1) + Block3DVisitor() { } @@ -62,8 +62,8 @@ public: void setStopLevel(int level); private: - int startLevel; - int stopLevel; + int startLevel{-1}; + int stopLevel{-1}; }; ////////////////////////////////////////////////////////////////////////// inline int Block3DVisitor::getStartLevel() const