diff --git a/CMake/FileUtilities.cmake b/CMake/FileUtilities.cmake index 23e256dfd85b91b1980d168c676ef6a1d2b758ea..4d42efcedd5d6a06d3d1ca12106e26c0ac875b93 100644 --- a/CMake/FileUtilities.cmake +++ b/CMake/FileUtilities.cmake @@ -6,16 +6,26 @@ ################################################################################# macro(includeAllFiles targetName file_path) - set(collectTestFiles ON) - set(collectProductionFiles ON) + if(NOT DEFINED collectTestFiles) + set(collectTestFiles ON) + endif() + + if(NOT DEFINED collectProductionFiles) + set(collectProductionFiles ON) + endif() includeFiles(${targetName} "${file_path}") endmacro(includeAllFiles) macro(includeProductionFiles targetName file_path) - set(collectTestFiles OFF) - set(collectProductionFiles ON) + if(NOT DEFINED collectTestFiles) + set(collectTestFiles OFF) + endif() + + if(NOT DEFINED collectProductionFiles) + set(collectProductionFiles ON) + endif() includeFiles(${targetName} "${file_path}") endmacro(includeProductionFiles) @@ -23,8 +33,13 @@ endmacro(includeProductionFiles) macro(includeTestFiles targetName file_paths) - set(collectTestFiles ON) - set(collectProductionFiles OFF) + if(NOT DEFINED collectTestFiles) + set(collectTestFiles ON) + endif() + + if(NOT DEFINED collectProductionFiles) + set(collectProductionFiles OFF) + endif() includeFiles(${targetName} "${file_paths}") endmacro(includeTestFiles) @@ -47,6 +62,9 @@ macro(includeFiles targetName file_paths) endforeach() + unset(collectTestFiles) + unset(collectProductionFiles) + endmacro(includeFiles) diff --git a/CMake/VirtualFluidsMacros.cmake b/CMake/VirtualFluidsMacros.cmake index 676353ea2c2e03f2f55e096948643f85f8b87ec0..b17d4a3b8d6e08e5d21039ad644950438f07f1ae 100644 --- a/CMake/VirtualFluidsMacros.cmake +++ b/CMake/VirtualFluidsMacros.cmake @@ -84,6 +84,8 @@ function (vf_get_library_test_name library_test_name) endfunction() + + ################################################################################# ## Add a target, link the libraries and add the compiler flags to the target ## @@ -116,8 +118,7 @@ function(vf_add_library) collectFiles(sourceFiles "${ARG_FILES}" "${ARG_FOLDER}" "${ARG_EXCLUDE}") - includeProductionFiles (${library_name} "${sourceFiles}") - + includeProductionFiles(${library_name} "${sourceFiles}") ################################################################# ### EXCECUTABLE ### diff --git a/CMake/compilerflags/AppleClang.cmake b/CMake/compilerflags/AppleClang.cmake index ef97a54a4ebe17bde5e016e04a40a187371172e9..f84d6f27ec4a28bb86ad224f86b2866037a6a2e9 100644 --- a/CMake/compilerflags/AppleClang.cmake +++ b/CMake/compilerflags/AppleClang.cmake @@ -14,11 +14,6 @@ LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-O3;-fomit-frame-pointer; ############################################################################################################# LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-pthread") -############################################################################################################# -# c++ 11 support -############################################################################################################# -LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-std=c++11") - # test #LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS_RELEASE "-Wall") @@ -31,11 +26,6 @@ LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wno-deprecated") #deprec #LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wbackslash-newline-escape") #backslash and newline separated by space LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wcomment") #'/*' within block comment -############################################################################################################# -# c++ 17 support -############################################################################################################# -#LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-std=c++17") -#LIST(APPEND CAB_COMPILER_ADDTIONAL_C_COMPILER_FLAGS "-std=c++17") #LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-fext-numeric-literals") #LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-D_GLIBCXX_USE_CXX11_ABI=0") diff --git a/CMake/compilerflags/Clang.cmake b/CMake/compilerflags/Clang.cmake index 4e79d520c0b91a41d62f658092489941926bda05..4e473e381ff7d9dc36e0a910e4504d355fb0ca60 100644 --- a/CMake/compilerflags/Clang.cmake +++ b/CMake/compilerflags/Clang.cmake @@ -14,10 +14,6 @@ LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-O3;-fomit-frame-pointer; ############################################################################################################# LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-pthread") -############################################################################################################# -# c++ 11 support -############################################################################################################# -LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-std=c++11") ############################################################################################################# # disable warning @@ -26,11 +22,6 @@ LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wno-deprecated") #deprec #LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wbackslash-newline-escape") #backslash and newline separated by space LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wcomment") #'/*' within block comment -############################################################################################################# -# c++ 17 support -############################################################################################################# -#LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-std=c++17") -#LIST(APPEND CAB_COMPILER_ADDTIONAL_C_COMPILER_FLAGS "-std=c++17") #LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-fext-numeric-literals") #LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-D_GLIBCXX_USE_CXX11_ABI=0") diff --git a/CMake/compilerflags/GNU.cmake b/CMake/compilerflags/GNU.cmake index 08dc75adc01375fc35ddd46bc00ae539dce4c96c..54a11f02a661b85a80fb7ce7fe9cfb8c60b04b0d 100644 --- a/CMake/compilerflags/GNU.cmake +++ b/CMake/compilerflags/GNU.cmake @@ -10,16 +10,7 @@ LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wno-deprecated") #deprec ############################################################################################################# LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-pthread") -############################################################################################################# -# c++ 11 support -############################################################################################################# -LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-std=c++11") -############################################################################################################# -# c++ 17 support -############################################################################################################# -#LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-std=c++17") -#LIST(APPEND CAB_COMPILER_ADDTIONAL_C_COMPILER_FLAGS "-std=c++17") #LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-fext-numeric-literals") #LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-D_GLIBCXX_USE_CXX11_ABI=0") @@ -28,3 +19,5 @@ LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-std=c++11") list(APPEND VF_LINK_OPTIONS -lgomp) list(APPEND VF_LINK_OPTIONS -lrt) + +list(APPEND VF_LINK_OPTIONS -ldl) diff --git a/CMake/compilerflags/Intel.cmake b/CMake/compilerflags/Intel.cmake index 4f4c7bb3ed2dad45a6f91e644fa0d74e5b4d98be..83cb9f74c500cc748a6a1e8c7440fa643d314451 100644 --- a/CMake/compilerflags/Intel.cmake +++ b/CMake/compilerflags/Intel.cmake @@ -24,11 +24,6 @@ LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-xHOST;-O3;-ip;-fno-alias ############################################################################################################### #LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-pthread") -############################################################################################################# -# c++ 11 support -############################################################################################################# -LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-std=c++11") - list(APPEND VF_LINK_OPTIONS -parallel) list(APPEND VF_LINK_OPTIONS -irc) diff --git a/apps/gpu/tests/NumericalTestPostProcessing/3rdPartyLinking.cmake b/apps/gpu/tests/NumericalTestPostProcessing/3rdPartyLinking.cmake deleted file mode 100644 index 9bba373d677af90361bd87eda881973bcb70793a..0000000000000000000000000000000000000000 --- a/apps/gpu/tests/NumericalTestPostProcessing/3rdPartyLinking.cmake +++ /dev/null @@ -1,10 +0,0 @@ -#include (${CMAKE_SOURCE_DIR}/${cmakeMacroPath}/GMock/Link.cmake) -#linkGMock(${targetName}) -include (${CMAKE_SOURCE_DIR}/${cmakeMacroPath}/Cuda/Link.cmake) -linkCuda(${targetName}) -include (${CMAKE_SOURCE_DIR}/${cmakeMacroPath}/MPI/Link.cmake) -linkMPI(${targetName}) -include (${CMAKE_SOURCE_DIR}/${cmakeMacroPath}/Boost/Link.cmake) -linkBoost(${targetName} "") -#include (${CMAKE_SOURCE_DIR}/${cmakeMacroPath}/MathLink/Link.cmake) -#linkMathLink(${targetName}) \ No newline at end of file diff --git a/apps/gpu/tests/NumericalTestPostProcessing/CMakePackage.cmake b/apps/gpu/tests/NumericalTestPostProcessing/CMakePackage.cmake deleted file mode 100644 index 317ed1a80f5c28a26ca65b4ade1d20ca1b422f0b..0000000000000000000000000000000000000000 --- a/apps/gpu/tests/NumericalTestPostProcessing/CMakePackage.cmake +++ /dev/null @@ -1,7 +0,0 @@ -#FILE ENDINGS -resetFileEndingsToCollect() -addCAndCPPFileTypes() - -#GLOB SOURCE FILES IN MY_SRCS -unset(MY_SRCS) -includeRecursiveAllFilesFrom(${targetName} ${CMAKE_CURRENT_LIST_DIR}) \ No newline at end of file diff --git a/apps/gpu/tests/NumericalTestPostProcessing/Utilities/AlmostEquals.h b/apps/gpu/tests/NumericalTestPostProcessing/Utilities/AlmostEquals.h index 72922c8a0b5660645ae36e6745da210ae5505c27..fd467aaa9ec710d909d4537aba3da7d9921bb59a 100644 --- a/apps/gpu/tests/NumericalTestPostProcessing/Utilities/AlmostEquals.h +++ b/apps/gpu/tests/NumericalTestPostProcessing/Utilities/AlmostEquals.h @@ -37,6 +37,7 @@ #pragma once #include <limits> +#include <float.h> // This template class serves as a compile-time function from size to // type. It maps a size in bytes to a primitive type with that diff --git a/apps/gpu/tests/NumericalTestPostProcessing/Utilities/LogFileReader/LogFileReader.cpp b/apps/gpu/tests/NumericalTestPostProcessing/Utilities/LogFileReader/LogFileReader.cpp index b100b2277d2d0672f259f551d79dc08c58625726..0f254c99746a98f0e8f2323ba0f89e73e9317052 100644 --- a/apps/gpu/tests/NumericalTestPostProcessing/Utilities/LogFileReader/LogFileReader.cpp +++ b/apps/gpu/tests/NumericalTestPostProcessing/Utilities/LogFileReader/LogFileReader.cpp @@ -19,6 +19,7 @@ #include <filesystem> #include <fstream> #include <iostream> +#include <cstring> std::shared_ptr<LogFileReader> LogFileReader::getInstance() { @@ -42,16 +43,16 @@ std::shared_ptr<LogFileData> LogFileReader::readLogFileToLogFileData(std::string std::unique_ptr<input::Input> input = input::Input::makeInput(stream, "config"); logFileData->setFilePath(filePath); - logFileData->setDate(StringUtil::toString(input->getValue("Date"))); - logFileData->setTime(StringUtil::toString(input->getValue("Time"))); + logFileData->setDate(input->getValue("Date")); + logFileData->setTime(input->getValue("Time")); logFileData->setGpuDevices(StringUtil::toStringVector(input->getValue("GPU_Devices"))); - logFileData->setKernel(StringUtil::toString(input->getValue("Kernel"))); + logFileData->setKernel(input->getValue("Kernel")); logFileData->setNumberOfTimeSteps(StringUtil::toInt(input->getValue("NumberOfTimeSteps"))); logFileData->setViscosity(StringUtil::toDouble(input->getValue("Viscosity"))); logFileData->setBasisTimeStepLength(StringUtil::toInt(input->getValue("BasisTimeStepLength"))); - logFileData->setSimName(StringUtil::toString(input->getValue("SimulationName"))); + logFileData->setSimName(input->getValue("SimulationName")); @@ -139,10 +140,10 @@ std::shared_ptr<LogFileData> LogFileReader::readLogFileToLogFileData(std::string resultsCheckTimeOStringStream << "ResultsCheckTime_" << logFileData->getBasicGridLengths().at(i); testTimeOStringStream << "TestTime_" << logFileData->getBasicGridLengths().at(i); analyticalVTKWritingTimeOStringStream << "AnalyticalVTKFileWritingTime_" << logFileData->getBasicGridLengths().at(i); - std::string simTimeString = StringUtil::toString(input->getValue(simTimeOStringStream.str())); - std::string resultCheckTimeString = StringUtil::toString(input->getValue(resultsCheckTimeOStringStream.str())); - std::string testTimeString = StringUtil::toString(input->getValue(testTimeOStringStream.str())); - std::string analyticalVTKWritingTimeString = StringUtil::toString(input->getValue(analyticalVTKWritingTimeOStringStream.str())); + std::string simTimeString = input->getValue(simTimeOStringStream.str()); + std::string resultCheckTimeString = input->getValue(resultsCheckTimeOStringStream.str()); + std::string testTimeString = input->getValue(testTimeOStringStream.str()); + std::string analyticalVTKWritingTimeString = input->getValue(analyticalVTKWritingTimeOStringStream.str()); simTimeString.erase(simTimeString.end() - 3, simTimeString.end()); resultCheckTimeString.erase(resultCheckTimeString.end() - 3, resultCheckTimeString.end()); testTimeString.erase(testTimeString.end() - 3, testTimeString.end()); @@ -392,7 +393,7 @@ std::shared_ptr<LogFileData> LogFileReader::readLogFileToLogFileData(std::string std::vector<double> l2NormDivergentKernel; std::vector<double> l2NormBetweenKernels; std::shared_ptr<L2NormBetweenKernelsLogFileDataImp> aL2NormLogFileData = L2NormBetweenKernelsLogFileDataImp::getNewInstance(); - aL2NormLogFileData->setBasicKernel(StringUtil::toString(input->getValue("BasicKernel_L2Norm_BK"))); + aL2NormLogFileData->setBasicKernel(input->getValue("BasicKernel_L2Norm_BK")); aL2NormLogFileData->setDivergentKernel(logFileData->getKernel()); aL2NormLogFileData->setDataToCalculate(dataToCalc.at(i)); aL2NormLogFileData->setTimeStep(timeSteps.at(j)); @@ -492,12 +493,12 @@ LogFileReader::LogFileReader() std::vector<std::string> LogFileReader::getAllFilesInDir(const std::string &dirPath, const std::string &fileExtension) { std::vector<std::string> listOfFiles; - std::experimental::filesystem::path myPath = dirPath; - if (std::experimental::filesystem::exists(myPath) && std::experimental::filesystem::is_directory(myPath)) + std::filesystem::path myPath = dirPath; + if (std::filesystem::exists(myPath) && std::filesystem::is_directory(myPath)) { - for (auto& item : std::experimental::filesystem::recursive_directory_iterator(myPath)) + for (auto& item : std::filesystem::recursive_directory_iterator(myPath)) { - if (std::experimental::filesystem::is_regular_file(item.path()) && item.path().extension() == fileExtension) + if (std::filesystem::is_regular_file(item.path()) && item.path().extension() == fileExtension) listOfFiles.push_back(item.path().string()); } } @@ -506,7 +507,7 @@ std::vector<std::string> LogFileReader::getAllFilesInDir(const std::string &dirP std::string LogFileReader::removeCharsFromString(std::string str, char * charsToRemove) { - for (unsigned int i = 0; i < strlen(charsToRemove); ++i) + for (unsigned int i = 0; i < std::strlen(charsToRemove); ++i) str.erase(remove(str.begin(), str.end(), charsToRemove[i]), str.end()); return str; } diff --git a/apps/gpu/tests/NumericalTestPostProcessing/Utilities/MathematicaAssistant/MathematicaAssistantImp.cpp b/apps/gpu/tests/NumericalTestPostProcessing/Utilities/MathematicaAssistant/MathematicaAssistantImp.cpp index 26cedc408c58d4c66d45dd33d0ee249ebd0400a8..ef041d1cf5cd86f436a7acb9aed37c7e072a7c57 100644 --- a/apps/gpu/tests/NumericalTestPostProcessing/Utilities/MathematicaAssistant/MathematicaAssistantImp.cpp +++ b/apps/gpu/tests/NumericalTestPostProcessing/Utilities/MathematicaAssistant/MathematicaAssistantImp.cpp @@ -3,6 +3,9 @@ #include "Utilities/DataPoint/DataPoint.h" #include "Utilities/MathematicaFunctionFactory/MathematicaFunctionFactory.h" +#include <cmath> + + MathematicaAssistantImp::MathematicaAssistantImp() { } @@ -137,7 +140,7 @@ void MathematicaAssistantImp::addFourthOrderOfAccuracyRef(std::vector<std::vecto } std::vector<double> fourth = { minData / 10.0 }; for (int l = 1; l < x.size(); l++) - fourth.push_back(fourth.at(l - 1) / exp(-4.0 * log(x.at(l - 1) / x.at(l)))); + fourth.push_back(fourth.at(l - 1) / std::exp(-4.0 * std::log(x.at(l - 1) / x.at(l)))); xAxesData.push_back(x); diff --git a/apps/gpu/tests/NumericalTestPostProcessing/Utilities/MathematicaFile/MathematicaFile.cpp b/apps/gpu/tests/NumericalTestPostProcessing/Utilities/MathematicaFile/MathematicaFile.cpp index 5e155fb1935ab14c4c7aeee5f1ccf3c34bcada30..84e7ee049ff8a1c1ec3def666f7a49bfc561312b 100644 --- a/apps/gpu/tests/NumericalTestPostProcessing/Utilities/MathematicaFile/MathematicaFile.cpp +++ b/apps/gpu/tests/NumericalTestPostProcessing/Utilities/MathematicaFile/MathematicaFile.cpp @@ -3,7 +3,7 @@ #include "Utilities/MathematicaFunction/MathematicaFunktion.h" #include <ctime> -#include <experimental/filesystem> +#include <filesystem> #include <iomanip> #include <sstream> @@ -24,7 +24,7 @@ void MathematicaFile::finishFile() fileFinished = true; myFile.close(); - std::experimental::filesystem::rename(filePathTxtFile, filePathMathematicaFile); + std::filesystem::rename(filePathTxtFile, filePathMathematicaFile); std::system(filePathMathematicaFile.c_str()); } } diff --git a/apps/gpu/tests/NumericalTestPostProcessing/Utilities/MathematicaFunction/LinePlot/MathematicaListPlotImp.cpp b/apps/gpu/tests/NumericalTestPostProcessing/Utilities/MathematicaFunction/LinePlot/MathematicaListPlotImp.cpp index e8508061686cba1092f0f85012d3a9b81b6fc439..15cf9bdb90a9ddbf723c89e7a8965e0d5e4dbdac 100644 --- a/apps/gpu/tests/NumericalTestPostProcessing/Utilities/MathematicaFunction/LinePlot/MathematicaListPlotImp.cpp +++ b/apps/gpu/tests/NumericalTestPostProcessing/Utilities/MathematicaFunction/LinePlot/MathematicaListPlotImp.cpp @@ -1,6 +1,6 @@ #include "MathematicaListPlotImp.h" -#include "Utilities\MathematicaFunction\PointList\MathematicaPointList.h" +#include "Utilities/MathematicaFunction/PointList/MathematicaPointList.h" std::shared_ptr<MathematicaListPlot> MathematicaListPlotImp::getNewInstance(std::vector<std::shared_ptr<MathematicaPointList>> pointList, std::string plotType, std::string xAxes, std::string yAxes) { diff --git a/apps/gpu/tests/NumericalTestPostProcessing/Utilities/MathematicaFunktion/ListLinePlot/MathematicaListLinePlot.h b/apps/gpu/tests/NumericalTestPostProcessing/Utilities/MathematicaFunktion/ListLinePlot/MathematicaListLinePlot.h index 21cb2f48156932db7730413935f690d92f78b925..665f596bbef4e55de3084ecf8f2f8b53c13201e8 100644 --- a/apps/gpu/tests/NumericalTestPostProcessing/Utilities/MathematicaFunktion/ListLinePlot/MathematicaListLinePlot.h +++ b/apps/gpu/tests/NumericalTestPostProcessing/Utilities/MathematicaFunktion/ListLinePlot/MathematicaListLinePlot.h @@ -1,7 +1,7 @@ #ifndef MATHEMATICA_PLOT_H #define MATHEMATICA_PLOT_H -#include "../MathematicaFunktionImp.h" +#include "Utilities/MathematicaFunction/MathematicaFunktionImp.h" #include <memory> #include <vector> diff --git a/apps/gpu/tests/NumericalTestPostProcessing/Utilities/MathematicaFunktion/PointList/MathematicaPointList.cpp b/apps/gpu/tests/NumericalTestPostProcessing/Utilities/MathematicaFunktion/PointList/MathematicaPointList.cpp index ab6b2b2805bea3d39e78b51ee942a6eba258e820..7bacbc329e2daa359e6e0f8bcb3b4f14bd04d3b6 100644 --- a/apps/gpu/tests/NumericalTestPostProcessing/Utilities/MathematicaFunktion/PointList/MathematicaPointList.cpp +++ b/apps/gpu/tests/NumericalTestPostProcessing/Utilities/MathematicaFunktion/PointList/MathematicaPointList.cpp @@ -1,6 +1,6 @@ #include "MathematicaPointList.h" -#include "Utilities\DataPoint\DataPoint.h" +#include "Utilities/DataPoint/DataPoint.h" std::shared_ptr<MathematicaPointList> MathematicaPointList::getNewInstance(std::string listName, std::vector< std::shared_ptr< DataPoint>> plotData) { diff --git a/apps/gpu/tests/NumericalTestPostProcessing/Utilities/MathematicaFunktion/PointList/MathematicaPointList.h b/apps/gpu/tests/NumericalTestPostProcessing/Utilities/MathematicaFunktion/PointList/MathematicaPointList.h index 2fa4e35db2c4aa9c0acb8196d246a39cc73b99ec..99869b1bc8d004834803efb51610597c655bd28e 100644 --- a/apps/gpu/tests/NumericalTestPostProcessing/Utilities/MathematicaFunktion/PointList/MathematicaPointList.h +++ b/apps/gpu/tests/NumericalTestPostProcessing/Utilities/MathematicaFunktion/PointList/MathematicaPointList.h @@ -1,7 +1,7 @@ #ifndef MATHEMATICA_POINT_LIST_H #define MATHEMATICA_POINT_LIST_H -#include "../MathematicaFunktionImp.h" +#include "Utilities/MathematicaFunction/MathematicaFunktionImp.h" #include <memory> #include <vector> diff --git a/apps/gpu/tests/NumericalTests/3rdPartyLinking.cmake b/apps/gpu/tests/NumericalTests/3rdPartyLinking.cmake deleted file mode 100644 index dd9d2ded976fe58dcd0fb3fb0527c53c2d466334..0000000000000000000000000000000000000000 --- a/apps/gpu/tests/NumericalTests/3rdPartyLinking.cmake +++ /dev/null @@ -1,10 +0,0 @@ -include (${CMAKE_SOURCE_DIR}/${cmakeMacroPath}/GMock/Link.cmake) -linkGMock(${targetName}) -include (${CMAKE_SOURCE_DIR}/${cmakeMacroPath}/Cuda/Link.cmake) -linkCuda(${targetName}) -include (${CMAKE_SOURCE_DIR}/${cmakeMacroPath}/MPI/Link.cmake) -linkMPI(${targetName}) -include (${CMAKE_SOURCE_DIR}/${cmakeMacroPath}/fftw/Link.cmake) -linkFftw(${targetName}) -include (${CMAKE_SOURCE_DIR}/${cmakeMacroPath}/Boost/Link.cmake) -linkBoost(${targetName} "") diff --git a/apps/gpu/tests/NumericalTests/CMakeLists.txt b/apps/gpu/tests/NumericalTests/CMakeLists.txt index e6f426361f8ea402649e6a4df9dbb7b9d2cf2d8b..cf4cf7213037f43b0ee5027a407228f0149d5f41 100644 --- a/apps/gpu/tests/NumericalTests/CMakeLists.txt +++ b/apps/gpu/tests/NumericalTests/CMakeLists.txt @@ -1,6 +1,6 @@ project(NumericalTestsGPU) - -vf_add_library(BUILDTYPE binary DEPENDS VirtualFluids_GPU GridGenerator basics cudart_static fftw3 gtest gmock gmock_main) +set(collectTestFiles ON) +vf_add_library(BUILDTYPE binary DEPENDS VirtualFluids_GPU GridGenerator basics fftw3 gtest gmock gmock_main cudart_static) vf_get_library_name(library_name) groupTarget(${library_name} ${testFolder}) @@ -13,4 +13,4 @@ if(BUILD_SHARED_LIBS) COMPILE_DEFINITIONS "GTEST_LINKED_AS_SHARED_LIBRARY=1") endif() -linkCUDA() \ No newline at end of file +linkCUDA() diff --git a/apps/gpu/tests/NumericalTests/CMakePackage.cmake b/apps/gpu/tests/NumericalTests/CMakePackage.cmake deleted file mode 100644 index 317ed1a80f5c28a26ca65b4ade1d20ca1b422f0b..0000000000000000000000000000000000000000 --- a/apps/gpu/tests/NumericalTests/CMakePackage.cmake +++ /dev/null @@ -1,7 +0,0 @@ -#FILE ENDINGS -resetFileEndingsToCollect() -addCAndCPPFileTypes() - -#GLOB SOURCE FILES IN MY_SRCS -unset(MY_SRCS) -includeRecursiveAllFilesFrom(${targetName} ${CMAKE_CURRENT_LIST_DIR}) \ No newline at end of file diff --git a/apps/gpu/tests/NumericalTests/Tests/NyTest/NyTest.cpp b/apps/gpu/tests/NumericalTests/Tests/NyTest/NyTest.cpp index 6ab597e5bbb90823053dfc60c9b466f63beed1c7..e3e7932e9d77481c26d3e9ffb80ce614de0d817c 100644 --- a/apps/gpu/tests/NumericalTests/Tests/NyTest/NyTest.cpp +++ b/apps/gpu/tests/NumericalTests/Tests/NyTest/NyTest.cpp @@ -8,6 +8,7 @@ #include "Tests/NyTest/NyTestParameterStruct.h" #include <iomanip> +#include <cmath> std::shared_ptr<NyTest> NyTest::getNewInstance(std::shared_ptr<ColorConsoleOutput> colorOutput, double viscosity, std::shared_ptr<NyTestParameterStruct> testPara, std::string dataToCalculate) { @@ -84,7 +85,7 @@ NyTest::NyTest(std::shared_ptr<ColorConsoleOutput> colorOutput, double viscosity double NyTest::calcOrderOfAccuracy(std::vector<double> data) { - double ooa = log(data.at(0) / data.at(1)) / log(lx.at(1) / lx.at(0)); + double ooa = std::log(data.at(0) / data.at(1)) / std::log(lx.at(1) / lx.at(0)); return ooa; } diff --git a/apps/gpu/tests/NumericalTests/Tests/PhiTest/PhiTest.cpp b/apps/gpu/tests/NumericalTests/Tests/PhiTest/PhiTest.cpp index ea8519cc090a8c2b0319e96a5a733a80ef6165ae..e3d749293793250893c78958eaa777fd1f3b87d7 100644 --- a/apps/gpu/tests/NumericalTests/Tests/PhiTest/PhiTest.cpp +++ b/apps/gpu/tests/NumericalTests/Tests/PhiTest/PhiTest.cpp @@ -8,6 +8,7 @@ #include "Tests/PhiTest/PhiTestParameterStruct.h" #include <iomanip> +#include <cmath> std::shared_ptr<PhiTest> PhiTest::getNewInstance(std::shared_ptr<ColorConsoleOutput> colorOutput, double viscosity, std::shared_ptr<PhiTestParameterStruct> testPara, std::string dataToCalculate) { @@ -72,7 +73,7 @@ PhiTest::PhiTest(std::shared_ptr<ColorConsoleOutput> colorOutput, double viscosi double PhiTest::calcOrderOfAccuracy(std::vector<double> data) { - double ooa = log(data.at(0) / data.at(1)) / log(lx.at(1) / lx.at(0)); + double ooa = std::log(data.at(0) / data.at(1)) / std::log(lx.at(1) / lx.at(0)); return ooa; } diff --git a/apps/gpu/tests/NumericalTests/Utilities/Calculator/AlmostEquals.h b/apps/gpu/tests/NumericalTests/Utilities/Calculator/AlmostEquals.h index 72922c8a0b5660645ae36e6745da210ae5505c27..fd467aaa9ec710d909d4537aba3da7d9921bb59a 100644 --- a/apps/gpu/tests/NumericalTests/Utilities/Calculator/AlmostEquals.h +++ b/apps/gpu/tests/NumericalTests/Utilities/Calculator/AlmostEquals.h @@ -37,6 +37,7 @@ #pragma once #include <limits> +#include <float.h> // This template class serves as a compile-time function from size to // type. It maps a size in bytes to a primitive type with that diff --git a/apps/gpu/tests/NumericalTests/Utilities/Calculator/L2NormCalculator/L2CalculatorNormalizeWithAmplitude/L2CalculatorNormalizeWithAmplitude.cpp b/apps/gpu/tests/NumericalTests/Utilities/Calculator/L2NormCalculator/L2CalculatorNormalizeWithAmplitude/L2CalculatorNormalizeWithAmplitude.cpp index 9f6657e03e2b049c4ee8dd549619e27f94c05296..0ef35604920afd0d323ce389a169004d0d12ce23 100644 --- a/apps/gpu/tests/NumericalTests/Utilities/Calculator/L2NormCalculator/L2CalculatorNormalizeWithAmplitude/L2CalculatorNormalizeWithAmplitude.cpp +++ b/apps/gpu/tests/NumericalTests/Utilities/Calculator/L2NormCalculator/L2CalculatorNormalizeWithAmplitude/L2CalculatorNormalizeWithAmplitude.cpp @@ -2,6 +2,8 @@ #include "Utilities/Calculator/FFTCalculator/FFTCalculator.h" +#include <cmath> + std::shared_ptr<L2NormCalculator> L2CalculatorNormalizeWithAmplitude::getInstance() { static std::shared_ptr<L2NormCalculator> uniqueInstance; @@ -17,7 +19,7 @@ double L2CalculatorNormalizeWithAmplitude::calc(std::vector<double> basicData, s if (equalDouble(amplitude, 0.0)) return -1.0; double counter = calcCounter(basicData, divergentData, level, lx, lz); - return sqrt(counter / (amplitude * amplitude)); + return std::sqrt(counter / (amplitude * amplitude)); } L2CalculatorNormalizeWithAmplitude::L2CalculatorNormalizeWithAmplitude() : L2NormCalculatorImp("Test could not run. Amplitude is zero. Normalization of the data is not possible.") diff --git a/apps/gpu/tests/NumericalTests/Utilities/Calculator/L2NormCalculator/L2CalculatorNormalizeWithBasicData/L2CalculatorNormalizeWithBasicData.cpp b/apps/gpu/tests/NumericalTests/Utilities/Calculator/L2NormCalculator/L2CalculatorNormalizeWithBasicData/L2CalculatorNormalizeWithBasicData.cpp index 20fb89c47622a543284aa77da0d25eac4ce71cbc..012c7fcf63a2210561d01b2ea05ed6b04d2fd44c 100644 --- a/apps/gpu/tests/NumericalTests/Utilities/Calculator/L2NormCalculator/L2CalculatorNormalizeWithBasicData/L2CalculatorNormalizeWithBasicData.cpp +++ b/apps/gpu/tests/NumericalTests/Utilities/Calculator/L2NormCalculator/L2CalculatorNormalizeWithBasicData/L2CalculatorNormalizeWithBasicData.cpp @@ -1,5 +1,7 @@ #include "L2CalculatorNormalizeWithBasicData.h" +#include <cmath> + std::shared_ptr<L2NormCalculator> L2CalculatorNormalizeWithBasicData::getInstance() { static std::shared_ptr<L2NormCalculator> uniqueInstance; @@ -13,13 +15,13 @@ double L2CalculatorNormalizeWithBasicData::calc(std::vector<double> basicData, s double counter = calcCounter(basicData, divergentData, level, lx, lz); double denominator = 0.0; for (int i = 0; i < basicData.size(); i++) { - double area = (1 / pow(2.0, level.at(i))) * (1 / pow(2.0, level.at(i))); + double area = (1 / std::pow(2.0, level.at(i))) * (1 / std::pow(2.0, level.at(i))); denominator += (basicData.at(i)*basicData.at(i)) * area; } if (equalDouble(denominator, 0.0)) return -1.0; - return sqrt(counter / denominator); + return std::sqrt(counter / denominator); } L2CalculatorNormalizeWithBasicData::L2CalculatorNormalizeWithBasicData() : L2NormCalculatorImp("Test could not run. BasicData is zero. Normalization of the data is not possible.") diff --git a/apps/gpu/tests/NumericalTests/Utilities/ConfigFileReaderNT/ConfigFileReaderNT.cpp b/apps/gpu/tests/NumericalTests/Utilities/ConfigFileReaderNT/ConfigFileReaderNT.cpp index d0104b7e5edd4df82ea5bca02686f929b6511e68..ee75dcf29d0a4afa71fa66b4f168a191a585c088 100644 --- a/apps/gpu/tests/NumericalTests/Utilities/ConfigFileReaderNT/ConfigFileReaderNT.cpp +++ b/apps/gpu/tests/NumericalTests/Utilities/ConfigFileReaderNT/ConfigFileReaderNT.cpp @@ -5,6 +5,7 @@ #include "VirtualFluids_GPU/Kernel/Utilities/Mapper/KernelMapper/KernelMapper.h" +#include <string> #include <fstream> std::shared_ptr<ConfigFileReader> ConfigFileReader::getNewInstance(const std::string aFilePath) @@ -130,7 +131,7 @@ std::vector<std::shared_ptr<TaylorGreenVortexUxParameterStruct> > ConfigFileRead aParameter->basicTimeStepLength = basisTimeStepLength.at(i); aParameter->l0 = l0; aParameter->rho0 = StringUtil::toDouble(input->getValue("Rho0")); - aParameter->vtkFilePath = StringUtil::toString(input->getValue("PathForVTKFileWriting")); + aParameter->vtkFilePath = input->getValue("PathForVTKFileWriting"); aParameter->dataToCalcTests = StringUtil::toStringVector(input->getValue("DataToCalcTests_TGV_Ux")); parameter.push_back(aParameter); } @@ -154,7 +155,7 @@ std::vector<std::shared_ptr<TaylorGreenVortexUzParameterStruct> > ConfigFileRead aParameter->basicTimeStepLength = basisTimeStepLength.at(i); aParameter->l0 = l0; aParameter->rho0 = StringUtil::toDouble(input->getValue("Rho0")); - aParameter->vtkFilePath = StringUtil::toString(input->getValue("PathForVTKFileWriting")); + aParameter->vtkFilePath = input->getValue("PathForVTKFileWriting"); aParameter->dataToCalcTests = StringUtil::toStringVector(input->getValue("DataToCalcTests_TGV_Uz")); parameter.push_back(aParameter); } @@ -177,7 +178,7 @@ std::vector<std::shared_ptr<ShearWaveParameterStruct> > ConfigFileReader::makeSh aParameter->basicTimeStepLength = basisTimeStepLength.at(i); aParameter->l0 = l0; aParameter->rho0 = StringUtil::toDouble(input->getValue("Rho0")); - aParameter->vtkFilePath = StringUtil::toString(input->getValue("PathForVTKFileWriting")); + aParameter->vtkFilePath = input->getValue("PathForVTKFileWriting"); aParameter->dataToCalcTests = StringUtil::toStringVector(input->getValue("DataToCalcTests_SW")); parameter.push_back(aParameter); } @@ -238,7 +239,7 @@ std::shared_ptr<L2NormTestBetweenKernelsParameterStruct> ConfigFileReader::makeL std::shared_ptr<L2NormTestBetweenKernelsParameterStruct> testParameter = std::shared_ptr<L2NormTestBetweenKernelsParameterStruct>(new L2NormTestBetweenKernelsParameterStruct); testParameter->basicTestParameter = basicTestParameter; - testParameter->basicKernel = myKernelMapper->getEnum(StringUtil::toString(input->getValue("BasicKernel_L2NormBetweenKernels"))); + testParameter->basicKernel = myKernelMapper->getEnum(input->getValue("BasicKernel_L2NormBetweenKernels")); testParameter->kernelsToTest = readKernelList(input); testParameter->timeSteps = StringUtil::toIntVector(input->getValue("Timesteps_L2NormBetweenKernels")); testParameter->normalizeData = StringUtil::toStringVector(input->getValue("NormalizeData_L2Norm")); @@ -324,7 +325,7 @@ std::vector<KernelType> ConfigFileReader::readKernelList(std::shared_ptr<input:: { if (StringUtil::toBool(input->getValue("L2NormBetweenKernelsTest"))) { std::vector<std::string> kernelList = StringUtil::toStringVector(input->getValue("KernelsToTest")); - std::string beginnKernel = StringUtil::toString(input->getValue("BasicKernel_L2NormBetweenKernels")); + std::string beginnKernel = input->getValue("BasicKernel_L2NormBetweenKernels"); bool basicKernelInKernelList = false; for (int i = 0; i < kernelList.size(); i++) { if (kernelList.at(i) == beginnKernel) diff --git a/apps/gpu/tests/NumericalTests/Utilities/ConfigFileReaderNT/ConfigFileReaderNT.h b/apps/gpu/tests/NumericalTests/Utilities/ConfigFileReaderNT/ConfigFileReaderNT.h index 90bb9b53979b9165704552864ff2a7f14fba88ee..50794d4adc9b201aef2cfd3965e605f928c2fca0 100644 --- a/apps/gpu/tests/NumericalTests/Utilities/ConfigFileReaderNT/ConfigFileReaderNT.h +++ b/apps/gpu/tests/NumericalTests/Utilities/ConfigFileReaderNT/ConfigFileReaderNT.h @@ -8,6 +8,7 @@ #include <memory> #include <string> +#include <vector> class KernelMapper; diff --git a/apps/gpu/tests/NumericalTests/Utilities/LogFileWriter/LogFileWriterImp.cpp b/apps/gpu/tests/NumericalTests/Utilities/LogFileWriter/LogFileWriterImp.cpp index d9f03bbc0611b3f9260d837ecb78f29fbcff9b8e..f8aa2c5ed87d752457610136f3f91551b5a300c2 100644 --- a/apps/gpu/tests/NumericalTests/Utilities/LogFileWriter/LogFileWriterImp.cpp +++ b/apps/gpu/tests/NumericalTests/Utilities/LogFileWriter/LogFileWriterImp.cpp @@ -12,7 +12,7 @@ #include <helper_functions.h> #include <iomanip> #include <ctime> -#include <experimental/filesystem> +#include <filesystem> LogFileWriterImp::LogFileWriterImp(std::shared_ptr<LogFileHead> logFileHead, std::shared_ptr<BasicSimulationInfo> basicSimInfo, std::shared_ptr<BasicTestLogFileInformation> basicTestInfo, std::vector<std::shared_ptr<TestLogFileInformation> > testLogFiles, std::shared_ptr<LogFileTimeInformation> logFileTimeInfo, std::shared_ptr<SimulationLogFileInformation> simLogInfo, KernelType kernel, double viscosity) : viscosity(viscosity) { @@ -60,9 +60,9 @@ std::string LogFileWriterImp::buildFilePath(std::string basicFilePath) std::ostringstream filePath; filePath << basicFilePath << simLogInfo->getFilePathExtension().at(0) << "/viscosity_" << viscosity << "/" << simLogInfo->getFilePathExtension().at(1) << "/" << kernelName; - std::experimental::filesystem::path dir(filePath.str()); - if (!(std::experimental::filesystem::exists(dir))) - std::experimental::filesystem::create_directories(dir); + std::filesystem::path dir(filePath.str()); + if (!(std::filesystem::exists(dir))) + std::filesystem::create_directories(dir); filePath << "/logfile_" << calcDateAndTime() << "_" << kernelName << "_vis_" << viscosity << ".txt"; return filePath.str(); diff --git a/apps/gpu/tests/NumericalTests/Utilities/NumericalTestFactory/NumericalTestFactoryImp.cpp b/apps/gpu/tests/NumericalTests/Utilities/NumericalTestFactory/NumericalTestFactoryImp.cpp index 4ff8c9f502bf23f36e284624b3b5b936e4ec05e0..009f17d611ba9a60cb8ee697b4a9e2c55ab9619b 100644 --- a/apps/gpu/tests/NumericalTests/Utilities/NumericalTestFactory/NumericalTestFactoryImp.cpp +++ b/apps/gpu/tests/NumericalTests/Utilities/NumericalTestFactory/NumericalTestFactoryImp.cpp @@ -14,7 +14,7 @@ #include "Simulations/TaylorGreenVortexUx/SimulationParameter/SimulationParameterTaylorGreenVortexUx.h" #include "Simulations/TaylorGreenVortexUz/SimulationParameter/SimulationParameterTaylorGreenVortexUz.h" -#include "Simulations/TaylorGreenVortexUz/LogFileInformation/LogFileInformationTaylorGreenvortexUz.h" +#include "Simulations/TaylorGreenVortexUz/LogFileInformation/LogFileInformationTaylorGreenVortexUz.h" #include "Simulations/TaylorGreenVortexUz/SimulationInfo/SimulationInfoTaylorGreenVortexUz.h" #include "Simulations/TaylorGreenVortexUz/AnalyticalResults/AnalyticalResultsTaylorGreenVortexUz.h" #include "Simulations/TaylorGreenVortexUz/InitialConditions/InitialConditionTaylorGreenVortexUz.h" diff --git a/apps/gpu/tests/NumericalTests/Utilities/SimulationParameter/SimulationParameterImp.cpp b/apps/gpu/tests/NumericalTests/Utilities/SimulationParameter/SimulationParameterImp.cpp index 6160e93a7007e32bba6c4e3607b59588bab5ddb0..870aab755f1981bb4ad29391ca752a8786c5d279 100644 --- a/apps/gpu/tests/NumericalTests/Utilities/SimulationParameter/SimulationParameterImp.cpp +++ b/apps/gpu/tests/NumericalTests/Utilities/SimulationParameter/SimulationParameterImp.cpp @@ -5,7 +5,7 @@ #include "Utilities/Structs/BasicSimulationParameterStruct.h" #include "Utilities/Structs/GridInformationStruct.h" -#include <experimental/filesystem> +#include <filesystem> SimulationParameterImp::SimulationParameterImp(KernelType kernel, double viscosity, std::shared_ptr<BasicSimulationParameterStruct> basicSimPara, std::shared_ptr<GridInformationStruct> gridInfo) : viscosity(viscosity) @@ -25,9 +25,9 @@ SimulationParameterImp::SimulationParameterImp(KernelType kernel, double viscosi void SimulationParameterImp::generateFileDirectionInMyStystem(std::string filePath) { - std::experimental::filesystem::path dir(filePath); - if (!(std::experimental::filesystem::exists(dir))) - std::experimental::filesystem::create_directories(dir); + std::filesystem::path dir(filePath); + if (!(std::filesystem::exists(dir))) + std::filesystem::create_directories(dir); } double SimulationParameterImp::getViscosity() diff --git a/apps/gpu/tests/NumericalTests/Utilities/Test/Test.h b/apps/gpu/tests/NumericalTests/Utilities/Test/Test.h index 8fb9a928242a77ffb27d96ab992c278bdcdc8427..af180adb96e8d8f31ea746bb8ea55d16d170622c 100644 --- a/apps/gpu/tests/NumericalTests/Utilities/Test/Test.h +++ b/apps/gpu/tests/NumericalTests/Utilities/Test/Test.h @@ -5,6 +5,7 @@ #include "TestStatus.h" #include <vector> +#include <string> class Test : public SimulationObserver { diff --git a/gpu.cmake b/gpu.cmake index be8b91477759fb264b8cce2b252365361ea14c0f..e9f5f697d5df8655e32dc5b5a4080e92a9c4508f 100644 --- a/gpu.cmake +++ b/gpu.cmake @@ -1,8 +1,4 @@ -if(UNIX) - set(CMAKE_CXX_STANDARD 14) -endif() - ############################################################# ### CUDAPATH ### ############################################################# @@ -147,6 +143,8 @@ ENDIF() ############################################################# if(VF.BUILD_NUMERIC_TESTS) + set(CMAKE_CXX_STANDARD 17) + add_subdirectory(3rdParty/fftw/fftw-3.3.7) add_subdirectory(3rdParty/googletest) add_subdirectory(apps/gpu/tests/NumericalTests)