From 103144965eb817b85d38b20603bec444ed2a206e Mon Sep 17 00:00:00 2001 From: Soeren Peters <peters@irmb.tu-bs.de> Date: Mon, 5 Oct 2020 10:08:28 +0200 Subject: [PATCH] Eliminate additional clang compiler warnings. --- apps/cpu/LaminarTubeFlow/ltf.cpp | 13 +- src/basics/basics/parallel/PbMpi.h | 14 +- src/basics/basics/utilities/UbLogger.h | 6 +- src/basics/basics/utilities/UbNupsTimer.h | 2 +- .../basics/utilities/UbStringInputASCII.cpp | 422 +++++++++--------- .../basics/utilities/UbStringInputASCII.h | 110 ++--- src/basics/basics/writer/WbWriter.h | 5 +- src/basics/basics/writer/WbWriterAvsASCII.cpp | 2 +- src/basics/basics/writer/WbWriterAvsASCII.h | 2 +- .../basics/writer/WbWriterAvsBinary.cpp | 2 +- src/basics/basics/writer/WbWriterAvsBinary.h | 4 +- .../basics/writer/WbWriterTecPlotASCII.cpp | 6 +- .../basics/writer/WbWriterTecPlotASCII.h | 4 +- src/basics/basics/writer/WbWriterVtkASCII.cpp | 2 +- src/basics/basics/writer/WbWriterVtkASCII.h | 4 +- .../basics/writer/WbWriterVtkBinary.cpp | 2 +- src/basics/basics/writer/WbWriterVtkBinary.h | 2 +- src/basics/geometry3d/GbSphere3D.cpp | 5 +- src/basics/geometry3d/GbTriFaceMesh3D.cpp | 4 +- src/basics/geometry3d/GbTriangularMesh3D.cpp | 22 +- src/basics/geometry3d/GbVoxelMatrix3D.cpp | 27 +- src/basics/geometry3d/KdTree/KdNode.h | 8 - .../KdCountRayIntersectionHandler.h | 4 +- .../ThinWallBCProcessor.cpp | 13 +- .../BoundaryConditions/ThinWallBCProcessor.h | 11 +- .../VelocityWithDensityBCAlgorithm.cpp | 4 +- .../CoProcessors/AdjustForcingCoProcessor.cpp | 8 +- .../CoProcessors/AdjustForcingCoProcessor.h | 3 +- .../CoProcessors/AverageValuesCoProcessor.cpp | 2 +- .../CoProcessors/ForceCalculator.cpp | 6 +- .../CoProcessors/MPIIOCoProcessor.cpp | 2 +- .../MPIIOMigrationBECoProcessor.cpp | 4 +- .../MPIIOMigrationBECoProcessor.h | 6 +- .../MicrophoneArrayCoProcessor.cpp | 2 +- .../PressureCoefficientCoProcessor.cpp | 2 +- .../CoProcessors/QCriterionCoProcessor.cpp | 14 +- .../CoProcessors/ShearStressCoProcessor.cpp | 42 +- .../TimeAveragedValuesCoProcessor.cpp | 2 +- .../TurbulenceIntensityCoProcessor.cpp | 2 +- .../WriteMQFromSelectionCoProcessor.cpp | 2 +- .../WriteMQFromSelectionCoProcessor.h | 2 +- .../WriteMacroscopicQuantitiesCoProcessor.cpp | 2 +- .../CoarseToFineNodeSetBlock3DConnector.cpp | 8 +- .../Connectors/D3Q27ETCFOffVectorConnector.h | 85 ++-- .../FineToCoarseNodeSetBlock3DConnector.cpp | 24 +- .../D3Q27TriFaceMeshInteractor.cpp | 59 ++- .../Interactors/InteractorsHelper.cpp | 2 +- ...ibleCumulant4thOrderViscosityLBMKernel.cpp | 6 +- .../LBM/CompressibleCumulantLBMKernel.cpp | 8 +- ...mpressibleOffsetInterpolationProcessor.cpp | 2 +- ...CompressibleOffsetInterpolationProcessor.h | 2 +- ...bleOffsetMomentsInterpolationProcessor.cpp | 4 +- ...sibleOffsetMomentsInterpolationProcessor.h | 2 +- ...fsetSquarePressureInterpolationProcessor.h | 2 +- .../LBM/IncompressibleCumulantLBMKernel.cpp | 6 +- ...mpressibleOffsetInterpolationProcessor.cpp | 6 +- ...compressibleOffsetInterpolationProcessor.h | 2 +- .../LBM/InitDensityLBMKernel.cpp | 2 +- .../LBM/InitDensityLBMKernel.h | 4 +- .../Visitors/CheckRatioBlockVisitor.cpp | 2 +- .../Visitors/ConnectorBlockVisitor.cpp | 6 +- .../Visitors/CreateTransmittersHelper.cpp | 4 +- .../InitDistributionsFromFileBlockVisitor.cpp | 27 +- .../InitDistributionsFromFileBlockVisitor.h | 5 +- ...tributionsWithInterpolationGridVisitor.cpp | 8 +- .../Visitors/MetisPartitioningGridVisitor.cpp | 3 + .../Visitors/RenumberGridVisitor.cpp | 2 +- .../Visitors/SetConnectorsBlockVisitor.cpp | 14 +- 68 files changed, 530 insertions(+), 566 deletions(-) diff --git a/apps/cpu/LaminarTubeFlow/ltf.cpp b/apps/cpu/LaminarTubeFlow/ltf.cpp index bb65bc627..7ab9d3c42 100644 --- a/apps/cpu/LaminarTubeFlow/ltf.cpp +++ b/apps/cpu/LaminarTubeFlow/ltf.cpp @@ -60,8 +60,6 @@ void run(string configname) SPtr<LBMUnitConverter> conv = SPtr<LBMUnitConverter>(new LBMUnitConverter()); - const int baseLevel = 0; - //BC Adapter ////////////////////////////////////////////////////////////////////////////// SPtr<BCAdapter> noSlipBCAdapter(new NoSlipBCAdapter()); @@ -179,10 +177,10 @@ void run(string configname) SPtr<D3Q27Interactor> cylinderInt(new D3Q27Interactor(cylinder, grid, noSlipBCAdapter, Interactor3D::INVERSESOLID)); - double r = dynamicPointerCast<GbCylinder3D>(cylinder)->getRadius(); - double cx1 = g_minX1; - double cx2 = cylinder->getX2Centroid(); - double cx3 = cylinder->getX3Centroid(); + //double r = dynamicPointerCast<GbCylinder3D>(cylinder)->getRadius(); + //double cx1 = g_minX1; + //double cx2 = cylinder->getX2Centroid(); + //double cx3 = cylinder->getX3Centroid(); mu::Parser fct; fct.SetExpr("vx1"); @@ -310,7 +308,8 @@ void run(string configname) if (myid == 0) UBLOG(logINFO, "Simulation-start"); calculator->calculate(); - if (myid == 0) UBLOG(logINFO, "Simulation-end"); + if (myid == 0) + UBLOG(logINFO, "Simulation-end"); } catch (std::exception& e) { diff --git a/src/basics/basics/parallel/PbMpi.h b/src/basics/basics/parallel/PbMpi.h index 76011d613..f6bf20b6f 100644 --- a/src/basics/basics/parallel/PbMpi.h +++ b/src/basics/basics/parallel/PbMpi.h @@ -302,7 +302,7 @@ void PbMpi::sendBoolValue(const bool& value,int dest, int tag, PbMpi::Comm comm) /*======================================================================*/ bool PbMpi::receiveBoolValue(int source, int tag, PbMpi::Comm comm) { - short dummy; + short dummy {0}; PbMpi::Recv(comm, &dummy, 1, PbMpi_SHORT, source, tag); //comm.Recv(&dummy, 1, MPI::SHORT, source, tag); @@ -313,8 +313,8 @@ bool PbMpi::receiveBoolValue(int source, int tag, PbMpi::Comm comm) void PbMpi::sendStringValue(const std::string& value,int dest, int tag, PbMpi::Comm comm) { std::vector<char> vec; - for(std::size_t i=0; i<value.size(); i++) - vec.push_back(value[i]); + for(char i : value) + vec.push_back(i); PbMpi::sendVector(vec,PbMpi_CHAR,dest,tag,comm); } @@ -327,8 +327,8 @@ std::string PbMpi::receiveStringValue(int source, int tag, PbMpi::Comm comm) PbMpi::receiveVector(vec,PbMpi_CHAR,source,tag,comm); std::string str; - for(std::size_t i=0; i<vec.size(); i++) - str+=vec[i]; + for(char i : vec) + str+=i; return str; } @@ -354,7 +354,7 @@ void PbMpi::sendVector(const std::vector<T>& v, MPI_Datatype datatype, int dest, template <class T> void PbMpi::receiveVector(std::vector<T>& v, MPI_Datatype datatype, int source, int tag, PbMpi::Comm comm) { - int size; + int size {0}; PbMpi::Recv(comm, &size, 1, PbMpi_INT, source, tag); //comm.Recv(&size, 1, MPI::INT, source, tag); @@ -424,7 +424,7 @@ void PbMpi::sendStringVector(const std::vector<std::string>& v, int dest, int ta void PbMpi::receiveStringVector(std::vector<std::string>& v, int source, int tag, PbMpi::Comm comm) { // send size - int stringVectorSize; + int stringVectorSize {0}; PbMpi::Recv(comm, &stringVectorSize, 1, PbMpi_INT, source, tag); //comm.Recv(&stringVectorSize, 1, MPI::INT, source, tag); diff --git a/src/basics/basics/utilities/UbLogger.h b/src/basics/basics/utilities/UbLogger.h index a7bb006c2..ccb3f1f87 100644 --- a/src/basics/basics/utilities/UbLogger.h +++ b/src/basics/basics/utilities/UbLogger.h @@ -315,8 +315,10 @@ class UbLog : public UbLogger< Output2Stream > // example UBLOG(logINFO) << "das ist ein log eintrag"; ////////////////////////////////////////////////////////////////////////// #define UBLOG(level, logtext) \ - if(level > UBLOG_MAX_LEVEL || level > UbLog::reportingLevel() || !Output2Stream::getStream()) ; \ - else UbLog().get(level) << logtext; + if(level <= UBLOG_MAX_LEVEL && level <= UbLog::reportingLevel() && Output2Stream::getStream()) \ + { \ + UbLog().get(level) << logtext; \ + } ////////////////////////////////////////////////////////////////////////// //makro 2 fuer korrekten MultiLineOutput (teuer!!) diff --git a/src/basics/basics/utilities/UbNupsTimer.h b/src/basics/basics/utilities/UbNupsTimer.h index cd99df78e..b18cbe30f 100644 --- a/src/basics/basics/utilities/UbNupsTimer.h +++ b/src/basics/basics/utilities/UbNupsTimer.h @@ -40,7 +40,7 @@ public: mTempNodes = 0.0; } /*==========================================================*/ - void startTiming(double nofNodes) + void startNUPSTiming(double nofNodes) { mTempNodes=nofNodes; UbTiming::startTiming(); diff --git a/src/basics/basics/utilities/UbStringInputASCII.cpp b/src/basics/basics/utilities/UbStringInputASCII.cpp index 094b6a5b8..b100a51c3 100644 --- a/src/basics/basics/utilities/UbStringInputASCII.cpp +++ b/src/basics/basics/utilities/UbStringInputASCII.cpp @@ -1,211 +1,211 @@ -#include <basics/utilities/UbStringInputASCII.h> -#include <cstring> - -using namespace std; - - -UbStringInputASCII::UbStringInputASCII(string inputString) : UbFileInputASCII("") -{ - instream.str(inputString); - - -// this->filename = filename; -// this->commentindicator = 'C'; -// -// infile.open(filename.c_str()); - -} -/*==========================================================*/ -int UbStringInputASCII::readInteger() -{ - int dummy; - instream>>dummy; - return dummy; -} -/*==========================================================*/ -std::size_t UbStringInputASCII::readSize_t() -{ - std::size_t dummy; - instream>>dummy; - return dummy; -} -/*==========================================================*/ -string UbStringInputASCII::getFileName() -{ - return this->filename; -} - -/*==========================================================*/ -void UbStringInputASCII::skipLine() -{ - string dummy; - getline(instream, dummy); -} -/*==========================================================*/ -void UbStringInputASCII::readLine() -{ - string dummy; - getline(instream, dummy); -} -/*==========================================================*/ -string UbStringInputASCII::readStringLine() -{ - string dummy; - getline(instream, dummy); - return dummy; -} -/*==========================================================*/ -string UbStringInputASCII::readLineTill(char stop) -{ - string dummy; - getline(instream, dummy, stop); - return dummy; -} -/*==========================================================*/ -string UbStringInputASCII::parseString() -{ - string dummy; - getline(instream, dummy, ' '); - return dummy; -} -/*==========================================================*/ -double UbStringInputASCII::readDouble() -{ - double dummy; - instream>>dummy; - return dummy; -} -/*==========================================================*/ -float UbStringInputASCII::readFloat() -{ - float dummy; - instream>>dummy; - return dummy; -} -/*==========================================================*/ -char UbStringInputASCII::readChar() -{ - char dummy; - instream>>dummy; - return dummy; -} -/*==========================================================*/ -string UbStringInputASCII::readString() -{ - string dummy; - instream>>dummy; - return dummy; -} -/*==========================================================*/ -bool UbStringInputASCII::containsString(string var) -{ - instream.seekg(0L, ios::beg); //Positionszeiger der Datei auf den Anfang setzen - char line[512]; - do - { - instream.getline(line,512); - if(instream.eof()) return false; - }while (strstr(line,var.c_str()) != line); // Ende Schleife, wenn varname ganz in zeile vorkommt - - return true; -} -/*==========================================================*/ -void UbStringInputASCII::setPosAfterLineWithString(string var) -{ - instream.seekg(0L, ios::beg); //Positionszeiger der Datei auf den Anfang setzen - char line[512]; - do - { - instream.getline(line,512); - if(instream.eof()) UB_THROW( UbException(UB_EXARGS,var+" wasn't found in "+this->filename) ); - }while (strstr(line,var.c_str()) != line); // Ende Schleife, wenn varname ganz in zeile vorkommt -} -/*==========================================================*/ -int UbStringInputASCII::readIntegerAfterString(string var) -// last change [10.3.2004] at [9:46] -//suchts in einer Datei nach varname und gibt den dahinter stehenden int-Wert zurueck -//z.B. timesteps 9 -{ - instream.seekg(0L, ios::beg); //Positionszeiger der Datei auf den Anfang setzen - - char line[512]; - - do - { - instream.getline(line,512); - if(instream.eof()) UB_THROW( UbException(UB_EXARGS,var+" wasn't found in "+this->filename) ); - }while (strstr(line,var.c_str()) != line); // Ende Schleife, wenn varname ganz in zeile vorkommt - - strcpy (line, (line+strlen(var.c_str()))); // zeile um "varname" kuerzen - while ((line[0] == ' ') || (line[0] == '\t')) strcpy (line, (line+1)); // Whitespaces entfernen - - return(atoi(line)); // Umwandlung in int -} -/*==========================================================*/ -// last change [10.3.2004] at [9:46] -//sucht in einer Datei nach varname und gibt den dahinter stehenden int-Wert zurueck -//z.B. nue 9.5 -double UbStringInputASCII::readDoubleAfterString(string var) -{ - instream.seekg(0L, ios::beg); //Positionszeiger der Datei auf den Anfang setzen - - char line[512]; - - do - { - instream.getline(line,512); - if(instream.eof()) UB_THROW( UbException(UB_EXARGS,var+" wasn't found in "+this->filename) ); - }while (/*!strncmp(varname,line,sizeof(varname))==0*/strstr(line,var.c_str()) != line); // Ende Schleife, wenn varname ganz in zeile vorkommt - - - strcpy (line, (line+strlen(var.c_str()))); // zeile um "varname" kuerzen - while ((line[0] == ' ') || (line[0] == '\t')) strcpy (line, (line+1)); // Whitespaces entfernen - - return (atof(line)); // Umwandlung in double -} -/*==========================================================*/ -// [9.9.2002] -// liefert sring-Wert der hinter dem uebergebenen char feld in der datei instream steht -// zudem wird der wert in die uebergebene variable value uebertragen (falls man das ergebniss als char benoetig) -string UbStringInputASCII::readStringAfterString(string var) -{ - instream.seekg(0L, ios::beg); //Positionszeiger der Datei auf den Anfang setzen - - char line[512]; - //string line_copy[512]; - - do{ - instream.getline(line,512); - if(instream.eof()) UB_THROW( UbException(UB_EXARGS,var+" wasn't found in "+this->filename) ); - }while (strstr(line,var.c_str()) != line); // Ende Schleife, wenn varname ganz in zeile vorkommt - - strcpy (line, (line+strlen(var.c_str()))); // zeile um "varname" kuerzen - while ((line[0] == ' ') || (line[0] == '\t')) strcpy (line, (line+1)); // Whitespaces entfernen - - char *p; - p=strtok(line," "); //schneidet alles "ab und inklusive space " nach namen ab - p=strtok(line,"\t");//schneidet alles "ab und inklusive tab " nach namen ab - - return (string)p; // Umwandlung in string -} -/*==========================================================*/ -// last change [10.3.2004] at [9:46] -//sucht in einer Datei nach varname und gibt den dahinter stehenden int-Wert zurueck -//z.B. nue 9.5 -bool UbStringInputASCII::readBoolAfterString(string var) -{ - if(this->readStringAfterString(var.c_str()) == "true" ) return true; - else if(this->readStringAfterString(var.c_str()) == "false") return false; - else UB_THROW( UbException(UB_EXARGS,var+" is not equal to 'true' or 'false' in "+this->filename) ); -} -/*==========================================================*/ -// last change [10.3.2004] at [9:46] -//sucht in einer Datei nach varname und gibt den dahinter stehenden int-Wert zurueck -//z.B. nue 9.5 -bool UbStringInputASCII::readBool() -{ - string tmp = this->readString(); - if( tmp == "true" ) return true; - else if(tmp == "false") return false; - else UB_THROW( UbException(UB_EXARGS,"expression is not equal to 'true' or 'false' in "+this->filename) ); -} +//#include <basics/utilities/UbStringInputASCII.h> +//#include <cstring> +// +//using namespace std; +// +// +//UbStringInputASCII::UbStringInputASCII(string inputString) : UbFileInputASCII("") +//{ +// instream.str(inputString); +// +// +//// this->filename = filename; +//// this->commentindicator = 'C'; +//// +//// infile.open(filename.c_str()); +// +//} +///*==========================================================*/ +//int UbStringInputASCII::readInteger() +//{ +// int dummy; +// instream>>dummy; +// return dummy; +//} +///*==========================================================*/ +//std::size_t UbStringInputASCII::readSize_t() +//{ +// std::size_t dummy; +// instream>>dummy; +// return dummy; +//} +///*==========================================================*/ +//string UbStringInputASCII::getFileName() +//{ +// return this->filename; +//} +// +///*==========================================================*/ +//void UbStringInputASCII::skipLine() +//{ +// string dummy; +// getline(instream, dummy); +//} +///*==========================================================*/ +//void UbStringInputASCII::readLine() +//{ +// string dummy; +// getline(instream, dummy); +//} +///*==========================================================*/ +//string UbStringInputASCII::readStringLine() +//{ +// string dummy; +// getline(instream, dummy); +// return dummy; +//} +///*==========================================================*/ +//string UbStringInputASCII::readLineTill(char stop) +//{ +// string dummy; +// getline(instream, dummy, stop); +// return dummy; +//} +///*==========================================================*/ +//string UbStringInputASCII::parseString() +//{ +// string dummy; +// getline(instream, dummy, ' '); +// return dummy; +//} +///*==========================================================*/ +//double UbStringInputASCII::readDouble() +//{ +// double dummy; +// instream>>dummy; +// return dummy; +//} +///*==========================================================*/ +//float UbStringInputASCII::readFloat() +//{ +// float dummy; +// instream>>dummy; +// return dummy; +//} +///*==========================================================*/ +//char UbStringInputASCII::readChar() +//{ +// char dummy; +// instream>>dummy; +// return dummy; +//} +///*==========================================================*/ +//string UbStringInputASCII::readString() +//{ +// string dummy; +// instream>>dummy; +// return dummy; +//} +///*==========================================================*/ +//bool UbStringInputASCII::containsString(string var) +//{ +// instream.seekg(0L, ios::beg); //Positionszeiger der Datei auf den Anfang setzen +// char line[512]; +// do +// { +// instream.getline(line,512); +// if(instream.eof()) return false; +// }while (strstr(line,var.c_str()) != line); // Ende Schleife, wenn varname ganz in zeile vorkommt +// +// return true; +//} +///*==========================================================*/ +//void UbStringInputASCII::setPosAfterLineWithString(string var) +//{ +// instream.seekg(0L, ios::beg); //Positionszeiger der Datei auf den Anfang setzen +// char line[512]; +// do +// { +// instream.getline(line,512); +// if(instream.eof()) UB_THROW( UbException(UB_EXARGS,var+" wasn't found in "+this->filename) ); +// }while (strstr(line,var.c_str()) != line); // Ende Schleife, wenn varname ganz in zeile vorkommt +//} +///*==========================================================*/ +//int UbStringInputASCII::readIntegerAfterString(string var) +//// last change [10.3.2004] at [9:46] +////suchts in einer Datei nach varname und gibt den dahinter stehenden int-Wert zurueck +////z.B. timesteps 9 +//{ +// instream.seekg(0L, ios::beg); //Positionszeiger der Datei auf den Anfang setzen +// +// char line[512]; +// +// do +// { +// instream.getline(line,512); +// if(instream.eof()) UB_THROW( UbException(UB_EXARGS,var+" wasn't found in "+this->filename) ); +// }while (strstr(line,var.c_str()) != line); // Ende Schleife, wenn varname ganz in zeile vorkommt +// +// strcpy (line, (line+strlen(var.c_str()))); // zeile um "varname" kuerzen +// while ((line[0] == ' ') || (line[0] == '\t')) strcpy (line, (line+1)); // Whitespaces entfernen +// +// return(atoi(line)); // Umwandlung in int +//} +///*==========================================================*/ +//// last change [10.3.2004] at [9:46] +////sucht in einer Datei nach varname und gibt den dahinter stehenden int-Wert zurueck +////z.B. nue 9.5 +//double UbStringInputASCII::readDoubleAfterString(string var) +//{ +// instream.seekg(0L, ios::beg); //Positionszeiger der Datei auf den Anfang setzen +// +// char line[512]; +// +// do +// { +// instream.getline(line,512); +// if(instream.eof()) UB_THROW( UbException(UB_EXARGS,var+" wasn't found in "+this->filename) ); +// }while (/*!strncmp(varname,line,sizeof(varname))==0*/strstr(line,var.c_str()) != line); // Ende Schleife, wenn varname ganz in zeile vorkommt +// +// +// strcpy (line, (line+strlen(var.c_str()))); // zeile um "varname" kuerzen +// while ((line[0] == ' ') || (line[0] == '\t')) strcpy (line, (line+1)); // Whitespaces entfernen +// +// return (atof(line)); // Umwandlung in double +//} +///*==========================================================*/ +//// [9.9.2002] +//// liefert sring-Wert der hinter dem uebergebenen char feld in der datei instream steht +//// zudem wird der wert in die uebergebene variable value uebertragen (falls man das ergebniss als char benoetig) +//string UbStringInputASCII::readStringAfterString(string var) +//{ +// instream.seekg(0L, ios::beg); //Positionszeiger der Datei auf den Anfang setzen +// +// char line[512]; +// //string line_copy[512]; +// +// do{ +// instream.getline(line,512); +// if(instream.eof()) UB_THROW( UbException(UB_EXARGS,var+" wasn't found in "+this->filename) ); +// }while (strstr(line,var.c_str()) != line); // Ende Schleife, wenn varname ganz in zeile vorkommt +// +// strcpy (line, (line+strlen(var.c_str()))); // zeile um "varname" kuerzen +// while ((line[0] == ' ') || (line[0] == '\t')) strcpy (line, (line+1)); // Whitespaces entfernen +// +// char *p; +// p=strtok(line," "); //schneidet alles "ab und inklusive space " nach namen ab +// p=strtok(line,"\t");//schneidet alles "ab und inklusive tab " nach namen ab +// +// return (string)p; // Umwandlung in string +//} +///*==========================================================*/ +//// last change [10.3.2004] at [9:46] +////sucht in einer Datei nach varname und gibt den dahinter stehenden int-Wert zurueck +////z.B. nue 9.5 +//bool UbStringInputASCII::readBoolAfterString(string var) +//{ +// if(this->readStringAfterString(var.c_str()) == "true" ) return true; +// else if(this->readStringAfterString(var.c_str()) == "false") return false; +// else UB_THROW( UbException(UB_EXARGS,var+" is not equal to 'true' or 'false' in "+this->filename) ); +//} +///*==========================================================*/ +//// last change [10.3.2004] at [9:46] +////sucht in einer Datei nach varname und gibt den dahinter stehenden int-Wert zurueck +////z.B. nue 9.5 +//bool UbStringInputASCII::readBool() +//{ +// string tmp = this->readString(); +// if( tmp == "true" ) return true; +// else if(tmp == "false") return false; +// else UB_THROW( UbException(UB_EXARGS,"expression is not equal to 'true' or 'false' in "+this->filename) ); +//} diff --git a/src/basics/basics/utilities/UbStringInputASCII.h b/src/basics/basics/utilities/UbStringInputASCII.h index 06db6d68c..eb2e01376 100644 --- a/src/basics/basics/utilities/UbStringInputASCII.h +++ b/src/basics/basics/utilities/UbStringInputASCII.h @@ -1,55 +1,55 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ -// -#ifndef UBSTRINGINPUTASCII_H -#define UBSTRINGINPUTASCII_H - -#include <fstream> -#include <iostream> -#include <string> - -#include <basics/utilities/UbException.h> -#include <basics/utilities/UbFileInput.h> - -#include <basics/utilities/UbFileInputASCII.h> - -class UbStringInputASCII : public UbFileInputASCII -{ -public: - UbStringInputASCII(std::string inputString); - - std::string getFileName(); - void skipLine(); // Springt zur naechsten Zeile - - void readLine(); - std::string readStringLine(); - std::size_t readSize_t(); - int readInteger(); // Liest einen Int-Wert ein - double readDouble(); // Liest einen double-Wert ein - float readFloat(); // Liest einen float-Wert ein - bool readBool(); // Liest einen bool-Wert ein - char readChar(); // Liest einen char-Wert ein - std::string readString(); // Liest ein Wort ein - std::string readLineTill(char stop); // Liest gesamte Zeile ein bis zu einem bestimmten Zeichen - std::string parseString(); - - bool containsString(std::string var); - void setPosAfterLineWithString(std::string var); - int readIntegerAfterString(std::string var); - double readDoubleAfterString(std::string var); - bool readBoolAfterString(std::string var); - std::string readStringAfterString(std::string var); - - FILETYPE getFileType() { return ASCII; } - -private: - std::istringstream instream; -}; - - -#endif - - +//// _ ___ __ __________ _ __ +//// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ +//// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ +//// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) +//// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ +//// +//#ifndef UBSTRINGINPUTASCII_H +//#define UBSTRINGINPUTASCII_H +// +//#include <fstream> +//#include <iostream> +//#include <string> +// +//#include <basics/utilities/UbException.h> +//#include <basics/utilities/UbFileInput.h> +// +//#include <basics/utilities/UbFileInputASCII.h> +// +//class UbStringInputASCII : public UbFileInputASCII +//{ +//public: +// UbStringInputASCII(std::string inputString); +// +// std::string getFileName(); +// void skipLine(); // Springt zur naechsten Zeile +// +// void readLine(); +// std::string readStringLine(); +// std::size_t readSize_t(); +// int readInteger(); // Liest einen Int-Wert ein +// double readDouble(); // Liest einen double-Wert ein +// float readFloat(); // Liest einen float-Wert ein +// bool readBool(); // Liest einen bool-Wert ein +// char readChar(); // Liest einen char-Wert ein +// std::string readString(); // Liest ein Wort ein +// std::string readLineTill(char stop); // Liest gesamte Zeile ein bis zu einem bestimmten Zeichen +// std::string parseString(); +// +// bool containsString(std::string var); +// void setPosAfterLineWithString(std::string var); +// int readIntegerAfterString(std::string var); +// double readDoubleAfterString(std::string var); +// bool readBoolAfterString(std::string var); +// std::string readStringAfterString(std::string var); +// +// FILETYPE getFileType() { return ASCII; } +// +//private: +// std::istringstream instream; +//}; +// +// +//#endif +// +// diff --git a/src/basics/basics/writer/WbWriter.h b/src/basics/basics/writer/WbWriter.h index 510c160a9..9683c446e 100644 --- a/src/basics/basics/writer/WbWriter.h +++ b/src/basics/basics/writer/WbWriter.h @@ -49,10 +49,7 @@ class WbWriter { public: ////////////////////////////////////////////////////////////////////////// - virtual ~WbWriter() - { - - } + virtual ~WbWriter() = default; ////////////////////////////////////////////////////////////////////////// //rein virtuelle Methoden diff --git a/src/basics/basics/writer/WbWriterAvsASCII.cpp b/src/basics/basics/writer/WbWriterAvsASCII.cpp index 388feecb9..f3e739884 100644 --- a/src/basics/basics/writer/WbWriterAvsASCII.cpp +++ b/src/basics/basics/writer/WbWriterAvsASCII.cpp @@ -783,7 +783,7 @@ std::string WbWriterAvsASCII::writeOctsWithCellData(const string& filename,vecto return avsfilename; } /*===============================================================================*/ -std::string WbWriterAvsASCII::writeOctsWithNodeData(const string& filename,vector<UbTupleFloat3 >& nodes, vector<UbTupleInt8 >& cells, vector<string >& datanames, vector<vector<double > >& nodedata) +std::string WbWriterAvsASCII::writeOctsWithNodeData(const string& filename,vector<UbTupleFloat3 >& nodes, vector<UbTupleUInt8 >& cells, vector<string >& datanames, vector<vector<double > >& nodedata) { string avsfilename = filename+getFileExtension(); UBLOG(logDEBUG1,"WbWriterAvsASCII::writeOctsWithNodeData to "<<avsfilename<<" - start"); diff --git a/src/basics/basics/writer/WbWriterAvsASCII.h b/src/basics/basics/writer/WbWriterAvsASCII.h index a683ae7a1..45e00fd6d 100644 --- a/src/basics/basics/writer/WbWriterAvsASCII.h +++ b/src/basics/basics/writer/WbWriterAvsASCII.h @@ -66,7 +66,7 @@ public: // 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<UbTupleInt8 >& cells, std::vector<std::string >& datanames, std::vector< std::vector<double > >& nodedata); + 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; }; #endif //WBWRITERAVSASCII_H diff --git a/src/basics/basics/writer/WbWriterAvsBinary.cpp b/src/basics/basics/writer/WbWriterAvsBinary.cpp index 2d0ad38c5..d3aa34aad 100644 --- a/src/basics/basics/writer/WbWriterAvsBinary.cpp +++ b/src/basics/basics/writer/WbWriterAvsBinary.cpp @@ -863,7 +863,7 @@ std::string WbWriterAvsBinary::writeOctsWithCellData(const string& filename,vect return avsfilename; } /*===============================================================================*/ -std::string WbWriterAvsBinary::writeOctsWithNodeData(const string& filename,vector<UbTupleFloat3 >& nodes, vector<UbTupleInt8 >& cells, vector<string >& datanames, vector<vector<double > >& nodedata) +std::string WbWriterAvsBinary::writeOctsWithNodeData(const string& filename,vector<UbTupleFloat3 >& nodes, vector<UbTupleUInt8 >& cells, vector<string >& datanames, vector<vector<double > >& nodedata) { string avsfilename = filename+getFileExtension(); UBLOG(logDEBUG1,"WbWriterAvsBinary::writeOctsWithNodeData to "<<avsfilename<<" - start"); diff --git a/src/basics/basics/writer/WbWriterAvsBinary.h b/src/basics/basics/writer/WbWriterAvsBinary.h index 8a31c3e94..8be53d2e9 100644 --- a/src/basics/basics/writer/WbWriterAvsBinary.h +++ b/src/basics/basics/writer/WbWriterAvsBinary.h @@ -63,8 +63,8 @@ public: // |/ |/ // 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<UbTupleInt8 >& cells, std::vector<std::string >& datanames, std::vector< std::vector<double > >& nodedata); + 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; }; #endif //WBWRITERAVSBINARY_H diff --git a/src/basics/basics/writer/WbWriterTecPlotASCII.cpp b/src/basics/basics/writer/WbWriterTecPlotASCII.cpp index 5e2ef86b4..6074b805b 100644 --- a/src/basics/basics/writer/WbWriterTecPlotASCII.cpp +++ b/src/basics/basics/writer/WbWriterTecPlotASCII.cpp @@ -4,7 +4,7 @@ using namespace std; /*===============================================================================*/ -string WbWriterTecPlotASCII::writeOctsWithNodeData(const string& filename,vector<UbTupleFloat3 >& nodes, vector<UbTupleInt8 >& cells, vector<string >& datanames, vector<vector<double > >& nodedata) +string WbWriterTecPlotASCII::writeOctsWithNodeData(const string& filename,vector<UbTupleFloat3 >& nodes, vector<UbTupleUInt8 >& cells, vector<string >& datanames, vector<vector<double > >& nodedata) { string tecplotfilename = filename+getFileExtension(); UBLOG(logDEBUG1,"WbWriterTecPlotASCII::writeOctsWithNodeData to "<<tecplotfilename<<" - start"); @@ -42,7 +42,7 @@ string WbWriterTecPlotASCII::writeOctsWithNodeData(const string& filename,vector for(size_t c=0; c<cells.size(); c++) { - UbTupleInt8& cell = cells[c]; + UbTupleUInt8& cell = cells[c]; out<<val<1>(cell)<<" " <<val<2>(cell)<<" " <<val<3>(cell)<<" " @@ -59,7 +59,7 @@ string WbWriterTecPlotASCII::writeOctsWithNodeData(const string& filename,vector return tecplotfilename; } /*===============================================================================*/ -string WbWriterTecPlotASCII::writeOcts(const string& filename,vector< UbTupleFloat3 >& nodes, vector< UbTupleInt8 >& cells) +string WbWriterTecPlotASCII::writeOctsU(const string& filename,vector< UbTupleFloat3 >& nodes, vector< UbTupleUInt8 >& cells) { vector<string > datanames; vector<vector<double > > nodedata; diff --git a/src/basics/basics/writer/WbWriterTecPlotASCII.h b/src/basics/basics/writer/WbWriterTecPlotASCII.h index ef6339032..1866ca60b 100644 --- a/src/basics/basics/writer/WbWriterTecPlotASCII.h +++ b/src/basics/basics/writer/WbWriterTecPlotASCII.h @@ -78,9 +78,9 @@ public: // | 3 ---+ 2 // |/ |/ // 0 ---- 1 - std::string writeOcts(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt8 >& cells); + std::string writeOctsU(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleUInt8 >& 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<UbTupleInt8 >& cells, std::vector<std::string >& datanames, std::vector<std::vector<double > >& nodedata); + 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; }; diff --git a/src/basics/basics/writer/WbWriterVtkASCII.cpp b/src/basics/basics/writer/WbWriterVtkASCII.cpp index e88bbf3b4..2d5598932 100644 --- a/src/basics/basics/writer/WbWriterVtkASCII.cpp +++ b/src/basics/basics/writer/WbWriterVtkASCII.cpp @@ -480,7 +480,7 @@ std::string WbWriterVtkASCII::writeOctsWithCellData(const string& filename,vecto return vtkfilename; } /*===============================================================================*/ -std::string WbWriterVtkASCII::writeOctsWithNodeData(const string& filename,vector< UbTupleFloat3 >& nodes, vector< UbTupleInt8 >& cells, vector< string >& datanames, vector< vector< double > >& nodedata) +std::string WbWriterVtkASCII::writeOctsWithNodeData(const string& filename,vector< UbTupleFloat3 >& nodes, vector< UbTupleUInt8 >& cells, vector< string >& datanames, vector< vector< double > >& nodedata) { string vtkfilename=filename+getFileExtension(); UBLOG(logDEBUG1,"WbWriterVtkASCII::writeOctsWithNodeData to "<<vtkfilename<<" - start"); diff --git a/src/basics/basics/writer/WbWriterVtkASCII.h b/src/basics/basics/writer/WbWriterVtkASCII.h index 75f0da453..c935c7d2c 100644 --- a/src/basics/basics/writer/WbWriterVtkASCII.h +++ b/src/basics/basics/writer/WbWriterVtkASCII.h @@ -66,8 +66,8 @@ public: // 0 ---- 1 std::string writeOcts(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt8 >& cells); std::string writeOctsBinary(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< UbTupleInt8 >& cells, std::vector<std::string >& datanames, std::vector<std::vector<double > >& nodedata); + 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; }; diff --git a/src/basics/basics/writer/WbWriterVtkBinary.cpp b/src/basics/basics/writer/WbWriterVtkBinary.cpp index 8925a9b03..b440986f4 100644 --- a/src/basics/basics/writer/WbWriterVtkBinary.cpp +++ b/src/basics/basics/writer/WbWriterVtkBinary.cpp @@ -540,7 +540,7 @@ std::string WbWriterVtkBinary::writeOctsWithCellData(const string& filename,vect return vtkfilename; } /*===============================================================================*/ -std::string WbWriterVtkBinary::writeOctsWithNodeData(const string& filename,vector<UbTupleFloat3 >& nodes, vector<UbTupleInt8 >& cells, vector<string >& datanames, vector<vector<double > >& nodedata) +std::string WbWriterVtkBinary::writeOctsWithNodeData(const string& filename,vector<UbTupleFloat3 >& nodes, vector<UbTupleUInt8 >& cells, vector<string >& datanames, vector<vector<double > >& nodedata) { //HEADER-SECTION string vtkfilename = filename + getFileExtension(); diff --git a/src/basics/basics/writer/WbWriterVtkBinary.h b/src/basics/basics/writer/WbWriterVtkBinary.h index 30dfc923c..46c101a5a 100644 --- a/src/basics/basics/writer/WbWriterVtkBinary.h +++ b/src/basics/basics/writer/WbWriterVtkBinary.h @@ -66,7 +66,7 @@ public: // 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<UbTupleInt8 >& cells, std::vector<std::string >& datanames, std::vector<std::vector<double > >& nodedata); + 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); }; diff --git a/src/basics/geometry3d/GbSphere3D.cpp b/src/basics/geometry3d/GbSphere3D.cpp index 05b634dbe..a9d8886df 100644 --- a/src/basics/geometry3d/GbSphere3D.cpp +++ b/src/basics/geometry3d/GbSphere3D.cpp @@ -696,9 +696,8 @@ double GbSphere3D::getCellVolumeInsideGbObject3D(const double& x1a,const double& } - double resultWithOneCell = getCellVolumeInsideGbObject3DHelperFunction( x1a, x2a, x3a, x1b, x2b, x3b ); - - //cout << tempResult << " vs. " << resultWithOneCell << endl; + // double resultWithOneCell = getCellVolumeInsideGbObject3DHelperFunction( x1a, x2a, x3a, x1b, x2b, x3b ); + // cout << tempResult << " vs. " << resultWithOneCell << endl; return tempResult; diff --git a/src/basics/geometry3d/GbTriFaceMesh3D.cpp b/src/basics/geometry3d/GbTriFaceMesh3D.cpp index 2f9dd9296..82aa12f4f 100644 --- a/src/basics/geometry3d/GbTriFaceMesh3D.cpp +++ b/src/basics/geometry3d/GbTriFaceMesh3D.cpp @@ -140,7 +140,7 @@ void GbTriFaceMesh3D::deleteRedundantNodes() for(size_t t=0; t<tris.size(); t++) { - if(t%100==0) UBLOG(logDEBUG5,"GbTriFaceMesh3D::deleteRedundantNodes - tri: "<<(t)<<" von "<<tris.size()); + if(t%100==0) { UBLOG(logDEBUG5,"GbTriFaceMesh3D::deleteRedundantNodes - tri: "<<(t)<<" von "<<tris.size()); } TriFace& tri = tris[t]; //Knoten bereits in neuem node vector? for(int v=0; v<=2; v++) @@ -781,8 +781,6 @@ bool GbTriFaceMesh3D::isPointInGbObject3D(const double& x1, const double& x2, co /*======================================================================*/ bool GbTriFaceMesh3D::isPointInGbObject3D(const double& x1, const double& x2, const double& x3) { - int counter=0; - if( !nodes->empty() ) { //Baum erstellen, wen noch keiner vorhanden diff --git a/src/basics/geometry3d/GbTriangularMesh3D.cpp b/src/basics/geometry3d/GbTriangularMesh3D.cpp index c709cc7da..1970956e3 100644 --- a/src/basics/geometry3d/GbTriangularMesh3D.cpp +++ b/src/basics/geometry3d/GbTriangularMesh3D.cpp @@ -1248,26 +1248,26 @@ char GbTriangularMesh3D::InTri2D( GbVector3D Tp[3], GbVector3D& pp ) area2 = AreaSign( pp, Tp[2], Tp[0] ); // printf("area0=%f area1=%f area2=%f\n",area0,area1,area2); - if ( ( area0 == 0. ) && ( area1 > 0. ) && ( area2 > 0. ) || - ( area1 == 0. ) && ( area0 > 0. ) && ( area2 > 0. ) || - ( area2 == 0. ) && ( area0 > 0. ) && ( area1 > 0. ) ) + if ( (( area0 == 0. ) && ( area1 > 0. ) && ( area2 > 0. )) || + (( area1 == 0. ) && ( area0 > 0. ) && ( area2 > 0. )) || + (( area2 == 0. ) && ( area0 > 0. ) && ( area1 > 0. )) ) return 'E'; - if ( ( area0 == 0. ) && ( area1 < 0. ) && ( area2 < 0. ) || - ( area1 == 0. ) && ( area0 < 0. ) && ( area2 < 0. ) || - ( area2 == 0. ) && ( area0 < 0. ) && ( area1 < 0. ) ) + if ( (( area0 == 0. ) && ( area1 < 0. ) && ( area2 < 0. )) || + (( area1 == 0. ) && ( area0 < 0. ) && ( area2 < 0. )) || + (( area2 == 0. ) && ( area0 < 0. ) && ( area1 < 0. )) ) return 'E'; - if ( ( area0 > 0. ) && ( area1 > 0. ) && ( area2 > 0. ) || - ( area0 < 0. ) && ( area1 < 0. ) && ( area2 < 0. ) ) + if ( (( area0 > 0. ) && ( area1 > 0. ) && ( area2 > 0. )) || + (( area0 < 0. ) && ( area1 < 0. ) && ( area2 < 0. )) ) return 'F'; if ( ( area0 == 0.0 ) && ( area1 == 0.0 ) && ( area2 == 0.0 ) ) fprintf( stderr, "Error in InTriD\n" ), exit(EXIT_FAILURE); - if ( ( area0 == 0. ) && ( area1 == 0. ) || - ( area0 == 0. ) && ( area2 == 0. ) || - ( area1 == 0. ) && ( area2 == 0. ) ) + if ( (( area0 == 0. ) && ( area1 == 0. )) || + (( area0 == 0. ) && ( area2 == 0. )) || + (( area1 == 0. ) && ( area2 == 0. )) ) return 'V'; else diff --git a/src/basics/geometry3d/GbVoxelMatrix3D.cpp b/src/basics/geometry3d/GbVoxelMatrix3D.cpp index 0995526a7..74878b64c 100644 --- a/src/basics/geometry3d/GbVoxelMatrix3D.cpp +++ b/src/basics/geometry3d/GbVoxelMatrix3D.cpp @@ -531,7 +531,6 @@ void GbVoxelMatrix3D::readMatrixFromVtiASCIIFile(std::string filename) //UBLOG(logINFO," - init values"); int val; - int u = 0; for (int x3 = 0; x3<nodesX3; x3++) for (int x2 = 0; x2<nodesX2; x2++) for (int x1 = 0; x1<nodesX1; x1++) @@ -550,15 +549,15 @@ void GbVoxelMatrix3D::readMatrixFromVtiASCIIFile(std::string filename) ////////////////////////////////////////////////////////////////////////// void GbVoxelMatrix3D::rotate90aroundX(double cX1, double cX2, double cX3) { - double tempMinPunktX1 = minX1-cX1; +// double tempMinPunktX1 = minX1-cX1; double tempMinPunktX2 = minX2-cX2; double tempMinPunktX3 = getX3Maximum()-cX3; - double tempMinPunktX1tf = tempMinPunktX1; +// double tempMinPunktX1tf = tempMinPunktX1; double tempMinPunktX2tf = -tempMinPunktX3; double tempMinPunktX3tf = tempMinPunktX2; - double minX1_temp = tempMinPunktX1tf+cX1; +// double minX1_temp = tempMinPunktX1tf+cX1; double minX2_temp = tempMinPunktX2tf+cX2; double minX3_temp = tempMinPunktX3tf+cX3; @@ -602,15 +601,15 @@ void GbVoxelMatrix3D::rotate90aroundX() void GbVoxelMatrix3D::rotate90aroundY(double cX1, double cX2, double cX3) { double tempMinPunktX1 = getX1Maximum()-cX1; - double tempMinPunktX2 = minX2-cX2; +// double tempMinPunktX2 = minX2-cX2; double tempMinPunktX3 = minX3-cX3; double tempMinPunktX1tf = tempMinPunktX3; - double tempMinPunktX2tf = tempMinPunktX2; +// double tempMinPunktX2tf = tempMinPunktX2; double tempMinPunktX3tf = -tempMinPunktX1; double minX1_temp = tempMinPunktX1tf+cX1; - double minX2_temp = tempMinPunktX2tf+cX2; +// double minX2_temp = tempMinPunktX2tf+cX2; double minX3_temp = tempMinPunktX3tf+cX3; minX1 = minX1_temp; @@ -654,15 +653,15 @@ void GbVoxelMatrix3D::rotate90aroundZ(double cX1, double cX2, double cX3) { double tempMinPunktX1 = minX1-cX1; double tempMinPunktX2 = getX2Maximum()-cX2; - double tempMinPunktX3 = minX3-cX3; +// double tempMinPunktX3 = minX3-cX3; double tempMinPunktX1tf = -tempMinPunktX2; double tempMinPunktX2tf = tempMinPunktX1; - double tempMinPunktX3tf = tempMinPunktX3; +// double tempMinPunktX3tf = tempMinPunktX3; double minX1_temp = tempMinPunktX1tf+cX1; double minX2_temp = tempMinPunktX2tf+cX2; - double minX3_temp = tempMinPunktX3tf+cX3; +// double minX3_temp = tempMinPunktX3tf+cX3; minX1 = minX1_temp; minX2 = minX2_temp; @@ -766,9 +765,6 @@ void GbVoxelMatrix3D::rotateAroundY(double theta) GbVoxelMatrix3D::Matrix3D voxelMatrix_temp(nx1, nx2, nx3, FLUID); - double newMinX1 = cos(theta)*minX1+sin(theta)*minX3; - double newMinX3 = -sin(theta)*minX1+cos(theta)*minX3; - for (int x3 = 0; x3<nx3; x3++) { for (int x2 = 0; x2<nx2; x2++) { for (int x1 = 0; x1<nx1; x1++) @@ -785,11 +781,6 @@ void GbVoxelMatrix3D::rotateAroundY(double theta) int newX2 = x2; int newX3 = UbMath::integerRounding((nrcX3-minX3)/deltaX3); - if (newX1 < 0) - { - int test=1; - } - if (newX1>0 && newX3>0 && newX1<nx1 && newX3<nx3) { voxelMatrix_temp(newX1, newX2, newX3) = voxelMatrix(x1, x2, x3); diff --git a/src/basics/geometry3d/KdTree/KdNode.h b/src/basics/geometry3d/KdTree/KdNode.h index 026ec3cbc..0ccacc6e1 100644 --- a/src/basics/geometry3d/KdTree/KdNode.h +++ b/src/basics/geometry3d/KdTree/KdNode.h @@ -136,14 +136,6 @@ namespace Kd const T& n2Y = val<2>(n2); const T& n2Z = val<3>(n2); - double t_nah = UbMath::max( ( (n1X <= n2X ? x[0] : x[1]) - n1X) / (n2X - n1X) - , ( (n1Y <= n2Y ? y[0] : y[1]) - n1Y) / (n2Y - n1Y) - , ( (n1Z <= n2Z ? z[0] : z[1]) - n1Z) / (n2Z - n1Z) ); - - double t_fern = UbMath::min( ( (n1X > n2X ? x[0] : x[1]) - n1X) / (n2X - n1X) - , ( (n1Y > n2Y ? y[0] : y[1]) - n1Y) / (n2Y - n1Y) - , ( (n1Z > n2Z ? z[0] : z[1]) - n1Z) / (n2Z - n1Z) ); - if ( UbMath::greater( UbMath::max( ( (n1X <= n2X ? x[0] : x[1]) - n1X) / (n2X - n1X) , ( (n1Y <= n2Y ? y[0] : y[1]) - n1Y) / (n2Y - n1Y) , ( (n1Z <= n2Z ? z[0] : z[1]) - n1Z) / (n2Z - n1Z) ) diff --git a/src/basics/geometry3d/KdTree/intersectionhandler/KdCountRayIntersectionHandler.h b/src/basics/geometry3d/KdTree/intersectionhandler/KdCountRayIntersectionHandler.h index a1285abc9..d72ed7ac7 100644 --- a/src/basics/geometry3d/KdTree/intersectionhandler/KdCountRayIntersectionHandler.h +++ b/src/basics/geometry3d/KdTree/intersectionhandler/KdCountRayIntersectionHandler.h @@ -62,9 +62,9 @@ namespace Kd { T e1x,e1y,e1z,e2x,e2y,e2z,px,py,pz,a,f,sx,sy,sz,u,qx,qy,qz,v,factor; - int counter = 0, iSec = 0; + int counter = 0; - for( std::size_t i=0; i<triFaces.size(); i++ ) + for(std::size_t i=0; i<triFaces.size(); i++ ) { GbTriFaceMesh3D::TriFace& triFace = triFaces[i]; diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/ThinWallBCProcessor.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/ThinWallBCProcessor.cpp index 89627e235..bdb9bf261 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/ThinWallBCProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/ThinWallBCProcessor.cpp @@ -4,22 +4,13 @@ #include "LBMKernel.h" -ThinWallBCProcessor::ThinWallBCProcessor() -{ - -} -////////////////////////////////////////////////////////////////////////// -ThinWallBCProcessor::ThinWallBCProcessor(SPtr<LBMKernel> kernel) : BCProcessor(kernel) -{ - -} ////////////////////////////////////////////////////////////////////////// -ThinWallBCProcessor::~ThinWallBCProcessor() +ThinWallBCProcessor::ThinWallBCProcessor(SPtr<ILBMKernel> kernel) : BCProcessor(kernel) { } ////////////////////////////////////////////////////////////////////////// -SPtr<BCProcessor> ThinWallBCProcessor::clone(SPtr<LBMKernel> kernel) +SPtr<BCProcessor> ThinWallBCProcessor::clone(SPtr<ILBMKernel> kernel) { SPtr<BCProcessor> bcProcessor(new ThinWallBCProcessor(kernel)); return bcProcessor; diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/ThinWallBCProcessor.h b/src/cpu/VirtualFluidsCore/BoundaryConditions/ThinWallBCProcessor.h index a3e9915f2..cd3ac5c49 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/ThinWallBCProcessor.h +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/ThinWallBCProcessor.h @@ -5,16 +5,15 @@ #include "BCProcessor.h" -class LBMKernel; +class ILBMKernel; class ThinWallBCProcessor : public BCProcessor { public: - ThinWallBCProcessor(); - ThinWallBCProcessor(SPtr<LBMKernel> kernel); - ~ThinWallBCProcessor(); - SPtr<BCProcessor> clone(SPtr<LBMKernel> kernel); - void applyPostCollisionBC(); + ThinWallBCProcessor() = default; + explicit ThinWallBCProcessor(SPtr<ILBMKernel> kernel); + SPtr<BCProcessor> clone(SPtr<ILBMKernel> kernel) override; + void applyPostCollisionBC(); //FIXME: should the base method virtual?? protected: private: diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityWithDensityBCAlgorithm.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityWithDensityBCAlgorithm.cpp index 5a1f95caf..0655f1d49 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityWithDensityBCAlgorithm.cpp +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityWithDensityBCAlgorithm.cpp @@ -68,9 +68,9 @@ void VelocityWithDensityBCAlgorithm::applyBC() if (bcArray->isSolid(nX1,nX2,nX3)) { const int invDir = D3Q27System::INVDIR[fdir]; - LBMReal q =1.0;// bcPtr->getQ(invDir);// m+m q=0 stabiler +// LBMReal q =1.0;// bcPtr->getQ(invDir);// m+m q=0 stabiler LBMReal velocity = bcPtr->getBoundaryVelocity(fdir); - //LBMReal fReturn = ((1.0 - q) / (1.0 + q))*((f[fdir] - feq[fdir]*collFactor) / (1.0 - collFactor)) + ((q*(f[fdir] + f[invDir]) - velocity*rho) / (1.0 + q))-drho*D3Q27System::WEIGTH[invDir]; +// LBMReal fReturn = ((1.0 - q) / (1.0 + q))*((f[fdir] - feq[fdir]*collFactor) / (1.0 - collFactor)) + ((q*(f[fdir] + f[invDir]) - velocity*rho) / (1.0 + q))-drho*D3Q27System::WEIGTH[invDir]; //if q=1 //LBMReal fReturn = ((q*(f[fdir] + f[invDir]) - velocity*rho) / (1.0 + q))-drho*D3Q27System::WEIGTH[invDir]; diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/AdjustForcingCoProcessor.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/AdjustForcingCoProcessor.cpp index 775c03b76..50498d93e 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/AdjustForcingCoProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/CoProcessors/AdjustForcingCoProcessor.cpp @@ -22,8 +22,7 @@ AdjustForcingCoProcessor::AdjustForcingCoProcessor(SPtr<Grid3D> grid, SPtr<UbSch path(path), integrateValues(integrateValues), comm(comm), - vx1Targed(vTarged), - forcing(forcing) + vx1Targed(vTarged) { //cnodes = integrateValues->getCNodes(); root = comm->isRoot(); @@ -75,10 +74,7 @@ AdjustForcingCoProcessor::AdjustForcingCoProcessor(SPtr<Grid3D> grid, SPtr<UbSch } //////////////////////////////////////////////////////////////////////////////////////////////////////// } -////////////////////////////////////////////////////////////////////////// -AdjustForcingCoProcessor::~AdjustForcingCoProcessor() -{ -} + ////////////////////////////////////////////////////////////////////////// void AdjustForcingCoProcessor::process(double step) { diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/AdjustForcingCoProcessor.h b/src/cpu/VirtualFluidsCore/CoProcessors/AdjustForcingCoProcessor.h index eaa57ebc0..87962f89e 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/AdjustForcingCoProcessor.h +++ b/src/cpu/VirtualFluidsCore/CoProcessors/AdjustForcingCoProcessor.h @@ -13,7 +13,7 @@ class Grid3D; class IntegrateValuesHelper; //! \brief Computes forcing such that a given velocity (vx1Targed) is reached inside an averaging domain (h1). -//! \details Algorithm based on PID controller (proportional–integral–derivative controller). The parameters of PID controller estimation based on Ziegler–Nichols method. +//! \details Algorithm based on PID controller (proportional_integral_derivative controller). The parameters of PID controller estimation based on Ziegler�Nichols method. //! Integrate values helper, scheduler must be set in test case. //! \author: Konstantin Kutscher @@ -23,7 +23,6 @@ public: const std::string& path, SPtr<IntegrateValuesHelper> integrateValues, double vTarged, SPtr<Communicator> comm); - virtual ~AdjustForcingCoProcessor(); //!< calls collect PostprocessData void process(double step) override; protected: diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/AverageValuesCoProcessor.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/AverageValuesCoProcessor.cpp index 474703728..bf52598b0 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/AverageValuesCoProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/CoProcessors/AverageValuesCoProcessor.cpp @@ -246,7 +246,7 @@ void AverageValuesCoProcessor::clearData() void AverageValuesCoProcessor::addData(const SPtr<Block3D> block) { UbTupleDouble3 org = grid->getBlockWorldCoordinates(block); - UbTupleDouble3 blockLengths = grid->getBlockLengths(block); +// UbTupleDouble3 blockLengths = grid->getBlockLengths(block); UbTupleDouble3 nodeOffset = grid->getNodeOffset(block); double dx = grid->getDeltaX(block); diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/ForceCalculator.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/ForceCalculator.cpp index 0df2af78f..1bdf0d57f 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/ForceCalculator.cpp +++ b/src/cpu/VirtualFluidsCore/CoProcessors/ForceCalculator.cpp @@ -68,9 +68,9 @@ void ForceCalculator::calculateForces(std::vector<SPtr<D3Q27Interactor> > intera forceX2global = 0.0; forceX3global = 0.0; - for (const SPtr<D3Q27Interactor> interactor : interactors) + for (const auto& interactor : interactors) { - for (BcNodeIndicesMap::value_type t : interactor->getBcNodeIndicesMap()) + for (const auto& t : interactor->getBcNodeIndicesMap()) { double forceX1 = 0.0; double forceX2 = 0.0; @@ -82,7 +82,7 @@ void ForceCalculator::calculateForces(std::vector<SPtr<D3Q27Interactor> > intera SPtr<DistributionArray3D> distributions = kernel->getDataSet()->getFdistributions(); distributions->swap(); - std::set< std::vector<int> >& transNodeIndices = t.second; + const std::set< std::vector<int> >& transNodeIndices = t.second; for (std::vector<int> node : transNodeIndices) { int x1 = node[0]; diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/MPIIOCoProcessor.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/MPIIOCoProcessor.cpp index 0ef0b2566..11004a027 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/MPIIOCoProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/CoProcessors/MPIIOCoProcessor.cpp @@ -198,7 +198,7 @@ void MPIIOCoProcessor::writeBlocks(int step) // write to the file MPI_File file_handler; - MPI_Info info = MPI_INFO_NULL; +// MPI_Info info = MPI_INFO_NULL; UbSystem::makeDirectory(path + "/mpi_io_cp/mpi_io_cp_" + UbSystem::toString(step)); std::string filename = path + "/mpi_io_cp/mpi_io_cp_" + UbSystem::toString(step) + "/cpBlocks.bin"; diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/MPIIOMigrationBECoProcessor.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/MPIIOMigrationBECoProcessor.cpp index 37d43afbe..df63e8a5b 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/MPIIOMigrationBECoProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/CoProcessors/MPIIOMigrationBECoProcessor.cpp @@ -747,7 +747,7 @@ void MPIIOMigrationBECoProcessor::blocksExchange(int tagN, int ind1, int ind2, i int indexB = ind1; int indexE = ind2; - int myBlocksCount = indexE - indexB; +// int myBlocksCount = indexE - indexB; int* blocksCounterSend = new int[size]; int* blocksCounterRec = new int[size]; @@ -786,7 +786,7 @@ void MPIIOMigrationBECoProcessor::blocksExchange(int tagN, int ind1, int ind2, i MPI_Request* requests = new MPI_Request[size * 2]; // send + receive int requestCount = 0; - MPI_Status status; +// MPI_Status status; for (int r = 0; r < size; r++) { diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/MPIIOMigrationBECoProcessor.h b/src/cpu/VirtualFluidsCore/CoProcessors/MPIIOMigrationBECoProcessor.h index d5ecf88a8..a3ff742cb 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/MPIIOMigrationBECoProcessor.h +++ b/src/cpu/VirtualFluidsCore/CoProcessors/MPIIOMigrationBECoProcessor.h @@ -72,8 +72,10 @@ protected: private: //MPI_Datatype gridParamType, block3dType; - MPI_Datatype dataSetType, dataSetSmallType, dataSetDoubleType; - MPI_Datatype boundCondParamType, boundCondTypeAdd, bcindexmatrixType; +// MPI_Datatype dataSetType, dataSetSmallType; + MPI_Datatype dataSetDoubleType; +// MPI_Datatype boundCondParamType, boundCondTypeAdd; + MPI_Datatype bcindexmatrixType; MPI_Datatype sendBlockDoubleType, sendBlockIntType; MPIIODataStructures::boundCondParam boundCondParamStr; diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/MicrophoneArrayCoProcessor.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/MicrophoneArrayCoProcessor.cpp index 8fb0f6eeb..73527fc76 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/MicrophoneArrayCoProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/CoProcessors/MicrophoneArrayCoProcessor.cpp @@ -38,7 +38,7 @@ void MicrophoneArrayCoProcessor::process(double step) bool MicrophoneArrayCoProcessor::addMicrophone(Vector3D coords) { micID++; - UbTupleInt3 blockIndexes = grid->getBlockIndexes(coords[0], coords[1], coords[2]); +// UbTupleInt3 blockIndexes = grid->getBlockIndexes(coords[0], coords[1], coords[2]); int minInitLevel = this->grid->getCoarsestInitializedLevel(); int maxInitLevel = this->grid->getFinestInitializedLevel(); diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/PressureCoefficientCoProcessor.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/PressureCoefficientCoProcessor.cpp index ddcfa6b67..ced56bb05 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/PressureCoefficientCoProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/CoProcessors/PressureCoefficientCoProcessor.cpp @@ -67,7 +67,7 @@ void PressureCoefficientCoProcessor::calculateRho() SPtr<DistributionArray3D> distributions = kernel->getDataSet()->getFdistributions(); UbTupleDouble3 org = grid->getBlockWorldCoordinates(block); - UbTupleDouble3 blockLengths = grid->getBlockLengths(block); +// UbTupleDouble3 blockLengths = grid->getBlockLengths(block); UbTupleDouble3 nodeOffset = grid->getNodeOffset(block); double dx = grid->getDeltaX(block); diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/QCriterionCoProcessor.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/QCriterionCoProcessor.cpp index 6378c3b7e..5e8acdc61 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/QCriterionCoProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/CoProcessors/QCriterionCoProcessor.cpp @@ -101,7 +101,7 @@ void QCriterionCoProcessor::clearData() void QCriterionCoProcessor::addData(const SPtr<Block3D> block) { UbTupleDouble3 org = grid->getBlockWorldCoordinates(block); - UbTupleDouble3 blockLengths = grid->getBlockLengths(block); +// UbTupleDouble3 blockLengths = grid->getBlockLengths(block); UbTupleDouble3 nodeOffset = grid->getNodeOffset(block); double dx = grid->getDeltaX(block); @@ -224,9 +224,9 @@ void QCriterionCoProcessor::getNeighborVelocities(int offx, int offy, int offz, bool compressible = block->getKernel()->getCompressible(); - int minX1 = 0; - int minX2 = 0; - int minX3 = 0; +// int minX1 = 0; +// int minX2 = 0; +// int minX3 = 0; int maxX1 = (int)(distributions->getNX1()); int maxX2 = (int)(distributions->getNX2()); @@ -239,7 +239,9 @@ void QCriterionCoProcessor::getNeighborVelocities(int offx, int offy, int offz, bool neighNodeIsBC=false; SPtr<BoundaryConditions> bcPtr; - int rankSelf= block->getRank(); + int rankSelf= block->getRank(); + + // FIXME: logical not is only applied to the left hand side of this comparison if (!(offx+offy+offz)==1) throw UbException(UB_EXARGS,"getNeighborVelocities called for diagonal directions!"); //////get neighbor nodes, if existent if ((ix1==0 && offx==1) || (ix2==0 && offy==1) || (ix3==0 && offz==1)) @@ -272,7 +274,7 @@ void QCriterionCoProcessor::getNeighborVelocities(int offx, int offy, int offz, { blockNeighW = grid->getBlock( val<1>(blockIndexes), val<2>(blockIndexes),(grid->getNX3()-1), currentLevel); } - else neighNodeIsBC; + else neighNodeIsBC; // FIXME??? if(blockNeighW && blockNeighW->isActive()) { diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/ShearStressCoProcessor.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/ShearStressCoProcessor.cpp index 0e5309f7d..514021b83 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/ShearStressCoProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/CoProcessors/ShearStressCoProcessor.cpp @@ -252,7 +252,7 @@ void ShearStressCoProcessor::addData() data.resize(datanames.size()); - for(SPtr<D3Q27Interactor> interactor : interactors) + for(const auto& interactor : interactors) { typedef std::map<SPtr<Block3D>, std::set< std::vector<int> > > TransNodeIndicesMap; for(TransNodeIndicesMap::value_type t : interactor->getBcNodeIndicesMap()) @@ -261,7 +261,7 @@ void ShearStressCoProcessor::addData() std::set< std::vector<int> >& transNodeIndicesSet = t.second; UbTupleDouble3 org = grid->getBlockWorldCoordinates(block); - UbTupleDouble3 blockLengths = grid->getBlockLengths(block); +// UbTupleDouble3 blockLengths = grid->getBlockLengths(block); UbTupleDouble3 nodeOffset = grid->getNodeOffset(block); double dx = grid->getDeltaX(block); @@ -280,11 +280,11 @@ void ShearStressCoProcessor::addData() int minX3 = ghostLayer; int maxX3 = (int)bcArray->getNX3() - 1 - ghostLayer; - int level=block->getLevel(); - if(level==1) - { - int le=0; - } +// int level=block->getLevel(); +// if(level==1) +// { +// int le=0; +// } for(std::vector<int> node : transNodeIndicesSet) { int ix1 = node[0]; @@ -362,14 +362,14 @@ void ShearStressCoProcessor::resetData(double step) { for(int level = minInitLevel; level<=maxInitLevel;level++) { - for(SPtr<Block3D> block : blockVector[level]) + for(const auto& block : blockVector[level]) { if (block) { - UbTupleDouble3 org = grid->getBlockWorldCoordinates(block); - UbTupleDouble3 blockLengths = grid->getBlockLengths(block); - UbTupleDouble3 nodeOffset = grid->getNodeOffset(block); - double dx = grid->getDeltaX(block); +// UbTupleDouble3 org = grid->getBlockWorldCoordinates(block); +// UbTupleDouble3 blockLengths = grid->getBlockLengths(block); +// UbTupleDouble3 nodeOffset = grid->getNodeOffset(block); +// double dx = grid->getDeltaX(block); SPtr<ILBMKernel> kernel = block->getKernel(); SPtr<BCArray3D> bcArray = kernel->getBCProcessor()->getBCArray(); @@ -614,18 +614,18 @@ bool ShearStressCoProcessor::checkUndefindedNodes( SPtr<BCArray3D> bcArray,int i ////////////////////////////////////////////////////////////////////////////////////// void ShearStressCoProcessor::initDistance() { - for(SPtr<D3Q27Interactor> interactor : interactors) + for(const auto& interactor : interactors) { - typedef std::map<SPtr<Block3D>, std::set< std::vector<int> > > TransNodeIndicesMap; - for (TransNodeIndicesMap::value_type t : interactor->getBcNodeIndicesMap()) +// typedef std::map<SPtr<Block3D>, std::set< std::vector<int> > > TransNodeIndicesMap; + for (const auto& t : interactor->getBcNodeIndicesMap()) { SPtr<Block3D> block = t.first; - std::set< std::vector<int> >& transNodeIndicesSet = t.second; + const std::set< std::vector<int> >& transNodeIndicesSet = t.second; - UbTupleDouble3 org = grid->getBlockWorldCoordinates(block); - UbTupleDouble3 blockLengths = grid->getBlockLengths(block); - UbTupleDouble3 nodeOffset = grid->getNodeOffset(block); - double dx = grid->getDeltaX(block); +// UbTupleDouble3 org = grid->getBlockWorldCoordinates(block); +// UbTupleDouble3 blockLengths = grid->getBlockLengths(block); +// UbTupleDouble3 nodeOffset = grid->getNodeOffset(block); +// double dx = grid->getDeltaX(block); SPtr<ILBMKernel> kernel = block->getKernel(); SPtr<BCArray3D> bcArray = kernel->getBCProcessor()->getBCArray(); @@ -633,7 +633,7 @@ void ShearStressCoProcessor::initDistance() SPtr<ShearStressValuesArray3D> ssv = kernel->getDataSet()->getShearStressValues(); int ghostLayer = kernel->getGhostLayerWidth(); - LBMReal collFactor = kernel->getCollisionFactor(); +// LBMReal collFactor = kernel->getCollisionFactor(); int minX1 = ghostLayer; int maxX1 = (int)bcArray->getNX1() - 1 - ghostLayer; diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/TimeAveragedValuesCoProcessor.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/TimeAveragedValuesCoProcessor.cpp index 79dafae06..d3b09f7ce 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/TimeAveragedValuesCoProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/CoProcessors/TimeAveragedValuesCoProcessor.cpp @@ -219,7 +219,7 @@ void TimeAveragedValuesCoProcessor::clearData() void TimeAveragedValuesCoProcessor::addData(const SPtr<Block3D> block) { UbTupleDouble3 org = grid->getBlockWorldCoordinates(block); - UbTupleDouble3 blockLengths = grid->getBlockLengths(block); +// UbTupleDouble3 blockLengths = grid->getBlockLengths(block); UbTupleDouble3 nodeOffset = grid->getNodeOffset(block); double dx = grid->getDeltaX(block); int level = block->getLevel(); diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/TurbulenceIntensityCoProcessor.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/TurbulenceIntensityCoProcessor.cpp index e3a4f4ee9..2eab0a349 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/TurbulenceIntensityCoProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/CoProcessors/TurbulenceIntensityCoProcessor.cpp @@ -107,7 +107,7 @@ void TurbulenceIntensityCoProcessor::clearData() void TurbulenceIntensityCoProcessor::addData(const SPtr<Block3D> block) { UbTupleDouble3 org = grid->getBlockWorldCoordinates(block); - UbTupleDouble3 blockLengths = grid->getBlockLengths(block); +// UbTupleDouble3 blockLengths = grid->getBlockLengths(block); UbTupleDouble3 nodeOffset = grid->getNodeOffset(block); double dx = grid->getDeltaX(block); diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/WriteMQFromSelectionCoProcessor.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/WriteMQFromSelectionCoProcessor.cpp index a27392981..455de36b8 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/WriteMQFromSelectionCoProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/CoProcessors/WriteMQFromSelectionCoProcessor.cpp @@ -132,7 +132,7 @@ void WriteMQFromSelectionCoProcessor::clearData() void WriteMQFromSelectionCoProcessor::addDataMQ(SPtr<Block3D> block) { double level = (double)block->getLevel(); - double blockID = (double)block->getGlobalID(); +// double blockID = (double)block->getGlobalID(); //Diese Daten werden geschrieben: datanames.resize(0); diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/WriteMQFromSelectionCoProcessor.h b/src/cpu/VirtualFluidsCore/CoProcessors/WriteMQFromSelectionCoProcessor.h index 12b8f6caf..5a5c0a58e 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/WriteMQFromSelectionCoProcessor.h +++ b/src/cpu/VirtualFluidsCore/CoProcessors/WriteMQFromSelectionCoProcessor.h @@ -44,7 +44,7 @@ private: std::string path; WbWriter* writer; SPtr<LBMUnitConverter> conv; - bool bcInformation; +// 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 8a08d4344..5654d1dfe 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/WriteMacroscopicQuantitiesCoProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/CoProcessors/WriteMacroscopicQuantitiesCoProcessor.cpp @@ -149,7 +149,7 @@ void WriteMacroscopicQuantitiesCoProcessor::clearData() void WriteMacroscopicQuantitiesCoProcessor::addDataMQ(SPtr<Block3D> block) { double level = (double)block->getLevel(); - double blockID = (double)block->getGlobalID(); +// double blockID = (double)block->getGlobalID(); //Diese Daten werden geschrieben: datanames.resize(0); diff --git a/src/cpu/VirtualFluidsCore/Connectors/CoarseToFineNodeSetBlock3DConnector.cpp b/src/cpu/VirtualFluidsCore/Connectors/CoarseToFineNodeSetBlock3DConnector.cpp index 117aa6a44..e39ad4127 100644 --- a/src/cpu/VirtualFluidsCore/Connectors/CoarseToFineNodeSetBlock3DConnector.cpp +++ b/src/cpu/VirtualFluidsCore/Connectors/CoarseToFineNodeSetBlock3DConnector.cpp @@ -82,10 +82,10 @@ void CoarseToFineNodeSetBlock3DConnector::init() ////////////////////////////////////////////////////// //Debug ////////////////////////////////////////////////////// - if (block.lock()->getGlobalID() == 2234) - { - int test = 0; - } +// if (block.lock()->getGlobalID() == 2234) +// { +// int test = 0; +// } if (sender00) sender00->getData().resize(iNodeSetSender00.size()*iCellSize*sendDataPerNode, initValue); else sender00 = VectorTransmitterPtr(new TbLocalTransmitter< CbVector< LBMReal > >()); diff --git a/src/cpu/VirtualFluidsCore/Connectors/D3Q27ETCFOffVectorConnector.h b/src/cpu/VirtualFluidsCore/Connectors/D3Q27ETCFOffVectorConnector.h index a793a47a5..48ac7a37f 100644 --- a/src/cpu/VirtualFluidsCore/Connectors/D3Q27ETCFOffVectorConnector.h +++ b/src/cpu/VirtualFluidsCore/Connectors/D3Q27ETCFOffVectorConnector.h @@ -318,23 +318,23 @@ void D3Q27ETCFOffVectorConnector< VectorTransmitter>::fillSendVectors() //int lMinX1_2, lMinX2_2, lMinX3_2, lMaxX1_2, lMaxX2_2, lMaxX3_2; //for coners - int lMinX1W = 1; - int lMaxX1W = 2; - - int lMinX1E = maxX1 - 3; - int lMaxX1E = maxX1 - 2; - - int lMinX2S = 1; - int lMaxX2S = 2; - - int lMinX2N = maxX2 - 3; - int lMaxX2N = maxX2 - 2; - - int lMinX3B = 1; - int lMaxX3B = 2; - - int lMinX3T = maxX3 - 3; - int lMaxX3T = maxX3 - 2; +// int lMinX1W = 1; +// int lMaxX1W = 2; +// +// int lMinX1E = maxX1 - 3; +// int lMaxX1E = maxX1 - 2; +// +// int lMinX2S = 1; +// int lMaxX2S = 2; +// +// int lMinX2N = maxX2 - 3; +// int lMaxX2N = maxX2 - 2; +// +// int lMinX3B = 1; +// int lMaxX3B = 2; +// +// int lMinX3T = maxX3 - 3; +// int lMaxX3T = maxX3 - 2; switch (sendDir) @@ -749,16 +749,15 @@ void D3Q27ETCFOffVectorConnector< VectorTransmitter>::getLocalMinMax(const int& halfOdd = gMax / 2 - 1 + dCoef; } - switch (even) + if(even) { - case true: - lMin = gMin + dCoef; - lMax = lMin + halfEven - dCoef; - break; - case false: - lMin = gMin + halfOdd; - lMax = gMax - 1; - break; + lMin = gMin + dCoef; + lMax = lMin + halfEven - dCoef; + } + else + { + lMin = gMin + halfOdd; + lMax = gMax - 1; } } ////////////////////////////////////////////////////////////////////////// @@ -856,23 +855,23 @@ void D3Q27ETCFOffVectorConnector< VectorTransmitter>::distributeReceiveVectors() int dummy; //for coners - int lMinX1W = 3; - int lMaxX1W = 3; - - int lMinX1E = maxX1 - 3; - int lMaxX1E = maxX1 - 2; - - int lMinX2S = 1; - int lMaxX2S = 3; - - int lMinX2N = maxX2 - 3; - int lMaxX2N = maxX2 - 2; - - int lMinX3B = 1; - int lMaxX3B = 3; - - int lMinX3T = maxX3 - 3; - int lMaxX3T = maxX3 - 2; +// int lMinX1W = 3; +// int lMaxX1W = 3; +// +// int lMinX1E = maxX1 - 3; +// int lMaxX1E = maxX1 - 2; +// +// int lMinX2S = 1; +// int lMaxX2S = 3; +// +// int lMinX2N = maxX2 - 3; +// int lMaxX2N = maxX2 - 2; +// +// int lMinX3B = 1; +// int lMaxX3B = 3; +// +// int lMinX3T = maxX3 - 3; +// int lMaxX3T = maxX3 - 2; /////////////////////////////////////// ///DEBUG diff --git a/src/cpu/VirtualFluidsCore/Connectors/FineToCoarseNodeSetBlock3DConnector.cpp b/src/cpu/VirtualFluidsCore/Connectors/FineToCoarseNodeSetBlock3DConnector.cpp index 31e30fe34..591fc727c 100644 --- a/src/cpu/VirtualFluidsCore/Connectors/FineToCoarseNodeSetBlock3DConnector.cpp +++ b/src/cpu/VirtualFluidsCore/Connectors/FineToCoarseNodeSetBlock3DConnector.cpp @@ -76,10 +76,10 @@ void FineToCoarseNodeSetBlock3DConnector::init() ////////////////////////////////////////////////////// //Debug ////////////////////////////////////////////////////// - if (FineToCoarseBlock3DConnector::block.lock()->getGlobalID() == 2183) - { - int test = 0; - } +// if (FineToCoarseBlock3DConnector::block.lock()->getGlobalID() == 2183) +// { +// int test = 0; +// } if (FineToCoarseBlock3DConnector::sender) FineToCoarseBlock3DConnector::sender->getData().resize(iNodeSetSender.size()*iCellSize*sendDataPerNode, initValue); @@ -93,10 +93,10 @@ void FineToCoarseNodeSetBlock3DConnector::findFCCells(int lMinX1, int lMinX2, in ////////////////////////////////////////////////////// //Debug ////////////////////////////////////////////////////// - if (FineToCoarseBlock3DConnector::block.lock()->getGlobalID() == 2183) - { - int test = 0; - } +// if (FineToCoarseBlock3DConnector::block.lock()->getGlobalID() == 2183) +// { +// int test = 0; +// } int ix1, ix2, ix3; @@ -767,10 +767,10 @@ void FineToCoarseNodeSetBlock3DConnector::findCFCells() ////////////////////////////////////////////////////// //Debug ////////////////////////////////////////////////////// - if (block.lock()->getGlobalID() == 2183) - { - int test = 0; - } +// if (block.lock()->getGlobalID() == 2183) +// { +// int test = 0; +// } switch (sendDir) { diff --git a/src/cpu/VirtualFluidsCore/Interactors/D3Q27TriFaceMeshInteractor.cpp b/src/cpu/VirtualFluidsCore/Interactors/D3Q27TriFaceMeshInteractor.cpp index 89ddd366e..0f669ddae 100644 --- a/src/cpu/VirtualFluidsCore/Interactors/D3Q27TriFaceMeshInteractor.cpp +++ b/src/cpu/VirtualFluidsCore/Interactors/D3Q27TriFaceMeshInteractor.cpp @@ -70,13 +70,13 @@ bool D3Q27TriFaceMeshInteractor::setDifferencesToGbObject3D(const SPtr<Block3D> //UBLOG(logINFO, "D3Q27TriFaceMeshInteractor::setDifferencesToGbObject3D()"); bcNodeIndicesMap[block] = set< std::vector<int> >(); - set< std::vector<int> >& transNodeIndices = bcNodeIndicesMap[block]; +// set< std::vector<int> >& transNodeIndices = bcNodeIndicesMap[block]; solidNodeIndicesMap[block] = set< UbTupleInt3 >(); set< UbTupleInt3 >& solidNodeIndices = solidNodeIndicesMap[block]; bool oneEntryGotBC = false; //ob ueberhaupt ein eintrag ein BC zugewiesen wurde - bool gotQs = false; //true, wenn "difference" gesetzt wurde +// bool gotQs = false; //true, wenn "difference" gesetzt wurde SPtr<BoundaryConditions> bc; SPtr<ILBMKernel> kernel = block->getKernel(); @@ -87,8 +87,8 @@ bool D3Q27TriFaceMeshInteractor::setDifferencesToGbObject3D(const SPtr<Block3D> int startIX1 = 0, startIX2 = 0, startIX3 = 0; int stopIX1 = (int)bcArray->getNX1(), stopIX2 = (int)bcArray->getNX2(), stopIX3 = (int)bcArray->getNX3(); - double dx = grid.lock()->getDeltaX(block); - UbTupleDouble3 orgDelta = grid.lock()->getNodeOffset(block); +// double dx = grid.lock()->getDeltaX(block); +// UbTupleDouble3 orgDelta = grid.lock()->getNodeOffset(block); bool pointOnBoundary = false; @@ -252,7 +252,7 @@ void D3Q27TriFaceMeshInteractor::setQs(const double& timeStep) UbTimer setQTimer; setQTimer.start(); UBLOG(logDEBUG3, " - setQs for "<<(int)triangles.size()<<" triangles"); - bool solidFromOtherInteractor = false; +// bool solidFromOtherInteractor = false; float blockMinX[3],blockMaxX[3],boxCenter[3],halfBoxSize[3]; for(size_t t=0; t<triangles.size(); t++) @@ -361,7 +361,7 @@ void D3Q27TriFaceMeshInteractor::setQs(const double& timeStep) int indexMaxX3 = (int)bcMatrix->getNX3(); std::set< std::vector<int> >& bcNodeIndices = this->bcNodeIndicesMap[block]; - std::set< UbTupleInt3 >& solidsFromOtherInteractors = tmpSolidNodesFromOtherInteractors[block]; +// std::set< UbTupleInt3 >& solidsFromOtherInteractors = tmpSolidNodesFromOtherInteractors[block]; double q, distance; double& nodeDx1 = nodeDeltaToNeigh[level][D3Q27System::E]; @@ -382,9 +382,9 @@ void D3Q27TriFaceMeshInteractor::setQs(const double& timeStep) double internX2 = pointplane1[1]; double internX3 = pointplane1[2]; - int blx1 = block->getX1(); - int blx2 = block->getX2(); - int blx3 = block->getX3(); +// int blx1 = block->getX1(); +// int blx2 = block->getX2(); +// int blx3 = block->getX3(); if(bcMatrix->isSolid(ix1,ix2,ix3) || bcMatrix->isUndefined(ix1,ix2,ix3)) { @@ -856,19 +856,18 @@ void D3Q27TriFaceMeshInteractor::initInteractor2(const double& timeStep) for(int ix1=indexMinX1; ix1<indexMaxX1; ix1++) { - int blx1 =block->getX1(); - int blx2 = block->getX2(); - int blx3 = block->getX3(); - - if (blx1==0&&blx2==1&&blx3==0) - { - //if (ix2==39&&ix3==4) - if (ix2==39&&ix3==4) - { - int seb=0; - } - - } +// int blx1 =block->getX1(); +// int blx2 = block->getX2(); +// int blx3 = block->getX3(); + +// if (blx1==0&&blx2==1&&blx3==0) +// { +// //if (ix2==39&&ix3==4) +// if (ix2==39&&ix3==4) +// { +// int seb=0; +// } +// } //Problem: wenn voher der punkt durch eine andere geo not active gesetzt wird und //dieser nun uebersprungen wird, dann hat man spaeter beim fuellalgorithmus luecken //in der front und der block wird u.U. faelschlicher weise komplett solid markiert @@ -1081,7 +1080,7 @@ void D3Q27TriFaceMeshInteractor::initInteractor2(const double& timeStep) { int pointInObjectCounter = 0; int scanlineCounter = 0; - int counter = 0; +// int counter = 0; //sollte die matrix groesse zu gross sein und der rekursive floodFill mehr speicher //benoetigen als der Stack hergibt -> keinen floodFill verwenden! @@ -1126,9 +1125,9 @@ void D3Q27TriFaceMeshInteractor::initInteractor2(const double& timeStep) SPtr<BCArray3D> bcMatrix = kernel->getBCProcessor()->getBCArray(); // bvd->getTimer().start(); - int indexMinX1 = 0; - int indexMinX2 = 0; - int indexMinX3 = 0; +// int indexMinX1 = 0; +// int indexMinX2 = 0; +// int indexMinX3 = 0; int indexMaxX1 = (int)bcMatrix->getNX1(); int indexMaxX2 = (int)bcMatrix->getNX2(); int indexMaxX3 = (int)bcMatrix->getNX3(); @@ -1168,10 +1167,10 @@ void D3Q27TriFaceMeshInteractor::initInteractor2(const double& timeStep) for(int bx1=0; bx1<blocknx1; ++bx1) { - if (bx2==9&&bx3==29) - { - int ride=0; - } +// if (bx2==9&&bx3==29) +// { +// int ride=0; +// } if( flagField(bx1,bx2,bx3)==UNDEF_FLAG ) { if( mesh->isPointInGbObject3D( val<1>(coords) + bx1*nodeDeltaX1 - 0.5*nodeDeltaX1 diff --git a/src/cpu/VirtualFluidsCore/Interactors/InteractorsHelper.cpp b/src/cpu/VirtualFluidsCore/Interactors/InteractorsHelper.cpp index 6a91cd8d8..354bdd4a9 100644 --- a/src/cpu/VirtualFluidsCore/Interactors/InteractorsHelper.cpp +++ b/src/cpu/VirtualFluidsCore/Interactors/InteractorsHelper.cpp @@ -109,7 +109,7 @@ void InteractorsHelper::updateGrid() { std::vector<int> ids; - for(const SPtr<Block3D> block : solidBlocks) + for(const auto& block : solidBlocks) ids.push_back(block->getGlobalID()); std::vector<int> rids; diff --git a/src/cpu/VirtualFluidsCore/LBM/CompressibleCumulant4thOrderViscosityLBMKernel.cpp b/src/cpu/VirtualFluidsCore/LBM/CompressibleCumulant4thOrderViscosityLBMKernel.cpp index 897793c94..3d59e6329 100644 --- a/src/cpu/VirtualFluidsCore/LBM/CompressibleCumulant4thOrderViscosityLBMKernel.cpp +++ b/src/cpu/VirtualFluidsCore/LBM/CompressibleCumulant4thOrderViscosityLBMKernel.cpp @@ -85,9 +85,9 @@ void CompressibleCumulant4thOrderViscosityLBMKernel::calculate(int step) muForcingX2.DefineVar("nu", &muNu); muForcingX3.DefineVar("nu", &muNu); - LBMReal forcingX1 = 0; - LBMReal forcingX2 = 0; - LBMReal forcingX3 = 0; +// LBMReal forcingX1 = 0; +// LBMReal forcingX2 = 0; +// LBMReal forcingX3 = 0; } ///////////////////////////////////// diff --git a/src/cpu/VirtualFluidsCore/LBM/CompressibleCumulantLBMKernel.cpp b/src/cpu/VirtualFluidsCore/LBM/CompressibleCumulantLBMKernel.cpp index d6c0d8279..c63a971f8 100644 --- a/src/cpu/VirtualFluidsCore/LBM/CompressibleCumulantLBMKernel.cpp +++ b/src/cpu/VirtualFluidsCore/LBM/CompressibleCumulantLBMKernel.cpp @@ -94,9 +94,9 @@ void CompressibleCumulantLBMKernel::calculate(int step) muForcingX2.DefineVar("nu", &muNu); muForcingX3.DefineVar("nu", &muNu); - LBMReal forcingX1 = 0; - LBMReal forcingX2 = 0; - LBMReal forcingX3 = 0; +// LBMReal forcingX1 = 0; +// LBMReal forcingX2 = 0; +// LBMReal forcingX3 = 0; } ///////////////////////////////////// @@ -483,7 +483,7 @@ void CompressibleCumulantLBMKernel::calculate(int step) ////////////////////////////// LBMReal OxyyPxzz = one;//three * (two - omega) / (three - omega);// //LBMReal OxyyMxzz = one;//six * (two - omega) / (six - omega);// - LBMReal Oxyz = one;//twelve * (two - omega) / (twelve + omega);// +// LBMReal Oxyz = one;//twelve * (two - omega) / (twelve + omega);// ////////////////////////////// //LBMReal OxyyPxzz = two-omega;// //LBMReal OxyyMxzz = two-omega;// diff --git a/src/cpu/VirtualFluidsCore/LBM/CompressibleOffsetInterpolationProcessor.cpp b/src/cpu/VirtualFluidsCore/LBM/CompressibleOffsetInterpolationProcessor.cpp index 971e0e8bc..aedd7b270 100644 --- a/src/cpu/VirtualFluidsCore/LBM/CompressibleOffsetInterpolationProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/LBM/CompressibleOffsetInterpolationProcessor.cpp @@ -643,7 +643,7 @@ void CompressibleOffsetInterpolationProcessor::calcInterpolatedNodeFC(LBMReal* f LBMReal eps_new = 2.; LBMReal o = omega; - LBMReal op = 1.; +// LBMReal op = 1.; //f_E = eps_new *((5.*ax*o + 5.*by*o + 5.*cz*o - 8.*ax*op + 4.*by*op + 4.*cz*op)/(54.*o*op)); //f_N = f_E + eps_new *((2.*(ax - by))/(9.*o)); diff --git a/src/cpu/VirtualFluidsCore/LBM/CompressibleOffsetInterpolationProcessor.h b/src/cpu/VirtualFluidsCore/LBM/CompressibleOffsetInterpolationProcessor.h index d4b6608ba..b4465799a 100644 --- a/src/cpu/VirtualFluidsCore/LBM/CompressibleOffsetInterpolationProcessor.h +++ b/src/cpu/VirtualFluidsCore/LBM/CompressibleOffsetInterpolationProcessor.h @@ -42,7 +42,7 @@ private: LBMReal kxyAverage, kyzAverage, kxzAverage, kxxMyyAverage, kxxMzzAverage; - LBMReal a,b,c; +// LBMReal a,b,c; void setOffsets(LBMReal xoff, LBMReal yoff, LBMReal zoff); void calcMoments(const LBMReal* const f, LBMReal omega, LBMReal& rho, LBMReal& vx1, LBMReal& vx2, LBMReal& vx3, diff --git a/src/cpu/VirtualFluidsCore/LBM/CompressibleOffsetMomentsInterpolationProcessor.cpp b/src/cpu/VirtualFluidsCore/LBM/CompressibleOffsetMomentsInterpolationProcessor.cpp index a985afe2f..211bf2729 100644 --- a/src/cpu/VirtualFluidsCore/LBM/CompressibleOffsetMomentsInterpolationProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/LBM/CompressibleOffsetMomentsInterpolationProcessor.cpp @@ -494,7 +494,7 @@ void CompressibleOffsetMomentsInterpolationProcessor::calcInterpolatedNodeCF(LBM //bulk viscosity LBMReal oP = OxxPyyPzzF; - LBMReal rho = press ;//+ (2.*axx*x+axy*y+axz*z+axyz*y*z+ax + 2.*byy*y+bxy*x+byz*z+bxyz*x*z+by + 2.*czz*z+cxz*x+cyz*y+cxyz*x*y+cz)/3.; +// LBMReal rho = press ;//+ (2.*axx*x+axy*y+axz*z+axyz*y*z+ax + 2.*byy*y+bxy*x+byz*z+bxyz*x*z+by + 2.*czz*z+cxz*x+cyz*y+cxyz*x*y+cz)/3.; LBMReal vx1 = a0 + 0.25*( xs*ax + ys*ay + zs*az) + 0.0625*(axx + xs*ys*axy + xs*zs*axz + ayy + ys*zs*ayz + azz) + 0.015625*(xs*ys*zs*axyz); LBMReal vx2 = b0 + 0.25*( xs*bx + ys*by + zs*bz) + 0.0625*(bxx + xs*ys*bxy + xs*zs*bxz + byy + ys*zs*byz + bzz) + 0.015625*(xs*ys*zs*bxyz); LBMReal vx3 = c0 + 0.25*( xs*cx + ys*cy + zs*cz) + 0.0625*(cxx + xs*ys*cxy + xs*zs*cxz + cyy + ys*zs*cyz + czz) + 0.015625*(xs*ys*zs*cxyz); @@ -937,7 +937,7 @@ void CompressibleOffsetMomentsInterpolationProcessor::calcInterpolatedNodeFC(LBM LBMReal vx2 = b0; LBMReal vx3 = c0; - LBMReal rho = press ;//+ (ax+by+cz)/3.; +// LBMReal rho = press ;//+ (ax+by+cz)/3.; LBMReal eps_new = 2.; LBMReal o = omega; diff --git a/src/cpu/VirtualFluidsCore/LBM/CompressibleOffsetMomentsInterpolationProcessor.h b/src/cpu/VirtualFluidsCore/LBM/CompressibleOffsetMomentsInterpolationProcessor.h index 20bffa4a6..f3a1403e4 100644 --- a/src/cpu/VirtualFluidsCore/LBM/CompressibleOffsetMomentsInterpolationProcessor.h +++ b/src/cpu/VirtualFluidsCore/LBM/CompressibleOffsetMomentsInterpolationProcessor.h @@ -42,7 +42,7 @@ private: LBMReal kxyAverage, kyzAverage, kxzAverage, kxxMyyAverage, kxxMzzAverage; - LBMReal a,b,c; +// LBMReal a,b,c; // bulk viscosity LBMReal shearViscosity; diff --git a/src/cpu/VirtualFluidsCore/LBM/CompressibleOffsetSquarePressureInterpolationProcessor.h b/src/cpu/VirtualFluidsCore/LBM/CompressibleOffsetSquarePressureInterpolationProcessor.h index 48aed6665..523669719 100644 --- a/src/cpu/VirtualFluidsCore/LBM/CompressibleOffsetSquarePressureInterpolationProcessor.h +++ b/src/cpu/VirtualFluidsCore/LBM/CompressibleOffsetSquarePressureInterpolationProcessor.h @@ -42,7 +42,7 @@ private: LBMReal kxyAverage, kyzAverage, kxzAverage, kxxMyyAverage, kxxMzzAverage; - LBMReal a,b,c; +// LBMReal a,b,c; // bulk viscosity bool bulkOmegaToOmega; diff --git a/src/cpu/VirtualFluidsCore/LBM/IncompressibleCumulantLBMKernel.cpp b/src/cpu/VirtualFluidsCore/LBM/IncompressibleCumulantLBMKernel.cpp index 1620dc656..dbeb77a1c 100644 --- a/src/cpu/VirtualFluidsCore/LBM/IncompressibleCumulantLBMKernel.cpp +++ b/src/cpu/VirtualFluidsCore/LBM/IncompressibleCumulantLBMKernel.cpp @@ -82,9 +82,9 @@ void IncompressibleCumulantLBMKernel::calculate(int step) muForcingX2.DefineVar("nu", &muNu); muForcingX3.DefineVar("nu", &muNu); - LBMReal forcingX1 = 0; - LBMReal forcingX2 = 0; - LBMReal forcingX3 = 0; +// LBMReal forcingX1 = 0; +// LBMReal forcingX2 = 0; +// LBMReal forcingX3 = 0; } ///////////////////////////////////// diff --git a/src/cpu/VirtualFluidsCore/LBM/IncompressibleOffsetInterpolationProcessor.cpp b/src/cpu/VirtualFluidsCore/LBM/IncompressibleOffsetInterpolationProcessor.cpp index 30b94fcd4..3d4409ee3 100644 --- a/src/cpu/VirtualFluidsCore/LBM/IncompressibleOffsetInterpolationProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/LBM/IncompressibleOffsetInterpolationProcessor.cpp @@ -313,11 +313,11 @@ void IncompressibleOffsetInterpolationProcessor::calcInterpolatedCoefficiets(con bxyz=-vx2_NEB + vx2_NET + vx2_NWB - vx2_NWT + vx2_SEB - vx2_SET - vx2_SWB + vx2_SWT; cxyz=-vx3_NEB + vx3_NET + vx3_NWB - vx3_NWT + vx3_SEB - vx3_SET - vx3_SWB + vx3_SWT; - /////////////////////BÖSE!!! + /////////////////////B�SE!!! //axx=0; ayy=0; azz=0; //bxx=0; byy=0; bzz=0; //cxx=0; cyy=0; czz=0; - ////////////////////!!!BÖSE + ////////////////////!!!B�SE ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //kxyAverage =(kxyFromfcNEQ_SWB+ @@ -715,7 +715,7 @@ void IncompressibleOffsetInterpolationProcessor::calcInterpolatedNodeFC(LBMReal* LBMReal eps_new = 2.; LBMReal o = omega; - LBMReal op = 1.; +// LBMReal op = 1.; //f_E = eps_new *((5.*ax*o + 5.*by*o + 5.*cz*o - 8.*ax*op + 4.*by*op + 4.*cz*op)/(54.*o*op)); //f_N = f_E + eps_new *((2.*(ax - by))/(9.*o)); diff --git a/src/cpu/VirtualFluidsCore/LBM/IncompressibleOffsetInterpolationProcessor.h b/src/cpu/VirtualFluidsCore/LBM/IncompressibleOffsetInterpolationProcessor.h index 411be2d38..b618660a9 100644 --- a/src/cpu/VirtualFluidsCore/LBM/IncompressibleOffsetInterpolationProcessor.h +++ b/src/cpu/VirtualFluidsCore/LBM/IncompressibleOffsetInterpolationProcessor.h @@ -43,7 +43,7 @@ private: LBMReal kxyAverage, kyzAverage, kxzAverage, kxxMyyAverage, kxxMzzAverage; - LBMReal a,b,c; +// LBMReal a,b,c; void setOffsets(LBMReal xoff, LBMReal yoff, LBMReal zoff); void calcMoments(const LBMReal* const f, LBMReal omega, LBMReal& rho, LBMReal& vx1, LBMReal& vx2, LBMReal& vx3, diff --git a/src/cpu/VirtualFluidsCore/LBM/InitDensityLBMKernel.cpp b/src/cpu/VirtualFluidsCore/LBM/InitDensityLBMKernel.cpp index addba756e..b866d9b1e 100644 --- a/src/cpu/VirtualFluidsCore/LBM/InitDensityLBMKernel.cpp +++ b/src/cpu/VirtualFluidsCore/LBM/InitDensityLBMKernel.cpp @@ -36,7 +36,7 @@ SPtr<LBMKernel> InitDensityLBMKernel::clone() kernel->setForcingX3(muForcingX3); kernel->setIndex(ix1, ix2, ix3); kernel->setDeltaT(deltaT); - dynamicPointerCast<InitDensityLBMKernel>(kernel)->OxyyMxzz = 1.0; +// dynamicPointerCast<InitDensityLBMKernel>(kernel)->OxyyMxzz = 1.0; return kernel; } diff --git a/src/cpu/VirtualFluidsCore/LBM/InitDensityLBMKernel.h b/src/cpu/VirtualFluidsCore/LBM/InitDensityLBMKernel.h index 6b3866f3f..465bcea75 100644 --- a/src/cpu/VirtualFluidsCore/LBM/InitDensityLBMKernel.h +++ b/src/cpu/VirtualFluidsCore/LBM/InitDensityLBMKernel.h @@ -19,11 +19,11 @@ public: protected: void initDataSet(); private: - LBMReal f[D3Q27System::ENDF+1]; +// LBMReal f[D3Q27System::ENDF+1]; CbArray4D<LBMReal, IndexerX4X3X2X1>::CbArray4DPtr localDistributions; CbArray4D<LBMReal, IndexerX4X3X2X1>::CbArray4DPtr nonLocalDistributions; CbArray3D<LBMReal, IndexerX3X2X1>::CbArray3DPtr zeroDistributions; - LBMReal OxyyMxzz; +// LBMReal OxyyMxzz; CbArray4D<LBMReal, IndexerX4X3X2X1> v; }; diff --git a/src/cpu/VirtualFluidsCore/Visitors/CheckRatioBlockVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/CheckRatioBlockVisitor.cpp index cf8bc597e..d7f16b428 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/CheckRatioBlockVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/CheckRatioBlockVisitor.cpp @@ -23,7 +23,7 @@ void CheckRatioBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block) int neighix1, neighix2, neighix3, neighlev; std::vector<SPtr<Block3D>> neighbors; grid->getAllNeighbors(ix1, ix2, ix3, level, this->levelDepth, neighbors); - bool hasAdded = false; +// bool hasAdded = false; for (size_t i = 0; i<neighbors.size(); i++) { if ((neighbors[i]->isActive()||includeNotActiveBlocks) diff --git a/src/cpu/VirtualFluidsCore/Visitors/ConnectorBlockVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/ConnectorBlockVisitor.cpp index 903087355..6248316b5 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/ConnectorBlockVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/ConnectorBlockVisitor.cpp @@ -106,7 +106,7 @@ void ConnectorBlockVisitor::setInterpolationConnectors(SPtr<Grid3D> grid, SPtr<B UBLOG(logINFO, block->toString()); } UBLOG(logDEBUG5, "ConnectorBlockVisitor::setInterpolationConnectors() - start"); - int blockRank = block->getRank(); +// int blockRank = block->getRank(); //search for all blocks with different ranks if (block->hasInterpolationFlagCF() && block->isActive()) @@ -450,8 +450,8 @@ void ConnectorBlockVisitor::createTransmitters(SPtr<Block3D> cBlock, SPtr<Block3 { UBLOG(logDEBUG5, "ConnectorBlockVisitor::createTransmitters(...) - start"); CreateTransmittersHelper helper; - bool MPIpool = true; - bool orthogonal = false; +// bool MPIpool = true; +// bool orthogonal = false; int fBlockRank = fBlock->getRank(); int cBlockRank = cBlock->getRank(); if (fBlockRank == cBlockRank && fBlockRank == gridRank) diff --git a/src/cpu/VirtualFluidsCore/Visitors/CreateTransmittersHelper.cpp b/src/cpu/VirtualFluidsCore/Visitors/CreateTransmittersHelper.cpp index 7851254a0..5e24c8696 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/CreateTransmittersHelper.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/CreateTransmittersHelper.cpp @@ -23,11 +23,11 @@ void CreateTransmittersHelper::createTransmitters(SPtr<Block3D> sblock, SPtr<Blo { //SourceBlock int srcLevel = sblock->getLevel(); - int srcID = sblock->getGlobalID(); +// int srcID = sblock->getGlobalID(); //TargetBlock int tgtLevel = tblock->getLevel(); - int tgtID = tblock->getGlobalID(); +// int tgtID = tblock->getGlobalID(); int invDir = D3Q27System::INVDIR[dir]; diff --git a/src/cpu/VirtualFluidsCore/Visitors/InitDistributionsFromFileBlockVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/InitDistributionsFromFileBlockVisitor.cpp index 21a42f72b..c03e82310 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/InitDistributionsFromFileBlockVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/InitDistributionsFromFileBlockVisitor.cpp @@ -11,8 +11,8 @@ #include "BCArray3D.h" -InitDistributionsFromFileBlockVisitor::InitDistributionsFromFileBlockVisitor(LBMReal nu, LBMReal rho, std::string filename) - : Block3DVisitor(0, Grid3DSystem::MAXLEVEL), nu(nu), rho(rho) +InitDistributionsFromFileBlockVisitor::InitDistributionsFromFileBlockVisitor(/*LBMReal nu, */LBMReal rho, std::string filename) + : Block3DVisitor(0, Grid3DSystem::MAXLEVEL), /*nu(nu),*/ rho(rho) { UbFileInputASCII in(filename); if (!in) @@ -39,10 +39,7 @@ InitDistributionsFromFileBlockVisitor::InitDistributionsFromFileBlockVisitor(LBM matrix(Vx3, x1, x2, x3) = in.readDouble(); } } -////////////////////////////////////////////////////////////////////////// -InitDistributionsFromFileBlockVisitor::~InitDistributionsFromFileBlockVisitor() -{ -} + ////////////////////////////////////////////////////////////////////////// void InitDistributionsFromFileBlockVisitor::visit(const SPtr<Grid3D> grid, SPtr<Block3D> block) { @@ -50,10 +47,10 @@ void InitDistributionsFromFileBlockVisitor::visit(const SPtr<Grid3D> grid, SPtr< if (!block) UB_THROW(UbException(UB_EXARGS, "block is not exist")); - UbTupleDouble3 blockLengths = grid->getBlockLengths(block); - UbTupleDouble3 nodeOffset = grid->getNodeOffset(block); - double dx = grid->getDeltaX(block); - LBMReal o = LBMSystem::calcCollisionFactor(nu, block->getLevel()); +// UbTupleDouble3 blockLengths = grid->getBlockLengths(block); +// UbTupleDouble3 nodeOffset = grid->getNodeOffset(block); +// double dx = grid->getDeltaX(block); +// LBMReal o = LBMSystem::calcCollisionFactor(nu, block->getLevel()); //Funktionszeiger @@ -76,20 +73,20 @@ void InitDistributionsFromFileBlockVisitor::visit(const SPtr<Grid3D> grid, SPtr< else calcFeqsFct = &D3Q27System::calcIncompFeq; - UbTupleDouble3 org = grid->getBlockWorldCoordinates(block); +// UbTupleDouble3 org = grid->getBlockWorldCoordinates(block); SPtr<BCArray3D> bcArray = kernel->getBCProcessor()->getBCArray(); SPtr<EsoTwist3D> distributions = dynamicPointerCast<EsoTwist3D>(kernel->getDataSet()->getFdistributions()); LBMReal f[D3Q27System::ENDF+1]; - size_t nx1 = distributions->getNX1(); - size_t nx2 = distributions->getNX2(); - size_t nx3 = distributions->getNX3(); +// size_t nx1 = distributions->getNX1(); +// size_t nx2 = distributions->getNX2(); +// size_t nx3 = distributions->getNX3(); int minX1 = 0; int minX2 = 0; - int minX3 = 0; +// int minX3 = 0; int maxX1 = (int)bcArray->getNX1(); int maxX2 = (int)bcArray->getNX2(); diff --git a/src/cpu/VirtualFluidsCore/Visitors/InitDistributionsFromFileBlockVisitor.h b/src/cpu/VirtualFluidsCore/Visitors/InitDistributionsFromFileBlockVisitor.h index ad93269d1..bb059fc11 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/InitDistributionsFromFileBlockVisitor.h +++ b/src/cpu/VirtualFluidsCore/Visitors/InitDistributionsFromFileBlockVisitor.h @@ -12,15 +12,14 @@ class Block3D; class InitDistributionsFromFileBlockVisitor : public Block3DVisitor { public: - InitDistributionsFromFileBlockVisitor(LBMReal nu, LBMReal rho, std::string file); - ~InitDistributionsFromFileBlockVisitor(); + InitDistributionsFromFileBlockVisitor(/*LBMReal nu, */LBMReal rho, std::string file); void visit(SPtr<Grid3D> grid, SPtr<Block3D> block) override; private: CbArray4D<LBMReal, IndexerX4X3X2X1> matrix; enum Velocity { Vx1, Vx2, Vx3 }; - LBMReal nu; +// LBMReal nu; LBMReal rho; }; #endif // InitDistributionsFromFileBlockVisitor_h__ diff --git a/src/cpu/VirtualFluidsCore/Visitors/InitDistributionsWithInterpolationGridVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/InitDistributionsWithInterpolationGridVisitor.cpp index 612fbcf86..8043b8140 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/InitDistributionsWithInterpolationGridVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/InitDistributionsWithInterpolationGridVisitor.cpp @@ -34,7 +34,7 @@ void InitDistributionsWithInterpolationGridVisitor::visit(SPtr<Grid3D> grid) for (int l = minInitLevel; l<=maxInitLevel; l++) { - int n = 0; +// int n = 0; vector<SPtr<Block3D>> blockVector; newGrid->getBlocks(l, blockVector); vector<SPtr<Block3D>> tBlockID; @@ -45,7 +45,7 @@ void InitDistributionsWithInterpolationGridVisitor::visit(SPtr<Grid3D> grid) UB_THROW(UbException(UB_EXARGS, "block is not exist")); int newBlockRank = newBlock->getRank(); - int newBlockLevel = newBlock->getLevel(); +// int newBlockLevel = newBlock->getLevel(); SPtr<Block3D> oldBlock = oldGrid->getBlock(newBlock->getX1(), newBlock->getX2(), newBlock->getX3(), newBlock->getLevel()); if (oldBlock) @@ -71,7 +71,7 @@ void InitDistributionsWithInterpolationGridVisitor::visit(SPtr<Grid3D> grid) if (oldBlock) { int oldBlockRank = oldBlock->getRank(); - int oldBlockLevel = oldBlock->getLevel(); +// int oldBlockLevel = oldBlock->getLevel(); if (oldBlockRank == newBlockRank && oldBlock->isActive() && newBlockRank == newGridRank && newBlock->isActive()) { @@ -89,7 +89,7 @@ void InitDistributionsWithInterpolationGridVisitor::visit(SPtr<Grid3D> grid) if (oldBlock) { int oldBlockRank = oldBlock->getRank(); - int oldBlockLevel = oldBlock->getLevel(); +// int oldBlockLevel = oldBlock->getLevel(); if (oldBlockRank == newBlockRank && oldBlock->isActive() && newBlockRank == newGridRank && newBlock->isActive()) { diff --git a/src/cpu/VirtualFluidsCore/Visitors/MetisPartitioningGridVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/MetisPartitioningGridVisitor.cpp index 903ca99bf..16dcbd43e 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/MetisPartitioningGridVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/MetisPartitioningGridVisitor.cpp @@ -311,6 +311,9 @@ int MetisPartitioningGridVisitor::getEdgeWeight(int dir) { return 1; } + +// FIXME: non-void function does not return a value in all control paths + return 0; } ////////////////////////////////////////////////////////////////////////// void MetisPartitioningGridVisitor::setNumberOfProcesses(int np) diff --git a/src/cpu/VirtualFluidsCore/Visitors/RenumberGridVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/RenumberGridVisitor.cpp index 3ddb171f3..1d01aac23 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/RenumberGridVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/RenumberGridVisitor.cpp @@ -16,7 +16,7 @@ void RenumberGridVisitor::visit(SPtr<Grid3D> grid) //UBLOG(logDEBUG5, "RenumberGridVisitor::visit() - start"); std::vector<SPtr<Block3D>> blocks; - int gridRank = grid->getRank(); +// int gridRank = grid->getRank(); int size; //MPI_Comm_size(MPI_COMM_WORLD, &size); size = comm->getNumberOfProcesses(); diff --git a/src/cpu/VirtualFluidsCore/Visitors/SetConnectorsBlockVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/SetConnectorsBlockVisitor.cpp index a302a50f3..ae9a00e2c 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/SetConnectorsBlockVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/SetConnectorsBlockVisitor.cpp @@ -150,11 +150,11 @@ void SetConnectorsBlockVisitor::setRemoteConnectors(SPtr<Block3D> sblock, SPtr<B void SetConnectorsBlockVisitor::setInterpolationConnectors(SPtr<Grid3D> grid, SPtr<Block3D> block) { UBLOG(logDEBUG5, "D3Q27SetConnectorsBlockVisitor::setInterpolationConnectors() - start"); - int blockRank = block->getRank(); - if (block->getGlobalID()==394) - { - int test=0; - } +// int blockRank = block->getRank(); +// if (block->getGlobalID()==394) +// { +// int test=0; +// } //search for all blocks with different ranks if (block->hasInterpolationFlagCF() && block->isActive()) @@ -497,8 +497,8 @@ void SetConnectorsBlockVisitor::createTransmitters(SPtr<Block3D> cBlock, SPtr<Bl { UBLOG(logDEBUG5, "D3Q27SetConnectorsBlockVisitor::createTransmitters(...) - start"); CreateTransmittersHelper helper; - bool MPIpool = true; - bool orthogonal = false; +// bool MPIpool = true; +// bool orthogonal = false; int fBlockRank = fBlock->getRank(); int cBlockRank = cBlock->getRank(); if(fBlockRank == cBlockRank && fBlockRank == gridRank) -- GitLab