From 3a9a1f1d4419b6464ba0fb44e42816a0b17af713 Mon Sep 17 00:00:00 2001 From: peters <peters@irmb.tu-bs.de> Date: Wed, 7 Oct 2020 16:52:56 +0200 Subject: [PATCH] Fix clang-tidy issues with gcc compiler. --- 3rdParty/MuParser/CMakeLists.txt | 2 +- CMake/compilerflags/GNU.cmake | 2 +- apps/cpu/LidDrivenCavity/LidDrivenCavity.cpp | 14 ++++++------- .../Core/Input/ConfigInput/ConfigInput.cpp | 2 +- .../Core/Input/ConfigInput/ConfigInput.h | 2 +- src/basics/Core/Timer/TimerImp.h | 2 +- src/basics/basics/container/CbArray2D.h | 2 +- src/basics/basics/utilities/UbSystem.h | 4 ++-- .../BoundaryConditions/BCArray3D.cpp | 6 +++--- .../BoundaryConditions/BCProcessor.cpp | 2 +- .../Data/D3Q27EsoTwist3DSplittedVector.cpp | 6 +++--- .../Grid/BasicCalculator.cpp | 3 --- .../VirtualFluidsCore/Grid/BasicCalculator.h | 2 +- src/cpu/VirtualFluidsCore/Grid/Block3D.cpp | 2 +- src/cpu/VirtualFluidsCore/Grid/Calculator.cpp | 4 ++-- src/cpu/VirtualFluidsCore/Grid/Grid3D.cpp | 20 +++++++++---------- .../Interactors/D3Q27Interactor.cpp | 4 ++-- .../Interactors/D3Q27Interactor.h | 2 +- src/cpu/VirtualFluidsCore/LBM/LBMKernel.cpp | 2 +- .../VirtualFluidsCore/Utilities/MemoryUtil.h | 6 +++--- .../InitDistributionsBlockVisitor.cpp | 11 +++++----- 21 files changed, 48 insertions(+), 52 deletions(-) diff --git a/3rdParty/MuParser/CMakeLists.txt b/3rdParty/MuParser/CMakeLists.txt index 14a1e4e45..49aa3ac25 100644 --- a/3rdParty/MuParser/CMakeLists.txt +++ b/3rdParty/MuParser/CMakeLists.txt @@ -35,7 +35,7 @@ if(MSVC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4251 /wd4310 /wd4267") # disable all muparser warnings elseif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) # Update if necessary - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-long-long -pedantic") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-long-long -pedantic -Wno-unknown-pragmas") endif() add_library(muparser diff --git a/CMake/compilerflags/GNU.cmake b/CMake/compilerflags/GNU.cmake index f44cafc66..8f932429c 100644 --- a/CMake/compilerflags/GNU.cmake +++ b/CMake/compilerflags/GNU.cmake @@ -21,7 +21,7 @@ list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wall") list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wno-unused-function") list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wno-reorder") list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wno-sign-compare") - +list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wno-unknown-pragmas") ############################################################################################################# # linker options diff --git a/apps/cpu/LidDrivenCavity/LidDrivenCavity.cpp b/apps/cpu/LidDrivenCavity/LidDrivenCavity.cpp index ff842ab75..c82742b7b 100644 --- a/apps/cpu/LidDrivenCavity/LidDrivenCavity.cpp +++ b/apps/cpu/LidDrivenCavity/LidDrivenCavity.cpp @@ -110,13 +110,13 @@ int main(int /*argc*/, char* /*argv*/[]) grid->accept(genBlocks); // Write block grid to VTK-file - SPtr<CoProcessor> ppblocks(new WriteBlocksCoProcessor(grid, SPtr<UbScheduler>(new UbScheduler(1)), path, WbWriterVtkXmlBinary::getInstance(), comm)); + auto ppblocks = std::make_shared<WriteBlocksCoProcessor>(grid, SPtr<UbScheduler>(new UbScheduler(1)), path, WbWriterVtkXmlBinary::getInstance(), comm); ppblocks->process(0); ppblocks.reset(); // Create LBM kernel - SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new CumulantK17LBMKernel()); + auto kernel = std::make_shared<CumulantK17LBMKernel>(); //SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new LBMKernelETD3Q27BGK()); @@ -125,16 +125,16 @@ int main(int /*argc*/, char* /*argv*/[]) // Create boundary conditions (BC) ////////////////////////////////////////////////////////////////////////// // Create no-slip BC - SPtr<BCAdapter> noSlipBCAdapter(new NoSlipBCAdapter()); - noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new NoSlipBCAlgorithm())); + auto noSlipBCAdapter = std::make_shared<NoSlipBCAdapter>(); + noSlipBCAdapter->setBcAlgorithm(std::make_shared<NoSlipBCAlgorithm>()); // Velocity BC mu::Parser fct; fct.SetExpr("u"); fct.DefineConst("u", u); // Set the same velocity in x and y-direction - SPtr<BCAdapter> velBCAdapter(new VelocityBCAdapter(true, true, false, fct, 0, BCFunction::INFCONST)); - velBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new VelocityBCAlgorithm())); + auto velBCAdapter = std::make_shared<VelocityBCAdapter>(true, true, false, fct, 0, BCFunction::INFCONST); + velBCAdapter->setBcAlgorithm(std::make_shared<VelocityBCAlgorithm>()); // Add velocity boundary condition to visitor. No-slip boundary BoundaryConditionsBlockVisitor bcVisitor; @@ -142,7 +142,7 @@ int main(int /*argc*/, char* /*argv*/[]) // Create boundary conditions processor SPtr<BCProcessor> bcProc; - bcProc = SPtr<BCProcessor>(new BCProcessor()); + bcProc = std::make_shared<BCProcessor>(); kernel->setBCProcessor(bcProc); // Create boundary conditions geometry diff --git a/src/basics/Core/Input/ConfigInput/ConfigInput.cpp b/src/basics/Core/Input/ConfigInput/ConfigInput.cpp index d71746ede..d894bcc28 100644 --- a/src/basics/Core/Input/ConfigInput/ConfigInput.cpp +++ b/src/basics/Core/Input/ConfigInput/ConfigInput.cpp @@ -65,7 +65,7 @@ namespace input void ConfigInput::makeLower(std::string &value) const { - for (unsigned i = 0; i < value.size(); i++) + for (size_t i = 0; i < value.size(); i++) value[i] = tolower(value[i]); } diff --git a/src/basics/Core/Input/ConfigInput/ConfigInput.h b/src/basics/Core/Input/ConfigInput/ConfigInput.h index 6ff7050c8..d01e1b812 100644 --- a/src/basics/Core/Input/ConfigInput/ConfigInput.h +++ b/src/basics/Core/Input/ConfigInput/ConfigInput.h @@ -41,7 +41,7 @@ namespace input protected: std::istream &stream; - typedef std::pair <std::string, std::string> String_Pair; + using String_Pair = std::pair <std::string, std::string>; std::map<std::string, std::string> configEntries; }; } diff --git a/src/basics/Core/Timer/TimerImp.h b/src/basics/Core/Timer/TimerImp.h index 9cda82fb0..9759b9daa 100644 --- a/src/basics/Core/Timer/TimerImp.h +++ b/src/basics/Core/Timer/TimerImp.h @@ -12,7 +12,7 @@ class BASICS_EXPORT TimerImp : public Timer { public: - typedef std::chrono::high_resolution_clock::time_point timePoint; + using timePoint = std::chrono::high_resolution_clock::time_point; void start() override; void end() override; diff --git a/src/basics/basics/container/CbArray2D.h b/src/basics/basics/container/CbArray2D.h index a5e06f0aa..107bc386f 100644 --- a/src/basics/basics/container/CbArray2D.h +++ b/src/basics/basics/container/CbArray2D.h @@ -53,7 +53,7 @@ class IndexerX2X1 { public: - typedef int size_type; + using size_type = int; public: inline std::size_t getIndex(const size_type& x1, const size_type& x2, const size_type& nx1, const size_type& /*nx2*/) const { diff --git a/src/basics/basics/utilities/UbSystem.h b/src/basics/basics/utilities/UbSystem.h index 6b2d302fd..975e70275 100644 --- a/src/basics/basics/utilities/UbSystem.h +++ b/src/basics/basics/utilities/UbSystem.h @@ -57,7 +57,7 @@ #include "dirent.h" #include <sys/stat.h> #include <unistd.h> - #include <string.h> + #include <cstring> #elif defined(__AIX__) #define UBSYSTEM_AIX #include "dirent.h" @@ -493,7 +493,7 @@ namespace UbSystem template<typename Ta, typename Tb> class IfThenElse<true, Ta, Tb> { public: - typedef Ta ResultT; + using ResultT = Ta; }; // partial specialization: false yields third argument diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/BCArray3D.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/BCArray3D.cpp index c0d93da3a..913967fab 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/BCArray3D.cpp +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/BCArray3D.cpp @@ -173,11 +173,11 @@ std::string BCArray3D::toString() const std::size_t bcCounter = 0; std::size_t undefCounter = 0; - for (int x1 = 0; x1 < bcindexmatrix.getNX1(); x1++) + for (size_t x1 = 0; x1 < bcindexmatrix.getNX1(); x1++) { - for (int x2 = 0; x2 < bcindexmatrix.getNX2(); x2++) + for (size_t x2 = 0; x2 < bcindexmatrix.getNX2(); x2++) { - for (int x3 = 0; x3 < bcindexmatrix.getNX3(); x3++) + for (size_t x3 = 0; x3 < bcindexmatrix.getNX3(); x3++) { if (bcindexmatrix(x1, x2, x3) >= 0) bcCounter++; else if (bcindexmatrix(x1, x2, x3) == FLUID) fluidCounter++; diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/BCProcessor.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/BCProcessor.cpp index 305d0b73d..020f4d60d 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/BCProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/BCProcessor.cpp @@ -44,7 +44,7 @@ BCProcessor::BCProcessor() BCProcessor::BCProcessor(SPtr<ILBMKernel> kernel) { SPtr<DistributionArray3D> distributions = std::dynamic_pointer_cast<EsoTwist3D>(kernel->getDataSet()->getFdistributions()); - bcArray = SPtr<BCArray3D>(new BCArray3D( distributions->getNX1(), distributions->getNX2(), distributions->getNX3(), BCArray3D::FLUID)); + bcArray = std::make_shared<BCArray3D>(distributions->getNX1(), distributions->getNX2(), distributions->getNX3(), BCArray3D::FLUID); } ////////////////////////////////////////////////////////////////////////// BCProcessor::~BCProcessor() diff --git a/src/cpu/VirtualFluidsCore/Data/D3Q27EsoTwist3DSplittedVector.cpp b/src/cpu/VirtualFluidsCore/Data/D3Q27EsoTwist3DSplittedVector.cpp index bfc92b6ac..3d7e5ad7d 100644 --- a/src/cpu/VirtualFluidsCore/Data/D3Q27EsoTwist3DSplittedVector.cpp +++ b/src/cpu/VirtualFluidsCore/Data/D3Q27EsoTwist3DSplittedVector.cpp @@ -43,10 +43,10 @@ D3Q27EsoTwist3DSplittedVector::D3Q27EsoTwist3DSplittedVector( size_t nx1, size_t this->NX2 = nx2; this->NX3 = nx3; - this->localDistributions = CbArray4D<LBMReal,IndexerX4X3X2X1>::CbArray4DPtr(new CbArray4D<LBMReal,IndexerX4X3X2X1>(13, nx1+1, nx2+1, nx3+1, value)); - this->nonLocalDistributions = CbArray4D<LBMReal,IndexerX4X3X2X1>::CbArray4DPtr(new CbArray4D<LBMReal,IndexerX4X3X2X1>(13, nx1+1, nx2+1, nx3+1, value)); + this->localDistributions = std::make_shared<CbArray4D<LBMReal, IndexerX4X3X2X1> >(13, nx1+1, nx2+1, nx3+1, value); + this->nonLocalDistributions = std::make_shared<CbArray4D<LBMReal, IndexerX4X3X2X1> >(13, nx1+1, nx2+1, nx3+1, value); - this->restDistributions = CbArray3D<LBMReal,IndexerX3X2X1>::CbArray3DPtr(new CbArray3D<LBMReal,IndexerX3X2X1>(nx1, nx2, nx3, value)); + this->restDistributions = std::make_shared<CbArray3D<LBMReal, IndexerX3X2X1> >(nx1, nx2, nx3, value); } ////////////////////////////////////////////////////////////////////////// D3Q27EsoTwist3DSplittedVector::~D3Q27EsoTwist3DSplittedVector() diff --git a/src/cpu/VirtualFluidsCore/Grid/BasicCalculator.cpp b/src/cpu/VirtualFluidsCore/Grid/BasicCalculator.cpp index d4266e8d9..3eec68c08 100644 --- a/src/cpu/VirtualFluidsCore/Grid/BasicCalculator.cpp +++ b/src/cpu/VirtualFluidsCore/Grid/BasicCalculator.cpp @@ -54,9 +54,6 @@ BasicCalculator::BasicCalculator(SPtr<Grid3D> grid, SPtr<UbScheduler> additional } ////////////////////////////////////////////////////////////////////////// -BasicCalculator::~BasicCalculator() -= default; -////////////////////////////////////////////////////////////////////////// void BasicCalculator::calculate() { UBLOG(logDEBUG1, "BasicCalculator::calculate() - started"); diff --git a/src/cpu/VirtualFluidsCore/Grid/BasicCalculator.h b/src/cpu/VirtualFluidsCore/Grid/BasicCalculator.h index 40f88ae55..d42f4f458 100644 --- a/src/cpu/VirtualFluidsCore/Grid/BasicCalculator.h +++ b/src/cpu/VirtualFluidsCore/Grid/BasicCalculator.h @@ -45,7 +45,7 @@ class BasicCalculator : public Calculator { public: BasicCalculator(SPtr<Grid3D> grid, SPtr<UbScheduler> additionalGhostLayerUpdateScheduler, int numberOfTimeSteps); - ~BasicCalculator() override; + ~BasicCalculator() override = default; void calculate() override; protected: diff --git a/src/cpu/VirtualFluidsCore/Grid/Block3D.cpp b/src/cpu/VirtualFluidsCore/Grid/Block3D.cpp index 2dd9332a1..4895f4bc5 100644 --- a/src/cpu/VirtualFluidsCore/Grid/Block3D.cpp +++ b/src/cpu/VirtualFluidsCore/Grid/Block3D.cpp @@ -495,7 +495,7 @@ void Block3D::addWeight( int rank, int weight ) ////////////////////////////////////////////////////////////////////////// void Block3D::addWeightForAll( int weight ) { - typedef std::map<int, int> wMap; + using wMap = std::map<int, int>; for (wMap::value_type &w : this->weight) { w.second += weight; diff --git a/src/cpu/VirtualFluidsCore/Grid/Calculator.cpp b/src/cpu/VirtualFluidsCore/Grid/Calculator.cpp index c6d1f78e4..aa58449ad 100644 --- a/src/cpu/VirtualFluidsCore/Grid/Calculator.cpp +++ b/src/cpu/VirtualFluidsCore/Grid/Calculator.cpp @@ -152,9 +152,9 @@ void Calculator::initRemoteConnectors() initConnectors(remoteConns[l]); if (l != maxLevel) { - for(int i = 0; i < remoteInterConnsCF[l].size(); i++) + for(size_t i = 0; i < remoteInterConnsCF[l].size(); i++) remoteInterConns[l].push_back(remoteInterConnsCF[l][i]); - for(int i = 0; i < remoteInterConnsFC[l+1].size(); i++) + for(size_t i = 0; i < remoteInterConnsFC[l+1].size(); i++) remoteInterConns[l].push_back(remoteInterConnsFC[l+1][i]); } } diff --git a/src/cpu/VirtualFluidsCore/Grid/Grid3D.cpp b/src/cpu/VirtualFluidsCore/Grid/Grid3D.cpp index f1d1d653d..334ded5eb 100644 --- a/src/cpu/VirtualFluidsCore/Grid/Grid3D.cpp +++ b/src/cpu/VirtualFluidsCore/Grid/Grid3D.cpp @@ -73,7 +73,7 @@ Grid3D::Grid3D(SPtr<Communicator> comm, int blockNx1, int blockNx2, int blockNx3 { levelSet.resize(Grid3DSystem::MAXLEVEL+1); rank = comm->getProcessID(); - trafo = SPtr<CoordinateTransformation3D>(new CoordinateTransformation3D(0.0, 0.0, 0.0, (double)blockNx1, (double)blockNx2, (double)blockNx3)); + trafo = std::make_shared<CoordinateTransformation3D>(0.0, 0.0, 0.0, (double)blockNx1, (double)blockNx2, (double)blockNx3); UbTupleInt3 minInd(0, 0, 0); UbTupleInt3 maxInd(gridNx1, gridNx2, gridNx3); this->fillExtentWithBlocks(minInd, maxInd); @@ -304,14 +304,14 @@ bool Grid3D::expandBlock(int ix1, int ix2, int ix3, int level) int bottom = ix3<<1; int top = bottom+1; - SPtr<Block3D> blockBSW = SPtr<Block3D>(new Block3D(west, south, bottom, l)); - SPtr<Block3D> blockBSE = SPtr<Block3D>(new Block3D(east, south, bottom, l)); - SPtr<Block3D> blockBNW = SPtr<Block3D>(new Block3D(west, north, bottom, l)); - SPtr<Block3D> blockBNE = SPtr<Block3D>(new Block3D(east, north, bottom, l)); - SPtr<Block3D> blockTSW = SPtr<Block3D>(new Block3D(west, south, top, l)); - SPtr<Block3D> blockTSE = SPtr<Block3D>(new Block3D(east, south, top, l)); - SPtr<Block3D> blockTNW = SPtr<Block3D>(new Block3D(west, north, top, l)); - SPtr<Block3D> blockTNE = SPtr<Block3D>(new Block3D(east, north, top, l)); + auto blockBSW = std::make_shared<Block3D>(west, south, bottom, l); + auto blockBSE = std::make_shared<Block3D>(east, south, bottom, l); + auto blockBNW = std::make_shared<Block3D>(west, north, bottom, l); + auto blockBNE = std::make_shared<Block3D>(east, north, bottom, l); + auto blockTSW = std::make_shared<Block3D>(west, south, top, l); + auto blockTSE = std::make_shared<Block3D>(east, south, top, l); + auto blockTNW = std::make_shared<Block3D>(west, north, top, l); + auto blockTNE = std::make_shared<Block3D>(east, north, top, l); if (!this->deleteBlock(ix1, ix2, ix3, level)) throw UbException(UB_EXARGS, "could not delete block"); @@ -379,7 +379,7 @@ SPtr<Block3D> Grid3D::collapseBlock(int fix1, int fix2, int fix3, int flevel, in /*TNE*/fineBlocks[6] = this->getBlock(fx1[1], fx2[1], fx3[1], flevel); /*TNW*/fineBlocks[7] = this->getBlock(fx1[0], fx2[1], fx3[1], flevel); - SPtr<Block3D> cblock = SPtr<Block3D>(new Block3D(cix1, cix2, cix3, clevel)); + auto cblock = std::make_shared<Block3D>(cix1, cix2, cix3, clevel); for (int i=0; i<2; i++) for (int k=0; k<2; k++) diff --git a/src/cpu/VirtualFluidsCore/Interactors/D3Q27Interactor.cpp b/src/cpu/VirtualFluidsCore/Interactors/D3Q27Interactor.cpp index 4ae4124e5..bc77cedde 100644 --- a/src/cpu/VirtualFluidsCore/Interactors/D3Q27Interactor.cpp +++ b/src/cpu/VirtualFluidsCore/Interactors/D3Q27Interactor.cpp @@ -322,7 +322,7 @@ bool D3Q27Interactor::setDifferencesToGbObject3D(const SPtr<Block3D> block) bc = bcArray->getBC(ix1,ix2,ix3); if(!bc) { - bc = SPtr<BoundaryConditions>(new BoundaryConditions); + bc = std::make_shared<BoundaryConditions>(); bcArray->setBC(ix1,ix2,ix3,bc); } @@ -467,7 +467,7 @@ bool D3Q27Interactor::setDifferencesToGbObject3D(const SPtr<Block3D> block) bc = bcArray->getBC(ix1,ix2,ix3); if(!bc) { - bc = SPtr<BoundaryConditions>(new BoundaryConditions); + bc = std::make_shared<BoundaryConditions>(); bcArray->setBC(ix1,ix2,ix3,bc); } for(int index=(int)bcAdapters.size()-1; index>=0; --index) diff --git a/src/cpu/VirtualFluidsCore/Interactors/D3Q27Interactor.h b/src/cpu/VirtualFluidsCore/Interactors/D3Q27Interactor.h index 9bd4725bb..d0c16b2a5 100644 --- a/src/cpu/VirtualFluidsCore/Interactors/D3Q27Interactor.h +++ b/src/cpu/VirtualFluidsCore/Interactors/D3Q27Interactor.h @@ -53,7 +53,7 @@ class Block3D; class Grid3D; class GbObject3D; -typedef std::map<SPtr<Block3D>, std::set< std::vector<int> > > BcNodeIndicesMap; +using BcNodeIndicesMap = std::map<SPtr<Block3D>, std::set< std::vector<int> > >; using SolidNodeIndicesMap = std::map<SPtr<Block3D>, std::set<UbTupleInt3> >; //! \brief A specialized class for grid generation. diff --git a/src/cpu/VirtualFluidsCore/LBM/LBMKernel.cpp b/src/cpu/VirtualFluidsCore/LBM/LBMKernel.cpp index bddb8984a..7004a4d73 100644 --- a/src/cpu/VirtualFluidsCore/LBM/LBMKernel.cpp +++ b/src/cpu/VirtualFluidsCore/LBM/LBMKernel.cpp @@ -43,7 +43,7 @@ LBMKernel::LBMKernel() this->setForcingX1(0.0); this->setForcingX2(0.0); this->setForcingX3(0.0); - dataSet = SPtr<DataSet3D>(new DataSet3D()); + dataSet = std::make_shared<DataSet3D>(); this->nx[0] = 0; this->nx[1] = 0; this->nx[2] = 0; diff --git a/src/cpu/VirtualFluidsCore/Utilities/MemoryUtil.h b/src/cpu/VirtualFluidsCore/Utilities/MemoryUtil.h index e60aa9578..863b4d4f1 100644 --- a/src/cpu/VirtualFluidsCore/Utilities/MemoryUtil.h +++ b/src/cpu/VirtualFluidsCore/Utilities/MemoryUtil.h @@ -50,9 +50,9 @@ #define MEMORYUTIL_LINUX #include "sys/types.h" #include "sys/sysinfo.h" - #include "stdlib.h" - #include "stdio.h" - #include "string.h" + #include "cstdlib" + #include "cstdio" + #include "cstring" #else #error "MemoryUtil::UnknownMachine" #endif diff --git a/src/cpu/VirtualFluidsCore/Visitors/InitDistributionsBlockVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/InitDistributionsBlockVisitor.cpp index 1f313a217..f40b6be1f 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/InitDistributionsBlockVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/InitDistributionsBlockVisitor.cpp @@ -139,9 +139,8 @@ void InitDistributionsBlockVisitor::visit(const SPtr<Grid3D> grid, SPtr<Block3D> this->muVx3.DefineVar("x1",&x1); this->muVx3.DefineVar("x2",&x2); this->muVx3.DefineVar("x3",&x3); this->muRho.DefineVar("x1",&x1); this->muRho.DefineVar("x2",&x2); this->muRho.DefineVar("x3",&x3); - //Funktionszeiger - typedef void (*CalcFeqsFct)(LBMReal* const& /*feq[27]*/,const LBMReal& /*(d)rho*/,const LBMReal& /*vx1*/,const LBMReal& /*vx2*/,const LBMReal& /*vx3*/); - CalcFeqsFct calcFeqsFct = NULL; + using CalcFeqsFct = void (*)(LBMReal* const& /*feq[27]*/,const LBMReal& /*(d)rho*/,const LBMReal& /*vx1*/,const LBMReal& /*vx2*/,const LBMReal& /*vx3*/); + CalcFeqsFct calcFeqsFct = NULL; LBMReal vx1,vx2,vx3,rho; @@ -168,9 +167,9 @@ void InitDistributionsBlockVisitor::visit(const SPtr<Grid3D> grid, SPtr<Block3D> LBMReal f[D3Q27System::ENDF+1]; - for(int ix3=0; ix3<bcArray->getNX3(); ix3++) - for(int ix2=0; ix2<bcArray->getNX2(); ix2++) - for(int ix1=0; ix1<bcArray->getNX1(); ix1++) + for(size_t ix3=0; ix3<bcArray->getNX3(); ix3++) + for(size_t ix2=0; ix2<bcArray->getNX2(); ix2++) + for(size_t ix1=0; ix1<bcArray->getNX1(); ix1++) { Vector3D coords = grid->getNodeCoordinates(block, ix1, ix2, ix3); x1 = coords[0]; -- GitLab