diff --git a/src/basics/Core/Timer/Timer.h b/src/basics/Core/Timer/Timer.h index 9607cc5f9a72873e1da226b4d071e000777073a1..702cfafb4b2eaef7cf779136d58ce7c37bc1b1e5 100644 --- a/src/basics/Core/Timer/Timer.h +++ b/src/basics/Core/Timer/Timer.h @@ -9,7 +9,7 @@ class BASICS_EXPORT Timer { public: - + virtual ~Timer() = default; static SPtr<Timer> makeStart(); virtual void start() = 0; diff --git a/src/basics/Core/Timer/TimerImp.cpp b/src/basics/Core/Timer/TimerImp.cpp index 4fc234a29cab0639cb703cf5e9d29151b321873b..4eb735424cd0e8a7215a92d0dedb2df2a8abcf84 100644 --- a/src/basics/Core/Timer/TimerImp.cpp +++ b/src/basics/Core/Timer/TimerImp.cpp @@ -1,9 +1,5 @@ #include "TimerImp.h" -TimerImp::TimerImp() -{ - -} void TimerImp::start() { diff --git a/src/basics/Core/Timer/TimerImp.h b/src/basics/Core/Timer/TimerImp.h index 20a11968005f88bebbc1e481149a6c9d939306a8..9cda82fb059e6a1dcb719aba8a4a972c4b363e9c 100644 --- a/src/basics/Core/Timer/TimerImp.h +++ b/src/basics/Core/Timer/TimerImp.h @@ -12,11 +12,8 @@ class BASICS_EXPORT TimerImp : public Timer { public: - typedef std::chrono::high_resolution_clock::time_point timePoint; - TimerImp(); - void start() override; void end() override; diff --git a/src/basics/basics/objects/ObObject.h b/src/basics/basics/objects/ObObject.h index c540005212a3798c7cfc773f5032ab5bbc5f1c72..0675ae68ff99f7db380c3d99500268bf94698b2b 100644 --- a/src/basics/basics/objects/ObObject.h +++ b/src/basics/basics/objects/ObObject.h @@ -40,17 +40,17 @@ class ObObject : public UbObservable { public: - ObObject() : name("") { } + ObObject() = default; ObObject(const std::string& name) : name(name) { } - virtual ~ObObject() { } + virtual ~ObObject() = default; - virtual ObObject* clone()=0; + virtual ObObject* clone() = 0; virtual std::string getName() { return name; } - void setName(std::string name) { this->name=name; } + void setName(std::string name) { this->name = name; } - virtual std::string toString()=0; + virtual std::string toString() override = 0; private: diff --git a/src/basics/basics/utilities/UbSystem.h b/src/basics/basics/utilities/UbSystem.h index ddaf6a31d6d90c7a90b12c3eb48fb05242fe79ac..3d504414524262d4cec19c94a68fce841b42d2e7 100644 --- a/src/basics/basics/utilities/UbSystem.h +++ b/src/basics/basics/utilities/UbSystem.h @@ -459,7 +459,6 @@ namespace UbSystem inline std::string getMachineName() { char Name[150]; - int i = 0; #if defined(UBSYSTEM_WINDOWS) || defined(UBSYSTEM_CYGWIN) TCHAR infoBuf[150]; @@ -467,7 +466,7 @@ namespace UbSystem memset(Name, 0, 150); if (GetComputerName(infoBuf, &bufCharCount)) { - for (i = 0; i<150; i++) + for (int i = 0; i<150; i++) { Name[i] = infoBuf[i]; } diff --git a/src/basics/basics/writer/WbWriterVtkXmlASCII.cpp b/src/basics/basics/writer/WbWriterVtkXmlASCII.cpp index 47b5d1fb26243d5c8b5d051ba2459e4219d5fe75..d4ad420ffcae457c74fbcc0b759b7be2098ab4f1 100644 --- a/src/basics/basics/writer/WbWriterVtkXmlASCII.cpp +++ b/src/basics/basics/writer/WbWriterVtkXmlASCII.cpp @@ -532,82 +532,82 @@ std::string WbWriterVtkXmlASCII::writeLines(const string& filename,vector<UbTupl return vtkfilename; } /*===============================================================================*/ -std::string WbWriterVtkXmlASCII::writeLinesWithNodeData(const string& filename,vector<UbTupleFloat3 >& nodes, vector<UbTupleInt2 >& lines, std::vector< std::string >& datanames, std::vector< std::vector< double > >& nodedata) -{ - string vtkfilename=filename+getFileExtension(); - UBLOG(logDEBUG1,"WbWriterVtkXmlASCII::writeLinesWithNodeData to "<<vtkfilename<<" - start"); - - std::ofstream out(vtkfilename.c_str()); - if(!out) - { - out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!! - string path = UbSystem::getPathFromString(vtkfilename); - if(path.size()>0){UbSystem::makeDirectory(path);out.open(vtkfilename.c_str());} - if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename); - } - - int nofNodes = (int)nodes.size(); - int nofLines = (int)lines.size(); - - //VTK FILE - out<<"<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"<<"\n"; - out<<" <UnstructuredGrid>"<<"\n"; - out<<" <Piece NumberOfPoints=\""<<nofNodes<<"\" NumberOfCells=\""<<nofLines<<"\"> \n"; - - //POINTS SECTION - out<<" <Points>\n"; - out<<" <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"ascii\">\n"; - for(int n=0; n<nofNodes; n++) - out<< val<1>(nodes[n]) <<" "<< val<2>(nodes[n]) <<" "<< val<3>(nodes[n]) <<" "; - - out<<"\n"; - out<<" </DataArray>\n"; - out<<" </Points>\n"; - - //CELLS SECTION - out<<" <Cells>\n"; - out<<" <DataArray type=\"Int32\" Name=\"connectivity\" format=\"ascii\">\n"; - - for(int c=0; c<nofLines; c++) - out<< val<1>(lines[c]) <<" "<< val<2>(lines[c])<<" "; - out<<"\n"; - out<<" </DataArray>\n"; - out<<" <DataArray type=\"Int32\" Name=\"offsets\" format=\"ascii\">\n"; - for(int c=1; c<=nofLines; c++) - out<<c*2<<" " ; - - out<<"\n"; - out<<" </DataArray>\n"; - - out<<" <DataArray type=\"UInt8\" Name=\"types\" format=\"ascii\">\n"; - - for(int c=0; c<nofLines; c++) - out<<"3 "; - out<<"\n"; - out<<" </DataArray>\n"; - out<<" </Cells>\n"; - - //write data section - out<<" <PointData Scalars=\"Scalars\"> \n"; - for(int s=0; s<(int)datanames.size(); ++s) - { - out<< " <DataArray type=\"Float32\" Name=\""<< datanames[s] <<"\" format=\"ascii\"> \n"; - - for(int d=0; d<(int)nodedata[s].size(); d++) - out<<nodedata[s][d]<<" "; - - out<<"\n </DataArray>\n"; - } - out<<" </PointData>\n"; - out<<" </Piece>\n"; - out<<" </UnstructuredGrid>\n"; - out<<"</VTKFile>"; - out<<endl; - out.close(); - UBLOG(logDEBUG1,"WbWriterVtkXmlASCII::writeLinesWithNodeData to "<<vtkfilename<<" - end"); - - return vtkfilename; -} +//std::string WbWriterVtkXmlASCII::writeLinesWithNodeData(const string& filename,vector<UbTupleFloat3 >& nodes, vector<UbTupleInt2 >& lines, std::vector< std::string >& datanames, std::vector< std::vector< double > >& nodedata) +//{ +// string vtkfilename=filename+getFileExtension(); +// UBLOG(logDEBUG1,"WbWriterVtkXmlASCII::writeLinesWithNodeData to "<<vtkfilename<<" - start"); +// +// std::ofstream out(vtkfilename.c_str()); +// if(!out) +// { +// out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!! +// string path = UbSystem::getPathFromString(vtkfilename); +// if(path.size()>0){UbSystem::makeDirectory(path);out.open(vtkfilename.c_str());} +// if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename); +// } +// +// int nofNodes = (int)nodes.size(); +// int nofLines = (int)lines.size(); +// +// //VTK FILE +// out<<"<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"<<"\n"; +// out<<" <UnstructuredGrid>"<<"\n"; +// out<<" <Piece NumberOfPoints=\""<<nofNodes<<"\" NumberOfCells=\""<<nofLines<<"\"> \n"; +// +// //POINTS SECTION +// out<<" <Points>\n"; +// out<<" <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"ascii\">\n"; +// for(int n=0; n<nofNodes; n++) +// out<< val<1>(nodes[n]) <<" "<< val<2>(nodes[n]) <<" "<< val<3>(nodes[n]) <<" "; +// +// out<<"\n"; +// out<<" </DataArray>\n"; +// out<<" </Points>\n"; +// +// //CELLS SECTION +// out<<" <Cells>\n"; +// out<<" <DataArray type=\"Int32\" Name=\"connectivity\" format=\"ascii\">\n"; +// +// for(int c=0; c<nofLines; c++) +// out<< val<1>(lines[c]) <<" "<< val<2>(lines[c])<<" "; +// out<<"\n"; +// out<<" </DataArray>\n"; +// out<<" <DataArray type=\"Int32\" Name=\"offsets\" format=\"ascii\">\n"; +// for(int c=1; c<=nofLines; c++) +// out<<c*2<<" " ; +// +// out<<"\n"; +// out<<" </DataArray>\n"; +// +// out<<" <DataArray type=\"UInt8\" Name=\"types\" format=\"ascii\">\n"; +// +// for(int c=0; c<nofLines; c++) +// out<<"3 "; +// out<<"\n"; +// out<<" </DataArray>\n"; +// out<<" </Cells>\n"; +// +// //write data section +// out<<" <PointData Scalars=\"Scalars\"> \n"; +// for(int s=0; s<(int)datanames.size(); ++s) +// { +// out<< " <DataArray type=\"Float32\" Name=\""<< datanames[s] <<"\" format=\"ascii\"> \n"; +// +// for(int d=0; d<(int)nodedata[s].size(); d++) +// out<<nodedata[s][d]<<" "; +// +// out<<"\n </DataArray>\n"; +// } +// out<<" </PointData>\n"; +// out<<" </Piece>\n"; +// out<<" </UnstructuredGrid>\n"; +// out<<"</VTKFile>"; +// out<<endl; +// out.close(); +// UBLOG(logDEBUG1,"WbWriterVtkXmlASCII::writeLinesWithNodeData to "<<vtkfilename<<" - end"); +// +// return vtkfilename; +//} /*===============================================================================*/ std::string WbWriterVtkXmlASCII::writeTriangles(const string& filename,vector<UbTupleFloat3 >& nodes, vector<UbTupleInt3 >& triangles) { diff --git a/src/basics/basics/writer/WbWriterVtkXmlASCII.h b/src/basics/basics/writer/WbWriterVtkXmlASCII.h index 97e60486fc82deee1c634c4c5472781f48924b3a..e43d976494d46cb045df4c53ca2ff5f4bdc11f7d 100644 --- a/src/basics/basics/writer/WbWriterVtkXmlASCII.h +++ b/src/basics/basics/writer/WbWriterVtkXmlASCII.h @@ -58,7 +58,7 @@ private: static std::string pvdEndTag; public: - std::string getFileExtension() { return ".ascii.vtu"; } + std::string getFileExtension() override { return ".ascii.vtu"; } //write a metafile std::string writeCollection(const std::string& filename, const std::vector<std::string>& filenames, const double& timesteps, const bool& sepGroups);//std::vector<double>& groups, std::vector<double>& parts); @@ -67,16 +67,17 @@ public: ////////////////////////////////////////////////////////////////////////// //nodes - std::string writeNodes(const std::string& filename,std::vector< UbTupleFloat3 >& nodes); - std::string writeNodesWithNodeData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector<std::string >& datanames, std::vector<std::vector<double > >& nodedata); - std::string writeNodesWithNodeDataDouble(const std::string& filename,std::vector< UbTupleDouble3 >& nodes, std::vector<std::string >& datanames, std::vector<std::vector<double > >& nodedata); + std::string writeNodes(const std::string& filename,std::vector< UbTupleFloat3 >& nodes) override; + std::string writeNodesWithNodeData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector<std::string >& datanames, std::vector<std::vector<double > >& nodedata) override; + std::string writeNodesWithNodeDataDouble(const std::string& filename,std::vector< UbTupleDouble3 >& nodes, std::vector<std::string >& datanames, std::vector<std::vector<double > >& nodedata) override; ////////////////////////////////////////////////////////////////////////// //lines // 0 ---- 1 //nodenumbering must start with 0! - std::string writeLines(const std::string& filename,std::vector<UbTupleFloat3 >& nodes, std::vector<UbTupleInt2 >& lines); - std::string writeLinesWithNodeData(const std::string& filename,std::vector<UbTupleFloat3 >& nodes, std::vector<UbTupleInt2 >& lines, std::vector< std::string >& datanames, std::vector< std::vector< double > >& nodedata); + std::string writeLines(const std::string& filename,std::vector<UbTupleFloat3 >& nodes, std::vector<UbTupleInt2 >& lines) override; + //std::string writeLinesWithNodeData(const std::string& filename,std::vector<UbTupleFloat3 >& nodes, std::vector<UbTupleInt2 >& lines, std::vector< std::string >& datanames, std::vector< std::vector< double > >& nodedata); + //FIXME: hides function in base class ////////////////////////////////////////////////////////////////////////// //triangles @@ -84,8 +85,8 @@ public: // // 0---1 //nodenumbering must start with 0! - std::string writeTriangles(const std::string& filename,std::vector<UbTupleFloat3 >& nodes, std::vector<UbTupleInt3 >& triangles); - std::string writeTrianglesWithNodeData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt3 >& cells, std::vector< std::string >& datanames, std::vector< std::vector< double > >& nodedata); + std::string writeTriangles(const std::string& filename,std::vector<UbTupleFloat3 >& nodes, std::vector<UbTupleInt3 >& triangles) override; + std::string writeTrianglesWithNodeData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt3 >& cells, std::vector< std::string >& datanames, std::vector< std::vector< double > >& nodedata) override; ////////////////////////////////////////////////////////////////////////// //2D @@ -95,12 +96,12 @@ public: // 0---1 //nodenumbering must start with 0! - std::string writeQuads(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt4 >& cells); - std::string writeQuadsWithNodeData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt4 >& cells, std::vector< std::string >& datanames, std::vector< std::vector< double > >& nodedata); - std::string writeQuadsWithCellData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt4 >& cells, std::vector< std::string >& datanames, std::vector< std::vector< double > >& celldata); + std::string writeQuads(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt4 >& cells) override; + std::string writeQuadsWithNodeData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt4 >& cells, std::vector< std::string >& datanames, std::vector< std::vector< double > >& nodedata) override; + std::string writeQuadsWithCellData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt4 >& cells, std::vector< std::string >& datanames, std::vector< std::vector< double > >& celldata) override; std::string writeQuadsWithNodeAndCellData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt4 >& cells, std::vector< std::string >& nodedatanames, std::vector< std::vector< double > >& nodedata, std::vector< std::string >& celldatanames, - std::vector< std::vector< double > >& celldata ); + std::vector< std::vector< double > >& celldata) override; ////////////////////////////////////////////////////////////////////////// //octs @@ -111,9 +112,9 @@ public: // | 3 ---+ 2 // |/ |/ // 0 ---- 1 - std::string writeOcts(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt8 >& cells); - std::string writeOctsWithCellData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt8 >& cells, std::vector< std::string >& datanames, std::vector< std::vector< double > >& celldata); - std::string writeOctsWithNodeData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleUInt8 >& cells, std::vector< std::string >& datanames, std::vector< std::vector< double > >& nodedata); + std::string writeOcts(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt8 >& cells) override; + std::string writeOctsWithCellData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt8 >& cells, std::vector< std::string >& datanames, std::vector< std::vector< double > >& celldata) override; + std::string writeOctsWithNodeData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleUInt8 >& cells, std::vector< std::string >& datanames, std::vector< std::vector< double > >& nodedata) override; private: diff --git a/src/basics/basics/writer/WbWriterVtkXmlBinary.cpp b/src/basics/basics/writer/WbWriterVtkXmlBinary.cpp index a1133890e43538affe6d84eaa134b97706198a89..448aeb91f0c67aa0352f01e5df01c2469666d22c 100644 --- a/src/basics/basics/writer/WbWriterVtkXmlBinary.cpp +++ b/src/basics/basics/writer/WbWriterVtkXmlBinary.cpp @@ -237,125 +237,125 @@ string WbWriterVtkXmlBinary::writeLines(const string& filename,vector<UbTupleFlo return vtkfilename; } /*===============================================================================*/ -std::string WbWriterVtkXmlBinary::writeLinesWithNodeData(const string& filename,vector<UbTupleFloat3 >& nodes, vector<UbTupleInt2 >& lines, std::vector< std::string >& datanames, std::vector< std::vector< double > >& nodedata) -{ - string vtkfilename = filename+getFileExtension(); - UBLOG(logDEBUG1,"WbWriterVtkXmlBinary::writeLinesWithNodeData to "<<vtkfilename<<" - start"); - - ofstream out(vtkfilename.c_str(),ios::out | ios::binary); - if(!out) - { - out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!! - string path = UbSystem::getPathFromString(vtkfilename); - if(path.size()>0){ UbSystem::makeDirectory(path); out.open(vtkfilename.c_str(),ios::out | ios::binary);} - if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename); - } - - int nofNodes = (int)nodes.size(); - int nofCells = (int)lines.size(); - - int bytesPerByteVal = 4; //==sizeof(int) - int bytesPoints = 3 /*x1/x2/x3 */ * nofNodes * sizeof(float); - int bytesCellConnectivty = 2 /*nodes per line */ * nofCells * sizeof(int ); - int bytesCellOffsets = 1 /*offset per line */ * nofCells * sizeof(int ); - int bytesCellTypes = 1 /*type of line */ * nofCells * sizeof(unsigned char); - int bytesScalarData = 1 /*scalar */ * nofNodes * sizeof(float); - - int offset = 0; - //VTK FILE - out<<"<?xml version=\"1.0\"?>\n"; - out<<"<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"<<"\n"; - out<<" <UnstructuredGrid>"<<"\n"; - out<<" <Piece NumberOfPoints=\""<<nofNodes<<"\" NumberOfCells=\""<<nofCells<<"\">\n"; - - //POINTS SECTION - out<<" <Points>\n"; - out<<" <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"appended\" offset=\""<< offset <<"\" />\n"; - out<<" </Points>\n"; - offset += (bytesPerByteVal + bytesPoints); - - //CELLS SECTION - out<<" <Cells>\n"; - out<<" <DataArray type=\"Int32\" Name=\"connectivity\" format=\"appended\" offset=\""<< offset <<"\" />\n"; - offset += (bytesPerByteVal + bytesCellConnectivty); - out<<" <DataArray type=\"Int32\" Name=\"offsets\" format=\"appended\" offset=\""<< offset <<"\" />\n"; - offset += (bytesPerByteVal + bytesCellOffsets); - out<<" <DataArray type=\"UInt8\" Name=\"types\" format=\"appended\" offset=\""<< offset <<"\" />\n "; - offset += (bytesPerByteVal + bytesCellTypes); - out<<" </Cells>\n"; - - //DATA SECTION - out<<" <PointData>\n"; - for(size_t s=0; s<datanames.size(); ++s) - { - out<< " <DataArray type=\"Float32\" Name=\""<< datanames[s] <<"\" format=\"appended\" offset=\""<< offset <<"\" /> \n"; - offset += (bytesPerByteVal + bytesScalarData); - } - out<<" </PointData>\n"; - - out<<" </Piece>\n"; - out<<" </UnstructuredGrid>\n"; - - // AppendedData SECTION - out<<" <AppendedData encoding=\"raw\">\n"; - out<<"_"; - - //POINTS SECTION - out.write((char*)&bytesPoints,bytesPerByteVal); - for(int n=0; n<nofNodes; n++) - { - out.write((char*)&val<1>(nodes[n]),sizeof(float)); - out.write((char*)&val<2>(nodes[n]),sizeof(float)); - out.write((char*)&val<3>(nodes[n]),sizeof(float)); - } - - //CELLS SECTION - //cellConnectivity - out.write( (char*)&bytesCellConnectivty, bytesPerByteVal ); - for(int c=0; c<nofCells; c++) - { - out.write( (char*)&val<1>(lines[c]), sizeof(int) ); - out.write( (char*)&val<2>(lines[c]), sizeof(int) ); - } - - //cellOffsets - out.write( (char*)&bytesCellOffsets, bytesPerByteVal ); - int itmp; - for(int c=1; c<=nofCells; c++) - { - itmp = 3 * c; - out.write( (char*)&itmp, sizeof(int) ); - } - - //cellTypes - out.write( (char*)&bytesCellTypes, bytesPerByteVal ); - unsigned char vtkCellType = 5; - for(int c=0; c<nofCells; c++) - { - out.write( (char*)&vtkCellType, sizeof(unsigned char) ); - } - - //DATA SECTION - //scalarData - for(size_t s=0; s<datanames.size(); ++s) - { - out.write((char*)&bytesScalarData,bytesPerByteVal); - for(size_t d=0; d<nodedata[s].size(); ++d) - { - //loake kopie machen, da in nodedata "doubles" sind - float tmp = (float)nodedata[s][d]; - out.write((char*)&tmp,sizeof(float)); - } - } - out<<"\n</AppendedData>\n"; - out<<"</VTKFile>"; - out<<endl; - out.close(); - UBLOG(logDEBUG1,"WbWriterVtkXmlBinary::writeLinesWithNodeData to "<<vtkfilename<<" - end"); - - return vtkfilename; - -} +//std::string WbWriterVtkXmlBinary::writeLinesWithNodeData(const string& filename,vector<UbTupleFloat3 >& nodes, vector<UbTupleInt2 >& lines, std::vector< std::string >& datanames, std::vector< std::vector< double > >& nodedata) +//{ +// string vtkfilename = filename+getFileExtension(); +// UBLOG(logDEBUG1,"WbWriterVtkXmlBinary::writeLinesWithNodeData to "<<vtkfilename<<" - start"); +// +// ofstream out(vtkfilename.c_str(),ios::out | ios::binary); +// if(!out) +// { +// out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!out) weiterhin true!!! +// string path = UbSystem::getPathFromString(vtkfilename); +// if(path.size()>0){ UbSystem::makeDirectory(path); out.open(vtkfilename.c_str(),ios::out | ios::binary);} +// if(!out) throw UbException(UB_EXARGS,"couldn't open file "+vtkfilename); +// } +// +// int nofNodes = (int)nodes.size(); +// int nofCells = (int)lines.size(); +// +// int bytesPerByteVal = 4; //==sizeof(int) +// int bytesPoints = 3 /*x1/x2/x3 */ * nofNodes * sizeof(float); +// int bytesCellConnectivty = 2 /*nodes per line */ * nofCells * sizeof(int ); +// int bytesCellOffsets = 1 /*offset per line */ * nofCells * sizeof(int ); +// int bytesCellTypes = 1 /*type of line */ * nofCells * sizeof(unsigned char); +// int bytesScalarData = 1 /*scalar */ * nofNodes * sizeof(float); +// +// int offset = 0; +// //VTK FILE +// out<<"<?xml version=\"1.0\"?>\n"; +// out<<"<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"<<"\n"; +// out<<" <UnstructuredGrid>"<<"\n"; +// out<<" <Piece NumberOfPoints=\""<<nofNodes<<"\" NumberOfCells=\""<<nofCells<<"\">\n"; +// +// //POINTS SECTION +// out<<" <Points>\n"; +// out<<" <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"appended\" offset=\""<< offset <<"\" />\n"; +// out<<" </Points>\n"; +// offset += (bytesPerByteVal + bytesPoints); +// +// //CELLS SECTION +// out<<" <Cells>\n"; +// out<<" <DataArray type=\"Int32\" Name=\"connectivity\" format=\"appended\" offset=\""<< offset <<"\" />\n"; +// offset += (bytesPerByteVal + bytesCellConnectivty); +// out<<" <DataArray type=\"Int32\" Name=\"offsets\" format=\"appended\" offset=\""<< offset <<"\" />\n"; +// offset += (bytesPerByteVal + bytesCellOffsets); +// out<<" <DataArray type=\"UInt8\" Name=\"types\" format=\"appended\" offset=\""<< offset <<"\" />\n "; +// offset += (bytesPerByteVal + bytesCellTypes); +// out<<" </Cells>\n"; +// +// //DATA SECTION +// out<<" <PointData>\n"; +// for(size_t s=0; s<datanames.size(); ++s) +// { +// out<< " <DataArray type=\"Float32\" Name=\""<< datanames[s] <<"\" format=\"appended\" offset=\""<< offset <<"\" /> \n"; +// offset += (bytesPerByteVal + bytesScalarData); +// } +// out<<" </PointData>\n"; +// +// out<<" </Piece>\n"; +// out<<" </UnstructuredGrid>\n"; +// +// // AppendedData SECTION +// out<<" <AppendedData encoding=\"raw\">\n"; +// out<<"_"; +// +// //POINTS SECTION +// out.write((char*)&bytesPoints,bytesPerByteVal); +// for(int n=0; n<nofNodes; n++) +// { +// out.write((char*)&val<1>(nodes[n]),sizeof(float)); +// out.write((char*)&val<2>(nodes[n]),sizeof(float)); +// out.write((char*)&val<3>(nodes[n]),sizeof(float)); +// } +// +// //CELLS SECTION +// //cellConnectivity +// out.write( (char*)&bytesCellConnectivty, bytesPerByteVal ); +// for(int c=0; c<nofCells; c++) +// { +// out.write( (char*)&val<1>(lines[c]), sizeof(int) ); +// out.write( (char*)&val<2>(lines[c]), sizeof(int) ); +// } +// +// //cellOffsets +// out.write( (char*)&bytesCellOffsets, bytesPerByteVal ); +// int itmp; +// for(int c=1; c<=nofCells; c++) +// { +// itmp = 3 * c; +// out.write( (char*)&itmp, sizeof(int) ); +// } +// +// //cellTypes +// out.write( (char*)&bytesCellTypes, bytesPerByteVal ); +// unsigned char vtkCellType = 5; +// for(int c=0; c<nofCells; c++) +// { +// out.write( (char*)&vtkCellType, sizeof(unsigned char) ); +// } +// +// //DATA SECTION +// //scalarData +// for(size_t s=0; s<datanames.size(); ++s) +// { +// out.write((char*)&bytesScalarData,bytesPerByteVal); +// for(size_t d=0; d<nodedata[s].size(); ++d) +// { +// //loake kopie machen, da in nodedata "doubles" sind +// float tmp = (float)nodedata[s][d]; +// out.write((char*)&tmp,sizeof(float)); +// } +// } +// out<<"\n</AppendedData>\n"; +// out<<"</VTKFile>"; +// out<<endl; +// out.close(); +// UBLOG(logDEBUG1,"WbWriterVtkXmlBinary::writeLinesWithNodeData to "<<vtkfilename<<" - end"); +// +// return vtkfilename; +// +//} /*===============================================================================*/ string WbWriterVtkXmlBinary::writeTriangles(const string& filename,vector<UbTupleFloat3 >& nodes, vector<UbTupleInt3 >& triangles) { diff --git a/src/basics/basics/writer/WbWriterVtkXmlBinary.h b/src/basics/basics/writer/WbWriterVtkXmlBinary.h index b4b03cf68efe298d42a64d003ef6cb9d495e95ba..6119fd2205c79c2f1db6cffff13f9e9a32985285 100644 --- a/src/basics/basics/writer/WbWriterVtkXmlBinary.h +++ b/src/basics/basics/writer/WbWriterVtkXmlBinary.h @@ -75,7 +75,8 @@ public: // 0 ---- 1 //nodenumbering must start with 0! std::string writeLines(const std::string& filename,std::vector<UbTupleFloat3 >& nodes, std::vector<UbTupleInt2 >& lines); - std::string writeLinesWithNodeData(const std::string& filename,std::vector<UbTupleFloat3 >& nodes, std::vector<UbTupleInt2 >& lines, std::vector< std::string >& datanames, std::vector< std::vector< double > >& nodedata); + //std::string writeLinesWithNodeData(const std::string& filename,std::vector<UbTupleFloat3 >& nodes, std::vector<UbTupleInt2 >& lines, std::vector< std::string >& datanames, std::vector< std::vector< double > >& nodedata); + // FIXME: hides function in base class ////////////////////////////////////////////////////////////////////////// //triangles diff --git a/src/basics/geometry3d/GbObject3D.h b/src/basics/geometry3d/GbObject3D.h index 09a3ef38bcd66d3dc907da2a49c0e5db6ae110a6..b0cca70e42ce8f9967f36f22b4dc69bb2edfe6b2 100644 --- a/src/basics/geometry3d/GbObject3D.h +++ b/src/basics/geometry3d/GbObject3D.h @@ -61,10 +61,8 @@ class GbObject3DCreator; class GbObject3D : public ObObject { public: - virtual ~GbObject3D(){} - //abstract Methods - virtual void finalize() =0 ; //detroys also all dynamic objects (e.g. GbPoints in GbLine) + virtual void finalize() = 0 ; //destroys also all dynamic objects (e.g. GbPoints in GbLine) /** * Returns the centroid x1 coordinate of this 3D object. * @return the centroid x1 coordinate of this 3D object @@ -136,7 +134,7 @@ public: virtual bool isInsideCell(const double& minX1,const double& minX2,const double& minX3,const double& maxX1,const double& maxX2,const double& maxX3); - virtual GbLine3D* createClippedLine3D (GbPoint3D &point1, GbPoint3D &point2)=0; + virtual GbLine3D* createClippedLine3D (GbPoint3D &point1, GbPoint3D &point2) = 0; virtual std::vector<GbTriangle3D*> getSurfaceTriangleSet()=0; virtual void addSurfaceTriangleSet(std::vector<UbTupleFloat3>& nodes, std::vector<UbTupleInt3>& triangles) { throw UbException("GbObject3D::addSurfaceTriangleSet - not implemented for "+(std::string)typeid(*this).name()); } diff --git a/src/basics/geometry3d/GbPolygon3D.h b/src/basics/geometry3d/GbPolygon3D.h index e9a499c0f12e040b9427424c03509440c32c7b8d..96b96a3acf08f9296f4584834a1390cec6d823e9 100644 --- a/src/basics/geometry3d/GbPolygon3D.h +++ b/src/basics/geometry3d/GbPolygon3D.h @@ -113,8 +113,8 @@ public: /* * Creates a 2D polygon as clone of this 2D polygon. */ - GbPolygon3D* clone() { return(new GbPolygon3D(this)); } - void finalize() + GbPolygon3D* clone() override { return(new GbPolygon3D(this)); } + void finalize() override { throw UbException(UB_EXARGS,"toDo"); } @@ -197,15 +197,15 @@ public: // if(!this.consistent) this.calculateValues(); // return(this.area); //} - double getX1Centroid(); - double getX1Minimum(); - double getX1Maximum(); - double getX2Centroid(); - double getX2Minimum(); - double getX2Maximum(); - double getX3Centroid(); - double getX3Minimum(); - double getX3Maximum(); + double getX1Centroid() override; + double getX1Minimum() override; + double getX1Maximum() override; + double getX2Centroid() override; + double getX2Minimum() override; + double getX2Maximum() override; + double getX3Centroid() override; + double getX3Minimum() override; + double getX3Maximum() override; /* * Adds a point to the end of this polygon. Notifies the observers of this 2D polygon. @@ -243,31 +243,32 @@ public: // } // catch(Exception e){ return(false); } // } - std::vector<GbTriangle3D*> getSurfaceTriangleSet() + std::vector<GbTriangle3D*> getSurfaceTriangleSet() override { std::cout<<"GbPolygon3D::getSurfaceTriangleSet() - not implemented\n"; std::vector<GbTriangle3D*> tmp; return tmp; } - bool isPointInGbObject3D(const double& x1, const double& x2, const double& x3) + bool isPointInGbObject3D(const double& x1, const double& x2, const double& x3) override { throw UbException(__FILE__, __LINE__, "GbPolygon3D::isPointInObject3D- not implemented"); } - bool isPointInGbObject3D(const double& x1, const double& x2, const double& x3, bool& pointIsOnBoundary) + bool isPointInGbObject3D(const double& x1, const double& x2, const double& x3, bool& pointIsOnBoundary) override { throw UbException(__FILE__, __LINE__, "GbPolygon3D::isPointInObject3D- not implemented"); } - bool isCellInsideGbObject3D(double x11,double x21,double x31,double x12,double x22,double x32) { return false; } + bool isCellInsideGbObject3D(const double& x1a,const double& x2a,const double& x3a,const double& x1b,const double& x2b,const double& x3b) override { return false; } - GbLine3D* createClippedLine3D (GbPoint3D& point1, GbPoint3D &point2) + GbLine3D* createClippedLine3D (GbPoint3D& point1, GbPoint3D &point2) override { throw UbException(__FILE__, __LINE__, "GbPolygon3D::createClippedLine3D - not implemented"); - } + } + /* * Returns a string representation of this 2D polygon. * @return a string representation of this 2D polygon */ - std::string toString(); + std::string toString() override; /*======================================================================*/ /* Private Methoden */ diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityBCAlgorithm.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityBCAlgorithm.cpp index b9cf0a48f744995f90deff8f1307a31a367ed64d..f21ead4bb236b3c7646ed6840530f817144f308e 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityBCAlgorithm.cpp +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityBCAlgorithm.cpp @@ -57,18 +57,18 @@ void VelocityBCAlgorithm::applyBC() LBMReal f[D3Q27System::ENDF+1]; LBMReal feq[D3Q27System::ENDF+1]; distributions->getDistributionInv(f, x1, x2, x3); - LBMReal rho, vx1, vx2, vx3, drho; + LBMReal vx1, vx2, vx3, drho; calcMacrosFct(f, drho, vx1, vx2, vx3); calcFeqFct(feq, drho, vx1, vx2, vx3); - rho = 1.0+drho*compressibleFactor; + //rho = 1.0+drho*compressibleFactor; for (int fdir = D3Q27System::FSTARTDIR; fdir<=D3Q27System::FENDDIR; fdir++) { if (bcPtr->hasVelocityBoundaryFlag(fdir)) { const int invDir = D3Q27System::INVDIR[fdir]; - LBMReal q = bcPtr->getQ(invDir); + //LBMReal q = bcPtr->getQ(invDir); LBMReal velocity = bcPtr->getBoundaryVelocity(invDir); LBMReal fReturn = f[invDir] - velocity; // TODO: compare with development distributions->setDistributionForDirection(fReturn, x1+D3Q27System::DX1[invDir], x2+D3Q27System::DX2[invDir], x3+D3Q27System::DX3[invDir], fdir); diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/NUPSCounterCoProcessor.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/NUPSCounterCoProcessor.cpp index 69f1562e66a90f009dbeb9fd8179db0517a8cebe..e881706cacc53a98076131da2022fc417d9bf1e7 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/NUPSCounterCoProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/CoProcessors/NUPSCounterCoProcessor.cpp @@ -40,10 +40,10 @@ NUPSCounterCoProcessor::NUPSCounterCoProcessor(SPtr<Grid3D> grid, SPtr<UbScheduler> s, int numOfThreads, SPtr<Communicator> comm) : CoProcessor(grid, s), numOfThreads(numOfThreads), - comm(comm), nup(0), nup_t(0), - nupsStep(0.0) + nupsStep(0.0), + comm(comm) { if (comm->getProcessID() == comm->getRoot()) { diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/WriteBoundaryConditionsCoProcessor.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/WriteBoundaryConditionsCoProcessor.cpp index dc9549c205beacbaa931913def35c5e10b79a90f..5f2c8f08954585d4f990d6175d37884db854e3ba 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/WriteBoundaryConditionsCoProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/CoProcessors/WriteBoundaryConditionsCoProcessor.cpp @@ -145,7 +145,6 @@ void WriteBoundaryConditionsCoProcessor::clearData() void WriteBoundaryConditionsCoProcessor::addDataGeo(SPtr<Block3D> block) { UbTupleDouble3 org = grid->getBlockWorldCoordinates(block); - UbTupleDouble3 blockLengths = grid->getBlockLengths(block); UbTupleDouble3 nodeOffset = grid->getNodeOffset(block); double dx = grid->getDeltaX(block); @@ -185,10 +184,6 @@ void WriteBoundaryConditionsCoProcessor::addDataGeo(SPtr<Block3D> block) maxX2 -= 1; maxX3 -= 1; - int s=0; - - - for (size_t ix3 = minX3; ix3<=maxX3; ix3++) { for (size_t ix2 = minX2; ix2<=maxX2; ix2++) diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/WriteBoundaryConditionsCoProcessor.h b/src/cpu/VirtualFluidsCore/CoProcessors/WriteBoundaryConditionsCoProcessor.h index 5786f038989f455236ff79b075219bea66fcd1e2..73bd92ffe485fad78adf34aaa2aeaf07e28b400d 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/WriteBoundaryConditionsCoProcessor.h +++ b/src/cpu/VirtualFluidsCore/CoProcessors/WriteBoundaryConditionsCoProcessor.h @@ -79,7 +79,6 @@ private: std::vector<std::vector<double> > data; std::string path; WbWriter* writer; - bool bcInformation; std::vector<std::vector<SPtr<Block3D> > > blockVector; int minInitLevel; int maxInitLevel; diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/WriteMacroscopicQuantitiesCoProcessor.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/WriteMacroscopicQuantitiesCoProcessor.cpp index 6789ff59e0dc115c36a229253def15326d39fede..5a5edcd0c551c77f43666ad74781645e66561db8 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/WriteMacroscopicQuantitiesCoProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/CoProcessors/WriteMacroscopicQuantitiesCoProcessor.cpp @@ -149,8 +149,6 @@ void WriteMacroscopicQuantitiesCoProcessor::clearData() ////////////////////////////////////////////////////////////////////////// void WriteMacroscopicQuantitiesCoProcessor::addDataMQ(SPtr<Block3D> block) { - double blockID = (double)block->getGlobalID(); - //This data is written: datanames.resize(0); datanames.push_back("DRho"); diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/WriteMacroscopicQuantitiesCoProcessor.h b/src/cpu/VirtualFluidsCore/CoProcessors/WriteMacroscopicQuantitiesCoProcessor.h index 67a1c61f3be38a91d2feb01657492508d523aa83..0386f938191630894e3facf04a2fa721e3fb6287 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/WriteMacroscopicQuantitiesCoProcessor.h +++ b/src/cpu/VirtualFluidsCore/CoProcessors/WriteMacroscopicQuantitiesCoProcessor.h @@ -88,7 +88,6 @@ private: std::string path; WbWriter* writer; SPtr<LBMUnitConverter> conv; - bool bcInformation; std::vector<std::vector<SPtr<Block3D> > > blockVector; int minInitLevel; int maxInitLevel; diff --git a/src/cpu/VirtualFluidsCore/Grid/Calculator.cpp b/src/cpu/VirtualFluidsCore/Grid/Calculator.cpp index 8155e33aedbda737bc5cb9ff9dd885dc843b9a70..45de9261c5d882a9f96a006974f53e9084ea02a4 100644 --- a/src/cpu/VirtualFluidsCore/Grid/Calculator.cpp +++ b/src/cpu/VirtualFluidsCore/Grid/Calculator.cpp @@ -66,7 +66,7 @@ Calculator::Calculator(SPtr<Grid3D> grid, SPtr<UbScheduler> additionalGhostLayer { std::vector<SPtr<Block3D>> blockVector; grid->getBlocks(level, gridRank, true, blockVector); - for (SPtr<Block3D> const block : blockVector) + for (const auto& block : blockVector) if (block) blocks[block->getLevel()].push_back(block); } diff --git a/src/cpu/VirtualFluidsCore/Grid/Grid3DSystem.h b/src/cpu/VirtualFluidsCore/Grid/Grid3DSystem.h index 8ed0d10e46cbf42f02da8cb90691b4c7b5904885..856b96d0fe0aaa8e80939e974eef32283df700c9 100644 --- a/src/cpu/VirtualFluidsCore/Grid/Grid3DSystem.h +++ b/src/cpu/VirtualFluidsCore/Grid/Grid3DSystem.h @@ -144,7 +144,7 @@ namespace Grid3DSystem default : return "Cell3DSystem::getDrectionString(...) - unknown dir"; } } - static const int& getInvertDirection(const int& direction); + static const int& getInvertDirection(const int& direction); ////////////////////////////////////////////////////////////////////////// static inline void setNeighborCoordinatesForDirection(int &x1, int &x2,int &x3, const int& direction) diff --git a/src/cpu/VirtualFluidsCore/Interactors/D3Q27Interactor.cpp b/src/cpu/VirtualFluidsCore/Interactors/D3Q27Interactor.cpp index d8daaccd8e9d3f01ee1cc63fe27ad4b9f6c30bc8..7e5b482297cbdff20fea571339e9f91682eef7f6 100644 --- a/src/cpu/VirtualFluidsCore/Interactors/D3Q27Interactor.cpp +++ b/src/cpu/VirtualFluidsCore/Interactors/D3Q27Interactor.cpp @@ -220,9 +220,6 @@ bool D3Q27Interactor::setDifferencesToGbObject3D(const SPtr<Block3D> block) double internX1,internX2,internX3; - //width of ghost layer - int gl = kernel->getGhostLayerWidth(); - int startIX1 = 0; int startIX2 = 0; int startIX3 = 0; @@ -230,8 +227,7 @@ bool D3Q27Interactor::setDifferencesToGbObject3D(const SPtr<Block3D> block) int stopIX2 = (int)bcArray->getNX2(); int stopIX3 = (int)bcArray->getNX3(); - double dx = grid.lock()->getDeltaX(block); - UbTupleDouble3 orgDelta = grid.lock()->getNodeOffset(block); + double dx = grid.lock()->getDeltaX(block); //other boundingRect than in init, because here the boundrect has to be increased by one dx GbCuboid3D extendedBoundingGeoOfGeoObject( geoObject3D->getX1Minimum()-1.02*dx diff --git a/src/cpu/VirtualFluidsCore/Interactors/Interactor3D.cpp b/src/cpu/VirtualFluidsCore/Interactors/Interactor3D.cpp index 307a34f727408e1ed9bc6bd5bb421170fd710b10..c05fc12ef3af5e50ee562423efd1ee703bf57740 100644 --- a/src/cpu/VirtualFluidsCore/Interactors/Interactor3D.cpp +++ b/src/cpu/VirtualFluidsCore/Interactors/Interactor3D.cpp @@ -62,8 +62,7 @@ Interactor3D::Interactor3D() } ////////////////////////////////////////////////////////////////////////// Interactor3D::Interactor3D(SPtr<Grid3D> grid, int type) - : type(type) - , grid(grid) + : grid(grid), type(type) { } diff --git a/src/cpu/VirtualFluidsCore/Interactors/Interactor3D.h b/src/cpu/VirtualFluidsCore/Interactors/Interactor3D.h index 9ff168bf80681547de91aac0f870cc306c78ad65..abfffbd316bcb17723a788b41728095fed83940d 100644 --- a/src/cpu/VirtualFluidsCore/Interactors/Interactor3D.h +++ b/src/cpu/VirtualFluidsCore/Interactors/Interactor3D.h @@ -117,10 +117,10 @@ protected: bool isBlockInsideGeoObject(double minX1, double minX2, double minX3, double maxX1, double maxX2, double maxX3, double delta); bool isBlockCuttingGeoObject(double minX1, double minX2, double minX3, double maxX1, double maxX2, double maxX3, double delta); - int type; - - WPtr<Grid3D> grid; + SPtr<GbObject3D> geoObject3D; + WPtr<Grid3D> grid; + int type; std::vector<SPtr<Block3D> > bcBlocks; std::vector<SPtr<Block3D> > solidBlocks; diff --git a/src/cpu/VirtualFluidsCore/Interactors/InteractorsHelper.cpp b/src/cpu/VirtualFluidsCore/Interactors/InteractorsHelper.cpp index 21d9b87d21feef741c9c7a89f6d11fdaad326f1a..0411b4f19792559f5d8bcbc768e5a392005632e8 100644 --- a/src/cpu/VirtualFluidsCore/Interactors/InteractorsHelper.cpp +++ b/src/cpu/VirtualFluidsCore/Interactors/InteractorsHelper.cpp @@ -69,7 +69,7 @@ void InteractorsHelper::selectBlocks() ////////////////////////////////////////////////////////////////////////// void InteractorsHelper::setBcBlocks() { - for(const SPtr<Interactor3D> interactor : interactors) + for(const auto& interactor : interactors) { SetBcBlocksBlockVisitor v(interactor); grid->accept(v); diff --git a/src/cpu/VirtualFluidsCore/Interactors/InteractorsHelper.h b/src/cpu/VirtualFluidsCore/Interactors/InteractorsHelper.h index b05ccf8da96d7945f0284f2f024c77c724362024..579040c7e3dffddbd4693d077b4b71c27f4bc5dd 100644 --- a/src/cpu/VirtualFluidsCore/Interactors/InteractorsHelper.h +++ b/src/cpu/VirtualFluidsCore/Interactors/InteractorsHelper.h @@ -60,7 +60,6 @@ private: SPtr<Grid3D> grid; std::vector<SPtr<Block3D> > solidBlocks; SPtr<Grid3DVisitor> visitor; - bool deleteBlocks; }; #endif diff --git a/src/cpu/VirtualFluidsCore/LBM/CumulantK17LBMKernel.cpp b/src/cpu/VirtualFluidsCore/LBM/CumulantK17LBMKernel.cpp index b3a3c989b5ad867eafb30bc8eba25421a34e8082..072d8cd90fa892bf72bebb13aa4fd28c5a4aa53c 100644 --- a/src/cpu/VirtualFluidsCore/LBM/CumulantK17LBMKernel.cpp +++ b/src/cpu/VirtualFluidsCore/LBM/CumulantK17LBMKernel.cpp @@ -113,10 +113,6 @@ void CumulantK17LBMKernel::calculate(int step) muForcingX1.DefineVar("nu", &muNu); muForcingX2.DefineVar("nu", &muNu); muForcingX3.DefineVar("nu", &muNu); - - LBMReal forcingX1 = 0; - LBMReal forcingX2 = 0; - LBMReal forcingX3 = 0; } ///////////////////////////////////// @@ -245,9 +241,6 @@ void CumulantK17LBMKernel::calculate(int step) vvy += forcingX2 * deltaT * c1o2; // Y vvz += forcingX3 * deltaT * c1o2; // Z } - /////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////// - LBMReal oMdrho = c1; //////////////////////////////////////////////////////////////////////////////////// // calculate the square of velocities for this lattice node LBMReal vx2 = vvx * vvx; diff --git a/src/cpu/VirtualFluidsCore/LBM/D3Q27System.h b/src/cpu/VirtualFluidsCore/LBM/D3Q27System.h index f1c6c1c79a22124f5d3af7f088a0dfe155f7fd8e..3a7ca9b460a6793e725826dd1c500d7d25e10210 100644 --- a/src/cpu/VirtualFluidsCore/LBM/D3Q27System.h +++ b/src/cpu/VirtualFluidsCore/LBM/D3Q27System.h @@ -531,8 +531,6 @@ namespace D3Q27System static inline void calcDistanceToNeighbors(std::vector<double>& distNeigh, const double& deltaX1,const double& deltaX2,const double& deltaX3) { //distNeigh.resize(FENDDIR+1, UbMath::sqrt2*deltaX1); - double sqrt3 = UbMath::sqrt3; - double sqrt2 = UbMath::sqrt2; distNeigh[E] = distNeigh[W] = deltaX1; distNeigh[N] = distNeigh[S] = deltaX2; distNeigh[T] = distNeigh[B] = deltaX3; diff --git a/src/cpu/VirtualFluidsCore/Visitors/BoundaryConditionsBlockVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/BoundaryConditionsBlockVisitor.cpp index 9bf49094cf2264e7fd2c95cfdd559d5b590d7b48..e75d09c2cb755204829bc277aba202a8f8f86079 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/BoundaryConditionsBlockVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/BoundaryConditionsBlockVisitor.cpp @@ -75,7 +75,6 @@ void BoundaryConditionsBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> bloc bool compressible = kernel->getCompressible(); double collFactor = kernel->getCollisionFactor(); - int level = block->getLevel(); int minX1 = 0; int minX2 = 0; diff --git a/src/cpu/VirtualFluidsCore/Visitors/InitDistributionsBlockVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/InitDistributionsBlockVisitor.cpp index 0a49f68e6412350893090db7d7c22b27d10b91a0..1f313a21738504ce5604b55f9647a2dd9dbcafaf 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/InitDistributionsBlockVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/InitDistributionsBlockVisitor.cpp @@ -168,10 +168,6 @@ void InitDistributionsBlockVisitor::visit(const SPtr<Grid3D> grid, SPtr<Block3D> LBMReal f[D3Q27System::ENDF+1]; - size_t nx1 = distributions->getNX1(); - size_t nx2 = distributions->getNX2(); - size_t nx3 = distributions->getNX3(); - for(int ix3=0; ix3<bcArray->getNX3(); ix3++) for(int ix2=0; ix2<bcArray->getNX2(); ix2++) for(int ix1=0; ix1<bcArray->getNX1(); ix1++)