From ea3f50aedfaf0c94c4878204d3ad566a68420b98 Mon Sep 17 00:00:00 2001 From: peters <peters@irmb.tu-bs.de> Date: Tue, 15 Jun 2021 17:52:13 +0200 Subject: [PATCH] CleanUp Parameter. --- src/basics/Core/Input/ConfigData/ConfigData.h | 185 -- .../Core/Input/ConfigData/ConfigDataImp.cpp | 834 --------- .../Core/Input/ConfigData/ConfigDataImp.h | 447 ----- .../ConfigFileReader/ConfigFileReader.cpp | 262 --- .../Input/ConfigFileReader/ConfigFileReader.h | 22 - .../Core/Input/ConfigInput/ConfigInput.cpp | 222 --- .../Core/Input/ConfigInput/ConfigInput.h | 48 - src/basics/Core/Input/Input.cpp | 24 - src/basics/Core/Input/Input.h | 24 - src/basics/Core/Input/JsonInput/JsonInput.cpp | 67 - src/basics/Core/Input/JsonInput/JsonInput.h | 30 - .../GPU/CudaMemoryManager.cpp | 2 + src/gpu/VirtualFluids_GPU/LBM/LB.h | 3 +- src/gpu/VirtualFluids_GPU/LBM/Simulation.cpp | 5 - .../VirtualFluids_GPU/Parameter/Parameter.cpp | 1335 +++++--------- .../VirtualFluids_GPU/Parameter/Parameter.h | 1572 +++++++++-------- 16 files changed, 1192 insertions(+), 3890 deletions(-) delete mode 100644 src/basics/Core/Input/ConfigData/ConfigData.h delete mode 100644 src/basics/Core/Input/ConfigData/ConfigDataImp.cpp delete mode 100644 src/basics/Core/Input/ConfigData/ConfigDataImp.h delete mode 100644 src/basics/Core/Input/ConfigFileReader/ConfigFileReader.cpp delete mode 100644 src/basics/Core/Input/ConfigFileReader/ConfigFileReader.h delete mode 100644 src/basics/Core/Input/ConfigInput/ConfigInput.cpp delete mode 100644 src/basics/Core/Input/ConfigInput/ConfigInput.h delete mode 100644 src/basics/Core/Input/Input.cpp delete mode 100644 src/basics/Core/Input/Input.h delete mode 100644 src/basics/Core/Input/JsonInput/JsonInput.cpp delete mode 100644 src/basics/Core/Input/JsonInput/JsonInput.h diff --git a/src/basics/Core/Input/ConfigData/ConfigData.h b/src/basics/Core/Input/ConfigData/ConfigData.h deleted file mode 100644 index 44d505576..000000000 --- a/src/basics/Core/Input/ConfigData/ConfigData.h +++ /dev/null @@ -1,185 +0,0 @@ -#ifndef CONFIGDATA_H -#define CONFIGDATA_H - -#include "../../DataTypes.h" - -#include <memory> -#include <vector> - -class ConfigData -{ -public: - virtual ~ConfigData() = default; - - virtual real getViscosity() = 0; - virtual uint getNumberOfDevices() = 0; - virtual std::vector<uint> getDevices() = 0; - virtual std::string getOutputPath() = 0; - virtual std::string getPrefix() = 0; - virtual std::string getGridPath() = 0; - virtual bool getPrintOutputFiles() = 0; - virtual bool getGeometryValues() = 0; - virtual bool getCalc2ndOrderMoments() = 0; - virtual bool getCalc3rdOrderMoments() = 0; - virtual bool getCalcHighOrderMoments() = 0; - virtual bool getReadGeo() = 0; - virtual bool getCalcMedian() = 0; - virtual bool getCalcDragLift() = 0; - virtual bool getCalcCp() = 0; - virtual bool getWriteVeloASCIIfiles() = 0; - virtual bool getCalcPlaneConc() = 0; - virtual bool getConcFile() = 0; - virtual bool getStreetVelocityFile() = 0; - virtual bool getUseMeasurePoints() = 0; - virtual bool getUseWale() = 0; - virtual bool getUseInitNeq() = 0; - virtual bool getSimulatePorousMedia() = 0; - virtual uint getD3Qxx() = 0; - virtual uint getTEnd() = 0; - virtual uint getTOut() = 0; - virtual uint getTStartOut() = 0; - virtual uint getTimeCalcMedStart() = 0; - virtual uint getTimeCalcMedEnd() = 0; - virtual uint getPressInID() = 0; - virtual uint getPressOutID() = 0; - virtual uint getPressInZ() = 0; - virtual uint getPressOutZ() = 0; - virtual bool getDiffOn() = 0; - virtual uint getDiffMod() = 0; - virtual real getDiffusivity() = 0; - virtual real getTemperatureInit() = 0; - virtual real getTemperatureBC() = 0; - virtual real getVelocity() = 0; - virtual real getViscosityRatio() = 0; - virtual real getVelocityRatio() = 0; - virtual real getDensityRatio() = 0; - virtual real getPressRatio() = 0; - virtual real getRealX() = 0; - virtual real getRealY() = 0; - virtual real getFactorPressBC() = 0; - virtual std::string getGeometryFileC() = 0; - virtual std::string getGeometryFileM() = 0; - virtual std::string getGeometryFileF() = 0; - virtual uint getClockCycleForMP() = 0; - virtual uint getTimestepForMP() = 0; - virtual real getForcingX() = 0; - virtual real getForcingY() = 0; - virtual real getForcingZ() = 0; - virtual real getQuadricLimiterP() = 0; - virtual real getQuadricLimiterM() = 0; - virtual real getQuadricLimiterD() = 0; - virtual bool getCalcParticles() = 0; - virtual int getParticleBasicLevel() = 0; - virtual int getParticleInitLevel() = 0; - virtual int getNumberOfParticles() = 0; - virtual real getStartXHotWall() = 0; - virtual real getEndXHotWall() = 0; - virtual std::vector<std::string> getPossNeighborFilesX() = 0; - virtual std::vector<std::string> getPossNeighborFilesY() = 0; - virtual std::vector<std::string> getPossNeighborFilesZ() = 0; - // virtual std::vector<std::string> getPossNeighborFilesX() = 0; - // virtual std::vector<std::string> getPossNeighborFilesY() = 0; - // virtual std::vector<std::string> getPossNeighborFilesZ() = 0; - virtual int getTimeDoCheckPoint() = 0; - virtual int getTimeDoRestart() = 0; - virtual bool getDoCheckPoint() = 0; - virtual bool getDoRestart() = 0; - virtual uint getMaxLevel() = 0; - virtual std::vector<int> getGridX() = 0; - virtual std::vector<int> getGridY() = 0; - virtual std::vector<int> getGridZ() = 0; - virtual std::vector<int> getDistX() = 0; - virtual std::vector<int> getDistY() = 0; - virtual std::vector<int> getDistZ() = 0; - virtual std::vector<bool> getNeedInterface() = 0; - virtual std::string getMainKernel() = 0; - virtual bool getMultiKernelOn() = 0; - virtual std::vector<int> getMultiKernelLevel() = 0; - virtual std::vector<std::string> getMultiKernelName() = 0; - - virtual bool isViscosityInConfigFile() = 0; - virtual bool isNumberOfDevicesInConfigFile() = 0; - virtual bool isDevicesInConfigFile() = 0; - virtual bool isOutputPathInConfigFile() = 0; - virtual bool isPrefixInConfigFile() = 0; - virtual bool isGridPathInConfigFile() = 0; - virtual bool isPrintOutputFilesInConfigFile() = 0; - virtual bool isGeometryValuesInConfigFile() = 0; - virtual bool isCalc2ndOrderMomentsInConfigFile() = 0; - virtual bool isCalc3rdOrderMomentsInConfigFile() = 0; - virtual bool isCalcHighOrderMomentsInConfigFile() = 0; - virtual bool isReadGeoInConfigFile() = 0; - virtual bool isCalcMedianInConfigFile() = 0; - virtual bool isCalcDragLiftInConfigFile() = 0; - virtual bool isCalcCpInConfigFile() = 0; - virtual bool isWriteVeloASCIIfilesInConfigFile() = 0; - virtual bool isCalcPlaneConcInConfigFile() = 0; - virtual bool isConcFileInConfigFile() = 0; - virtual bool isStreetVelocityFileInConfigFile() = 0; - virtual bool isUseMeasurePointsInConfigFile() = 0; - virtual bool isUseWaleInConfigFile() = 0; - virtual bool isUseInitNeqInConfigFile() = 0; - virtual bool isSimulatePorousMediaInConfigFile() = 0; - virtual bool isD3QxxInConfigFile() = 0; - virtual bool isTEndInConfigFile() = 0; - virtual bool isTOutInConfigFile() = 0; - virtual bool isTStartOutInConfigFile() = 0; - virtual bool isTimeCalcMedStartInConfigFile() = 0; - virtual bool isTimeCalcMedEndInConfigFile() = 0; - virtual bool isPressInIDInConfigFile() = 0; - virtual bool isPressOutIDInConfigFile() = 0; - virtual bool isPressInZInConfigFile() = 0; - virtual bool isPressOutZInConfigFile() = 0; - virtual bool isDiffOnInConfigFile() = 0; - virtual bool isDiffModInConfigFile() = 0; - virtual bool isDiffusivityInConfigFile() = 0; - virtual bool isTemperatureInitInConfigFile() = 0; - virtual bool isTemperatureBCInConfigFile() = 0; - // virtual bool isViscosityInConfigFile() = 0; - virtual bool isVelocityInConfigFile() = 0; - virtual bool isViscosityRatioInConfigFile() = 0; - virtual bool isVelocityRatioInConfigFile() = 0; - virtual bool isDensityRatioInConfigFile() = 0; - virtual bool isPressRatioInConfigFile() = 0; - virtual bool isRealXInConfigFile() = 0; - virtual bool isRealYInConfigFile() = 0; - virtual bool isFactorPressBCInConfigFile() = 0; - virtual bool isGeometryFileCInConfigFile() = 0; - virtual bool isGeometryFileMInConfigFile() = 0; - virtual bool isGeometryFileFInConfigFile() = 0; - virtual bool isClockCycleForMPInConfigFile() = 0; - virtual bool isTimestepForMPInConfigFile() = 0; - virtual bool isForcingXInConfigFile() = 0; - virtual bool isForcingYInConfigFile() = 0; - virtual bool isForcingZInConfigFile() = 0; - virtual bool isQuadricLimiterPInConfigFile() = 0; - virtual bool isQuadricLimiterMInConfigFile() = 0; - virtual bool isQuadricLimiterDInConfigFile() = 0; - virtual bool isCalcParticlesInConfigFile() = 0; - virtual bool isParticleBasicLevelInConfigFile() = 0; - virtual bool isParticleInitLevelInConfigFile() = 0; - virtual bool isNumberOfParticlesInConfigFile() = 0; - virtual bool isNeighborWSBInConfigFile() = 0; - virtual bool isStartXHotWallInConfigFile() = 0; - virtual bool isEndXHotWallInConfigFile() = 0; - virtual bool isPossNeighborFilesXInConfigFile() = 0; - virtual bool isPossNeighborFilesYInConfigFile() = 0; - virtual bool isPossNeighborFilesZInConfigFile() = 0; - virtual bool isTimeDoCheckPointInConfigFile() = 0; - virtual bool isTimeDoRestartInConfigFile() = 0; - virtual bool isDoCheckPointInConfigFile() = 0; - virtual bool isDoRestartInConfigFile() = 0; - virtual bool isMaxLevelInConfigFile() = 0; - virtual bool isGridXInConfigFile() = 0; - virtual bool isGridYInConfigFile() = 0; - virtual bool isGridZInConfigFile() = 0; - virtual bool isDistXInConfigFile() = 0; - virtual bool isDistYInConfigFile() = 0; - virtual bool isDistZInConfigFile() = 0; - virtual bool isNeedInterfaceInConfigFile() = 0; - virtual bool isMainKernelInConfigFile() = 0; - virtual bool isMultiKernelOnInConfigFile() = 0; - virtual bool isMultiKernelLevelInConfigFile() = 0; - virtual bool isMultiKernelNameInConfigFile() = 0; -}; -#endif diff --git a/src/basics/Core/Input/ConfigData/ConfigDataImp.cpp b/src/basics/Core/Input/ConfigData/ConfigDataImp.cpp deleted file mode 100644 index 0c53b3282..000000000 --- a/src/basics/Core/Input/ConfigData/ConfigDataImp.cpp +++ /dev/null @@ -1,834 +0,0 @@ -#include "ConfigDataImp.h" - -std::shared_ptr<ConfigDataImp> ConfigDataImp::getNewInstance() -{ - return std::shared_ptr<ConfigDataImp>(new ConfigDataImp()); -} - -real ConfigDataImp::getViscosity() { return this->viscosity; } - -uint ConfigDataImp::getNumberOfDevices() { return this->numberOfDevices; } - -std::vector<uint> ConfigDataImp::getDevices() { return this->devices; } - -std::string ConfigDataImp::getOutputPath() { return this->outputPath; } - -std::string ConfigDataImp::getPrefix() { return this->prefix; } - -std::string ConfigDataImp::getGridPath() { return this->gridPath; } - -bool ConfigDataImp::getPrintOutputFiles() { return this->printOutputFiles; } - -bool ConfigDataImp::getGeometryValues() { return this->geometryValues; } - -bool ConfigDataImp::getCalc2ndOrderMoments() { return this->calc2ndOrderMoments; } - -bool ConfigDataImp::getCalc3rdOrderMoments() { return this->calc3rdOrderMoments; } - -bool ConfigDataImp::getCalcHighOrderMoments() { return this->calcHighOrderMoments; } - -bool ConfigDataImp::getReadGeo() { return this->readGeo; } - -bool ConfigDataImp::getCalcMedian() { return this->calcMedian; } - -bool ConfigDataImp::getCalcDragLift() { return this->calcDragLift; } - -bool ConfigDataImp::getCalcCp() { return this->calcCp; } - -bool ConfigDataImp::getWriteVeloASCIIfiles() { return this->writeVeloASCIIfiles; } - -bool ConfigDataImp::getCalcPlaneConc() { return this->calcPlaneConc; } - -bool ConfigDataImp::getConcFile() { return this->concFile; } - -bool ConfigDataImp::getStreetVelocityFile() { return this->streetVelocityFile; } - -bool ConfigDataImp::getUseMeasurePoints() { return this->useMeasurePoints; } - -bool ConfigDataImp::getUseWale() { return this->useWale; } - -bool ConfigDataImp::getUseInitNeq() { return this->useInitNeq; } - -bool ConfigDataImp::getSimulatePorousMedia() { return this->simulatePorousMedia; } - -uint ConfigDataImp::getD3Qxx() { return this->d3Qxx; } - -uint ConfigDataImp::getTEnd() { return this->tEnd; } - -uint ConfigDataImp::getTOut() { return this->tOut; } - -uint ConfigDataImp::getTStartOut() { return this->tStartOut; } - -uint ConfigDataImp::getTimeCalcMedStart() { return this->timeCalcMedStart; } - -uint ConfigDataImp::getTimeCalcMedEnd() { return this->timeCalcMedEnd; } - -uint ConfigDataImp::getPressInID() { return this->pressInID; } - -uint ConfigDataImp::getPressOutID() { return this->pressOutID; } - -uint ConfigDataImp::getPressInZ() { return this->pressInZ; } - -uint ConfigDataImp::getPressOutZ() { return this->pressOutZ; } - -bool ConfigDataImp::getDiffOn() { return this->diffOn; } - -uint ConfigDataImp::getDiffMod() { return this->diffMod; } - -real ConfigDataImp::getDiffusivity() { return this->diffusivity; } - -real ConfigDataImp::getTemperatureInit() { return this->temperatureInit; } - -real ConfigDataImp::getTemperatureBC() { return this->temperatureBC; } - -real ConfigDataImp::getVelocity() { return this->velocity; } - -real ConfigDataImp::getViscosityRatio() { return this->viscosityRatio; } - -real ConfigDataImp::getVelocityRatio() { return this->velocityRatio; } - -real ConfigDataImp::getDensityRatio() { return this->densityRatio; } - -real ConfigDataImp::getPressRatio() { return this->pressRatio; } - -real ConfigDataImp::getRealX() { return this->realX; } - -real ConfigDataImp::getRealY() { return this->realY; } - -real ConfigDataImp::getFactorPressBC() { return this->factorPressBC; } - -std::string ConfigDataImp::getGeometryFileC() { return this->geometryFileC; } - -std::string ConfigDataImp::getGeometryFileM() { return this->geometryFileM; } - -std::string ConfigDataImp::getGeometryFileF() { return this->geometryFileF; } - -uint ConfigDataImp::getClockCycleForMP() { return this->clockCycleForMP; } - -uint ConfigDataImp::getTimestepForMP() { return this->timestepForMP; } - -real ConfigDataImp::getForcingX() { return this->forcingX; } - -real ConfigDataImp::getForcingY() { return this->forcingY; } - -real ConfigDataImp::getForcingZ() { return this->forcingZ; } - -real ConfigDataImp::getQuadricLimiterP() { return this->quadricLimiterP; } - -real ConfigDataImp::getQuadricLimiterM() { return this->quadricLimiterM; } - -real ConfigDataImp::getQuadricLimiterD() { return this->quadricLimiterD; } - -bool ConfigDataImp::getCalcParticles() { return this->calcParticles; } - -int ConfigDataImp::getParticleBasicLevel() { return this->particleBasicLevel; } - -int ConfigDataImp::getParticleInitLevel() { return this->particleInitLevel; } - -int ConfigDataImp::getNumberOfParticles() { return this->numberOfParticles; } - -real ConfigDataImp::getStartXHotWall() { return this->startXHotWall; } - -real ConfigDataImp::getEndXHotWall() { return this->endXHotWall; } - -std::vector<std::string> ConfigDataImp::getPossNeighborFilesX() { return this->possNeighborFilesX; } - -std::vector<std::string> ConfigDataImp::getPossNeighborFilesY() { return this->possNeighborFilesY; } - -std::vector<std::string> ConfigDataImp::getPossNeighborFilesZ() { return this->possNeighborFilesZ; } - -int ConfigDataImp::getTimeDoCheckPoint() { return this->timeDoCheckPoint; } - -int ConfigDataImp::getTimeDoRestart() { return this->timeDoRestart; } - -bool ConfigDataImp::getDoCheckPoint() { return this->doCheckPoint; } - -bool ConfigDataImp::getDoRestart() { return this->doRestart; } - -uint ConfigDataImp::getMaxLevel() { return this->maxLevel; } - -std::vector<int> ConfigDataImp::getGridX() { return this->gridX; } - -std::vector<int> ConfigDataImp::getGridY() { return this->gridY; } - -std::vector<int> ConfigDataImp::getGridZ() { return this->gridZ; } - -std::vector<int> ConfigDataImp::getDistX() { return this->distX; } - -std::vector<int> ConfigDataImp::getDistY() { return this->distY; } - -std::vector<int> ConfigDataImp::getDistZ() { return this->distZ; } - -std::vector<bool> ConfigDataImp::getNeedInterface() { return this->needInterface; } - -std::string ConfigDataImp::getMainKernel() { return this->mainKernel; } - -bool ConfigDataImp::getMultiKernelOn() { return this->multiKernelOn; } - -std::vector<int> ConfigDataImp::getMultiKernelLevel() { return this->multiKernelLevel; } - -std::vector<std::string> ConfigDataImp::getMultiKernelName() { return this->multiKernelName; } - -void ConfigDataImp::setViscosity(real viscosity) -{ - this->viscosity = viscosity; - this->isViscosity = true; -} - -void ConfigDataImp::setNumberOfDevices(uint numberOfDevices) -{ - this->numberOfDevices = numberOfDevices; - this->isNumberOfDevices = true; -} - -void ConfigDataImp::setDevices(std::vector<uint> devices) -{ - this->devices = devices; - this->isDevices = true; -} - -void ConfigDataImp::setOutputPath(std::string outputPath) -{ - this->outputPath = outputPath; - this->isOutputPath = true; -} - -void ConfigDataImp::setPrefix(std::string prefix) -{ - this->prefix = prefix; - this->isPrefix = true; -} - -void ConfigDataImp::setGridPath(std::string gridPath) -{ - this->gridPath = gridPath; - this->isGridPath = true; -} - -void ConfigDataImp::setPrintOutputFiles(bool printOutputFiles) -{ - this->printOutputFiles = printOutputFiles; - this->isPrintOutputFiles = true; -} - -void ConfigDataImp::setGeometryValues(bool geometryValues) -{ - this->geometryValues = geometryValues; - this->isGeometryValues = true; -} - -void ConfigDataImp::setCalc2ndOrderMoments(bool calc2ndOrderMoments) -{ - this->calc2ndOrderMoments = calc2ndOrderMoments; - this->isCalc2ndOrderMoments = true; -} - -void ConfigDataImp::setCalc3rdOrderMoments(bool calc3rdOrderMoments) -{ - this->calc3rdOrderMoments = calc3rdOrderMoments; - this->isCalc3rdOrderMoments = true; -} - -void ConfigDataImp::setCalcHighOrderMoments(bool calcHighOrderMoments) -{ - this->calcHighOrderMoments = calcHighOrderMoments; - this->isCalcHighOrderMoments = true; -} - -void ConfigDataImp::setReadGeo(bool readGeo) -{ - this->readGeo = readGeo; - this->isReadGeo = true; -} - -void ConfigDataImp::setCalcMedian(bool calcMedian) -{ - this->calcMedian = calcMedian; - this->isCalcMedian = true; -} - -void ConfigDataImp::setCalcDragLift(bool calcDragLift) -{ - this->calcDragLift = calcDragLift; - this->isCalcDragLift = true; -} - -void ConfigDataImp::setCalcCp(bool calcCp) -{ - this->calcCp = calcCp; - this->isCalcCp = true; -} - -void ConfigDataImp::setWriteVeloASCIIfiles(bool writeVeloASCIIfiles) -{ - this->writeVeloASCIIfiles = writeVeloASCIIfiles; - this->isWriteVeloASCII = true; -} - -void ConfigDataImp::setCalcPlaneConc(bool calcPlaneConc) -{ - this->calcPlaneConc = calcPlaneConc; - this->isCalcPlaneConc = true; -} - -void ConfigDataImp::setConcFile(bool concFile) -{ - this->concFile = concFile; - this->isConcFile = true; -} - -void ConfigDataImp::setStreetVelocityFile(bool streetVelocityFile) -{ - this->streetVelocityFile = streetVelocityFile; - this->isStreetVelocityFile = true; -} - -void ConfigDataImp::setUseMeasurePoints(bool useMeasurePoints) -{ - this->useMeasurePoints = useMeasurePoints; - this->isUseMeasurePoints = true; -} - -void ConfigDataImp::setUseWale(bool useWale) -{ - this->useWale = useWale; - this->isUseWale = true; -} - -void ConfigDataImp::setUseInitNeq(bool useInitNeq) -{ - this->useInitNeq = useInitNeq; - this->isUseInitNeq = true; -} - -void ConfigDataImp::setSimulatePorousMedia(bool simulatePorousMedia) -{ - this->simulatePorousMedia = simulatePorousMedia; - this->isSimulatePorousMedia = true; -} - -void ConfigDataImp::setD3Qxx(uint d3Qxx) -{ - this->d3Qxx = d3Qxx; - this->isD3Qxx = true; -} - -void ConfigDataImp::setTEnd(uint tEnd) -{ - this->tEnd = tEnd; - this->isTEnd = true; -} - -void ConfigDataImp::setTOut(uint tOut) -{ - this->tOut = tOut; - this->isTOut = true; -} - -void ConfigDataImp::setTStartOut(uint tStartOut) -{ - this->tStartOut = tStartOut; - this->isTStartOut = true; -} - -void ConfigDataImp::setTimeCalcMedStart(uint timeCalcMedStart) -{ - this->timeCalcMedStart = timeCalcMedStart; - this->isTimeCalcMedStart = true; -} - -void ConfigDataImp::setTimeCalcMedEnd(uint timeCalcMedEnd) -{ - this->timeCalcMedEnd = timeCalcMedEnd; - this->isTimeCalcMedEnd = true; -} - -void ConfigDataImp::setPressInID(uint pressInID) -{ - this->pressInID = pressInID; - this->isPressInID = true; -} - -void ConfigDataImp::setPressOutID(uint pressOutID) -{ - this->pressOutID = pressOutID; - this->isPressOutID = true; -} - -void ConfigDataImp::setPressInZ(uint pressInZ) -{ - this->pressInZ = pressInZ; - this->isPressInZ = true; -} - -void ConfigDataImp::setPressOutZ(uint pressOutZ) -{ - this->pressOutZ = pressOutZ; - this->isPressOutZ = true; -} - -void ConfigDataImp::setDiffOn(bool diffOn) -{ - this->diffOn = diffOn; - this->isDiffOn = true; -} - -void ConfigDataImp::setDiffMod(uint diffMod) -{ - this->diffMod = diffMod; - this->isDiffMod = true; -} - -void ConfigDataImp::setDiffusivity(real diffusivity) -{ - this->diffusivity = diffusivity; - this->isDiffusivity = true; -} - -void ConfigDataImp::setTemperatureInit(real temperatureInit) -{ - this->temperatureInit = temperatureInit; - this->isTemperatureInit = true; -} - -void ConfigDataImp::setTemperatureBC(real temperatureBC) -{ - this->temperatureBC = temperatureBC; - this->isTemperatureBC = true; -} - -// void ConfigDataImp::setViscosity(real viscosity) -//{ -// this->viscosity = viscosity; -// this->isViscosity = true; -//} - -void ConfigDataImp::setVelocity(real velocity) -{ - this->velocity = velocity; - this->isVelocity = true; -} - -void ConfigDataImp::setViscosityRatio(real viscosityRatio) -{ - this->viscosityRatio = viscosityRatio; - this->isViscosityRatio = true; -} - -void ConfigDataImp::setVelocityRatio(real velocityRatio) -{ - this->velocityRatio = velocityRatio; - this->isVelocityRatio = true; -} - -void ConfigDataImp::setDensityRatio(real densityRatio) -{ - this->densityRatio = densityRatio; - this->isDensityRatio = true; -} - -void ConfigDataImp::setPressRatio(real pressRatio) -{ - this->pressRatio = pressRatio; - this->isPressRatio = true; -} - -void ConfigDataImp::setRealX(real realX) -{ - this->realX = realX; - this->isRealX = true; -} - -void ConfigDataImp::setRealY(real realY) -{ - this->realY = realY; - this->isRealY = true; -} - -void ConfigDataImp::setFactorPressBC(real factorPressBC) -{ - this->factorPressBC = factorPressBC; - this->isFactorPressBC = true; -} - -void ConfigDataImp::setGeometryFileC(std::string geometryFileC) -{ - this->geometryFileC = geometryFileC; - this->isGeometryFileC = true; -} - -void ConfigDataImp::setGeometryFileM(std::string geometryFileM) -{ - this->geometryFileM = geometryFileM; - this->isGeometryFileM = true; -} - -void ConfigDataImp::setGeometryFileF(std::string geometryFileF) -{ - this->geometryFileF = geometryFileF; - this->isGeometryFileF = true; -} - -void ConfigDataImp::setClockCycleForMP(uint clockCycleForMP) -{ - this->clockCycleForMP = clockCycleForMP; - this->isClockCycleForMP = true; -} - -void ConfigDataImp::setTimestepForMP(uint timestepForMP) -{ - this->timestepForMP = timestepForMP; - this->isTimestepForMP = true; -} - -void ConfigDataImp::setForcingX(real forcingX) -{ - this->forcingX = forcingX; - this->isForcingX = true; -} - -void ConfigDataImp::setForcingY(real forcingY) -{ - this->forcingY = forcingY; - this->isForcingY = true; -} - -void ConfigDataImp::setForcingZ(real forcingZ) -{ - this->forcingZ = forcingZ; - this->isForcingZ = true; -} - -void ConfigDataImp::setQuadricLimiterP(real quadricLimiterP) -{ - this->quadricLimiterP = quadricLimiterP; - this->isQuadricLimiterP = true; -} - -void ConfigDataImp::setQuadricLimiterM(real quadricLimiterM) -{ - this->quadricLimiterM = quadricLimiterM; - this->isQuadricLimiterM = true; -} - -void ConfigDataImp::setQuadricLimiterD(real quadricLimiterD) -{ - this->quadricLimiterD = quadricLimiterD; - this->isQuadricLimiterD = true; -} - -void ConfigDataImp::setCalcParticles(bool calcParticles) -{ - this->calcParticles = calcParticles; - this->isCalcParticles = true; -} - -void ConfigDataImp::setParticleBasicLevel(int particleBasicLevel) -{ - this->particleBasicLevel = particleBasicLevel; - this->isParticleBasicLevel = true; -} - -void ConfigDataImp::setParticleInitLevel(int particleInitLevel) -{ - this->particleInitLevel = particleInitLevel; - this->isParticleInitLevel = true; -} - -void ConfigDataImp::setNumberOfParticles(int numberOfParticles) -{ - this->numberOfParticles = numberOfParticles; - this->isNumberOfParticles = true; -} - -void ConfigDataImp::setStartXHotWall(real startXHotWall) -{ - this->startXHotWall = startXHotWall; - this->isStartXHotWall = true; -} - -void ConfigDataImp::setEndXHotWall(real endXHotWall) -{ - this->endXHotWall = endXHotWall; - this->isEndXHotWall = true; -} - -void ConfigDataImp::setPossNeighborFilesX(const std::vector<std::string> &possNeighborFilesX) -{ - this->possNeighborFilesX = possNeighborFilesX; - this->isPossNeighborFilesX = true; -} - -void ConfigDataImp::setPossNeighborFilesY(const std::vector<std::string> &possNeighborFilesY) -{ - this->possNeighborFilesY = possNeighborFilesY; - this->isPossNeighborFilesY = true; -} - -void ConfigDataImp::setPossNeighborFilesZ(const std::vector<std::string> &possNeighborFilesZ) -{ - this->possNeighborFilesZ = possNeighborFilesZ; - this->isPossNeighborFilesZ = true; -} - -void ConfigDataImp::setTimeDoCheckPoint(int timeDoCheckPoint) -{ - this->timeDoCheckPoint = timeDoCheckPoint; - this->isTimeDoCheckPoint = true; -} - -void ConfigDataImp::setTimeDoRestart(int timeDoRestart) -{ - this->timeDoRestart = timeDoRestart; - this->isTimeDoRestart = true; -} - -void ConfigDataImp::setDoCheckPoint(bool doCheckPoint) -{ - this->doCheckPoint = doCheckPoint; - this->isDoCheckPoint = true; -} - -void ConfigDataImp::setDoRestart(bool doRestart) -{ - this->doRestart = doRestart; - this->isDoRestart = true; -} - -void ConfigDataImp::setMaxLevel(uint maxLevel) -{ - this->maxLevel = maxLevel; - this->isMaxLevel = true; -} - -void ConfigDataImp::setGridX(const std::vector<int> &gridX) -{ - this->gridX = gridX; - this->isGridX = true; -} - -void ConfigDataImp::setGridY(const std::vector<int> &gridY) -{ - this->gridY = gridY; - this->isGridY = true; -} - -void ConfigDataImp::setGridZ(const std::vector<int> &gridZ) -{ - this->gridZ = gridZ; - this->isGridZ = true; -} - -void ConfigDataImp::setDistX(const std::vector<int> &distX) -{ - this->distX = distX; - this->isDistX = true; -} - -void ConfigDataImp::setDistY(const std::vector<int> &distY) -{ - this->distY = distY; - this->isDistY = true; -} - -void ConfigDataImp::setDistZ(const std::vector<int> &distZ) -{ - this->distZ = distZ; - this->isDistZ = true; -} - -void ConfigDataImp::setNeedInterface(const std::vector<bool> &needInterface) -{ - this->needInterface = needInterface; - this->isNeedInterface = true; -} - -void ConfigDataImp::setMainKernel(const std::string &mainKernel) -{ - this->mainKernel = mainKernel; - this->isMainKernel = true; -} - -void ConfigDataImp::setMultiKernelOn(bool multiKernelOn) -{ - this->multiKernelOn = multiKernelOn; - this->isMultiKernelOn = true; -} - -void ConfigDataImp::setMultiKernelLevel(const std::vector<int> &multiKernelLevel) -{ - this->multiKernelLevel = multiKernelLevel; - this->isMultiKernelLevel = true; -} - -void ConfigDataImp::setMultiKernelName(const std::vector<std::string> &multiKernelName) -{ - this->multiKernelName = multiKernelName; - this->isMultiKernelName = true; -} - -bool ConfigDataImp::isCalc2ndOrderMomentsInConfigFile() { return this->isCalc2ndOrderMoments; } - -bool ConfigDataImp::isCalc3rdOrderMomentsInConfigFile() { return this->isCalc2ndOrderMoments; } - -bool ConfigDataImp::isCalcHighOrderMomentsInConfigFile() { return this->isCalcHighOrderMoments; } - -bool ConfigDataImp::isReadGeoInConfigFile() { return this->isReadGeo; } - -bool ConfigDataImp::isCalcMedianInConfigFile() { return this->isCalcMedian; } - -bool ConfigDataImp::isCalcDragLiftInConfigFile() { return this->isCalcDragLift; } - -bool ConfigDataImp::isCalcCpInConfigFile() { return this->isCalcCp; } - -bool ConfigDataImp::isWriteVeloASCIIfilesInConfigFile() { return this->isWriteVeloASCII; } - -bool ConfigDataImp::isCalcPlaneConcInConfigFile() { return this->isCalcPlaneConc; } - -bool ConfigDataImp::isConcFileInConfigFile() { return this->isConcFile; } - -bool ConfigDataImp::isStreetVelocityFileInConfigFile() { return this->isStreetVelocityFile; } - -bool ConfigDataImp::isUseMeasurePointsInConfigFile() { return this->isUseMeasurePoints; } - -bool ConfigDataImp::isUseWaleInConfigFile() { return this->isUseWale; } - -bool ConfigDataImp::isUseInitNeqInConfigFile() { return this->isUseInitNeq; } - -bool ConfigDataImp::isSimulatePorousMediaInConfigFile() { return this->isSimulatePorousMedia; } - -bool ConfigDataImp::isD3QxxInConfigFile() { return this->isD3Qxx; } - -bool ConfigDataImp::isTEndInConfigFile() { return this->isTEnd; } - -bool ConfigDataImp::isTOutInConfigFile() { return this->isTOut; } - -bool ConfigDataImp::isTStartOutInConfigFile() { return this->isTStartOut; } - -bool ConfigDataImp::isTimeCalcMedStartInConfigFile() { return this->isTimeCalcMedStart; } - -bool ConfigDataImp::isTimeCalcMedEndInConfigFile() { return this->isTimeCalcMedEnd; } - -bool ConfigDataImp::isPressInIDInConfigFile() { return this->isPressInID; } - -bool ConfigDataImp::isPressOutIDInConfigFile() { return this->isPressOutID; } - -bool ConfigDataImp::isPressInZInConfigFile() { return this->isPressInZ; } - -bool ConfigDataImp::isPressOutZInConfigFile() { return this->isPressOutZ; } - -bool ConfigDataImp::isDiffOnInConfigFile() { return this->isDiffOn; } - -bool ConfigDataImp::isDiffModInConfigFile() { return this->isDiffMod; } - -bool ConfigDataImp::isDiffusivityInConfigFile() { return this->isDiffusivity; } - -bool ConfigDataImp::isTemperatureInitInConfigFile() { return this->isTemperatureInit; } - -bool ConfigDataImp::isTemperatureBCInConfigFile() { return this->isTemperatureBC; } - -bool ConfigDataImp::isViscosityInConfigFile() { return this->isViscosity; } - -bool ConfigDataImp::isNumberOfDevicesInConfigFile() { return this->isNumberOfDevices; } - -bool ConfigDataImp::isDevicesInConfigFile() { return this->isDevices; } - -bool ConfigDataImp::isOutputPathInConfigFile() { return this->isOutputPath; } - -bool ConfigDataImp::isPrefixInConfigFile() { return this->isPrefix; } - -bool ConfigDataImp::isGridPathInConfigFile() { return this->isGridPath; } - -bool ConfigDataImp::isPrintOutputFilesInConfigFile() { return this->isPrintOutputFiles; } - -bool ConfigDataImp::isGeometryValuesInConfigFile() { return this->isGeometryValues; } - -bool ConfigDataImp::isVelocityInConfigFile() { return this->isVelocity; } - -bool ConfigDataImp::isViscosityRatioInConfigFile() { return this->isViscosityRatio; } - -bool ConfigDataImp::isVelocityRatioInConfigFile() { return this->isVelocityRatio; } - -bool ConfigDataImp::isDensityRatioInConfigFile() { return this->isDensityRatio; } - -bool ConfigDataImp::isPressRatioInConfigFile() { return this->isPressRatio; } - -bool ConfigDataImp::isRealXInConfigFile() { return this->isRealX; } - -bool ConfigDataImp::isRealYInConfigFile() { return this->isRealY; } - -bool ConfigDataImp::isFactorPressBCInConfigFile() { return this->isFactorPressBC; } - -bool ConfigDataImp::isGeometryFileCInConfigFile() { return this->isGeometryFileC; } - -bool ConfigDataImp::isGeometryFileMInConfigFile() { return this->isGeometryFileM; } - -bool ConfigDataImp::isGeometryFileFInConfigFile() { return this->isGeometryFileF; } - -bool ConfigDataImp::isClockCycleForMPInConfigFile() { return this->isClockCycleForMP; } - -bool ConfigDataImp::isTimestepForMPInConfigFile() { return this->isTimestepForMP; } - -bool ConfigDataImp::isForcingXInConfigFile() { return this->isForcingX; } - -bool ConfigDataImp::isForcingYInConfigFile() { return this->isForcingY; } - -bool ConfigDataImp::isForcingZInConfigFile() { return this->isForcingZ; } - -bool ConfigDataImp::isQuadricLimiterPInConfigFile() { return this->isQuadricLimiterP; } - -bool ConfigDataImp::isQuadricLimiterMInConfigFile() { return this->isQuadricLimiterM; } - -bool ConfigDataImp::isQuadricLimiterDInConfigFile() { return this->isQuadricLimiterD; } - -bool ConfigDataImp::isCalcParticlesInConfigFile() { return this->isCalcParticles; } - -bool ConfigDataImp::isParticleBasicLevelInConfigFile() { return this->isParticleBasicLevel; } - -bool ConfigDataImp::isParticleInitLevelInConfigFile() { return this->isParticleInitLevel; } - -bool ConfigDataImp::isNumberOfParticlesInConfigFile() { return this->isNumberOfParticles; } - -bool ConfigDataImp::isNeighborWSBInConfigFile() { return this->isNeighborWSB; } - -bool ConfigDataImp::isStartXHotWallInConfigFile() { return this->isStartXHotWall; } - -bool ConfigDataImp::isEndXHotWallInConfigFile() { return this->isEndXHotWall; } - -bool ConfigDataImp::isPossNeighborFilesXInConfigFile() { return this->isPossNeighborFilesX; } - -bool ConfigDataImp::isPossNeighborFilesYInConfigFile() { return this->isPossNeighborFilesY; } - -bool ConfigDataImp::isPossNeighborFilesZInConfigFile() { return this->isPossNeighborFilesZ; } - -bool ConfigDataImp::isTimeDoCheckPointInConfigFile() { return this->isTimeDoCheckPoint; } - -bool ConfigDataImp::isTimeDoRestartInConfigFile() { return this->isTimeDoCheckPoint; } - -bool ConfigDataImp::isDoCheckPointInConfigFile() { return this->isDoCheckPoint; } - -bool ConfigDataImp::isDoRestartInConfigFile() { return this->isDoRestart; } - -bool ConfigDataImp::isMaxLevelInConfigFile() { return this->isMaxLevel; } - -bool ConfigDataImp::isGridXInConfigFile() { return this->isGridX; } - -bool ConfigDataImp::isGridYInConfigFile() { return this->isGridY; } - -bool ConfigDataImp::isGridZInConfigFile() { return this->isGridZ; } - -bool ConfigDataImp::isDistXInConfigFile() { return this->isDistX; } - -bool ConfigDataImp::isDistYInConfigFile() { return this->isDistY; } - -bool ConfigDataImp::isDistZInConfigFile() { return this->isDistZ; } - -bool ConfigDataImp::isNeedInterfaceInConfigFile() { return this->isNeedInterface; } - -bool ConfigDataImp::isMainKernelInConfigFile() { return this->isMainKernel; } - -bool ConfigDataImp::isMultiKernelOnInConfigFile() { return this->isMultiKernelOn; } - -bool ConfigDataImp::isMultiKernelLevelInConfigFile() { return this->isMultiKernelLevel; } - -bool ConfigDataImp::isMultiKernelNameInConfigFile() { return this->isMultiKernelName; } diff --git a/src/basics/Core/Input/ConfigData/ConfigDataImp.h b/src/basics/Core/Input/ConfigData/ConfigDataImp.h deleted file mode 100644 index 511ac4be1..000000000 --- a/src/basics/Core/Input/ConfigData/ConfigDataImp.h +++ /dev/null @@ -1,447 +0,0 @@ -#ifndef CONFIGDATAIMP_H -#define CONFIGDATAIMP_H - -#include "ConfigData.h" - -#include <memory> -#include <string> - -class ConfigDataImp : public ConfigData -{ -public: - static std::shared_ptr<ConfigDataImp> getNewInstance(); - - real getViscosity() override; - uint getNumberOfDevices() override; - std::vector<uint> getDevices() override; - std::string getOutputPath() override; - std::string getPrefix() override; - std::string getGridPath() override; - bool getPrintOutputFiles() override; - bool getGeometryValues() override; - bool getCalc2ndOrderMoments() override; - bool getCalc3rdOrderMoments() override; - bool getCalcHighOrderMoments() override; - bool getReadGeo() override; - bool getCalcMedian() override; - bool getCalcDragLift() override; - bool getCalcCp() override; - bool getWriteVeloASCIIfiles() override; - bool getCalcPlaneConc() override; - bool getConcFile() override; - bool getStreetVelocityFile() override; - bool getUseMeasurePoints() override; - bool getUseWale() override; - bool getUseInitNeq() override; - bool getSimulatePorousMedia() override; - uint getD3Qxx() override; - uint getTEnd() override; - uint getTOut() override; - uint getTStartOut() override; - uint getTimeCalcMedStart() override; - uint getTimeCalcMedEnd() override; - uint getPressInID() override; - uint getPressOutID() override; - uint getPressInZ() override; - uint getPressOutZ() override; - bool getDiffOn() override; - uint getDiffMod() override; - real getDiffusivity() override; - real getTemperatureInit() override; - real getTemperatureBC() override; - real getVelocity() override; - real getViscosityRatio() override; - real getVelocityRatio() override; - real getDensityRatio() override; - real getPressRatio() override; - real getRealX() override; - real getRealY() override; - real getFactorPressBC() override; - std::string getGeometryFileC() override; - std::string getGeometryFileM() override; - std::string getGeometryFileF() override; - uint getClockCycleForMP() override; - uint getTimestepForMP() override; - real getForcingX() override; - real getForcingY() override; - real getForcingZ() override; - real getQuadricLimiterP() override; - real getQuadricLimiterM() override; - real getQuadricLimiterD() override; - bool getCalcParticles() override; - int getParticleBasicLevel() override; - int getParticleInitLevel() override; - int getNumberOfParticles() override; - real getStartXHotWall() override; - real getEndXHotWall() override; - std::vector<std::string> getPossNeighborFilesX() override; - std::vector<std::string> getPossNeighborFilesY() override; - std::vector<std::string> getPossNeighborFilesZ() override; - // std::vector<std::string> getPossNeighborFilesX(); - // std::vector<std::string> getPossNeighborFilesY(); - // std::vector<std::string> getPossNeighborFilesZ(); - int getTimeDoCheckPoint() override; - int getTimeDoRestart() override; - bool getDoCheckPoint() override; - bool getDoRestart() override; - uint getMaxLevel() override; - std::vector<int> getGridX() override; - std::vector<int> getGridY() override; - std::vector<int> getGridZ() override; - std::vector<int> getDistX() override; - std::vector<int> getDistY() override; - std::vector<int> getDistZ() override; - std::vector<bool> getNeedInterface() override; - std::string getMainKernel() override; - bool getMultiKernelOn() override; - std::vector<int> getMultiKernelLevel() override; - std::vector<std::string> getMultiKernelName() override; - - void setViscosity(real viscosity); - void setNumberOfDevices(uint numberOfDevices); - void setDevices(std::vector<uint> devices); - void setOutputPath(std::string outputPath); - void setPrefix(std::string prefix); - void setGridPath(std::string gridPath); - void setPrintOutputFiles(bool printOutputFiles); - void setGeometryValues(bool geometryValues); - void setCalc2ndOrderMoments(bool calc2ndOrderMoments); - void setCalc3rdOrderMoments(bool calc3rdOrderMoments); - void setCalcHighOrderMoments(bool calcHighOrderMoment); - void setReadGeo(bool readGeo); - void setCalcMedian(bool calcMedian); - void setCalcDragLift(bool calcDragLift); - void setCalcCp(bool calcCp); - void setWriteVeloASCIIfiles(bool writeVeloASCIIfiles); - void setCalcPlaneConc(bool calcPlaneConc); - void setConcFile(bool concFile); - void setStreetVelocityFile(bool streetVelocityFile); - void setUseMeasurePoints(bool useMeasurePoints); - void setUseWale(bool useWale); - void setUseInitNeq(bool useInitNeq); - void setSimulatePorousMedia(bool simulatePorousMedia); - void setD3Qxx(uint d3Qxx); - void setTEnd(uint tEnd); - void setTOut(uint tOut); - void setTStartOut(uint tStartOut); - void setTimeCalcMedStart(uint timeCalcMedStart); - void setTimeCalcMedEnd(uint timeCalcMedEnd); - void setPressInID(uint pressInID); - void setPressOutID(uint pressOutID); - void setPressInZ(uint pressInZ); - void setPressOutZ(uint pressOutZ); - void setDiffOn(bool diffOn); - void setDiffMod(uint diffMod); - void setDiffusivity(real diffusivity); - void setTemperatureInit(real temperatureInit); - void setTemperatureBC(real temperatureBC); - // void setViscosity(real viscosity); - void setVelocity(real velocity); - void setViscosityRatio(real viscosityRatio); - void setVelocityRatio(real velocityRatio); - void setDensityRatio(real fensityRatio); - void setPressRatio(real pressRatio); - void setRealX(real realX); - void setRealY(real realY); - void setFactorPressBC(real factorPressBC); - void setGeometryFileC(std::string geometryFileC); - void setGeometryFileM(std::string geometryFileM); - void setGeometryFileF(std::string geometryFileF); - void setClockCycleForMP(uint clockCycleForMP); - void setTimestepForMP(uint timestepForMP); - void setForcingX(real forcingX); - void setForcingY(real forcingY); - void setForcingZ(real forcingZ); - void setQuadricLimiterP(real quadricLimiterP); - void setQuadricLimiterM(real quadricLimiterM); - void setQuadricLimiterD(real quadricLimiterD); - void setCalcParticles(bool calcParticles); - void setParticleBasicLevel(int particleBasicLevel); - void setParticleInitLevel(int particleInitLevel); - void setNumberOfParticles(int numberOfParticles); - void setStartXHotWall(real startXHotWall); - void setEndXHotWall(real endXHotWall); - void setPossNeighborFilesX(const std::vector<std::string> &possNeighborFilesX); - void setPossNeighborFilesY(const std::vector<std::string> &possNeighborFilesY); - void setPossNeighborFilesZ(const std::vector<std::string> &possNeighborFilesZ); - // void setPossNeighborFilesX(std::vector<std::string> possNeighborFilesX); - // void setPossNeighborFilesY(std::vector<std::string> possNeighborFilesY); - // void setPossNeighborFilesZ(std::vector<std::string> possNeighborFilesZ); - void setTimeDoCheckPoint(int timeDoCheckPoint); - void setTimeDoRestart(int timeDoRestart); - void setDoCheckPoint(bool doCheckPoint); - void setDoRestart(bool doRestart); - void setMaxLevel(uint maxLevel); - void setGridX(const std::vector<int> &gridX); - void setGridY(const std::vector<int> &gridY); - void setGridZ(const std::vector<int> &gridZ); - void setDistX(const std::vector<int> &distX); - void setDistY(const std::vector<int> &distY); - void setDistZ(const std::vector<int> &distZ); - void setNeedInterface(const std::vector<bool> &needInterface); - void setMainKernel(const std::string &mainKernel); - void setMultiKernelOn(bool multiKernelOn); - void setMultiKernelLevel(const std::vector<int> &multiKernelLevel); - void setMultiKernelName(const std::vector<std::string> &multiKernelName); - - bool isViscosityInConfigFile() override; - bool isNumberOfDevicesInConfigFile() override; - bool isDevicesInConfigFile() override; - bool isOutputPathInConfigFile() override; - bool isPrefixInConfigFile() override; - bool isGridPathInConfigFile() override; - bool isPrintOutputFilesInConfigFile() override; - bool isGeometryValuesInConfigFile() override; - bool isCalc2ndOrderMomentsInConfigFile() override; - bool isCalc3rdOrderMomentsInConfigFile() override; - bool isCalcHighOrderMomentsInConfigFile() override; - bool isReadGeoInConfigFile() override; - bool isCalcMedianInConfigFile() override; - bool isCalcDragLiftInConfigFile() override; - bool isCalcCpInConfigFile() override; - bool isWriteVeloASCIIfilesInConfigFile() override; - bool isCalcPlaneConcInConfigFile() override; - bool isConcFileInConfigFile() override; - bool isStreetVelocityFileInConfigFile() override; - bool isUseMeasurePointsInConfigFile() override; - bool isUseWaleInConfigFile() override; - bool isUseInitNeqInConfigFile() override; - bool isSimulatePorousMediaInConfigFile() override; - bool isD3QxxInConfigFile() override; - bool isTEndInConfigFile() override; - bool isTOutInConfigFile() override; - bool isTStartOutInConfigFile() override; - bool isTimeCalcMedStartInConfigFile() override; - bool isTimeCalcMedEndInConfigFile() override; - bool isPressInIDInConfigFile() override; - bool isPressOutIDInConfigFile() override; - bool isPressInZInConfigFile() override; - bool isPressOutZInConfigFile() override; - bool isDiffOnInConfigFile() override; - bool isDiffModInConfigFile() override; - bool isDiffusivityInConfigFile() override; - bool isTemperatureInitInConfigFile() override; - bool isTemperatureBCInConfigFile() override; - // bool isViscosityInConfigFile(); - bool isVelocityInConfigFile() override; - bool isViscosityRatioInConfigFile() override; - bool isVelocityRatioInConfigFile() override; - bool isDensityRatioInConfigFile() override; - bool isPressRatioInConfigFile() override; - bool isRealXInConfigFile() override; - bool isRealYInConfigFile() override; - bool isFactorPressBCInConfigFile() override; - bool isGeometryFileCInConfigFile() override; - bool isGeometryFileMInConfigFile() override; - bool isGeometryFileFInConfigFile() override; - bool isClockCycleForMPInConfigFile() override; - bool isTimestepForMPInConfigFile() override; - bool isForcingXInConfigFile() override; - bool isForcingYInConfigFile() override; - bool isForcingZInConfigFile() override; - bool isQuadricLimiterPInConfigFile() override; - bool isQuadricLimiterMInConfigFile() override; - bool isQuadricLimiterDInConfigFile() override; - bool isCalcParticlesInConfigFile() override; - bool isParticleBasicLevelInConfigFile() override; - bool isParticleInitLevelInConfigFile() override; - bool isNumberOfParticlesInConfigFile() override; - bool isNeighborWSBInConfigFile() override; - bool isStartXHotWallInConfigFile() override; - bool isEndXHotWallInConfigFile() override; - bool isPossNeighborFilesXInConfigFile() override; - bool isPossNeighborFilesYInConfigFile() override; - bool isPossNeighborFilesZInConfigFile() override; - bool isTimeDoCheckPointInConfigFile() override; - bool isTimeDoRestartInConfigFile() override; - bool isDoCheckPointInConfigFile() override; - bool isDoRestartInConfigFile() override; - bool isMaxLevelInConfigFile() override; - bool isGridXInConfigFile() override; - bool isGridYInConfigFile() override; - bool isGridZInConfigFile() override; - bool isDistXInConfigFile() override; - bool isDistYInConfigFile() override; - bool isDistZInConfigFile() override; - bool isNeedInterfaceInConfigFile() override; - bool isMainKernelInConfigFile() override; - bool isMultiKernelOnInConfigFile() override; - bool isMultiKernelLevelInConfigFile() override; - bool isMultiKernelNameInConfigFile() override; - -private: - ConfigDataImp() = default; - - real viscosity { 0. }; - uint numberOfDevices { 0 }; - std::vector<uint> devices; - std::string outputPath; - std::string prefix; - std::string gridPath; - bool printOutputFiles { false }; - bool geometryValues { false }; - bool calc2ndOrderMoments { false }; - bool calc3rdOrderMoments { false }; - bool calcHighOrderMoments { false }; - bool readGeo { false }; - bool calcMedian { false }; - bool calcDragLift { false }; - bool calcCp { false }; - bool writeVeloASCIIfiles { false }; - bool calcPlaneConc { false }; - bool concFile { false }; - bool streetVelocityFile { false }; - bool useMeasurePoints { false }; - bool useWale { false }; - bool useInitNeq { false }; - bool simulatePorousMedia { false }; - uint d3Qxx { 0 }; - uint tEnd { 0 }; - uint tOut { 0 }; - uint tStartOut { 0 }; - uint timeCalcMedStart { 0 }; - uint timeCalcMedEnd { 0 }; - uint pressInID { 0 }; - uint pressOutID { 0 }; - uint pressInZ { 0 }; - uint pressOutZ { 0 }; - bool diffOn { false }; - uint diffMod { 0 }; - real diffusivity { 0. }; - real temperatureInit { 0. }; - real temperatureBC { 0. }; - // real viscosity { 0 }; - real velocity { 0. }; - real viscosityRatio { 0. }; - real velocityRatio { 0. }; - real densityRatio { 0. }; - real pressRatio { 0. }; - real realX { 0. }; - real realY { 0. }; - real factorPressBC { 0. }; - std::string geometryFileC; - std::string geometryFileM; - std::string geometryFileF; - uint clockCycleForMP { 0 }; - uint timestepForMP { 0 }; - real forcingX { 0. }; - real forcingY { 0. }; - real forcingZ { 0. }; - real quadricLimiterP { 0. }; - real quadricLimiterM { 0. }; - real quadricLimiterD { 0. }; - bool calcParticles { false }; - int particleBasicLevel { 0 }; - int particleInitLevel { 0 }; - int numberOfParticles { 0 }; - real startXHotWall { 0. }; - real endXHotWall { 0. }; - std::vector<std::string> possNeighborFilesX; - std::vector<std::string> possNeighborFilesY; - std::vector<std::string> possNeighborFilesZ; - // std::vector<std::string> possNeighborFilesX; - // std::vector<std::string> possNeighborFilesY; - // std::vector<std::string> possNeighborFilesZ; - int timeDoCheckPoint { 0 }; - int timeDoRestart { 0 }; - bool doCheckPoint{ false }; - bool doRestart{ false }; - int maxLevel { 0 }; - std::vector<int> gridX; - std::vector<int> gridY; - std::vector<int> gridZ; - std::vector<int> distX; - std::vector<int> distY; - std::vector<int> distZ; - std::vector<bool> needInterface; - std::string mainKernel; - bool multiKernelOn{ false }; - std::vector<int> multiKernelLevel; - std::vector<std::string> multiKernelName; - - bool isViscosity { false }; - bool isNumberOfDevices {false}; - bool isDevices { false }; - bool isOutputPath { false }; - bool isPrefix { false }; - bool isGridPath { false }; - bool isPrintOutputFiles { false }; - bool isGeometryValues { false }; - bool isCalc2ndOrderMoments { false }; - bool isCalc3rdOrderMoments { false }; - bool isCalcHighOrderMoments { false }; - bool isReadGeo { false }; - bool isCalcMedian { false }; - bool isCalcDragLift { false }; - bool isCalcCp { false }; - bool isWriteVeloASCII { false }; - bool isCalcPlaneConc { false }; - bool isConcFile { false }; - bool isStreetVelocityFile { false }; - bool isUseMeasurePoints { false }; - bool isUseWale { false }; - bool isUseInitNeq { false }; - bool isSimulatePorousMedia { false }; - bool isD3Qxx { false }; - bool isTEnd { false }; - bool isTOut { false }; - bool isTStartOut { false }; - bool isTimeCalcMedStart { false }; - bool isTimeCalcMedEnd { false }; - bool isPressInID { false }; - bool isPressOutID { false }; - bool isPressInZ { false }; - bool isPressOutZ { false }; - bool isDiffOn { false }; - bool isDiffMod { false }; - bool isDiffusivity { false }; - bool isTemperatureInit { false }; - bool isTemperatureBC { false }; - // bool isViscosity { false }; - bool isVelocity { false }; - bool isViscosityRatio { false }; - bool isVelocityRatio { false }; - bool isDensityRatio { false }; - bool isPressRatio { false }; - bool isRealX { false }; - bool isRealY { false }; - bool isFactorPressBC { false }; - bool isGeometryFileC { false }; - bool isGeometryFileM { false }; - bool isGeometryFileF { false }; - bool isClockCycleForMP { false }; - bool isTimestepForMP { false }; - bool isForcingX { false }; - bool isForcingY { false }; - bool isForcingZ { false }; - bool isQuadricLimiterP { false }; - bool isQuadricLimiterM { false }; - bool isQuadricLimiterD { false }; - bool isCalcParticles { false }; - bool isParticleBasicLevel { false }; - bool isParticleInitLevel { false }; - bool isNumberOfParticles { false }; - bool isNeighborWSB { false }; - bool isStartXHotWall { false }; - bool isEndXHotWall { false }; - bool isPossNeighborFilesX { false }; - bool isPossNeighborFilesY { false }; - bool isPossNeighborFilesZ { false }; - bool isTimeDoCheckPoint { false }; - bool isTimeDoRestart { false }; - bool isDoCheckPoint { false }; - bool isDoRestart { false }; - bool isMaxLevel { false }; - bool isGridX { false }; - bool isGridY { false }; - bool isGridZ { false }; - bool isDistX { false }; - bool isDistY { false }; - bool isDistZ { false }; - bool isNeedInterface { false }; - bool isMainKernel { false }; - bool isMultiKernelOn { false }; - bool isMultiKernelLevel { false }; - bool isMultiKernelName { false }; -}; -#endif diff --git a/src/basics/Core/Input/ConfigFileReader/ConfigFileReader.cpp b/src/basics/Core/Input/ConfigFileReader/ConfigFileReader.cpp deleted file mode 100644 index 8fdb9fe1b..000000000 --- a/src/basics/Core/Input/ConfigFileReader/ConfigFileReader.cpp +++ /dev/null @@ -1,262 +0,0 @@ -#include "ConfigFileReader.h" -#include "../../StringUtilities/StringUtil.h" -#include "../ConfigData/ConfigDataImp.h" -#include "../Input.h" - -#include <fstream> -#include <iostream> - -std::shared_ptr<ConfigFileReader> ConfigFileReader::getNewInstance() -{ - return std::shared_ptr<ConfigFileReader>(new ConfigFileReader()); -} - -std::shared_ptr<ConfigData> ConfigFileReader::readConfigFile(const char* filePath) const -{ - std::cout << filePath << std::endl; - std::shared_ptr<ConfigDataImp> data = ConfigDataImp::getNewInstance(); - std::ifstream stream; - stream.open(filePath, std::ios::in); - if (stream.fail()) - throw std::runtime_error("can not open config file!"); - std::unique_ptr<input::Input> input = input::Input::makeInput(stream, "config"); - - if (input->getValue("NumberOfDevices") != "") - data->setNumberOfDevices(StringUtil::toInt(input->getValue("NumberOfDevices"))); - - if (input->getValue("Devices") != "") - data->setDevices(StringUtil::toUintVector(input->getValue("Devices"))); - - if (input->getValue("Path") != "") - data->setOutputPath(input->getValue("Path")); - - if (input->getValue("Prefix") != "") - data->setPrefix(input->getValue("Prefix")); - - if (input->getValue("GridPath") != "") - data->setGridPath(input->getValue("GridPath")); - else { - std::cout << "GridPath has to be defined!" << std::endl; - exit(1); - } - - if (input->getValue("WriteGrid") != "") - data->setPrintOutputFiles(StringUtil::toBool(input->getValue("WriteGrid"))); - - if (input->getValue("GeometryValues") != "") - data->setGeometryValues(StringUtil::toBool(input->getValue("GeometryValues"))); - - if (input->getValue("calc2ndOrderMoments") != "") - data->setCalc2ndOrderMoments(StringUtil::toBool(input->getValue("calc2ndOrderMoments"))); - - if (input->getValue("calc3rdOrderMoments") != "") - data->setCalc3rdOrderMoments(StringUtil::toBool(input->getValue("calc3rdOrderMoments"))); - - if (input->getValue("calcHigherOrderMoments") != "") - data->setCalcHighOrderMoments(StringUtil::toBool(input->getValue("calcHigherOrderMoments"))); - - if (input->getValue("ReadGeometry") != "") - data->setReadGeo(StringUtil::toBool(input->getValue("ReadGeometry"))); - - if (input->getValue("calcMedian") != "") - data->setCalcMedian(StringUtil::toBool(input->getValue("calcMedian"))); - - if (input->getValue("UseConcFile") != "") - data->setConcFile(StringUtil::toBool(input->getValue("UseConcFile"))); - - if (input->getValue("UseStreetVelocityFile") != "") - data->setStreetVelocityFile(StringUtil::toBool(input->getValue("UseStreetVelocityFile"))); - - if (input->getValue("UseMeasurePoints") != "") - data->setUseMeasurePoints(StringUtil::toBool(input->getValue("UseMeasurePoints"))); - - if (input->getValue("UseWale") != "") - data->setUseWale(StringUtil::toBool(input->getValue("UseWale"))); - - if (input->getValue("UseInitNeq") != "") - data->setUseInitNeq(StringUtil::toBool(input->getValue("UseInitNeq"))); - - if (input->getValue("SimulatePorousMedia") != "") - data->setSimulatePorousMedia(StringUtil::toBool(input->getValue("SimulatePorousMedia"))); - - if (input->getValue("D3Qxx") != "") - data->setD3Qxx(StringUtil::toInt(input->getValue("D3Qxx"))); - - if (input->getValue("TimeEnd") != "") - data->setTEnd(StringUtil::toInt(input->getValue("TimeEnd"))); - - if (input->getValue("TimeOut") != "") - data->setTOut(StringUtil::toInt(input->getValue("TimeOut"))); - - if (input->getValue("TimeStartOut") != "") - data->setTStartOut(StringUtil::toInt(input->getValue("TimeStartOut"))); - - if (input->getValue("TimeStartCalcMedian") != "") - data->setTimeCalcMedStart(StringUtil::toInt(input->getValue("TimeStartCalcMedian"))); - - if (input->getValue("TimeEndCalcMedian") != "") - data->setTimeCalcMedEnd(StringUtil::toInt(input->getValue("TimeEndCalcMedian"))); - - if (input->getValue("PressInID") != "") - data->setPressInID(StringUtil::toInt(input->getValue("PressInID"))); - - if (input->getValue("PressOutID") != "") - data->setPressOutID(StringUtil::toInt(input->getValue("PressOutID"))); - - if (input->getValue("PressInZ") != "") - data->setPressInZ(StringUtil::toInt(input->getValue("PressInZ"))); - - if (input->getValue("PressOutZ") != "") - data->setPressOutZ(StringUtil::toInt(input->getValue("PressOutZ"))); - ////////////////////////////////////////////////////////////////////////// - if (input->getValue("DiffOn") != "") - data->setDiffOn(StringUtil::toBool(input->getValue("DiffOn"))); - - if (input->getValue("DiffMod") != "") - data->setDiffMod(StringUtil::toInt(input->getValue("DiffMod"))); - - if (input->getValue("Diffusivity") != "") - data->setDiffusivity(StringUtil::toFloat(input->getValue("Diffusivity"))); - - if (input->getValue("Temp") != "") - data->setTemperatureInit(StringUtil::toFloat(input->getValue("Temp"))); - - if (input->getValue("TempBC") != "") - data->setTemperatureBC(StringUtil::toFloat(input->getValue("TempBC"))); - ////////////////////////////////////////////////////////////////////////// - if (input->getValue("Viscosity_LB") != "") - data->setViscosity(StringUtil::toFloat(input->getValue("Viscosity_LB"))); - - if (input->getValue("Velocity_LB") != "") - data->setVelocity(StringUtil::toFloat(input->getValue("Velocity_LB"))); - - if (input->getValue("Viscosity_Ratio_World_to_LB") != "") - data->setViscosityRatio(StringUtil::toFloat(input->getValue("Viscosity_Ratio_World_to_LB"))); - - if (input->getValue("Velocity_Ratio_World_to_LB") != "") - data->setVelocityRatio(StringUtil::toFloat(input->getValue("Velocity_Ratio_World_to_LB"))); - - if (input->getValue("Density_Ratio_World_to_LB") != "") - data->setDensityRatio(StringUtil::toFloat(input->getValue("Density_Ratio_World_to_LB"))); - - if (input->getValue("Delta_Press") != "") - data->setPressRatio(StringUtil::toFloat(input->getValue("Delta_Press"))); - - if (input->getValue("SliceRealX") != "") - data->setRealX(StringUtil::toFloat(input->getValue("SliceRealX"))); - - if (input->getValue("SliceRealY") != "") - data->setRealY(StringUtil::toFloat(input->getValue("SliceRealY"))); - - if (input->getValue("FactorPressBC") != "") - data->setFactorPressBC(StringUtil::toFloat(input->getValue("FactorPressBC"))); - - if (input->getValue("GeometryC") != "") - data->setGeometryFileC(input->getValue("GeometryC")); - - if (input->getValue("GeometryM") != "") - data->setGeometryFileM(input->getValue("GeometryM")); - - if (input->getValue("GeometryF") != "") - data->setGeometryFileF(input->getValue("GeometryF")); - ////////////////////////////////////////////////////////////////////////// - if (input->getValue("measureClockCycle") != "") - data->setClockCycleForMP(StringUtil::toInt(input->getValue("measureClockCycle"))); - - if (input->getValue("measureTimestep") != "") - data->setTimestepForMP(StringUtil::toInt(input->getValue("measureTimestep"))); - ////////////////////////////////////////////////////////////////////////// - // Forcing - if (input->getValue("ForcingX") != "") - data->setForcingX(StringUtil::toFloat(input->getValue("ForcingX"))); - if (input->getValue("ForcingY") != "") - data->setForcingY(StringUtil::toFloat(input->getValue("ForcingY"))); - if (input->getValue("ForcingZ") != "") - data->setForcingZ(StringUtil::toFloat(input->getValue("ForcingZ"))); - ////////////////////////////////////////////////////////////////////////// - // Quadric Limiters - if (input->getValue("QuadricLimiterP") != "") - data->setQuadricLimiterP(StringUtil::toFloat(input->getValue("QuadricLimiterP"))); - if (input->getValue("QuadricLimiterM") != "") - data->setQuadricLimiterM(StringUtil::toFloat(input->getValue("QuadricLimiterM"))); - if (input->getValue("QuadricLimiterD") != "") - data->setQuadricLimiterD(StringUtil::toFloat(input->getValue("QuadricLimiterD"))); - ////////////////////////////////////////////////////////////////////////// - // Particles - if (input->getValue("calcParticles") != "") - data->setCalcParticles(StringUtil::toBool(input->getValue("calcParticles"))); - - if (input->getValue("baseLevel") != "") - data->setParticleBasicLevel(StringUtil::toInt(input->getValue("baseLevel"))); - - if (input->getValue("initLevel") != "") - data->setParticleInitLevel(StringUtil::toInt(input->getValue("initLevel"))); - - if (input->getValue("numberOfParticles") != "") - data->setNumberOfParticles(StringUtil::toInt(input->getValue("numberOfParticles"))); - - if (input->getValue("startXHotWall") != "") - data->setStartXHotWall(real(StringUtil::toDouble(input->getValue("startXHotWall")))); - - if (input->getValue("endXHotWall") != "") - data->setEndXHotWall(real(StringUtil::toDouble(input->getValue("endXHotWall")))); - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // Restart - if (input->getValue("TimeDoCheckPoint") != "") - data->setTimeDoCheckPoint(StringUtil::toInt(input->getValue("TimeDoCheckPoint"))); - - if (input->getValue("TimeDoRestart") != "") - data->setTimeDoRestart(StringUtil::toInt(input->getValue("TimeDoRestart"))); - - if (input->getValue("DoCheckPoint") != "") - data->setDoCheckPoint(StringUtil::toBool(input->getValue("DoCheckPoint"))); - - if (input->getValue("DoRestart") != "") - data->setDoRestart(StringUtil::toBool(input->getValue("DoRestart"))); - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - if (input->getValue("NOGL") != "") - data->setMaxLevel(StringUtil::toInt(input->getValue("NOGL"))); - - if (input->getValue("GridX") != "") - data->setGridX(StringUtil::toIntVector(input->getValue("GridX"))); - - if (input->getValue("GridY") != "") - data->setGridY(StringUtil::toIntVector(input->getValue("GridY"))); - - if (input->getValue("GridZ") != "") - data->setGridZ(StringUtil::toIntVector(input->getValue("GridZ"))); - - if (input->getValue("DistX") != "") - data->setDistX(StringUtil::toIntVector(input->getValue("DistX"))); - - if (input->getValue("DistY") != "") - data->setDistY(StringUtil::toIntVector(input->getValue("DistY"))); - - if (input->getValue("DistZ") != "") - data->setDistZ(StringUtil::toIntVector(input->getValue("DistZ"))); - - if (input->getValue("NeedInterface") != "") - data->setNeedInterface(StringUtil::toBoolVector(input->getValue("NeedInterface"))); - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // Kernel - if (input->getValue("MainKernelName") != "") - data->setMainKernel(input->getValue("MainKernelName")); - - if (input->getValue("MultiKernelOn") != "") - data->setMultiKernelOn(StringUtil::toBool(input->getValue("MultiKernelOn"))); - - if (input->getValue("MultiKernelLevel") != "") - data->setMultiKernelLevel(StringUtil::toIntVector(input->getValue("MultiKernelLevel"))); - - if (input->getValue("MultiKernelName") != "") - data->setMultiKernelName(StringUtil::toStringVector(input->getValue("MultiKernelName"))); - - if (StringUtil::toStringVector(input->getValue("MultiKernelName")).size() != - StringUtil::toIntVector(input->getValue("MultiKernelLevel")).size()) { - std::cout << "MultiKernelName and MultiKernelLevel has to be of same size!" << std::endl; - exit(1); - } - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - return data; -} diff --git a/src/basics/Core/Input/ConfigFileReader/ConfigFileReader.h b/src/basics/Core/Input/ConfigFileReader/ConfigFileReader.h deleted file mode 100644 index 77c93ebfa..000000000 --- a/src/basics/Core/Input/ConfigFileReader/ConfigFileReader.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef CONFIGFILEREADER_H -#define CONFIGFILEREADER_H - - -#include <memory> -#include <string> - -#include "basics_export.h" - -class ConfigData; - -class ConfigFileReader -{ -public: - BASICS_EXPORT static std::shared_ptr<ConfigFileReader> getNewInstance(); - - BASICS_EXPORT std::shared_ptr<ConfigData> readConfigFile(const char* filePath) const; - -private: - ConfigFileReader() = default; -}; -#endif diff --git a/src/basics/Core/Input/ConfigInput/ConfigInput.cpp b/src/basics/Core/Input/ConfigInput/ConfigInput.cpp deleted file mode 100644 index 1fdff1e87..000000000 --- a/src/basics/Core/Input/ConfigInput/ConfigInput.cpp +++ /dev/null @@ -1,222 +0,0 @@ -#include "ConfigInput.h" -#include <algorithm> -#include <cerrno> -#include <iostream> -#include <sstream> -#include <string> - -#define COMMENT '#' - -namespace input -{ -// Trim the given characters from the beginning and end of a string. -// the default is to trim whitespace. If the string is empty or contains -// only the trim characters, an empty string is returned. -std::string trim(const std::string &instring, const std::string &trimstring = std::string(" \t\n")) -{ - if (trimstring.size() == 0) - return instring; - std::string temp = ""; - std::string::size_type begpos = instring.find_first_not_of(trimstring); - if (begpos == std::string::npos) { - return temp; - } else { - std::string::size_type endpos = instring.find_last_not_of(trimstring); - temp = instring.substr(begpos, endpos - begpos + 1); - } - return temp; -} - -ConfigInput::ConfigInput(std::istream &stream) : stream(stream) -{ - while (!stream.eof()) - this->setTokenValuePair(); -} - -ConfigInput::~ConfigInput() = default; - -bool ConfigInput::hasValue(const std::string &key) const -{ - bool valueFound = false; - std::string keyCopy = key; - this->makeLower(keyCopy); - if (configEntries.find(keyCopy.c_str()) != configEntries.end()) - valueFound = true; - - return valueFound; -} - -std::string ConfigInput::getValue(const std::string &key) -{ - std::string keyCopy = key; - this->makeLower(keyCopy); - if (configEntries.find(keyCopy.c_str()) != configEntries.end()) - return (*configEntries.find(keyCopy.c_str())).second; - return ""; -} - -////////////////////////////////////////////////////////////////////////// -// private methods // -////////////////////////////////////////////////////////////////////////// - -void ConfigInput::makeLower(std::string &value) const -{ - for (size_t i = 0; i < value.size(); i++) - value[i] = tolower(value[i]); -} - -void ConfigInput::setTokenValuePair() -{ - this->eatWhiteAndComments(true); - - std::string token; - if (!this->setToken(token)) - return; - - std::string value; - this->setValue(value); - - configEntries.insert(String_Pair(token, value)); -} - -bool ConfigInput::setToken(std::string &token) -{ - char tokenChar[1024]; - bool foundEqualSign = false; - int charIndex = 0; - - this->findToken(foundEqualSign, tokenChar, charIndex); - - if (!isToken(charIndex, foundEqualSign)) - return false; - - this->nullTerminate(tokenChar, charIndex); - token = tokenChar; - makeLower(token); - return true; -} - -void ConfigInput::findToken(bool &foundEqualSign, char *token, int &i) -{ - char ch; - while (!(stream.get(ch)).fail()) { - if ((ch != '\t')) { - if ((ch == '=') || (ch == ' ') || (ch == '\n') || (ch == '\r') || (ch == '\t')) { - foundEqualSign = true; - break; - } - token[i++] = ch; - } - } -} - -bool ConfigInput::isToken(int charIndex, bool foundEqualSign) -{ - if (charIndex == 0) { - configEntries.insert(String_Pair("", "")); - return false; - } - - if (!foundEqualSign && !advanceToEqualSignOnLine()) { - configEntries.insert(String_Pair("", "")); - return false; - } - return true; -} - -void ConfigInput::setValue(std::string &value) -{ - int charIndex = 0; - char valueChar[1024]; - this->findValue(charIndex, valueChar); - - if (charIndex == 0) - value = ""; - else { - this->nullTerminate(valueChar, charIndex); - value = valueChar; - value = trim(value); - this->stripLeadingAndTrailingQuotes(value); - } -} - -int ConfigInput::findValue(int &charIndex, char *value) -{ - char ch; - char c = eatWhiteAndComments(false); - if (c != '\n') { - charIndex = 0; - while (!(stream.get(ch)).fail()) { - if ((ch == '\t') || (ch == '\r') || (ch == '\n') || (ch == '#')) { - while (ch != '\n') { - if (stream.get(ch).fail()) - break; - } - break; - } else { - value[charIndex++] = ch; - } - } - } - return charIndex; -} - -void ConfigInput::stripLeadingAndTrailingQuotes(std::string &m_value) -{ - if (m_value[0] == '"') - m_value = m_value.substr(1); - if (m_value[m_value.length() - 1] == '"') - m_value = m_value.substr(0, m_value.length() - 1); -} - -void ConfigInput::nullTerminate(char *value, int &i) { value[i++] = '\0'; } - -bool ConfigInput::advanceToEqualSignOnLine() -{ - char ch; - bool foundEqual = false; - while (!(stream.get(ch)).fail()) { - if (isNewLine(ch) || isCarriageReturn(ch)) - break; - if (isEqualSign(ch)) { - foundEqual = true; - break; - } - } - return foundEqual; -} - -char ConfigInput::eatWhiteAndComments(bool traverseNewlines) -{ - char ch; - bool isComment = false; - - while (!(stream.get(ch)).fail()) { - if (isCommentSign(ch)) - isComment = true; - else if (isNewLine(ch)) { - isComment = false; - if (!traverseNewlines) - return (ch); - } else if (isRegularChar(isComment, ch)) { - stream.putback(ch); - return 0; - } - } - return 0; -} - -bool ConfigInput::isRegularChar(bool isComment, char ch) -{ - return (!isComment) && (ch != ' ') && (ch != '\t') && (ch != '\r'); -} - -bool ConfigInput::isCommentSign(char ch) { return ch == COMMENT; } - -bool ConfigInput::isEqualSign(char ch) { return ch == '='; } - -bool ConfigInput::isNewLine(char ch) { return ch == '\n'; } - -bool ConfigInput::isCarriageReturn(char ch) { return ch == '\r'; } - -} // namespace input diff --git a/src/basics/Core/Input/ConfigInput/ConfigInput.h b/src/basics/Core/Input/ConfigInput/ConfigInput.h deleted file mode 100644 index aee9242ca..000000000 --- a/src/basics/Core/Input/ConfigInput/ConfigInput.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef ConfigInput_H -#define ConfigInput_H -#include <istream> -#include <list> -#include <map> -#include <memory> -#include <string> -#include <vector> - -#include "../Input.h" -#include "basics_export.h" - -namespace input -{ -class ConfigInput : public Input -{ -public: - BASICS_EXPORT ConfigInput(std::istream &stream); - BASICS_EXPORT ~ConfigInput() override; - - BASICS_EXPORT bool hasValue(const std::string &key) const override; - BASICS_EXPORT std::string getValue(const std::string &key) override; - -protected: - virtual void setTokenValuePair(); - void setValue(std::string &value); - bool setToken(std::string &token); - bool isToken(int charIndex, bool foundEqualSign); - int findValue(int &charIndex, char *value); - void stripLeadingAndTrailingQuotes(std::string &m_value); - void nullTerminate(char *token, int &i); - void findToken(bool &foundEqualSign, char *token, int &i); - char eatWhiteAndComments(bool traverse_newlines = true); - bool isRegularChar(bool isComment, char ch); - bool isNewLine(char ch); - bool isCommentSign(char ch); - bool advanceToEqualSignOnLine(); - bool isCarriageReturn(char ch); - bool isEqualSign(char ch); - void makeLower(std::string &instring) const; - -protected: - std::istream &stream; - using String_Pair = std::pair<std::string, std::string>; - std::map<std::string, std::string> configEntries; -}; -} // namespace input -#endif diff --git a/src/basics/Core/Input/Input.cpp b/src/basics/Core/Input/Input.cpp deleted file mode 100644 index f971dd226..000000000 --- a/src/basics/Core/Input/Input.cpp +++ /dev/null @@ -1,24 +0,0 @@ -#include "Input.h" - -#include <memory> - -#ifdef BUILD_JSONCPP -#include "JsonInput/JsonInput.h" -#endif - -#include "ConfigInput/ConfigInput.h" - -namespace input -{ - -std::unique_ptr<input::Input> Input::makeInput(std::istream &stream, const std::string & /*inputType*/) -{ -#ifdef BUILD_JSONCPP - if (inputType == "json") - return std::unique_ptr<Input>(new JsonInput(stream)); -#endif - - return std::make_unique<ConfigInput>(stream); -} - -} // namespace input diff --git a/src/basics/Core/Input/Input.h b/src/basics/Core/Input/Input.h deleted file mode 100644 index 3b07b8b32..000000000 --- a/src/basics/Core/Input/Input.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef Input_H -#define Input_H - -#include "basics_export.h" - -#include <istream> -#include <memory> -#include <string> - -namespace input -{ -class Input -{ -public: - static BASICS_EXPORT std::unique_ptr<Input> makeInput(std::istream &stream, const std::string &inputType); - - virtual ~Input() = default; - - virtual bool hasValue(const std::string &key) const = 0; - virtual std::string getValue(const std::string &key) = 0; -}; -} // namespace input - -#endif diff --git a/src/basics/Core/Input/JsonInput/JsonInput.cpp b/src/basics/Core/Input/JsonInput/JsonInput.cpp deleted file mode 100644 index 34a1d154a..000000000 --- a/src/basics/Core/Input/JsonInput/JsonInput.cpp +++ /dev/null @@ -1,67 +0,0 @@ -#ifdef BUILD_JSONCPP - -#include "JsonInput.h" - -#include <fstream> -#include <iterator> -#include <sstream> -#include <string> -#include <vector> - -namespace input -{ -template <typename Out> -void split(const std::string &s, char delim, Out result) -{ - std::stringstream ss; - ss.str(s); - std::string item; - while (std::getline(ss, item, delim)) { - *(result++) = item; - } -} - -std::vector<std::string> split(const std::string &s, char delim) -{ - std::vector<std::string> elems; - split(s, delim, std::back_inserter(elems)); - return elems; -} - -JsonInput::JsonInput(std::istream &stream) -{ - Json::Reader reader; - reader.parse(stream, jsonValue); -} - -bool JsonInput::hasValue(const std::string &key) const -{ - auto keys = split(key, ' '); - - if (keys.size() == 1 && !jsonValue[keys[0]].isNull()) - return true; - else if (keys.size() == 2 && !jsonValue[keys[0]][keys[1]].isNull()) - return true; - else if (keys.size() == 3 && !jsonValue[keys[0]][keys[1]][keys[2]].isNull()) - return true; - else - return false; -} - -std::string JsonInput::getValue(const std::string &key) -{ - auto keys = split(key, ' '); - - if (keys.size() == 1) - return jsonValue[keys[0]].asString(); - else if (keys.size() == 2) - return jsonValue[keys[0]][keys[1]].asString(); - else if (keys.size() == 3) - return jsonValue[keys[0]][keys[1]][keys[2]].asString(); - else - return ""; -} - -} // namespace input - -#endif diff --git a/src/basics/Core/Input/JsonInput/JsonInput.h b/src/basics/Core/Input/JsonInput/JsonInput.h deleted file mode 100644 index 8a33e99bf..000000000 --- a/src/basics/Core/Input/JsonInput/JsonInput.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifdef BUILD_JSONCPP - -#ifndef JsonInput_H -#define JsonInput_H - -#include <json/json.h> -#include <string> - -#include "basics_export.h" - -#include "../Input.h" - -namespace input -{ -class JsonInput : public Input -{ -public: - BASICS_EXPORT JsonInput(std::istream &stream); - - BASICS_EXPORT virtual bool hasValue(const std::string &key) const override; - BASICS_EXPORT virtual std::string getValue(const std::string &key) override; - -private: - Json::Value jsonValue; -}; -} // namespace input - -#endif - -#endif diff --git a/src/gpu/VirtualFluids_GPU/GPU/CudaMemoryManager.cpp b/src/gpu/VirtualFluids_GPU/GPU/CudaMemoryManager.cpp index aeafe342f..8e2818186 100644 --- a/src/gpu/VirtualFluids_GPU/GPU/CudaMemoryManager.cpp +++ b/src/gpu/VirtualFluids_GPU/GPU/CudaMemoryManager.cpp @@ -6,6 +6,8 @@ #include <Parameter/Parameter.h> +#include "Calculation/PorousMedia.h" + #include <lbm/constants/NumericConstants.h> void CudaMemoryManager::cudaAllocFull(int lev) diff --git a/src/gpu/VirtualFluids_GPU/LBM/LB.h b/src/gpu/VirtualFluids_GPU/LBM/LB.h index 1a2a06d29..bea4a1683 100644 --- a/src/gpu/VirtualFluids_GPU/LBM/LB.h +++ b/src/gpu/VirtualFluids_GPU/LBM/LB.h @@ -60,7 +60,8 @@ struct InitCondition real TempBC {1.0}; real RealX {1.0}; real RealY {1.0}; - int numprocs, myid; + int numprocs {1}; + int myid {0}; int maxdev {1}; uint tDoCheckPoint {0}; uint tDoRestart {0}; diff --git a/src/gpu/VirtualFluids_GPU/LBM/Simulation.cpp b/src/gpu/VirtualFluids_GPU/LBM/Simulation.cpp index 7dc916a47..d73d300ed 100644 --- a/src/gpu/VirtualFluids_GPU/LBM/Simulation.cpp +++ b/src/gpu/VirtualFluids_GPU/LBM/Simulation.cpp @@ -87,19 +87,14 @@ void Simulation::init(SPtr<Parameter> para, SPtr<GridProvider> gridProvider, std comm = vf::gpu::Communicator::getInstanz(); this->para = para; - para->setMyID(comm->getPID()); - para->setNumprocs(comm->getNummberOfProcess()); devCheck(comm->mapCudaDevice(para->getMyID(), para->getNumprocs(), para->getDevices(), para->getMaxDev())); - para->initParameter(); - gridProvider->allocAndCopyForcing(); gridProvider->allocAndCopyQuadricLimiters(); gridProvider->setDimensions(); gridProvider->setBoundingBox(); para->setRe(para->getVelocity() * (real)1.0 / para->getViscosity()); - para->setPhi((real) 0.0); para->setlimitOfNodesForVTK(30000000); //max 30 Million nodes per VTK file if (para->getDoRestart()) para->setStartTurn(para->getTimeDoRestart()); diff --git a/src/gpu/VirtualFluids_GPU/Parameter/Parameter.cpp b/src/gpu/VirtualFluids_GPU/Parameter/Parameter.cpp index 919204ff7..8c3a4c510 100644 --- a/src/gpu/VirtualFluids_GPU/Parameter/Parameter.cpp +++ b/src/gpu/VirtualFluids_GPU/Parameter/Parameter.cpp @@ -1,10 +1,35 @@ -// _ ___ __ __________ _ __ ______________ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ / ___/ __ / / / / -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ / /___/ /_/ / / / / -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) / /_) / ____/ /__/ / -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ \____/_/ \_____/ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ // -////////////////////////////////////////////////////////////////////////// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file Parameter.h +//! \ingroup Parameter +//! \author Martin Schoenherr +//======================================================================================= #include "Parameter.h" #include <stdio.h> @@ -13,963 +38,402 @@ #include <curand_kernel.h> - -#include "Core/Input/ConfigData/ConfigData.h" #include "Core/StringUtilities/StringUtil.h" -#include "Communication/Communicator.h" -//#ifdef WIN32 -// #include <Winsock2.h> -//#endif -//lib for windows Ws2_32.lib #include <basics/config/ConfigurationFile.h> -SPtr<Parameter> Parameter::make(SPtr<ConfigData> configData, vf::gpu::Communicator* comm) -{ - return SPtr<Parameter>(new Parameter(configData, comm)); -} - -Parameter::Parameter(const vf::gpu::Communicator& comm) +Parameter::Parameter(const vf::basics::ConfigurationFile &configData, int numberOfProcesses, int myId) { - ic.numprocs = comm.getNummberOfProcess(); - ic.myid = comm.getPID(); -} - + ic.numprocs = numberOfProcesses; + ic.myid = myId; -Parameter::Parameter(const vf::basics::ConfigurationFile& configData, - const vf::gpu::Communicator& comm) : - Parameter(comm) + readConfigData(configData); + initLBMSimulationParameter(); +} +void Parameter::readConfigData(const vf::basics::ConfigurationFile &configData) { - if (configData.contains("NumberOfDevices")) + if (configData.contains("NumberOfDevices")) this->setMaxDev(configData.getValue<int>("NumberOfDevices")); ////////////////////////////////////////////////////////////////////////// if (configData.contains("Devices")) this->setDevices(configData.getVector<uint>("Devices")); ////////////////////////////////////////////////////////////////////////// - if (configData.contains("Path")) - this->setOutputPath(configData.getValue<std::string>("Path")); - else - this->setOutputPath("C:/Output/"); //TODO: Shouldnt we throw an exception here? + if (configData.contains("Path")) + this->setOutputPath(configData.getValue<std::string>("Path")); + else + throw std::runtime_error("<Path> need to be defined in config file!"); ////////////////////////////////////////////////////////////////////////// - if (configData.contains("Prefix")) - this->setOutputPrefix(configData.getValue<std::string>("Prefix")); + if (configData.contains("Prefix")) + this->setOutputPrefix(configData.getValue<std::string>("Prefix")); ////////////////////////////////////////////////////////////////////////// if (configData.contains("WriteGrid")) - this->setPrintFiles(configData.getValue<bool>("WriteGrid")); + this->setPrintFiles(configData.getValue<bool>("WriteGrid")); ////////////////////////////////////////////////////////////////////////// - if (configData.contains("GeometryValues")) - this->setGeometryValues(configData.getValue<bool>("GeometryValues")); - ////////////////////////////////////////////////////////////////////////// - if (configData.contains("calc2ndOrderMoments")) - this->setCalc2ndOrderMoments(configData.getValue<bool>("calc2ndOrderMoments")); - ////////////////////////////////////////////////////////////////////////// - if (configData.contains("calc3rdOrderMoments")) - this->setCalc3rdOrderMoments(configData.getValue<bool>("calc3rdOrderMoments")); - ////////////////////////////////////////////////////////////////////////// - if (configData.contains("calcHigherOrderMoments")) - this->setCalcHighOrderMoments(configData.getValue<bool>("calcHigherOrderMoments")); - ////////////////////////////////////////////////////////////////////////// - if (configData.contains("calcMedian")) - this->setCalcMedian(configData.getValue<bool>("calcMedian")); - ////////////////////////////////////////////////////////////////////////// - if (configData.contains("calcCp")) - this->calcCp = configData.getValue<bool>("calcCp"); - ////////////////////////////////////////////////////////////////////////// - if (configData.contains("calcDrafLift")) - this->calcDragLift = configData.getValue<bool>("calcDrafLift"); - ////////////////////////////////////////////////////////////////////////// - if (configData.contains("writeVeloASCIIfiles")) - this->writeVeloASCII = configData.getValue<bool>("writeVeloASCIIfiles"); - ////////////////////////////////////////////////////////////////////////// - if (configData.contains("calcPlaneConc")) - this->calcPlaneConc = configData.getValue<bool>("calcPlaneConc"); - ////////////////////////////////////////////////////////////////////////// - if (configData.contains("UseConcFile")) - this->setConcFile(configData.getValue<bool>("UseConcFile")); - ////////////////////////////////////////////////////////////////////////// - if (configData.contains("UseStreetVelocityFile")) - this->setStreetVelocityFile(configData.getValue<bool>("UseStreetVelocityFile")); - ////////////////////////////////////////////////////////////////////////// - if (configData.contains("UseMeasurePoints")) - this->setUseMeasurePoints(configData.getValue<bool>("UseMeasurePoints")); - ////////////////////////////////////////////////////////////////////////// - if (configData.contains("UseWale")) - this->setUseWale(configData.getValue<bool>("UseWale")); - ////////////////////////////////////////////////////////////////////////// - if (configData.contains("UseInitNeq")) - this->setUseInitNeq(configData.getValue<bool>("UseInitNeq")); - ////////////////////////////////////////////////////////////////////////// - if (configData.contains("SimulatePorousMedia")) - this->setSimulatePorousMedia(configData.getValue<bool>("SimulatePorousMedia")); - ////////////////////////////////////////////////////////////////////////// - if (configData.contains("D3Qxx")) - this->setD3Qxx(configData.getValue<int>("D3Qxx")); - ////////////////////////////////////////////////////////////////////////// - if (configData.contains("TimeEnd")) - this->setTEnd(configData.getValue<int>("TimeEnd")); - ////////////////////////////////////////////////////////////////////////// - if (configData.contains("TimeOut")) - this->setTOut(configData.getValue<int>("TimeOut")); - ////////////////////////////////////////////////////////////////////////// - if (configData.contains("TimeStartOut")) - this->setTStartOut(configData.getValue<int>("TimeStartOut")); - ////////////////////////////////////////////////////////////////////////// - if (configData.contains("TimeStartCalcMedian")) - this->setTimeCalcMedStart(configData.getValue<int>("TimeStartCalcMedian")); - ////////////////////////////////////////////////////////////////////////// - if (configData.contains("TimeEndCalcMedian")) - this->setTimeCalcMedEnd(configData.getValue<int>("TimeEndCalcMedian")); - ////////////////////////////////////////////////////////////////////////// - if (configData.contains("PressInID")) - this->setTOut(configData.getValue<int>("PressInID")); - ////////////////////////////////////////////////////////////////////////// - if (configData.contains("PressOutID")) - this->setTStartOut(configData.getValue<int>("PressOutID")); - ////////////////////////////////////////////////////////////////////////// - if (configData.contains("PressInZ")) - this->setTimeCalcMedStart(configData.getValue<int>("PressInZ")); - ////////////////////////////////////////////////////////////////////////// - if (configData.contains("PressOutZ")) - this->setTimeCalcMedEnd(configData.getValue<int>("PressOutZ")); - - // ////////////////////////////////////////////////////////////////////////// - // //second component - - ////////////////////////////////////////////////////////////////////////// - if (configData.contains("DiffOn")) - this->setDiffOn(configData.getValue<bool>("DiffOn")); - ////////////////////////////////////////////////////////////////////////// - if (configData.contains("DiffMod")) - this->setDiffMod(configData.getValue<int>("DiffMod")); - ////////////////////////////////////////////////////////////////////////// - if (configData.contains("Diffusivity")) - this->setDiffusivity(configData.getValue<real>("Diffusivity")); - ////////////////////////////////////////////////////////////////////////// - if (configData.contains("Temp")) - this->setTemperatureInit(configData.getValue<real>("Temp")); - ////////////////////////////////////////////////////////////////////////// - if (configData.contains("TempBC")) - this->setTemperatureBC(configData.getValue<real>("TempBC")); - - - ////////////////////////////////////////////////////////////////////////// - if (configData.contains("Viscosity_LB")) - this->setViscosity(configData.getValue<real>("Viscosity_LB")); - ////////////////////////////////////////////////////////////////////////// - if (configData.contains("Velocity_LB")) - this->setVelocity(configData.getValue<real>("Velocity_LB")); - ////////////////////////////////////////////////////////////////////////// - if (configData.contains("Viscosity_Ratio_World_to_LB")) - this->setViscosityRatio(configData.getValue<real>("Viscosity_Ratio_World_to_LB")); - ////////////////////////////////////////////////////////////////////////// - if (configData.contains("Velocity_Ratio_World_to_LB")) - this->setVelocityRatio(configData.getValue<real>("Velocity_Ratio_World_to_LB")); - // ////////////////////////////////////////////////////////////////////////// - if (configData.contains("Density_Ratio_World_to_LB")) - this->setDensityRatio(configData.getValue<real>("Density_Ratio_World_to_LB")); - - if (configData.contains("Delta_Press")) - this->setPressRatio(configData.getValue<real>("Delta_Press")); - - ////////////////////////////////////////////////////////////////////////// - if (configData.contains("SliceRealX")) - this->setRealX(configData.getValue<real>("SliceRealX")); - ////////////////////////////////////////////////////////////////////////// - if (configData.contains("SliceRealY")) - this->setRealY(configData.getValue<real>("SliceRealY")); - ////////////////////////////////////////////////////////////////////////// - if (configData.contains("FactorPressBC")) - this->setFactorPressBC(configData.getValue<real>("FactorPressBC")); - // ////////////////////////////////////////////////////////////////////////// - // //read Geometry (STL) - if (configData.contains("ReadGeometry")) - this->setReadGeo(configData.getValue<bool>("ReadGeometry")); - - - if (configData.contains("GeometryC")) - this->setGeometryFileC(configData.getValue<std::string>("GeometryC")); - else if (this->getReadGeo()) - throw std::runtime_error("readGeo is true, GeometryC has to be set as well!"); - - if (configData.contains("GeometryM")) - this->setGeometryFileM(configData.getValue<std::string>("GeometryM")); - else if (this->getReadGeo()) - throw std::runtime_error("readGeo is true, GeometryM has to be set as well!"); - - if (configData.contains("GeometryF")) - this->setGeometryFileF(configData.getValue<std::string>("GeometryF")); - else if (this->getReadGeo()) - throw std::runtime_error("readGeo is true, GeometryF has to be set as well!"); - - - ////////////////////////////////////////////////////////////////////////// - if (configData.contains("measureClockCycle")) - this->setclockCycleForMP(configData.getValue<real>("measureClockCycle")); - - if (configData.contains("measureTimestep")) - this->settimestepForMP(configData.getValue<uint>("measureTimestep")); - - ////////////////////////////////////////////////////////////////////////// - - std::string gridPath {""}; - if (configData.contains("GridPath")) - gridPath = configData.getValue<std::string>("GridPath"); - else - throw std::runtime_error("GridPath has to be defined in config file!"); - - if (this->getNumprocs() == 1) - gridPath += "/"; - else - gridPath += "/" + StringUtil::toString(this->getMyID()) + "/"; - - // ////////////////////////////////////////////////////////////////////////// - this->setFName(this->getOutputPath() + "/" + this->getOutputPrefix()); - ////////////////////////////////////////////////////////////////////////// - this->setgeoVec( gridPath + "geoVec.dat"); - this->setcoordX( gridPath + "coordX.dat"); - this->setcoordY( gridPath + "coordY.dat"); - this->setcoordZ( gridPath + "coordZ.dat"); - this->setneighborX( gridPath + "neighborX.dat"); - this->setneighborY( gridPath + "neighborY.dat"); - this->setneighborZ( gridPath + "neighborZ.dat"); - this->setneighborWSB( gridPath + "neighborWSB.dat"); - this->setscaleCFC( gridPath + "scaleCFC.dat"); - this->setscaleCFF( gridPath + "scaleCFF.dat"); - this->setscaleFCC( gridPath + "scaleFCC.dat"); - this->setscaleFCF( gridPath + "scaleFCF.dat"); - this->setscaleOffsetCF( gridPath + "offsetVecCF.dat"); - this->setscaleOffsetFC( gridPath + "offsetVecFC.dat"); - this->setgeomBoundaryBcQs( gridPath + "geomBoundaryQs.dat"); - this->setgeomBoundaryBcValues( gridPath + "geomBoundaryValues.dat"); - this->setinletBcQs( gridPath + "inletBoundaryQs.dat"); - this->setinletBcValues( gridPath + "inletBoundaryValues.dat"); - this->setoutletBcQs( gridPath + "outletBoundaryQs.dat"); - this->setoutletBcValues( gridPath + "outletBoundaryValues.dat"); - this->settopBcQs( gridPath + "topBoundaryQs.dat"); - this->settopBcValues( gridPath + "topBoundaryValues.dat"); - this->setbottomBcQs( gridPath + "bottomBoundaryQs.dat"); - this->setbottomBcValues( gridPath + "bottomBoundaryValues.dat"); - this->setfrontBcQs( gridPath + "frontBoundaryQs.dat"); - this->setfrontBcValues( gridPath + "frontBoundaryValues.dat"); - this->setbackBcQs( gridPath + "backBoundaryQs.dat"); - this->setbackBcValues( gridPath + "backBoundaryValues.dat"); - this->setnumberNodes( gridPath + "numberNodes.dat"); - this->setLBMvsSI( gridPath + "LBMvsSI.dat"); - this->setmeasurePoints( gridPath + "measurePoints.dat"); - this->setpropellerValues( gridPath + "propellerValues.dat"); - this->setcpTop( gridPath + "cpTop.dat"); - this->setcpBottom( gridPath + "cpBottom.dat"); - this->setcpBottom2( gridPath + "cpBottom2.dat"); - this->setConcentration( gridPath + "conc.dat"); - this->setStreetVelocity( gridPath + "streetVector.dat"); - ////////////////////////////////////////////////////////////////////////// - //Normals - Geometry - this->setgeomBoundaryNormalX(gridPath + "geomBoundaryNormalX.dat"); - this->setgeomBoundaryNormalY(gridPath + "geomBoundaryNormalY.dat"); - this->setgeomBoundaryNormalZ(gridPath + "geomBoundaryNormalZ.dat"); - //Normals - Inlet - this->setInflowBoundaryNormalX(gridPath + "inletBoundaryNormalX.dat"); - this->setInflowBoundaryNormalY(gridPath + "inletBoundaryNormalY.dat"); - this->setInflowBoundaryNormalZ(gridPath + "inletBoundaryNormalZ.dat"); - //Normals - Outlet - this->setOutflowBoundaryNormalX(gridPath + "outletBoundaryNormalX.dat"); - this->setOutflowBoundaryNormalY(gridPath + "outletBoundaryNormalY.dat"); - this->setOutflowBoundaryNormalZ(gridPath + "outletBoundaryNormalZ.dat"); - ////////////////////////////////////////////////////////////////////////// - // //Forcing - real forcingX = 0.0; - real forcingY = 0.0; - real forcingZ = 0.0; - - if (configData.contains("ForcingX")) - forcingX = configData.getValue<real>("ForcingX"); - if (configData.contains("ForcingY")) - forcingY = configData.getValue<real>("ForcingY"); - if (configData.contains("ForcingZ")) - forcingZ = configData.getValue<real>("ForcingZ"); - - this->setForcing(forcingX, forcingY, forcingZ); - ////////////////////////////////////////////////////////////////////////// - //quadricLimiters - real quadricLimiterP = (real)0.01; - real quadricLimiterM = (real)0.01; - real quadricLimiterD = (real)0.01; - - if (configData.contains("QuadricLimiterP")) - quadricLimiterP = configData.getValue<real>("QuadricLimiterP"); - if (configData.contains("QuadricLimiterM")) - quadricLimiterM = configData.getValue<real>("QuadricLimiterM"); - if (configData.contains("QuadricLimiterD")) - quadricLimiterD = configData.getValue<real>("QuadricLimiterD"); - - this->setQuadricLimiters(quadricLimiterP, quadricLimiterM, quadricLimiterD); - ////////////////////////////////////////////////////////////////////////// - //Particles - if (configData.contains("calcParticles")) - this->setCalcParticles(configData.getValue<bool>("calcParticles")); - - if (configData.contains("baseLevel")) - this->setParticleBasicLevel(configData.getValue<int>("baseLevel")); - - if (configData.contains("initLevel")) - this->setParticleInitLevel(configData.getValue<int>("initLevel")); - - if (configData.contains("numberOfParticles")) - this->setNumberOfParticles(configData.getValue<int>("numberOfParticles")); - - if (configData.contains("startXHotWall")) - this->setEndXHotWall(configData.getValue<real>("startXHotWall")); - - if (configData.contains("endXHotWall")) - this->setCalcParticles(configData.getValue<real>("endXHotWall")); - ////////////////////////////////////////////////////////////////////////// - //for Multi GPU - if (this->getNumprocs() > 1) - { - ////////////////////////////////////////////////////////////////////////// - //3D domain decomposition - std::vector<std::string> sendProcNeighborsX, sendProcNeighborsY, sendProcNeighborsZ; - std::vector<std::string> recvProcNeighborsX, recvProcNeighborsY, recvProcNeighborsZ; - for (int i = 0; i < this->getNumprocs(); i++) - { - sendProcNeighborsX.push_back(gridPath + StringUtil::toString(i) + "Xs.dat"); - sendProcNeighborsY.push_back(gridPath + StringUtil::toString(i) + "Ys.dat"); - sendProcNeighborsZ.push_back(gridPath + StringUtil::toString(i) + "Zs.dat"); - recvProcNeighborsX.push_back(gridPath + StringUtil::toString(i) + "Xr.dat"); - recvProcNeighborsY.push_back(gridPath + StringUtil::toString(i) + "Yr.dat"); - recvProcNeighborsZ.push_back(gridPath + StringUtil::toString(i) + "Zr.dat"); - } - this->setPossNeighborFilesX(sendProcNeighborsX, "send"); - this->setPossNeighborFilesY(sendProcNeighborsY, "send"); - this->setPossNeighborFilesZ(sendProcNeighborsZ, "send"); - this->setPossNeighborFilesX(recvProcNeighborsX, "recv"); - this->setPossNeighborFilesY(recvProcNeighborsY, "recv"); - this->setPossNeighborFilesZ(recvProcNeighborsZ, "recv"); - } - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //Restart - if (configData.contains("TimeDoCheckPoint")) - this->setTimeDoCheckPoint(configData.getValue<uint>("TimeDoCheckPoint")); - - if (configData.contains("TimeDoRestart")) - this->setTimeDoRestart(configData.getValue<uint>("TimeDoRestart")); - - if (configData.contains("DoCheckPoint")) - this->setDoCheckPoint(configData.getValue<bool>("DoCheckPoint")); - - if (configData.contains("DoRestart")) - this->setDoRestart(configData.getValue<bool>("DoRestart")); - // //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - if (configData.contains("NOGL")) - this->setMaxLevel(configData.getValue<int>("NOGL")); - - this->setGridX(std::vector<int>(this->getMaxLevel()+1, 32)); - this->setGridY(std::vector<int>(this->getMaxLevel()+1, 32)); - this->setGridZ(std::vector<int>(this->getMaxLevel()+1, 32)); - - this->setDistX(std::vector<int>(this->getMaxLevel()+1, 32)); - this->setDistY(std::vector<int>(this->getMaxLevel()+1, 32)); - this->setDistZ(std::vector<int>(this->getMaxLevel()+1, 32)); - - this->setNeedInterface(std::vector<bool>(6, true)); - - if (configData.contains("GridX")) - this->setGridX(configData.getVector<int>("GridX")); - - if (configData.contains("GridY")) - this->setGridY(configData.getVector<int>("GridY")); - - if (configData.contains("GridZ")) - this->setGridZ(configData.getVector<int>("GridZ")); - - - if (configData.contains("DistX")) - this->setDistX(configData.getVector<int>("DistX")); - - if (configData.contains("DistY")) - this->setDistY(configData.getVector<int>("DistY")); - - if (configData.contains("DistZ")) - this->setDistZ(configData.getVector<int>("DistZ")); - - - if (configData.contains("NeedInterface")) - this->setNeedInterface(configData.getVector<bool>("NeedInterface")); - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // Kernel - if (configData.contains("MainKernelName")) - this->setMainKernel(configData.getValue<std::string>("MainKernelName")); - - if (configData.contains("MultiKernelOn")) - this->setMultiKernelOn(configData.getValue<bool>("MultiKernelOn")); - - if (configData.contains("MultiKernelLevel")) - this->setMultiKernelLevel(configData.getVector<int>("MultiKernelLevel")); - else if (this->getMultiKernelOn()) - { - std::vector<int> tmp; - for (int i = 0; i < this->getMaxLevel()+1; i++) - { - tmp.push_back(i); - } - this->setMultiKernelLevel(tmp); - } - - if (configData.contains("MultiKernelName")) - this->setMultiKernel(StringUtil::toStringVector(configData.getValue<std::string>("MultiKernelName"))); - else if (this->getMultiKernelOn()) - { - std::vector<std::string> tmp; - for (int i = 0; i < this->getMaxLevel()+1; i++) - { - tmp.push_back("CumulantK17Comp"); - } - this->setMultiKernel(tmp); - } -} - -Parameter::Parameter(SPtr<ConfigData> configData, vf::gpu::Communicator* comm) -{ - ////////////////////////////////////////////////////////////////////////// - this->setNumprocs(comm->getNummberOfProcess()); - this->setMyID(comm->getPID()); - ////////////////////////////////////////////////////////////////////////// - if (configData->isNumberOfDevicesInConfigFile()) - this->setMaxDev(configData->getNumberOfDevices()); - else - this->setMaxDev((int)1); - ////////////////////////////////////////////////////////////////////////// - if (configData->isDevicesInConfigFile()) - this->setDevices(configData->getDevices()); - else - this->setDevices(std::vector<uint>{(uint)0}); - ////////////////////////////////////////////////////////////////////////// - if (configData->isOutputPathInConfigFile()) - this->setOutputPath(configData->getOutputPath()); - else - this->setOutputPath("C:/Output/"); - ////////////////////////////////////////////////////////////////////////// - if (configData->isPrefixInConfigFile()) - this->setOutputPrefix(configData->getPrefix()); - else - this->setOutputPrefix("MyFile"); - ////////////////////////////////////////////////////////////////////////// - if (configData->isPrintOutputFilesInConfigFile()) - this->setPrintFiles(configData->getPrintOutputFiles()); - else - this->setPrintFiles(false); - ////////////////////////////////////////////////////////////////////////// - if (configData->isGeometryValuesInConfigFile()) - this->setGeometryValues(configData->getGeometryValues()); - else - this->setGeometryValues(false); - ////////////////////////////////////////////////////////////////////////// - if (configData->isCalc2ndOrderMomentsInConfigFile()) - this->setCalc2ndOrderMoments(configData->getCalc2ndOrderMoments()); - else - this->setCalc2ndOrderMoments(false); - ////////////////////////////////////////////////////////////////////////// - if (configData->isCalc3rdOrderMomentsInConfigFile()) - this->setCalc3rdOrderMoments(configData->getCalc3rdOrderMoments()); - else - this->setCalc3rdOrderMoments(false); - ////////////////////////////////////////////////////////////////////////// - if (configData->isCalcHighOrderMomentsInConfigFile()) - this->setCalcHighOrderMoments(configData->getCalcHighOrderMoments()); - else - this->setCalcHighOrderMoments(false); - ////////////////////////////////////////////////////////////////////////// - if (configData->isCalcMedianInConfigFile()) - this->setCalcMedian(configData->getCalcMedian()); - else - this->setCalcMedian(false); - ////////////////////////////////////////////////////////////////////////// - if (configData->isCalcDragLiftInConfigFile()) - this->setCalcDragLift(configData->getCalcDragLift()); - else - this->setCalcDragLift(false); - ////////////////////////////////////////////////////////////////////////// - if (configData->isCalcCpInConfigFile()) - this->setCalcCp(configData->getCalcCp()); - else - this->setCalcCp(false); - ////////////////////////////////////////////////////////////////////////// - if (configData->isWriteVeloASCIIfilesInConfigFile()) - this->setWriteVeloASCIIfiles(configData->getWriteVeloASCIIfiles()); - else - this->setWriteVeloASCIIfiles(false); - ////////////////////////////////////////////////////////////////////////// - if (configData->isCalcPlaneConcInConfigFile()) - this->setCalcPlaneConc(configData->getCalcPlaneConc()); - else - this->setCalcPlaneConc(false); - ////////////////////////////////////////////////////////////////////////// - if (configData->isConcFileInConfigFile()) - this->setConcFile(configData->getConcFile()); - else - this->setConcFile(false); - ////////////////////////////////////////////////////////////////////////// - if (configData->isStreetVelocityFileInConfigFile()) - this->setStreetVelocityFile(configData->getStreetVelocityFile()); - else - this->setStreetVelocityFile(false); - ////////////////////////////////////////////////////////////////////////// - if (configData->isUseMeasurePointsInConfigFile()) - this->setUseMeasurePoints(configData->getUseMeasurePoints()); - else - this->setUseMeasurePoints(false); - ////////////////////////////////////////////////////////////////////////// - if (configData->isUseWaleInConfigFile()) - this->setUseWale(configData->getUseWale()); - else - this->setUseWale(false); - ////////////////////////////////////////////////////////////////////////// - if (configData->isUseInitNeqInConfigFile()) - this->setUseInitNeq(configData->getUseInitNeq()); - else - this->setUseInitNeq(false); - ////////////////////////////////////////////////////////////////////////// - if (configData->isSimulatePorousMediaInConfigFile()) - this->setSimulatePorousMedia(configData->getSimulatePorousMedia()); - else - this->setSimulatePorousMedia(false); - ////////////////////////////////////////////////////////////////////////// - if (configData->isD3QxxInConfigFile()) - this->setD3Qxx(configData->getD3Qxx()); - else - this->setD3Qxx((int)27); - ////////////////////////////////////////////////////////////////////////// - if (configData->isTEndInConfigFile()) - this->setTEnd(configData->getTEnd()); - else - this->setTEnd((uint)10); - ////////////////////////////////////////////////////////////////////////// - if (configData->isTOutInConfigFile()) - this->setTOut(configData->getTOut()); - else - this->setTOut((uint)1); - ////////////////////////////////////////////////////////////////////////// - if (configData->isTStartOutInConfigFile()) - this->setTStartOut(configData->getTStartOut()); - else - this->setTStartOut((uint)0); - ////////////////////////////////////////////////////////////////////////// - if (configData->isTimeCalcMedStartInConfigFile()) - this->setTimeCalcMedStart(configData->getTimeCalcMedStart()); - else - this->setTimeCalcMedStart((int)0); - ////////////////////////////////////////////////////////////////////////// - if (configData->isTimeCalcMedEndInConfigFile()) - this->setTimeCalcMedEnd(configData->getTimeCalcMedEnd()); - else - this->setTimeCalcMedEnd((int)10); - ////////////////////////////////////////////////////////////////////////// - if (configData->isPressInIDInConfigFile()) - this->setPressInID(configData->getPressInID()); - else - this->setPressInID((uint)0); - ////////////////////////////////////////////////////////////////////////// - if (configData->isPressOutIDInConfigFile()) - this->setPressOutID(configData->getPressOutID()); - else - this->setPressOutID((uint)0); - ////////////////////////////////////////////////////////////////////////// - if (configData->isPressInZInConfigFile()) - this->setPressInZ(configData->getPressInZ()); - else - this->setPressInZ((uint)1); - ////////////////////////////////////////////////////////////////////////// - if (configData->isPressOutZInConfigFile()) - this->setPressOutZ(configData->getPressOutZ()); - else - this->setPressOutZ((uint)2); - ////////////////////////////////////////////////////////////////////////// - //second component - if (configData->isDiffOnInConfigFile()) - this->setDiffOn(configData->getDiffOn()); - else - this->setDiffOn(false); - - if (configData->isDiffModInConfigFile()) - this->setDiffMod(configData->getDiffMod()); - else - this->setDiffMod((int)27); - - if (configData->isDiffusivityInConfigFile()) - this->setDiffusivity(configData->getDiffusivity()); - else - this->setDiffusivity((real)0.001); - - if (configData->isTemperatureInitInConfigFile()) - this->setTemperatureInit(configData->getTemperatureInit()); - else - this->setTemperatureInit((real)0.0); - - if (configData->isTemperatureBCInConfigFile()) - this->setTemperatureBC(configData->getTemperatureBC()); - else - this->setTemperatureBC((real)1.0); - ////////////////////////////////////////////////////////////////////////// - if (configData->isViscosityInConfigFile()) - this->setViscosity(configData->getViscosity()); - else - this->setViscosity((real)0.001); - ////////////////////////////////////////////////////////////////////////// - if (configData->isVelocityInConfigFile()) - this->setVelocity(configData->getVelocity()); - else - this->setVelocity((real)0.01); - ////////////////////////////////////////////////////////////////////////// - if (configData->isViscosityRatioInConfigFile()) - this->setViscosityRatio(configData->getViscosityRatio()); - else - this->setViscosityRatio((real)1.0); - ////////////////////////////////////////////////////////////////////////// - if (configData->isVelocityRatioInConfigFile()) - this->setVelocityRatio(configData->getVelocityRatio()); - else - this->setVelocityRatio((real)1.0); - ////////////////////////////////////////////////////////////////////////// - if (configData->isDensityRatioInConfigFile()) - this->setDensityRatio(configData->getDensityRatio()); - else - this->setDensityRatio((real)1.0); - ////////////////////////////////////////////////////////////////////////// - if (configData->isPressRatioInConfigFile()) - this->setPressRatio(configData->getPressRatio()); - else - this->setPressRatio((real)1.0); - ////////////////////////////////////////////////////////////////////////// - if (configData->isRealXInConfigFile()) - this->setRealX(configData->getRealX()); - else - this->setRealX((real)1.0); - ////////////////////////////////////////////////////////////////////////// - if (configData->isRealYInConfigFile()) - this->setRealY(configData->getRealY()); - else - this->setRealY((real)1.0); - ////////////////////////////////////////////////////////////////////////// - if (configData->isFactorPressBCInConfigFile()) - this->setFactorPressBC(configData->getFactorPressBC()); - else - this->setFactorPressBC((real)1.0); - ////////////////////////////////////////////////////////////////////////// - //read Geometry (STL) - if (configData->isReadGeoInConfigFile()) - this->setReadGeo(configData->getReadGeo()); - else - this->setReadGeo(false); - - if (configData->isGeometryFileCInConfigFile()) - this->setGeometryFileC(configData->getGeometryFileC()); - else if (this->getReadGeo()) - { - std::cout << "GeometryFileC has to be defined!" << std::endl; - exit(1); - } - else - this->setGeometryFileC(""); - - if (configData->isGeometryFileMInConfigFile()) - this->setGeometryFileM(configData->getGeometryFileM()); - else if (this->getReadGeo()) - { - std::cout << "GeometryFileM has to be defined!" << std::endl; - exit(1); - } - else - this->setGeometryFileM(""); - - if (configData->isGeometryFileFInConfigFile()) - this->setGeometryFileF(configData->getGeometryFileF()); - else if (this->getReadGeo()) - { - std::cout << "GeometryFileF has to be defined!" << std::endl; - exit(1); - } - else - this->setGeometryFileF(""); - ////////////////////////////////////////////////////////////////////////// - if (configData->isClockCycleForMPInConfigFile()) - this->setclockCycleForMP(configData->getClockCycleForMP()); - else - this->setclockCycleForMP((real)1.0); - - if (configData->isTimestepForMPInConfigFile()) - this->settimestepForMP(configData->getTimestepForMP()); - else - this->settimestepForMP((uint)10); - ////////////////////////////////////////////////////////////////////////// - std::string gridPath = ""; - if (configData->isGridPathInConfigFile()) - gridPath = configData->getGridPath(); - else - { - std::cout << "GridPath has to be defined!" << std::endl; - exit(1); - } - - if (this->getNumprocs() == 1) - gridPath += "/"; - else - gridPath += "/" + StringUtil::toString(this->getMyID()) + "/"; - ////////////////////////////////////////////////////////////////////////// - this->setFName(this->getOutputPath() + "/" + this->getOutputPrefix()); - ////////////////////////////////////////////////////////////////////////// - this->setgeoVec( gridPath + "geoVec.dat"); - this->setcoordX( gridPath + "coordX.dat"); - this->setcoordY( gridPath + "coordY.dat"); - this->setcoordZ( gridPath + "coordZ.dat"); - this->setneighborX( gridPath + "neighborX.dat"); - this->setneighborY( gridPath + "neighborY.dat"); - this->setneighborZ( gridPath + "neighborZ.dat"); - this->setneighborWSB( gridPath + "neighborWSB.dat"); - this->setscaleCFC( gridPath + "scaleCFC.dat"); - this->setscaleCFF( gridPath + "scaleCFF.dat"); - this->setscaleFCC( gridPath + "scaleFCC.dat"); - this->setscaleFCF( gridPath + "scaleFCF.dat"); - this->setscaleOffsetCF( gridPath + "offsetVecCF.dat"); - this->setscaleOffsetFC( gridPath + "offsetVecFC.dat"); - this->setgeomBoundaryBcQs( gridPath + "geomBoundaryQs.dat"); - this->setgeomBoundaryBcValues( gridPath + "geomBoundaryValues.dat"); - this->setinletBcQs( gridPath + "inletBoundaryQs.dat"); - this->setinletBcValues( gridPath + "inletBoundaryValues.dat"); - this->setoutletBcQs( gridPath + "outletBoundaryQs.dat"); - this->setoutletBcValues( gridPath + "outletBoundaryValues.dat"); - this->settopBcQs( gridPath + "topBoundaryQs.dat"); - this->settopBcValues( gridPath + "topBoundaryValues.dat"); - this->setbottomBcQs( gridPath + "bottomBoundaryQs.dat"); - this->setbottomBcValues( gridPath + "bottomBoundaryValues.dat"); - this->setfrontBcQs( gridPath + "frontBoundaryQs.dat"); - this->setfrontBcValues( gridPath + "frontBoundaryValues.dat"); - this->setbackBcQs( gridPath + "backBoundaryQs.dat"); - this->setbackBcValues( gridPath + "backBoundaryValues.dat"); - this->setnumberNodes( gridPath + "numberNodes.dat"); - this->setLBMvsSI( gridPath + "LBMvsSI.dat"); - this->setmeasurePoints( gridPath + "measurePoints.dat"); - this->setpropellerValues( gridPath + "propellerValues.dat"); - this->setcpTop( gridPath + "cpTop.dat"); - this->setcpBottom( gridPath + "cpBottom.dat"); - this->setcpBottom2( gridPath + "cpBottom2.dat"); - this->setConcentration( gridPath + "conc.dat"); - this->setStreetVelocity( gridPath + "streetVector.dat"); - ////////////////////////////////////////////////////////////////////////// - //Normals - Geometry - this->setgeomBoundaryNormalX(gridPath + "geomBoundaryNormalX.dat"); - this->setgeomBoundaryNormalY(gridPath + "geomBoundaryNormalY.dat"); - this->setgeomBoundaryNormalZ(gridPath + "geomBoundaryNormalZ.dat"); - //Normals - Inlet - this->setInflowBoundaryNormalX(gridPath + "inletBoundaryNormalX.dat"); - this->setInflowBoundaryNormalY(gridPath + "inletBoundaryNormalY.dat"); - this->setInflowBoundaryNormalZ(gridPath + "inletBoundaryNormalZ.dat"); - //Normals - Outlet - this->setOutflowBoundaryNormalX(gridPath + "outletBoundaryNormalX.dat"); - this->setOutflowBoundaryNormalY(gridPath + "outletBoundaryNormalY.dat"); - this->setOutflowBoundaryNormalZ(gridPath + "outletBoundaryNormalZ.dat"); - ////////////////////////////////////////////////////////////////////////// - //Forcing - real forcingX = 0.0; - real forcingY = 0.0; - real forcingZ = 0.0; - - if (configData->isForcingXInConfigFile()) - forcingX = configData->getForcingX(); - if (configData->isForcingYInConfigFile()) - forcingY = configData->getForcingY(); - if (configData->isForcingZInConfigFile()) - forcingZ = configData->getForcingZ(); - - this->setForcing(forcingX, forcingY, forcingZ); - ////////////////////////////////////////////////////////////////////////// - //quadricLimiters - real quadricLimiterP = (real)0.01; - real quadricLimiterM = (real)0.01; - real quadricLimiterD = (real)0.01; - - if (configData->isQuadricLimiterPInConfigFile()) - quadricLimiterP = configData->getQuadricLimiterP(); - if (configData->isQuadricLimiterMInConfigFile()) - quadricLimiterM = configData->getQuadricLimiterM(); - if (configData->isQuadricLimiterDInConfigFile()) - quadricLimiterD = configData->getQuadricLimiterD(); - - this->setQuadricLimiters(quadricLimiterP, quadricLimiterM, quadricLimiterD); - ////////////////////////////////////////////////////////////////////////// - //Particles - if (configData->isCalcParticlesInConfigFile()) - this->setCalcParticles(configData->getCalcParticles()); - else - this->setCalcParticles(false); + if (configData.contains("GeometryValues")) + this->setGeometryValues(configData.getValue<bool>("GeometryValues")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("calc2ndOrderMoments")) + this->setCalc2ndOrderMoments(configData.getValue<bool>("calc2ndOrderMoments")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("calc3rdOrderMoments")) + this->setCalc3rdOrderMoments(configData.getValue<bool>("calc3rdOrderMoments")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("calcHigherOrderMoments")) + this->setCalcHighOrderMoments(configData.getValue<bool>("calcHigherOrderMoments")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("calcMedian")) + this->setCalcMedian(configData.getValue<bool>("calcMedian")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("calcCp")) + this->calcCp = configData.getValue<bool>("calcCp"); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("calcDrafLift")) + this->calcDragLift = configData.getValue<bool>("calcDrafLift"); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("writeVeloASCIIfiles")) + this->writeVeloASCII = configData.getValue<bool>("writeVeloASCIIfiles"); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("calcPlaneConc")) + this->calcPlaneConc = configData.getValue<bool>("calcPlaneConc"); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("UseConcFile")) + this->setConcFile(configData.getValue<bool>("UseConcFile")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("UseStreetVelocityFile")) + this->setStreetVelocityFile(configData.getValue<bool>("UseStreetVelocityFile")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("UseMeasurePoints")) + this->setUseMeasurePoints(configData.getValue<bool>("UseMeasurePoints")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("UseWale")) + this->setUseWale(configData.getValue<bool>("UseWale")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("UseInitNeq")) + this->setUseInitNeq(configData.getValue<bool>("UseInitNeq")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("SimulatePorousMedia")) + this->setSimulatePorousMedia(configData.getValue<bool>("SimulatePorousMedia")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("D3Qxx")) + this->setD3Qxx(configData.getValue<int>("D3Qxx")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("TimeEnd")) + this->setTEnd(configData.getValue<int>("TimeEnd")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("TimeOut")) + this->setTOut(configData.getValue<int>("TimeOut")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("TimeStartOut")) + this->setTStartOut(configData.getValue<int>("TimeStartOut")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("TimeStartCalcMedian")) + this->setTimeCalcMedStart(configData.getValue<int>("TimeStartCalcMedian")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("TimeEndCalcMedian")) + this->setTimeCalcMedEnd(configData.getValue<int>("TimeEndCalcMedian")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("PressInID")) + this->setTOut(configData.getValue<int>("PressInID")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("PressOutID")) + this->setTStartOut(configData.getValue<int>("PressOutID")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("PressInZ")) + this->setTimeCalcMedStart(configData.getValue<int>("PressInZ")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("PressOutZ")) + this->setTimeCalcMedEnd(configData.getValue<int>("PressOutZ")); - if (configData->isParticleBasicLevelInConfigFile()) - this->setParticleBasicLevel(configData->getParticleBasicLevel()); - else - this->setParticleBasicLevel((int)0); + ////////////////////////////////////////////////////////////////////////// + //second component + if (configData.contains("DiffOn")) + this->setDiffOn(configData.getValue<bool>("DiffOn")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("DiffMod")) + this->setDiffMod(configData.getValue<int>("DiffMod")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("Diffusivity")) + this->setDiffusivity(configData.getValue<real>("Diffusivity")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("Temp")) + this->setTemperatureInit(configData.getValue<real>("Temp")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("TempBC")) + this->setTemperatureBC(configData.getValue<real>("TempBC")); - if (configData->isParticleInitLevelInConfigFile()) - this->setParticleInitLevel(configData->getParticleInitLevel()); - else - this->setParticleInitLevel((int)0); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("Viscosity_LB")) + this->setViscosity(configData.getValue<real>("Viscosity_LB")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("Velocity_LB")) + this->setVelocity(configData.getValue<real>("Velocity_LB")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("Viscosity_Ratio_World_to_LB")) + this->setViscosityRatio(configData.getValue<real>("Viscosity_Ratio_World_to_LB")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("Velocity_Ratio_World_to_LB")) + this->setVelocityRatio(configData.getValue<real>("Velocity_Ratio_World_to_LB")); + // ////////////////////////////////////////////////////////////////////////// + if (configData.contains("Density_Ratio_World_to_LB")) + this->setDensityRatio(configData.getValue<real>("Density_Ratio_World_to_LB")); - if (configData->isNumberOfParticlesInConfigFile()) - this->setNumberOfParticles(configData->getNumberOfParticles()); - else - this->setNumberOfParticles((int)0); + if (configData.contains("Delta_Press")) + this->setPressRatio(configData.getValue<real>("Delta_Press")); - if (configData->isStartXHotWallInConfigFile()) - this->setStartXHotWall(configData->getStartXHotWall()); - else - this->setStartXHotWall((real)0); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("SliceRealX")) + this->setRealX(configData.getValue<real>("SliceRealX")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("SliceRealY")) + this->setRealY(configData.getValue<real>("SliceRealY")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("FactorPressBC")) + this->setFactorPressBC(configData.getValue<real>("FactorPressBC")); - if (configData->isEndXHotWallInConfigFile()) - this->setEndXHotWall(configData->getEndXHotWall()); - else - this->setEndXHotWall((real)0); - ////////////////////////////////////////////////////////////////////////// - //for Multi GPU - if (this->getNumprocs() > 1) - { - ////////////////////////////////////////////////////////////////////////// - //3D domain decomposition - std::vector<std::string> sendProcNeighborsX, sendProcNeighborsY, sendProcNeighborsZ; - std::vector<std::string> recvProcNeighborsX, recvProcNeighborsY, recvProcNeighborsZ; - for (int i = 0; i < this->getNumprocs(); i++) - { - sendProcNeighborsX.push_back(gridPath + StringUtil::toString(i) + "Xs.dat"); - sendProcNeighborsY.push_back(gridPath + StringUtil::toString(i) + "Ys.dat"); - sendProcNeighborsZ.push_back(gridPath + StringUtil::toString(i) + "Zs.dat"); - recvProcNeighborsX.push_back(gridPath + StringUtil::toString(i) + "Xr.dat"); - recvProcNeighborsY.push_back(gridPath + StringUtil::toString(i) + "Yr.dat"); - recvProcNeighborsZ.push_back(gridPath + StringUtil::toString(i) + "Zr.dat"); - } - this->setPossNeighborFilesX(sendProcNeighborsX, "send"); - this->setPossNeighborFilesY(sendProcNeighborsY, "send"); - this->setPossNeighborFilesZ(sendProcNeighborsZ, "send"); - this->setPossNeighborFilesX(recvProcNeighborsX, "recv"); - this->setPossNeighborFilesY(recvProcNeighborsY, "recv"); - this->setPossNeighborFilesZ(recvProcNeighborsZ, "recv"); - } - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //Restart - if (configData->isTimeDoCheckPointInConfigFile()) - this->setTimeDoCheckPoint(configData->getTimeDoCheckPoint()); - else - this->setTimeDoCheckPoint((uint)0); + ////////////////////////////////////////////////////////////////////////// + //read Geometry (STL) + if (configData.contains("ReadGeometry")) + this->setReadGeo(configData.getValue<bool>("ReadGeometry")); - if (configData->isTimeDoRestartInConfigFile()) - this->setTimeDoRestart(configData->getTimeDoRestart()); - else - this->setTimeDoRestart((uint)0); + if (configData.contains("GeometryC")) + this->setGeometryFileC(configData.getValue<std::string>("GeometryC")); + else if (this->getReadGeo()) + throw std::runtime_error("readGeo is true, GeometryC has to be set as well!"); - if (configData->isDoCheckPointInConfigFile()) - this->setDoCheckPoint(configData->getDoCheckPoint()); - else - this->setDoCheckPoint(false); + if (configData.contains("GeometryM")) + this->setGeometryFileM(configData.getValue<std::string>("GeometryM")); + else if (this->getReadGeo()) + throw std::runtime_error("readGeo is true, GeometryM has to be set as well!"); - if (configData->isDoRestartInConfigFile()) - this->setDoRestart(configData->getDoRestart()); - else - this->setDoRestart(false); - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - if (configData->isMaxLevelInConfigFile()) - this->setMaxLevel(configData->getMaxLevel()); - else - this->setMaxLevel((int)1); + if (configData.contains("GeometryF")) + this->setGeometryFileF(configData.getValue<std::string>("GeometryF")); + else if (this->getReadGeo()) + throw std::runtime_error("readGeo is true, GeometryF has to be set as well!"); - if (configData->isGridXInConfigFile()) - this->setGridX(configData->getGridX()); - else - this->setGridX(std::vector<int>(this->getMaxLevel()+1, 32)); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("measureClockCycle")) + this->setclockCycleForMP(configData.getValue<real>("measureClockCycle")); - if (configData->isGridYInConfigFile()) - this->setGridY(configData->getGridY()); - else - this->setGridY(std::vector<int>(this->getMaxLevel()+1, 32)); + if (configData.contains("measureTimestep")) + this->settimestepForMP(configData.getValue<uint>("measureTimestep")); - if (configData->isGridZInConfigFile()) - this->setGridZ(configData->getGridZ()); - else - this->setGridZ(std::vector<int>(this->getMaxLevel()+1, 32)); + ////////////////////////////////////////////////////////////////////////// - if (configData->isDistXInConfigFile()) - this->setDistX(configData->getDistX()); - else - this->setDistX(std::vector<int>(this->getMaxLevel()+1, 32)); + std::string gridPath{ "" }; + if (configData.contains("GridPath")) + gridPath = configData.getValue<std::string>("GridPath"); + else + throw std::runtime_error("GridPath has to be defined in config file!"); - if (configData->isDistYInConfigFile()) - this->setDistY(configData->getDistY()); - else - this->setDistY(std::vector<int>(this->getMaxLevel()+1, 32)); + if (this->getNumprocs() == 1) + gridPath += "/"; + else + gridPath += "/" + StringUtil::toString(this->getMyID()) + "/"; - if (configData->isDistZInConfigFile()) - this->setDistZ(configData->getDistZ()); - else - this->setDistZ(std::vector<int>(this->getMaxLevel()+1, 32)); + // ////////////////////////////////////////////////////////////////////////// + this->setFName(this->getOutputPath() + "/" + this->getOutputPrefix()); + ////////////////////////////////////////////////////////////////////////// + this->setgeoVec(gridPath + "geoVec.dat"); + this->setcoordX(gridPath + "coordX.dat"); + this->setcoordY(gridPath + "coordY.dat"); + this->setcoordZ(gridPath + "coordZ.dat"); + this->setneighborX(gridPath + "neighborX.dat"); + this->setneighborY(gridPath + "neighborY.dat"); + this->setneighborZ(gridPath + "neighborZ.dat"); + this->setneighborWSB(gridPath + "neighborWSB.dat"); + this->setscaleCFC(gridPath + "scaleCFC.dat"); + this->setscaleCFF(gridPath + "scaleCFF.dat"); + this->setscaleFCC(gridPath + "scaleFCC.dat"); + this->setscaleFCF(gridPath + "scaleFCF.dat"); + this->setscaleOffsetCF(gridPath + "offsetVecCF.dat"); + this->setscaleOffsetFC(gridPath + "offsetVecFC.dat"); + this->setgeomBoundaryBcQs(gridPath + "geomBoundaryQs.dat"); + this->setgeomBoundaryBcValues(gridPath + "geomBoundaryValues.dat"); + this->setinletBcQs(gridPath + "inletBoundaryQs.dat"); + this->setinletBcValues(gridPath + "inletBoundaryValues.dat"); + this->setoutletBcQs(gridPath + "outletBoundaryQs.dat"); + this->setoutletBcValues(gridPath + "outletBoundaryValues.dat"); + this->settopBcQs(gridPath + "topBoundaryQs.dat"); + this->settopBcValues(gridPath + "topBoundaryValues.dat"); + this->setbottomBcQs(gridPath + "bottomBoundaryQs.dat"); + this->setbottomBcValues(gridPath + "bottomBoundaryValues.dat"); + this->setfrontBcQs(gridPath + "frontBoundaryQs.dat"); + this->setfrontBcValues(gridPath + "frontBoundaryValues.dat"); + this->setbackBcQs(gridPath + "backBoundaryQs.dat"); + this->setbackBcValues(gridPath + "backBoundaryValues.dat"); + this->setnumberNodes(gridPath + "numberNodes.dat"); + this->setLBMvsSI(gridPath + "LBMvsSI.dat"); + this->setmeasurePoints(gridPath + "measurePoints.dat"); + this->setpropellerValues(gridPath + "propellerValues.dat"); + this->setcpTop(gridPath + "cpTop.dat"); + this->setcpBottom(gridPath + "cpBottom.dat"); + this->setcpBottom2(gridPath + "cpBottom2.dat"); + this->setConcentration(gridPath + "conc.dat"); + this->setStreetVelocity(gridPath + "streetVector.dat"); + ////////////////////////////////////////////////////////////////////////// + // Normals - Geometry + this->setgeomBoundaryNormalX(gridPath + "geomBoundaryNormalX.dat"); + this->setgeomBoundaryNormalY(gridPath + "geomBoundaryNormalY.dat"); + this->setgeomBoundaryNormalZ(gridPath + "geomBoundaryNormalZ.dat"); + // Normals - Inlet + this->setInflowBoundaryNormalX(gridPath + "inletBoundaryNormalX.dat"); + this->setInflowBoundaryNormalY(gridPath + "inletBoundaryNormalY.dat"); + this->setInflowBoundaryNormalZ(gridPath + "inletBoundaryNormalZ.dat"); + // Normals - Outlet + this->setOutflowBoundaryNormalX(gridPath + "outletBoundaryNormalX.dat"); + this->setOutflowBoundaryNormalY(gridPath + "outletBoundaryNormalY.dat"); + this->setOutflowBoundaryNormalZ(gridPath + "outletBoundaryNormalZ.dat"); + ////////////////////////////////////////////////////////////////////////// + // //Forcing + real forcingX = 0.0; + real forcingY = 0.0; + real forcingZ = 0.0; + + if (configData.contains("ForcingX")) + forcingX = configData.getValue<real>("ForcingX"); + if (configData.contains("ForcingY")) + forcingY = configData.getValue<real>("ForcingY"); + if (configData.contains("ForcingZ")) + forcingZ = configData.getValue<real>("ForcingZ"); + + this->setForcing(forcingX, forcingY, forcingZ); + ////////////////////////////////////////////////////////////////////////// + // quadricLimiters + real quadricLimiterP = (real)0.01; + real quadricLimiterM = (real)0.01; + real quadricLimiterD = (real)0.01; + + if (configData.contains("QuadricLimiterP")) + quadricLimiterP = configData.getValue<real>("QuadricLimiterP"); + if (configData.contains("QuadricLimiterM")) + quadricLimiterM = configData.getValue<real>("QuadricLimiterM"); + if (configData.contains("QuadricLimiterD")) + quadricLimiterD = configData.getValue<real>("QuadricLimiterD"); + + this->setQuadricLimiters(quadricLimiterP, quadricLimiterM, quadricLimiterD); + ////////////////////////////////////////////////////////////////////////// + // Particles + if (configData.contains("calcParticles")) + this->setCalcParticles(configData.getValue<bool>("calcParticles")); - if (configData->isNeedInterfaceInConfigFile()) - this->setNeedInterface(configData->getNeedInterface()); - else - this->setNeedInterface(std::vector<bool>(6, true)); + if (configData.contains("baseLevel")) + this->setParticleBasicLevel(configData.getValue<int>("baseLevel")); - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // Kernel - if (configData->isMainKernelInConfigFile()) - this->setMainKernel(configData->getMainKernel()); - else - this->setMainKernel("CumulantK15Comp"); + if (configData.contains("initLevel")) + this->setParticleInitLevel(configData.getValue<int>("initLevel")); - if (configData->isMultiKernelOnInConfigFile()) - this->setMultiKernelOn(configData->getMultiKernelOn()); - else - this->setMultiKernelOn(false); + if (configData.contains("numberOfParticles")) + this->setNumberOfParticles(configData.getValue<int>("numberOfParticles")); - if (configData->isMultiKernelLevelInConfigFile()) - this->setMultiKernelLevel(configData->getMultiKernelLevel()); - else if (this->getMultiKernelOn()) - { - std::vector<int> tmp; - for (int i = 0; i < this->getMaxLevel()+1; i++) - { - tmp.push_back(i); - } - this->setMultiKernelLevel(tmp); - } - else - this->setMultiKernelLevel(std::vector<int>(0)); + if (configData.contains("startXHotWall")) + this->setEndXHotWall(configData.getValue<real>("startXHotWall")); - if (configData->isMultiKernelNameInConfigFile()) { - std::vector<std::string> kernels; - for (std::size_t i = 0; i < configData->getMultiKernelName().size(); i++) { - kernels.push_back(configData->getMultiKernelName().at(i)); - } - this->setMultiKernel(kernels); - } - else if (this->getMultiKernelOn()) - { - std::vector<std::string> tmp; - for (int i = 0; i < this->getMaxLevel()+1; i++) - { - tmp.push_back("CumulantK15Comp"); - } - this->setMultiKernel(tmp); - } - else { + if (configData.contains("endXHotWall")) + this->setCalcParticles(configData.getValue<real>("endXHotWall")); + ////////////////////////////////////////////////////////////////////////// + // for Multi GPU + if (this->getNumprocs() > 1) { + ////////////////////////////////////////////////////////////////////////// + // 3D domain decomposition + std::vector<std::string> sendProcNeighborsX, sendProcNeighborsY, sendProcNeighborsZ; + std::vector<std::string> recvProcNeighborsX, recvProcNeighborsY, recvProcNeighborsZ; + for (int i = 0; i < this->getNumprocs(); i++) { + sendProcNeighborsX.push_back(gridPath + StringUtil::toString(i) + "Xs.dat"); + sendProcNeighborsY.push_back(gridPath + StringUtil::toString(i) + "Ys.dat"); + sendProcNeighborsZ.push_back(gridPath + StringUtil::toString(i) + "Zs.dat"); + recvProcNeighborsX.push_back(gridPath + StringUtil::toString(i) + "Xr.dat"); + recvProcNeighborsY.push_back(gridPath + StringUtil::toString(i) + "Yr.dat"); + recvProcNeighborsZ.push_back(gridPath + StringUtil::toString(i) + "Zr.dat"); + } + this->setPossNeighborFilesX(sendProcNeighborsX, "send"); + this->setPossNeighborFilesY(sendProcNeighborsY, "send"); + this->setPossNeighborFilesZ(sendProcNeighborsZ, "send"); + this->setPossNeighborFilesX(recvProcNeighborsX, "recv"); + this->setPossNeighborFilesY(recvProcNeighborsY, "recv"); + this->setPossNeighborFilesZ(recvProcNeighborsZ, "recv"); + } + + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // Restart + if (configData.contains("TimeDoCheckPoint")) + this->setTimeDoCheckPoint(configData.getValue<uint>("TimeDoCheckPoint")); + + if (configData.contains("TimeDoRestart")) + this->setTimeDoRestart(configData.getValue<uint>("TimeDoRestart")); + + if (configData.contains("DoCheckPoint")) + this->setDoCheckPoint(configData.getValue<bool>("DoCheckPoint")); + + if (configData.contains("DoRestart")) + this->setDoRestart(configData.getValue<bool>("DoRestart")); + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + if (configData.contains("NOGL")) + this->setMaxLevel(configData.getValue<int>("NOGL")); + + this->setGridX(std::vector<int>(this->getMaxLevel() + 1, 32)); + this->setGridY(std::vector<int>(this->getMaxLevel() + 1, 32)); + this->setGridZ(std::vector<int>(this->getMaxLevel() + 1, 32)); + + this->setDistX(std::vector<int>(this->getMaxLevel() + 1, 32)); + this->setDistY(std::vector<int>(this->getMaxLevel() + 1, 32)); + this->setDistZ(std::vector<int>(this->getMaxLevel() + 1, 32)); + + this->setNeedInterface(std::vector<bool>(6, true)); + + if (configData.contains("GridX")) + this->setGridX(configData.getVector<int>("GridX")); + + if (configData.contains("GridY")) + this->setGridY(configData.getVector<int>("GridY")); + + if (configData.contains("GridZ")) + this->setGridZ(configData.getVector<int>("GridZ")); + + if (configData.contains("DistX")) + this->setDistX(configData.getVector<int>("DistX")); + + if (configData.contains("DistY")) + this->setDistY(configData.getVector<int>("DistY")); + + if (configData.contains("DistZ")) + this->setDistZ(configData.getVector<int>("DistZ")); + + if (configData.contains("NeedInterface")) + this->setNeedInterface(configData.getVector<bool>("NeedInterface")); + + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // Kernel + if (configData.contains("MainKernelName")) + this->setMainKernel(configData.getValue<std::string>("MainKernelName")); + + if (configData.contains("MultiKernelOn")) + this->setMultiKernelOn(configData.getValue<bool>("MultiKernelOn")); + + if (configData.contains("MultiKernelLevel")) + this->setMultiKernelLevel(configData.getVector<int>("MultiKernelLevel")); + else if (this->getMultiKernelOn()) { + std::vector<int> tmp; + for (int i = 0; i < this->getMaxLevel() + 1; i++) { + tmp.push_back(i); + } + this->setMultiKernelLevel(tmp); + } + + if (configData.contains("MultiKernelName")) + this->setMultiKernel(StringUtil::toStringVector(configData.getValue<std::string>("MultiKernelName"))); + else if (this->getMultiKernelOn()) { std::vector<std::string> tmp; - this->setMultiKernel(tmp); - } - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + for (int i = 0; i < this->getMaxLevel() + 1; i++) { + tmp.push_back("CumulantK17Comp"); + } + this->setMultiKernel(tmp); + } } -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -//init-method -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -void Parameter::initParameter() +void Parameter::initLBMSimulationParameter() { factor_gridNZ = 2; coarse = 0; @@ -980,7 +444,7 @@ void Parameter::initParameter() //host for (int i = coarse; i <= fine; i++) { - parH[i] = new ParameterStruct; + parH[i] = std::make_shared<LBMSimulationParameter>(); parH[i]->numberofthreads = 64;// 128; parH[i]->gridNX = getGridX().at(i); parH[i]->gridNY = getGridY().at(i); @@ -1058,7 +522,7 @@ void Parameter::initParameter() //device for (int i = coarse; i <= fine; i++) { - parD[i] = new ParameterStruct; + parD[i] = std::make_shared<LBMSimulationParameter>(); parD[i]->numberofthreads = parH[i]->numberofthreads; parD[i]->gridNX = parH[i]->gridNX; parD[i]->gridNY = parH[i]->gridNY; @@ -1091,14 +555,8 @@ void Parameter::initParameter() parD[i]->distY = parH[i]->distY; parD[i]->distZ = parH[i]->distZ; } - - //Interface - //comment out for geller - //for (int i = coarse; i < fine; i++) - //{ - // initInterfaceParameter(i); - //} } + void Parameter::setSizeMatSparse(int level) { parH[level]->size_Mat_SP = 1; @@ -2348,11 +1806,11 @@ unsigned int Parameter::getStartTurn() { return startTurn; } -ParameterStruct* Parameter::getParD(int level) +std::shared_ptr<LBMSimulationParameter> Parameter::getParD(int level) { return parD[level]; } -ParameterStruct* Parameter::getParH(int level) +std::shared_ptr<LBMSimulationParameter> Parameter::getParH(int level) { return parH[level]; } @@ -3041,16 +2499,9 @@ bool Parameter::getIsProp() { return ic.isProp; } -bool Parameter::overWritingRestart(unsigned int t) +bool Parameter::overWritingRestart(uint t) { - if (t == getTimeDoRestart()) - { - return true; - } - else - { - return false; - } + return t == getTimeDoRestart(); } unsigned int Parameter::getTimestepForMP() { diff --git a/src/gpu/VirtualFluids_GPU/Parameter/Parameter.h b/src/gpu/VirtualFluids_GPU/Parameter/Parameter.h index 1626e41ae..2a93b6dd9 100644 --- a/src/gpu/VirtualFluids_GPU/Parameter/Parameter.h +++ b/src/gpu/VirtualFluids_GPU/Parameter/Parameter.h @@ -1,830 +1,848 @@ -// _ ___ __ __________ _ __ ______________ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ / ___/ __ / / / / -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ / /___/ /_/ / / / / -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) / /_) / ____/ /__/ / -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ \____/_/ \_____/ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ // -////////////////////////////////////////////////////////////////////////// -#ifndef PARAMETER_H -#define PARAMETER_H +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file Parameter.h +//! \ingroup Parameter +//! \author Martin Schoenherr +//======================================================================================= +#ifndef GPU_PARAMETER_H +#define GPU_PARAMETER_H #include <vector> +#include <string> +#include <memory> #include <functional> -#include "LBM/LB.h" + #include "LBM/D3Q27.h" -#include "Calculation/PorousMedia.h" +#include "LBM/LB.h" -#include "PointerDefinitions.h" #include "VirtualFluids_GPU_export.h" -class ConfigData; struct curandStateXORWOW; typedef struct curandStateXORWOW curandState; namespace vf { -namespace gpu -{ -class Communicator; -} - namespace basics { class ConfigurationFile; } } -//struct -struct ParameterStruct +//! \struct LBMSimulationParameter +//! \brief struct holds and manages the LB-parameter of the simulation +//! \brief For this purpose it holds structures and pointer for host and device data, respectively. +struct LBMSimulationParameter { - bool evenOrOdd; - unsigned int numberofthreads; - - //distributions/////////// - //Distributions19 d0; - Distributions27 d0; - Distributions27 d0SP; - - //distributions F3//////// - Distributions6 g6; - - //thermo////////////////// - Distributions7 d7; - Distributions27 d27; - real *Conc, *Conc_Full; - real diffusivity; - //BC NoSlip - TempforBoundaryConditions Temp; - //BC Velocity - TempVelforBoundaryConditions TempVel; - //BC Pressure - TempPressforBoundaryConditions TempPress; - //Plane Conc - real *ConcPlaneIn, *ConcPlaneOut1, *ConcPlaneOut2; - std::vector<double> PlaneConcVectorIn, PlaneConcVectorOut1, PlaneConcVectorOut2; - - //trafo/////////////////// - real mTtoWx, mTtoWy, mTtoWz; - real cTtoWx, cTtoWy, cTtoWz; - - //MGstrafo//////////////// - real cStartx, cStarty, cStartz; - real cFx, cFy, cFz; - - //geo///////////////////// - int *geo; - unsigned int *geoSP; - - //k/////////////////////// - unsigned int *k; - - //neighbor//////////////// - //unsigned int *neighborX, *neighborY, *neighborZ; - unsigned int *neighborX_SP, *neighborY_SP, *neighborZ_SP, *neighborWSB_SP; - - //coordinates//////////// - //unsigned int *coordX_SP, *coordY_SP, *coordZ_SP; - real *coordX_SP, *coordY_SP, *coordZ_SP; - - //body forces//////////// - real *forceX_SP, *forceY_SP, *forceZ_SP; - - //vel parab/////////////// - real *vParab; - - // turbulent viscosity /// - real *turbViscosity; - real *gSij, *gSDij, *gDxvx, *gDyvx, *gDzvx, *gDxvy, *gDyvy, *gDzvy, *gDxvz, *gDyvz, *gDzvz; //DebugInformation - - //macroscopic values////// - real *vx, *vy, *vz, *rho; - real *vx_SP, *vy_SP, *vz_SP, *rho_SP, *press_SP; - real vis, omega; - - //derivations for iso test - real *dxxUx, *dyyUy, *dzzUz; - - //median-macro-values///// - real *vx_SP_Med, *vy_SP_Med, *vz_SP_Med, *rho_SP_Med, *press_SP_Med; - real *vx_SP_Med_Out, *vy_SP_Med_Out, *vz_SP_Med_Out, *rho_SP_Med_Out, *press_SP_Med_Out; - //Advection-Diffusion - real *Conc_Med, *Conc_Med_Out; - - //grid//////////////////// - unsigned int nx, ny, nz; - unsigned int gridNX, gridNY, gridNZ; - - //size of matrix////////// - unsigned int size_Mat; - unsigned int sizePlaneXY, sizePlaneYZ, sizePlaneXZ; - - //size of sparse matrix////////// - unsigned int size_Mat_SP; - unsigned int size_Array_SP; - - //size of Plane btw. 2 GPUs////// - unsigned int sizePlaneSB, sizePlaneRB, startB, endB; - unsigned int sizePlaneST, sizePlaneRT, startT, endT; - bool isSetSendB, isSetRecvB, isSetSendT, isSetRecvT; - int *SendT, *SendB, *RecvT, *RecvB; - - //size of Plane for PressMess - unsigned int sizePlanePress, startP; - unsigned int sizePlanePressIN, startPIN; - unsigned int sizePlanePressOUT, startPOUT; - bool isSetPress; - - //memsizeSP///////////////// - unsigned int mem_size_real_SP; - unsigned int mem_size_int_SP; - - //memsize///////////////// - unsigned int mem_size_real; - unsigned int mem_size_int; - unsigned int mem_size_bool; - unsigned int mem_size_real_yz; - - //print/////////////////// - unsigned int startz, endz; - real Lx,Ly,Lz,dx; - real distX, distY, distZ; - - //interface//////////////// - bool need_interface[6]; - unsigned int XdistKn, YdistKn, ZdistKn; - InterpolationCellCF intCF; - InterpolationCellFC intFC; - unsigned int K_CF; - unsigned int K_FC; - unsigned int mem_size_kCF; - unsigned int mem_size_kFC; - - //offset////////////////// - OffsetCF offCF; - OffsetFC offFC; - unsigned int mem_size_kCF_off; - unsigned int mem_size_kFC_off; - - //BC's//////////////////// - QforBoundaryConditions QWall, Qinflow, Qoutflow, QSlip; - unsigned int kQ=0, kInflowQ=0, kOutflowQ=0, kSlipQ=0; - unsigned int kQread, kInflowQread, kOutflowQread, kSlipQread; - - QforBoundaryConditions QpressX0,QpressX1,QpressY0,QpressY1,QpressZ0,QpressZ1; - QforBoundaryConditions QPropeller; - QforBoundaryConditions QPress; - QforBoundaryConditions QGeom; - QforBoundaryConditions QGeomNormalX, QGeomNormalY, QGeomNormalZ; - QforBoundaryConditions QInflowNormalX, QInflowNormalY, QInflowNormalZ; - QforBoundaryConditions QOutflowNormalX, QOutflowNormalY, QOutflowNormalZ; - QforBoundaryConditions QInlet, QOutlet, QPeriodic; - unsigned int kInletQread, kOutletQread; - unsigned int kPressQ=0, kPressQread; - //testRoundoffError - Distributions27 kDistTestRE; - - ////////////////////////////////////////////////////////////////////////// - //velocities to fit the force - real *VxForce, *VyForce, *VzForce; - ////////////////////////////////////////////////////////////////////////// - real *forcing; - - //Measure Points///////// - std::vector<MeasurePoints> MP; - unsigned int* kMP; - real* VxMP; - real* VyMP; - real* VzMP; - real* RhoMP; - unsigned int memSizerealkMP, memSizeIntkMP, numberOfPointskMP; - unsigned int numberOfValuesMP; - - //Drag Lift////////////// - double *DragPreX, *DragPostX; - double *DragPreY, *DragPostY; - double *DragPreZ, *DragPostZ; - std::vector<double> DragXvector; - std::vector<double> DragYvector; - std::vector<double> DragZvector; - - //2ndMoments//////////// - real *kxyFromfcNEQ, *kyzFromfcNEQ, *kxzFromfcNEQ, *kxxMyyFromfcNEQ, *kxxMzzFromfcNEQ; - - //3rdMoments//////////// - real *CUMbbb, *CUMabc, *CUMbac, *CUMbca, *CUMcba, *CUMacb, *CUMcab; - - //HigherMoments///////// - real *CUMcbb, *CUMbcb, *CUMbbc, *CUMcca, *CUMcac, *CUMacc, *CUMbcc, *CUMcbc, *CUMccb, *CUMccc; - - //CpTop///////////////// - int *cpTopIndex; - double *cpPressTop; - unsigned int numberOfPointsCpTop; - std::vector< std::vector< double > > cpTop; - std::vector< double > pressMirror; - std::vector< bool > isOutsideInterface; - unsigned int numberOfPointsPressWindow; - - - //CpBottom///////////// - int *cpBottomIndex; - double *cpPressBottom; - unsigned int numberOfPointsCpBottom; - std::vector< std::vector< double > > cpBottom; - - //CpBottom2//////////// - int *cpBottom2Index; - double *cpPressBottom2; - unsigned int numberOfPointsCpBottom2; - std::vector< std::vector< double > > cpBottom2; - - //Concentration//////// - int *concIndex; - real *concentration; - unsigned int numberOfPointsConc; - - //street X and Y velocity fractions/////// - real *streetFractionXvelocity; - real *streetFractionYvelocity; - int *naschVelocity; - uint numberOfStreetNodes; - - //deltaPhi - real deltaPhi; - - //////////////////////////////////////////////////////////////////////////// - //particles - PathLineParticles plp; - //////////////////////////////////////////////////////////////////////////// - - //////////////////////////////////////////////////////////////////////////// - //1D domain decomposition - std::vector< ProcessNeighbor27 > sendProcessNeighbor; - std::vector< ProcessNeighbor27 > recvProcessNeighbor; - /////////////////////////////////////////////////////// - //3D domain decomposition - std::vector< ProcessNeighbor27 > sendProcessNeighborX; - std::vector< ProcessNeighbor27 > sendProcessNeighborY; - std::vector< ProcessNeighbor27 > sendProcessNeighborZ; - std::vector< ProcessNeighbor27 > recvProcessNeighborX; - std::vector< ProcessNeighbor27 > recvProcessNeighborY; - std::vector< ProcessNeighbor27 > recvProcessNeighborZ; - /////////////////////////////////////////////////////// - //3D domain decomposition convection diffusion - std::vector< ProcessNeighbor27 > sendProcessNeighborADX; - std::vector< ProcessNeighbor27 > sendProcessNeighborADY; - std::vector< ProcessNeighbor27 > sendProcessNeighborADZ; - std::vector< ProcessNeighbor27 > recvProcessNeighborADX; - std::vector< ProcessNeighbor27 > recvProcessNeighborADY; - std::vector< ProcessNeighbor27 > recvProcessNeighborADZ; - /////////////////////////////////////////////////////// - //3D domain decomposition F3 - std::vector< ProcessNeighborF3 > sendProcessNeighborF3X; - std::vector< ProcessNeighborF3 > sendProcessNeighborF3Y; - std::vector< ProcessNeighborF3 > sendProcessNeighborF3Z; - std::vector< ProcessNeighborF3 > recvProcessNeighborF3X; - std::vector< ProcessNeighborF3 > recvProcessNeighborF3Y; - std::vector< ProcessNeighborF3 > recvProcessNeighborF3Z; - //////////////////////////////////////////////////////////////////////////// + bool evenOrOdd; + unsigned int numberofthreads; + + // distributions/////////// + // Distributions19 d0; + Distributions27 d0; + Distributions27 d0SP; + + // distributions F3//////// + Distributions6 g6; + + // thermo////////////////// + Distributions7 d7; + Distributions27 d27; + real *Conc, *Conc_Full; + real diffusivity; + // BC NoSlip + TempforBoundaryConditions Temp; + // BC Velocity + TempVelforBoundaryConditions TempVel; + // BC Pressure + TempPressforBoundaryConditions TempPress; + // Plane Conc + real *ConcPlaneIn, *ConcPlaneOut1, *ConcPlaneOut2; + std::vector<double> PlaneConcVectorIn, PlaneConcVectorOut1, PlaneConcVectorOut2; + + // trafo/////////////////// + real mTtoWx, mTtoWy, mTtoWz; + real cTtoWx, cTtoWy, cTtoWz; + + // MGstrafo//////////////// + real cStartx, cStarty, cStartz; + real cFx, cFy, cFz; + + // geo///////////////////// + int *geo; + unsigned int *geoSP; + + // k/////////////////////// + unsigned int *k; + + // neighbor//////////////// + // unsigned int *neighborX, *neighborY, *neighborZ; + unsigned int *neighborX_SP, *neighborY_SP, *neighborZ_SP, *neighborWSB_SP; + + // coordinates//////////// + // unsigned int *coordX_SP, *coordY_SP, *coordZ_SP; + real *coordX_SP, *coordY_SP, *coordZ_SP; + + // body forces//////////// + real *forceX_SP, *forceY_SP, *forceZ_SP; + + // vel parab/////////////// + real *vParab; + + // turbulent viscosity /// + real *turbViscosity; + real *gSij, *gSDij, *gDxvx, *gDyvx, *gDzvx, *gDxvy, *gDyvy, *gDzvy, *gDxvz, *gDyvz, *gDzvz; // DebugInformation + + // macroscopic values////// + real *vx, *vy, *vz, *rho; + real *vx_SP, *vy_SP, *vz_SP, *rho_SP, *press_SP; + real vis, omega; + + // derivations for iso test + real *dxxUx, *dyyUy, *dzzUz; + + // median-macro-values///// + real *vx_SP_Med, *vy_SP_Med, *vz_SP_Med, *rho_SP_Med, *press_SP_Med; + real *vx_SP_Med_Out, *vy_SP_Med_Out, *vz_SP_Med_Out, *rho_SP_Med_Out, *press_SP_Med_Out; + // Advection-Diffusion + real *Conc_Med, *Conc_Med_Out; + + // grid//////////////////// + unsigned int nx, ny, nz; + unsigned int gridNX, gridNY, gridNZ; + + // size of matrix////////// + unsigned int size_Mat; + unsigned int sizePlaneXY, sizePlaneYZ, sizePlaneXZ; + + // size of sparse matrix////////// + unsigned int size_Mat_SP; + unsigned int size_Array_SP; + + // size of Plane btw. 2 GPUs////// + unsigned int sizePlaneSB, sizePlaneRB, startB, endB; + unsigned int sizePlaneST, sizePlaneRT, startT, endT; + bool isSetSendB, isSetRecvB, isSetSendT, isSetRecvT; + int *SendT, *SendB, *RecvT, *RecvB; + + // size of Plane for PressMess + unsigned int sizePlanePress, startP; + unsigned int sizePlanePressIN, startPIN; + unsigned int sizePlanePressOUT, startPOUT; + bool isSetPress; + + // memsizeSP///////////////// + unsigned int mem_size_real_SP; + unsigned int mem_size_int_SP; + + // memsize///////////////// + unsigned int mem_size_real; + unsigned int mem_size_int; + unsigned int mem_size_bool; + unsigned int mem_size_real_yz; + + // print/////////////////// + unsigned int startz, endz; + real Lx, Ly, Lz, dx; + real distX, distY, distZ; + + // interface//////////////// + bool need_interface[6]; + unsigned int XdistKn, YdistKn, ZdistKn; + InterpolationCellCF intCF; + InterpolationCellFC intFC; + unsigned int K_CF; + unsigned int K_FC; + unsigned int mem_size_kCF; + unsigned int mem_size_kFC; + + // offset////////////////// + OffsetCF offCF; + OffsetFC offFC; + unsigned int mem_size_kCF_off; + unsigned int mem_size_kFC_off; + + // BC's//////////////////// + QforBoundaryConditions QWall, Qinflow, Qoutflow, QSlip; + unsigned int kQ = 0, kInflowQ = 0, kOutflowQ = 0, kSlipQ = 0; + unsigned int kQread, kInflowQread, kOutflowQread, kSlipQread; + + QforBoundaryConditions QpressX0, QpressX1, QpressY0, QpressY1, QpressZ0, QpressZ1; + QforBoundaryConditions QPropeller; + QforBoundaryConditions QPress; + QforBoundaryConditions QGeom; + QforBoundaryConditions QGeomNormalX, QGeomNormalY, QGeomNormalZ; + QforBoundaryConditions QInflowNormalX, QInflowNormalY, QInflowNormalZ; + QforBoundaryConditions QOutflowNormalX, QOutflowNormalY, QOutflowNormalZ; + QforBoundaryConditions QInlet, QOutlet, QPeriodic; + unsigned int kInletQread, kOutletQread; + unsigned int kPressQ = 0, kPressQread; + // testRoundoffError + Distributions27 kDistTestRE; + + ////////////////////////////////////////////////////////////////////////// + // velocities to fit the force + real *VxForce, *VyForce, *VzForce; + ////////////////////////////////////////////////////////////////////////// + real *forcing; + + // Measure Points///////// + std::vector<MeasurePoints> MP; + unsigned int *kMP; + real *VxMP; + real *VyMP; + real *VzMP; + real *RhoMP; + unsigned int memSizerealkMP, memSizeIntkMP, numberOfPointskMP; + unsigned int numberOfValuesMP; + + // Drag Lift////////////// + double *DragPreX, *DragPostX; + double *DragPreY, *DragPostY; + double *DragPreZ, *DragPostZ; + std::vector<double> DragXvector; + std::vector<double> DragYvector; + std::vector<double> DragZvector; + + // 2ndMoments//////////// + real *kxyFromfcNEQ, *kyzFromfcNEQ, *kxzFromfcNEQ, *kxxMyyFromfcNEQ, *kxxMzzFromfcNEQ; + + // 3rdMoments//////////// + real *CUMbbb, *CUMabc, *CUMbac, *CUMbca, *CUMcba, *CUMacb, *CUMcab; + + // HigherMoments///////// + real *CUMcbb, *CUMbcb, *CUMbbc, *CUMcca, *CUMcac, *CUMacc, *CUMbcc, *CUMcbc, *CUMccb, *CUMccc; + + // CpTop///////////////// + int *cpTopIndex; + double *cpPressTop; + unsigned int numberOfPointsCpTop; + std::vector<std::vector<double>> cpTop; + std::vector<double> pressMirror; + std::vector<bool> isOutsideInterface; + unsigned int numberOfPointsPressWindow; + + // CpBottom///////////// + int *cpBottomIndex; + double *cpPressBottom; + unsigned int numberOfPointsCpBottom; + std::vector<std::vector<double>> cpBottom; + + // CpBottom2//////////// + int *cpBottom2Index; + double *cpPressBottom2; + unsigned int numberOfPointsCpBottom2; + std::vector<std::vector<double>> cpBottom2; + + // Concentration//////// + int *concIndex; + real *concentration; + unsigned int numberOfPointsConc; + + // street X and Y velocity fractions/////// + real *streetFractionXvelocity; + real *streetFractionYvelocity; + int *naschVelocity; + uint numberOfStreetNodes; + + // deltaPhi + real deltaPhi; + + //////////////////////////////////////////////////////////////////////////// + // particles + PathLineParticles plp; + //////////////////////////////////////////////////////////////////////////// + + //////////////////////////////////////////////////////////////////////////// + // 1D domain decomposition + std::vector<ProcessNeighbor27> sendProcessNeighbor; + std::vector<ProcessNeighbor27> recvProcessNeighbor; + /////////////////////////////////////////////////////// + // 3D domain decomposition + std::vector<ProcessNeighbor27> sendProcessNeighborX; + std::vector<ProcessNeighbor27> sendProcessNeighborY; + std::vector<ProcessNeighbor27> sendProcessNeighborZ; + std::vector<ProcessNeighbor27> recvProcessNeighborX; + std::vector<ProcessNeighbor27> recvProcessNeighborY; + std::vector<ProcessNeighbor27> recvProcessNeighborZ; + /////////////////////////////////////////////////////// + // 3D domain decomposition convection diffusion + std::vector<ProcessNeighbor27> sendProcessNeighborADX; + std::vector<ProcessNeighbor27> sendProcessNeighborADY; + std::vector<ProcessNeighbor27> sendProcessNeighborADZ; + std::vector<ProcessNeighbor27> recvProcessNeighborADX; + std::vector<ProcessNeighbor27> recvProcessNeighborADY; + std::vector<ProcessNeighbor27> recvProcessNeighborADZ; + /////////////////////////////////////////////////////// + // 3D domain decomposition F3 + std::vector<ProcessNeighborF3> sendProcessNeighborF3X; + std::vector<ProcessNeighborF3> sendProcessNeighborF3Y; + std::vector<ProcessNeighborF3> sendProcessNeighborF3Z; + std::vector<ProcessNeighborF3> recvProcessNeighborF3X; + std::vector<ProcessNeighborF3> recvProcessNeighborF3Y; + std::vector<ProcessNeighborF3> recvProcessNeighborF3Z; + //////////////////////////////////////////////////////////////////////////// }; class VIRTUALFLUIDS_GPU_EXPORT Parameter { public: - Parameter(const vf::gpu::Communicator& comm); - Parameter(const vf::basics::ConfigurationFile& configData, const vf::gpu::Communicator& comm); - Parameter(SPtr<ConfigData> configData, vf::gpu::Communicator* comm); - - static SPtr<Parameter> make(SPtr<ConfigData> configData, vf::gpu::Communicator* comm); - - ParameterStruct* getParH(int level); - ParameterStruct* getParD(int level); - void initParameter(); - void fillSparse(int level); - - //measure points - void copyMeasurePointsArrayToVector(int lev); - - ////////////////////////////////////////////////////////////////////////// - //setter - void setForcing(real forcingX, real forcingY, real forcingZ); - void setQuadricLimiters(real quadricLimiterP, real quadricLimiterM, real quadricLimiterD); - void setPhi(real inPhi); - void setAngularVelocity(real inAngVel); - void setStepEnsight(unsigned int step); - void setOutputCount(unsigned int outputCount); - void setlimitOfNodesForVTK(unsigned int limitOfNodesForVTK); - void setStartTurn(unsigned int inStartTurn); - void setSizeMatSparse(int level); - void setDiffOn(bool isDiff); - void setCompOn(bool isComp); - void setDiffMod(int DiffMod); - void setDiffusivity(real Diffusivity); - void setD3Qxx(int d3qxx); - void setMaxLevel(int maxlevel); - void setParticleBasicLevel(int pbl); - void setParticleInitLevel(int pil); - void setNumberOfParticles(int nop); - void setCalcParticles(bool calcParticles); - void setStartXHotWall(real startXHotWall); - void setEndXHotWall(real endXHotWall); - void setTEnd(unsigned int tend); - void setTOut(unsigned int tout); - void setTStartOut(unsigned int tStartOut); - void setTimestepOfCoarseLevel(unsigned int timestep); - void setCalcMedian(bool calcMedian); - void setCalcDragLift(bool calcDragLift); - void setCalcCp(bool calcCp); - void setWriteVeloASCIIfiles(bool writeVeloASCII); - void setCalcPlaneConc(bool calcPlaneConc); - void setTimeCalcMedStart(int CalcMedStart); - void setTimeCalcMedEnd(int CalcMedEnd); - void setMaxDev(int maxdev); - void setMyID(int myid); - void setNumprocs(int numprocs); - void setPressInID(unsigned int PressInID); - void setPressOutID(unsigned int PressOutID); - void setPressInZ(unsigned int PressInZ); - void setPressOutZ(unsigned int PressOutZ); - void settimestepForMP(unsigned int timestepForMP); - void setOutputPath(std::string oPath); - void setOutputPrefix(std::string oPrefix); - void setFName(std::string fname); - void setGeometryFileC(std::string GeometryFileC); - void setGeometryFileM(std::string GeometryFileM); - void setGeometryFileF(std::string GeometryFileF); - void setkFull(std::string kFull); - void setgeoFull(std::string geoFull); - void setgeoVec(std::string geoVec); - void setcoordX(std::string coordX); - void setcoordY(std::string coordY); - void setcoordZ(std::string coordZ); - void setneighborX(std::string neighborX); - void setneighborY(std::string neighborY); - void setneighborZ(std::string neighborZ); - void setneighborWSB(std::string neighborWSB); - void setscaleCFC(std::string scaleCFC); - void setscaleCFF(std::string scaleCFF); - void setscaleFCC(std::string scaleFCC); - void setscaleFCF(std::string scaleFCF); - void setscaleOffsetCF(std::string scaleOffsetCF); - void setscaleOffsetFC(std::string scaleOffsetFC); - void setgeomBoundaryBcQs(std::string geomBoundaryBcQs); - void setgeomBoundaryBcValues(std::string geomBoundaryBcValues); - void setnoSlipBcPos(std::string noSlipBcPos); - void setnoSlipBcQs(std::string noSlipBcQs); - void setnoSlipBcValue(std::string noSlipBcValue); - void setnoSlipBcValues(std::string noSlipBcValues); - void setslipBcPos(std::string slipBcPos); - void setslipBcQs(std::string slipBcQs); - void setslipBcValue(std::string slipBcValue); - void setpressBcPos(std::string pressBcPos); - void setpressBcQs(std::string pressBcQs); - void setpressBcValue(std::string pressBcValue); - void setpressBcValues(std::string pressBcValues); - void setvelBcQs(std::string velBcQs); - void setvelBcValues(std::string velBcValues); - void setinletBcQs(std::string inletBcQs); - void setinletBcValues(std::string inletBcValues); - void setoutletBcQs(std::string outletBcQs); - void setoutletBcValues(std::string outletBcValues); - void settopBcQs(std::string topBcQs); - void settopBcValues(std::string topBcValues); - void setbottomBcQs(std::string bottomBcQs); - void setbottomBcValues(std::string bottomBcValues); - void setfrontBcQs(std::string frontBcQs); - void setfrontBcValues(std::string frontBcValues); - void setbackBcQs(std::string backBcQs); - void setbackBcValues(std::string backBcValues); - void setwallBcQs(std::string wallBcQs); - void setwallBcValues(std::string wallBcValues); - void setperiodicBcQs(std::string periodicBcQs); - void setperiodicBcValues(std::string periodicBcValues); - void setpropellerCylinder(std::string propellerCylinder); - void setpropellerValues(std::string propellerValues); - void setpropellerQs(std::string propellerQs); - void setmeasurePoints(std::string measurePoints); - void setnumberNodes(std::string numberNodes); - void setLBMvsSI(std::string LBMvsSI); - void setcpTop(std::string cpTop); - void setcpBottom(std::string cpBottom); - void setcpBottom2(std::string cpBottom2); - void setConcentration(std::string concFile); - void setStreetVelocity(std::string streetVelocity); - void setPrintFiles(bool printfiles); - void setReadGeo(bool readGeo); - void setTemperatureInit(real Temp); - void setTemperatureBC(real TempBC); - void setViscosity(real Viscosity); - void setVelocity(real Velocity); - void setViscosityRatio(real ViscosityRatio); - void setVelocityRatio(real VelocityRatio); - void setDensityRatio(real DensityRatio); - void setPressRatio(real PressRatio); - void setRealX(real RealX); - void setRealY(real RealY); - void setRe(real Re); - void setFactorPressBC(real factorPressBC); - void setIsGeo(bool isGeo); - void setIsGeoNormal(bool isGeoNormal); - void setIsInflowNormal(bool isInflowNormal); - void setIsOutflowNormal(bool isOutflowNormal); - void setIsProp(bool isProp); - void setIsCp(bool isCp); - void setConcFile(bool concFile); - void setStreetVelocityFile(bool streetVelocityFile); - void setUseMeasurePoints(bool useMeasurePoints); - void setUseWale(bool useWale); - void setUseInitNeq(bool useInitNeq); - void setSimulatePorousMedia(bool simulatePorousMedia); - void setIsF3(bool isF3); + Parameter(const vf::basics::ConfigurationFile &configData, int numberOfProcesses, int myId); + + std::shared_ptr<LBMSimulationParameter> getParH(int level); + std::shared_ptr<LBMSimulationParameter> getParD(int level); + + void fillSparse(int level); + + // measure points + void copyMeasurePointsArrayToVector(int lev); + + ////////////////////////////////////////////////////////////////////////// + // setter + void setForcing(real forcingX, real forcingY, real forcingZ); + void setQuadricLimiters(real quadricLimiterP, real quadricLimiterM, real quadricLimiterD); + void setPhi(real inPhi); + void setAngularVelocity(real inAngVel); + void setStepEnsight(unsigned int step); + void setOutputCount(unsigned int outputCount); + void setlimitOfNodesForVTK(unsigned int limitOfNodesForVTK); + void setStartTurn(unsigned int inStartTurn); + void setSizeMatSparse(int level); + void setDiffOn(bool isDiff); + void setCompOn(bool isComp); + void setDiffMod(int DiffMod); + void setDiffusivity(real Diffusivity); + void setD3Qxx(int d3qxx); + void setMaxLevel(int maxlevel); + void setParticleBasicLevel(int pbl); + void setParticleInitLevel(int pil); + void setNumberOfParticles(int nop); + void setCalcParticles(bool calcParticles); + void setStartXHotWall(real startXHotWall); + void setEndXHotWall(real endXHotWall); + void setTEnd(unsigned int tend); + void setTOut(unsigned int tout); + void setTStartOut(unsigned int tStartOut); + void setTimestepOfCoarseLevel(unsigned int timestep); + void setCalcMedian(bool calcMedian); + void setCalcDragLift(bool calcDragLift); + void setCalcCp(bool calcCp); + void setWriteVeloASCIIfiles(bool writeVeloASCII); + void setCalcPlaneConc(bool calcPlaneConc); + void setTimeCalcMedStart(int CalcMedStart); + void setTimeCalcMedEnd(int CalcMedEnd); + void setMaxDev(int maxdev); + void setMyID(int myid); + void setNumprocs(int numprocs); + void setPressInID(unsigned int PressInID); + void setPressOutID(unsigned int PressOutID); + void setPressInZ(unsigned int PressInZ); + void setPressOutZ(unsigned int PressOutZ); + void settimestepForMP(unsigned int timestepForMP); + void setOutputPath(std::string oPath); + void setOutputPrefix(std::string oPrefix); + void setFName(std::string fname); + void setGeometryFileC(std::string GeometryFileC); + void setGeometryFileM(std::string GeometryFileM); + void setGeometryFileF(std::string GeometryFileF); + void setkFull(std::string kFull); + void setgeoFull(std::string geoFull); + void setgeoVec(std::string geoVec); + void setcoordX(std::string coordX); + void setcoordY(std::string coordY); + void setcoordZ(std::string coordZ); + void setneighborX(std::string neighborX); + void setneighborY(std::string neighborY); + void setneighborZ(std::string neighborZ); + void setneighborWSB(std::string neighborWSB); + void setscaleCFC(std::string scaleCFC); + void setscaleCFF(std::string scaleCFF); + void setscaleFCC(std::string scaleFCC); + void setscaleFCF(std::string scaleFCF); + void setscaleOffsetCF(std::string scaleOffsetCF); + void setscaleOffsetFC(std::string scaleOffsetFC); + void setgeomBoundaryBcQs(std::string geomBoundaryBcQs); + void setgeomBoundaryBcValues(std::string geomBoundaryBcValues); + void setnoSlipBcPos(std::string noSlipBcPos); + void setnoSlipBcQs(std::string noSlipBcQs); + void setnoSlipBcValue(std::string noSlipBcValue); + void setnoSlipBcValues(std::string noSlipBcValues); + void setslipBcPos(std::string slipBcPos); + void setslipBcQs(std::string slipBcQs); + void setslipBcValue(std::string slipBcValue); + void setpressBcPos(std::string pressBcPos); + void setpressBcQs(std::string pressBcQs); + void setpressBcValue(std::string pressBcValue); + void setpressBcValues(std::string pressBcValues); + void setvelBcQs(std::string velBcQs); + void setvelBcValues(std::string velBcValues); + void setinletBcQs(std::string inletBcQs); + void setinletBcValues(std::string inletBcValues); + void setoutletBcQs(std::string outletBcQs); + void setoutletBcValues(std::string outletBcValues); + void settopBcQs(std::string topBcQs); + void settopBcValues(std::string topBcValues); + void setbottomBcQs(std::string bottomBcQs); + void setbottomBcValues(std::string bottomBcValues); + void setfrontBcQs(std::string frontBcQs); + void setfrontBcValues(std::string frontBcValues); + void setbackBcQs(std::string backBcQs); + void setbackBcValues(std::string backBcValues); + void setwallBcQs(std::string wallBcQs); + void setwallBcValues(std::string wallBcValues); + void setperiodicBcQs(std::string periodicBcQs); + void setperiodicBcValues(std::string periodicBcValues); + void setpropellerCylinder(std::string propellerCylinder); + void setpropellerValues(std::string propellerValues); + void setpropellerQs(std::string propellerQs); + void setmeasurePoints(std::string measurePoints); + void setnumberNodes(std::string numberNodes); + void setLBMvsSI(std::string LBMvsSI); + void setcpTop(std::string cpTop); + void setcpBottom(std::string cpBottom); + void setcpBottom2(std::string cpBottom2); + void setConcentration(std::string concFile); + void setStreetVelocity(std::string streetVelocity); + void setPrintFiles(bool printfiles); + void setReadGeo(bool readGeo); + void setTemperatureInit(real Temp); + void setTemperatureBC(real TempBC); + void setViscosity(real Viscosity); + void setVelocity(real Velocity); + void setViscosityRatio(real ViscosityRatio); + void setVelocityRatio(real VelocityRatio); + void setDensityRatio(real DensityRatio); + void setPressRatio(real PressRatio); + void setRealX(real RealX); + void setRealY(real RealY); + void setRe(real Re); + void setFactorPressBC(real factorPressBC); + void setIsGeo(bool isGeo); + void setIsGeoNormal(bool isGeoNormal); + void setIsInflowNormal(bool isInflowNormal); + void setIsOutflowNormal(bool isOutflowNormal); + void setIsProp(bool isProp); + void setIsCp(bool isCp); + void setConcFile(bool concFile); + void setStreetVelocityFile(bool streetVelocityFile); + void setUseMeasurePoints(bool useMeasurePoints); + void setUseWale(bool useWale); + void setUseInitNeq(bool useInitNeq); + void setSimulatePorousMedia(bool simulatePorousMedia); + void setIsF3(bool isF3); void setIsBodyForce(bool isBodyForce); - void setclockCycleForMP(real clockCycleForMP); - void setDevices(std::vector<uint> devices); - void setGridX(std::vector<int> GridX); - void setGridY(std::vector<int> GridY); - void setGridZ(std::vector<int> GridZ); - void setDistX(std::vector<int> DistX); - void setDistY(std::vector<int> DistY); - void setDistZ(std::vector<int> DistZ); - void setScaleLBMtoSI(std::vector<real> scaleLBMtoSI); - void setTranslateLBMtoSI(std::vector<real> translateLBMtoSI); - void setMinCoordX(std::vector<real> MinCoordX); - void setMinCoordY(std::vector<real> MinCoordY); - void setMinCoordZ(std::vector<real> MinCoordZ); - void setMaxCoordX(std::vector<real> MaxCoordX); - void setMaxCoordY(std::vector<real> MaxCoordY); - void setMaxCoordZ(std::vector<real> MaxCoordZ); - void setNeedInterface(std::vector<bool> NeedInterface); - void setTempH(TempforBoundaryConditions* TempH); - void setTempD(TempforBoundaryConditions* TempD); - void setTempVelH(TempVelforBoundaryConditions* TempVelH); - void setTempVelD(TempVelforBoundaryConditions* TempVelD); - void setTempPressH(TempPressforBoundaryConditions* TempPressH); - void setTempPressD(TempPressforBoundaryConditions* TempPressD); - void setTimeDoCheckPoint(unsigned int tDoCheckPoint); - void setTimeDoRestart(unsigned int tDoRestart); - void setDoCheckPoint(bool doCheckPoint); - void setDoRestart(bool doRestart); - void setObj(std::string str, bool isObj); - void setGeometryValues(bool GeometryValues); - void setCalc2ndOrderMoments(bool is2ndOrderMoments); - void setCalc3rdOrderMoments(bool is3rdOrderMoments); - void setCalcHighOrderMoments(bool isHighOrderMoments); - void setMemsizeGPU(double admem, bool reset); - //1D domain decomposition - void setPossNeighborFiles(std::vector<std::string> possNeighborFiles, std::string sor); - void setNumberOfProcessNeighbors(unsigned int numberOfProcessNeighbors, int level, std::string sor); - void setIsNeighbor(bool isNeighbor); - //3D domain decomposition - void setPossNeighborFilesX(std::vector<std::string> possNeighborFiles, std::string sor); - void setPossNeighborFilesY(std::vector<std::string> possNeighborFiles, std::string sor); - void setPossNeighborFilesZ(std::vector<std::string> possNeighborFiles, std::string sor); - void setNumberOfProcessNeighborsX(unsigned int numberOfProcessNeighbors, int level, std::string sor); - void setNumberOfProcessNeighborsY(unsigned int numberOfProcessNeighbors, int level, std::string sor); - void setNumberOfProcessNeighborsZ(unsigned int numberOfProcessNeighbors, int level, std::string sor); - void setIsNeighborX(bool isNeighbor); - void setIsNeighborY(bool isNeighbor); - void setIsNeighborZ(bool isNeighbor); - //void setkInflowQ(unsigned int kInflowQ); - //void setkOutflowQ(unsigned int kOutflowQ); - //void setQinflowH(QforBoundaryConditions* QinflowH); - //void setQinflowD(QforBoundaryConditions* QinflowD); - //void setQoutflowH(QforBoundaryConditions* QoutflowH); - //void setQoutflowD(QforBoundaryConditions* QoutflowD); - //Normals - void setgeomBoundaryNormalX(std::string geomNormalX); - void setgeomBoundaryNormalY(std::string geomNormalY); - void setgeomBoundaryNormalZ(std::string geomNormalZ); - void setInflowBoundaryNormalX(std::string inflowNormalX); - void setInflowBoundaryNormalY(std::string inflowNormalY); - void setInflowBoundaryNormalZ(std::string inflowNormalZ); - void setOutflowBoundaryNormalX(std::string outflowNormalX); - void setOutflowBoundaryNormalY(std::string outflowNormalY); - void setOutflowBoundaryNormalZ(std::string outflowNormalZ); - //Kernel + void setclockCycleForMP(real clockCycleForMP); + void setDevices(std::vector<uint> devices); + void setGridX(std::vector<int> GridX); + void setGridY(std::vector<int> GridY); + void setGridZ(std::vector<int> GridZ); + void setDistX(std::vector<int> DistX); + void setDistY(std::vector<int> DistY); + void setDistZ(std::vector<int> DistZ); + void setScaleLBMtoSI(std::vector<real> scaleLBMtoSI); + void setTranslateLBMtoSI(std::vector<real> translateLBMtoSI); + void setMinCoordX(std::vector<real> MinCoordX); + void setMinCoordY(std::vector<real> MinCoordY); + void setMinCoordZ(std::vector<real> MinCoordZ); + void setMaxCoordX(std::vector<real> MaxCoordX); + void setMaxCoordY(std::vector<real> MaxCoordY); + void setMaxCoordZ(std::vector<real> MaxCoordZ); + void setNeedInterface(std::vector<bool> NeedInterface); + void setTempH(TempforBoundaryConditions *TempH); + void setTempD(TempforBoundaryConditions *TempD); + void setTempVelH(TempVelforBoundaryConditions *TempVelH); + void setTempVelD(TempVelforBoundaryConditions *TempVelD); + void setTempPressH(TempPressforBoundaryConditions *TempPressH); + void setTempPressD(TempPressforBoundaryConditions *TempPressD); + void setTimeDoCheckPoint(unsigned int tDoCheckPoint); + void setTimeDoRestart(unsigned int tDoRestart); + void setDoCheckPoint(bool doCheckPoint); + void setDoRestart(bool doRestart); + void setObj(std::string str, bool isObj); + void setGeometryValues(bool GeometryValues); + void setCalc2ndOrderMoments(bool is2ndOrderMoments); + void setCalc3rdOrderMoments(bool is3rdOrderMoments); + void setCalcHighOrderMoments(bool isHighOrderMoments); + void setMemsizeGPU(double admem, bool reset); + // 1D domain decomposition + void setPossNeighborFiles(std::vector<std::string> possNeighborFiles, std::string sor); + void setNumberOfProcessNeighbors(unsigned int numberOfProcessNeighbors, int level, std::string sor); + void setIsNeighbor(bool isNeighbor); + // 3D domain decomposition + void setPossNeighborFilesX(std::vector<std::string> possNeighborFiles, std::string sor); + void setPossNeighborFilesY(std::vector<std::string> possNeighborFiles, std::string sor); + void setPossNeighborFilesZ(std::vector<std::string> possNeighborFiles, std::string sor); + void setNumberOfProcessNeighborsX(unsigned int numberOfProcessNeighbors, int level, std::string sor); + void setNumberOfProcessNeighborsY(unsigned int numberOfProcessNeighbors, int level, std::string sor); + void setNumberOfProcessNeighborsZ(unsigned int numberOfProcessNeighbors, int level, std::string sor); + void setIsNeighborX(bool isNeighbor); + void setIsNeighborY(bool isNeighbor); + void setIsNeighborZ(bool isNeighbor); + // void setkInflowQ(unsigned int kInflowQ); + // void setkOutflowQ(unsigned int kOutflowQ); + // void setQinflowH(QforBoundaryConditions* QinflowH); + // void setQinflowD(QforBoundaryConditions* QinflowD); + // void setQoutflowH(QforBoundaryConditions* QoutflowH); + // void setQoutflowD(QforBoundaryConditions* QoutflowD); + // Normals + void setgeomBoundaryNormalX(std::string geomNormalX); + void setgeomBoundaryNormalY(std::string geomNormalY); + void setgeomBoundaryNormalZ(std::string geomNormalZ); + void setInflowBoundaryNormalX(std::string inflowNormalX); + void setInflowBoundaryNormalY(std::string inflowNormalY); + void setInflowBoundaryNormalZ(std::string inflowNormalZ); + void setOutflowBoundaryNormalX(std::string outflowNormalX); + void setOutflowBoundaryNormalY(std::string outflowNormalY); + void setOutflowBoundaryNormalZ(std::string outflowNormalZ); + // Kernel void setMainKernel(std::string kernel); - void setMultiKernelOn(bool isOn); - void setMultiKernelLevel(std::vector<int> kernelLevel); + void setMultiKernelOn(bool isOn); + void setMultiKernelLevel(std::vector<int> kernelLevel); void setMultiKernel(std::vector<std::string> kernel); - void setADKernel(std::string adKernel); - - //getter - double* getForcesDouble(); - real* getForcesHost(); - real* getForcesDev(); - double* getQuadricLimitersDouble(); - real* getQuadricLimitersHost(); - real* getQuadricLimitersDev(); - real getPhi(); - real getAngularVelocity(); - real getStartXHotWall(); - real getEndXHotWall(); - unsigned int getStepEnsight(); - unsigned int getOutputCount(); - unsigned int getlimitOfNodesForVTK(); - unsigned int getStartTurn(); - bool getEvenOrOdd(int level); - bool getDiffOn(); - bool getCompOn(); - bool getPrintFiles(); - bool getReadGeo(); - bool getCalcMedian(); - bool getCalcDragLift(); - bool getCalcCp(); - bool getCalcParticle(); - bool getWriteVeloASCIIfiles(); - bool getCalcPlaneConc(); - int getFine(); - int getCoarse(); - int getParticleBasicLevel(); - int getParticleInitLevel(); - int getNumberOfParticles(); - int getDiffMod(); - int getFactorNZ(); - int getD3Qxx(); - int getMaxLevel(); - int getTimeCalcMedStart(); - int getTimeCalcMedEnd(); - int getMaxDev(); - int getMyID(); - int getNumprocs(); - std::string getOutputPath(); - std::string getOutputPrefix(); - std::string getFName(); - std::string getGeometryFileC(); - std::string getGeometryFileM(); - std::string getGeometryFileF(); - std::string getkFull(); - std::string getgeoFull(); - std::string getgeoVec(); - std::string getcoordX(); - std::string getcoordY(); - std::string getcoordZ(); - std::string getneighborX(); - std::string getneighborY(); - std::string getneighborZ(); - std::string getneighborWSB(); - std::string getscaleCFC(); - std::string getscaleCFF(); - std::string getscaleFCC(); - std::string getscaleFCF(); - std::string getscaleOffsetCF(); - std::string getscaleOffsetFC(); - std::string getgeomBoundaryBcQs(); - std::string getgeomBoundaryBcValues(); - std::string getnoSlipBcPos(); - std::string getnoSlipBcQs(); - std::string getnoSlipBcValue(); - std::string getnoSlipBcValues(); - std::string getslipBcPos(); - std::string getslipBcQs(); - std::string getslipBcValue(); - std::string getpressBcPos(); - std::string getpressBcQs(); - std::string getpressBcValue(); - std::string getpressBcValues(); - std::string getvelBcQs(); - std::string getvelBcValues(); - std::string getinletBcQs(); - std::string getinletBcValues(); - std::string getoutletBcQs(); - std::string getoutletBcValues(); - std::string gettopBcQs(); - std::string gettopBcValues(); - std::string getbottomBcQs(); - std::string getbottomBcValues(); - std::string getfrontBcQs(); - std::string getfrontBcValues(); - std::string getbackBcQs(); - std::string getbackBcValues(); - std::string getwallBcQs(); - std::string getwallBcValues(); - std::string getperiodicBcQs(); - std::string getperiodicBcValues(); - std::string getpropellerQs(); - std::string getpropellerCylinder(); - std::string getpropellerValues(); - std::string getmeasurePoints(); - std::string getnumberNodes(); - std::string getLBMvsSI(); - std::string getcpTop(); - std::string getcpBottom(); - std::string getcpBottom2(); - std::string getConcentration(); - std::string getStreetVelocityFilePath(); - unsigned int getPressInID(); - unsigned int getPressOutID(); - unsigned int getPressInZ(); - unsigned int getPressOutZ(); - unsigned int getMemSizereal(int level); - unsigned int getMemSizeInt(int level); - unsigned int getMemSizeBool(int level); - unsigned int getMemSizerealYZ(int level); - unsigned int getSizeMat(int level); - unsigned int getTStart(); - unsigned int getTInit(); - unsigned int getTEnd(); - unsigned int getTOut(); - unsigned int getTStartOut(); - unsigned int getTimestepForMP(); - unsigned int getTimestepOfCoarseLevel(); - real getDiffusivity(); - real getTemperatureInit(); - real getTemperatureBC(); - real getViscosity(); - real getVelocity(); - real getViscosityRatio(); - real getVelocityRatio(); - real getDensityRatio(); - real getPressRatio(); - real getRealX(); - real getRealY(); - real getRe(); - real getFactorPressBC(); - real getclockCycleForMP(); - std::vector<uint> getDevices(); - std::vector<int> getGridX(); - std::vector<int> getGridY(); - std::vector<int> getGridZ(); - std::vector<int> getDistX(); - std::vector<int> getDistY(); - std::vector<int> getDistZ(); - std::vector<real> getScaleLBMtoSI(); - std::vector<real> getTranslateLBMtoSI(); - std::vector<real> getMinCoordX(); - std::vector<real> getMinCoordY(); - std::vector<real> getMinCoordZ(); - std::vector<real> getMaxCoordX(); - std::vector<real> getMaxCoordY(); - std::vector<real> getMaxCoordZ(); - std::vector<bool> getNeedInterface(); - TempforBoundaryConditions* getTempH(); - TempforBoundaryConditions* getTempD(); - TempVelforBoundaryConditions* getTempVelH(); - TempVelforBoundaryConditions* getTempVelD(); - TempPressforBoundaryConditions* getTempPressH(); - TempPressforBoundaryConditions* getTempPressD(); - unsigned int getTimeDoCheckPoint(); - unsigned int getTimeDoRestart(); - bool getDoCheckPoint(); - bool getDoRestart(); - bool overWritingRestart(unsigned int t); - bool getIsGeo(); - bool getIsGeoNormal(); - bool getIsInflowNormal(); - bool getIsOutflowNormal(); - bool getIsProp(); - bool getIsCp(); - bool getIsGeometryValues(); - bool getCalc2ndOrderMoments(); - bool getCalc3rdOrderMoments(); - bool getCalcHighOrderMoments(); - bool getConcFile(); - bool isStreetVelocityFile(); - bool getUseMeasurePoints(); - bool getUseWale(); - bool getUseInitNeq(); - bool getSimulatePorousMedia(); - bool getIsF3(); + void setADKernel(std::string adKernel); + + // getter + double *getForcesDouble(); + real *getForcesHost(); + real *getForcesDev(); + double *getQuadricLimitersDouble(); + real *getQuadricLimitersHost(); + real *getQuadricLimitersDev(); + real getPhi(); + real getAngularVelocity(); + real getStartXHotWall(); + real getEndXHotWall(); + unsigned int getStepEnsight(); + unsigned int getOutputCount(); + unsigned int getlimitOfNodesForVTK(); + unsigned int getStartTurn(); + bool getEvenOrOdd(int level); + bool getDiffOn(); + bool getCompOn(); + bool getPrintFiles(); + bool getReadGeo(); + bool getCalcMedian(); + bool getCalcDragLift(); + bool getCalcCp(); + bool getCalcParticle(); + bool getWriteVeloASCIIfiles(); + bool getCalcPlaneConc(); + int getFine(); + int getCoarse(); + int getParticleBasicLevel(); + int getParticleInitLevel(); + int getNumberOfParticles(); + int getDiffMod(); + int getFactorNZ(); + int getD3Qxx(); + int getMaxLevel(); + int getTimeCalcMedStart(); + int getTimeCalcMedEnd(); + int getMaxDev(); + int getMyID(); + int getNumprocs(); + std::string getOutputPath(); + std::string getOutputPrefix(); + std::string getFName(); + std::string getGeometryFileC(); + std::string getGeometryFileM(); + std::string getGeometryFileF(); + std::string getkFull(); + std::string getgeoFull(); + std::string getgeoVec(); + std::string getcoordX(); + std::string getcoordY(); + std::string getcoordZ(); + std::string getneighborX(); + std::string getneighborY(); + std::string getneighborZ(); + std::string getneighborWSB(); + std::string getscaleCFC(); + std::string getscaleCFF(); + std::string getscaleFCC(); + std::string getscaleFCF(); + std::string getscaleOffsetCF(); + std::string getscaleOffsetFC(); + std::string getgeomBoundaryBcQs(); + std::string getgeomBoundaryBcValues(); + std::string getnoSlipBcPos(); + std::string getnoSlipBcQs(); + std::string getnoSlipBcValue(); + std::string getnoSlipBcValues(); + std::string getslipBcPos(); + std::string getslipBcQs(); + std::string getslipBcValue(); + std::string getpressBcPos(); + std::string getpressBcQs(); + std::string getpressBcValue(); + std::string getpressBcValues(); + std::string getvelBcQs(); + std::string getvelBcValues(); + std::string getinletBcQs(); + std::string getinletBcValues(); + std::string getoutletBcQs(); + std::string getoutletBcValues(); + std::string gettopBcQs(); + std::string gettopBcValues(); + std::string getbottomBcQs(); + std::string getbottomBcValues(); + std::string getfrontBcQs(); + std::string getfrontBcValues(); + std::string getbackBcQs(); + std::string getbackBcValues(); + std::string getwallBcQs(); + std::string getwallBcValues(); + std::string getperiodicBcQs(); + std::string getperiodicBcValues(); + std::string getpropellerQs(); + std::string getpropellerCylinder(); + std::string getpropellerValues(); + std::string getmeasurePoints(); + std::string getnumberNodes(); + std::string getLBMvsSI(); + std::string getcpTop(); + std::string getcpBottom(); + std::string getcpBottom2(); + std::string getConcentration(); + std::string getStreetVelocityFilePath(); + unsigned int getPressInID(); + unsigned int getPressOutID(); + unsigned int getPressInZ(); + unsigned int getPressOutZ(); + unsigned int getMemSizereal(int level); + unsigned int getMemSizeInt(int level); + unsigned int getMemSizeBool(int level); + unsigned int getMemSizerealYZ(int level); + unsigned int getSizeMat(int level); + unsigned int getTStart(); + unsigned int getTInit(); + unsigned int getTEnd(); + unsigned int getTOut(); + unsigned int getTStartOut(); + unsigned int getTimestepForMP(); + unsigned int getTimestepOfCoarseLevel(); + real getDiffusivity(); + real getTemperatureInit(); + real getTemperatureBC(); + real getViscosity(); + real getVelocity(); + real getViscosityRatio(); + real getVelocityRatio(); + real getDensityRatio(); + real getPressRatio(); + real getRealX(); + real getRealY(); + real getRe(); + real getFactorPressBC(); + real getclockCycleForMP(); + std::vector<uint> getDevices(); + std::vector<int> getGridX(); + std::vector<int> getGridY(); + std::vector<int> getGridZ(); + std::vector<int> getDistX(); + std::vector<int> getDistY(); + std::vector<int> getDistZ(); + std::vector<real> getScaleLBMtoSI(); + std::vector<real> getTranslateLBMtoSI(); + std::vector<real> getMinCoordX(); + std::vector<real> getMinCoordY(); + std::vector<real> getMinCoordZ(); + std::vector<real> getMaxCoordX(); + std::vector<real> getMaxCoordY(); + std::vector<real> getMaxCoordZ(); + std::vector<bool> getNeedInterface(); + TempforBoundaryConditions *getTempH(); + TempforBoundaryConditions *getTempD(); + TempVelforBoundaryConditions *getTempVelH(); + TempVelforBoundaryConditions *getTempVelD(); + TempPressforBoundaryConditions *getTempPressH(); + TempPressforBoundaryConditions *getTempPressD(); + unsigned int getTimeDoCheckPoint(); + unsigned int getTimeDoRestart(); + bool getDoCheckPoint(); + bool getDoRestart(); + bool overWritingRestart(unsigned int t); + bool getIsGeo(); + bool getIsGeoNormal(); + bool getIsInflowNormal(); + bool getIsOutflowNormal(); + bool getIsProp(); + bool getIsCp(); + bool getIsGeometryValues(); + bool getCalc2ndOrderMoments(); + bool getCalc3rdOrderMoments(); + bool getCalcHighOrderMoments(); + bool getConcFile(); + bool isStreetVelocityFile(); + bool getUseMeasurePoints(); + bool getUseWale(); + bool getUseInitNeq(); + bool getSimulatePorousMedia(); + bool getIsF3(); bool getIsBodyForce(); - double getMemsizeGPU(); - //1D domain decomposition - std::vector<std::string> getPossNeighborFiles(std::string sor); - unsigned int getNumberOfProcessNeighbors(int level, std::string sor); - bool getIsNeighbor(); - //3D domain decomposition - std::vector<std::string> getPossNeighborFilesX(std::string sor); - std::vector<std::string> getPossNeighborFilesY(std::string sor); - std::vector<std::string> getPossNeighborFilesZ(std::string sor); - unsigned int getNumberOfProcessNeighborsX(int level, std::string sor); - unsigned int getNumberOfProcessNeighborsY(int level, std::string sor); - unsigned int getNumberOfProcessNeighborsZ(int level, std::string sor); - bool getIsNeighborX(); - bool getIsNeighborY(); - bool getIsNeighborZ(); - //Normals - std::string getgeomBoundaryNormalX(); - std::string getgeomBoundaryNormalY(); - std::string getgeomBoundaryNormalZ(); - std::string getInflowBoundaryNormalX(); - std::string getInflowBoundaryNormalY(); - std::string getInflowBoundaryNormalZ(); - std::string getOutflowBoundaryNormalX(); - std::string getOutflowBoundaryNormalY(); - std::string getOutflowBoundaryNormalZ(); - //CUDA random number - curandState* getRandomState(); - //Kernel + double getMemsizeGPU(); + // 1D domain decomposition + std::vector<std::string> getPossNeighborFiles(std::string sor); + unsigned int getNumberOfProcessNeighbors(int level, std::string sor); + bool getIsNeighbor(); + // 3D domain decomposition + std::vector<std::string> getPossNeighborFilesX(std::string sor); + std::vector<std::string> getPossNeighborFilesY(std::string sor); + std::vector<std::string> getPossNeighborFilesZ(std::string sor); + unsigned int getNumberOfProcessNeighborsX(int level, std::string sor); + unsigned int getNumberOfProcessNeighborsY(int level, std::string sor); + unsigned int getNumberOfProcessNeighborsZ(int level, std::string sor); + bool getIsNeighborX(); + bool getIsNeighborY(); + bool getIsNeighborZ(); + // Normals + std::string getgeomBoundaryNormalX(); + std::string getgeomBoundaryNormalY(); + std::string getgeomBoundaryNormalZ(); + std::string getInflowBoundaryNormalX(); + std::string getInflowBoundaryNormalY(); + std::string getInflowBoundaryNormalZ(); + std::string getOutflowBoundaryNormalX(); + std::string getOutflowBoundaryNormalY(); + std::string getOutflowBoundaryNormalZ(); + // CUDA random number + curandState *getRandomState(); + // Kernel std::string getMainKernel(); - bool getMultiKernelOn(); - std::vector<int> getMultiKernelLevel(); + bool getMultiKernelOn(); + std::vector<int> getMultiKernelLevel(); std::vector<std::string> getMultiKernel(); - std::string getADKernel(); + std::string getADKernel(); -public: - //Forcing/////////////// - real *forcingH, *forcingD; - double hostForcing[3]; + // Forcing/////////////// + real *forcingH, *forcingD; + double hostForcing[3]; ////////////////////////////////////////////////////////////////////////// // limiters real *quadricLimitersH, *quadricLimitersD; double hostQuadricLimiters[3]; - //////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////// // initial condition - void setInitialCondition(std::function<void(real,real,real,real&,real&,real&,real&)> initialCondition); - std::function<void(real,real,real,real&,real&,real&,real&)>& getInitialCondition(); + void setInitialCondition(std::function<void(real, real, real, real &, real &, real &, real &)> initialCondition); + std::function<void(real, real, real, real &, real &, real &, real &)> &getInitialCondition(); -protected: private: - bool compOn; - bool diffOn {false}; - bool isF3; - bool calcDragLift {false}; - bool calcCp {false}; - bool writeVeloASCII {false}; - bool calcPlaneConc {false}; + void readConfigData(const vf::basics::ConfigurationFile &configData); + void initLBMSimulationParameter(); + + bool compOn; + bool diffOn{ false }; + bool isF3; + bool calcDragLift{ false }; + bool calcCp{ false }; + bool writeVeloASCII{ false }; + bool calcPlaneConc{ false }; bool isBodyForce; - int diffMod {27}; - int maxlevel {0}; - int coarse, fine; - int factor_gridNZ; - int D3Qxx {27}; - InitCondition ic; - double memsizeGPU; - unsigned int limitOfNodesForVTK; - unsigned int outputCount; - unsigned int timestep; - - - //Kernel - std::string mainKernel {"CumulantK17Comp"}; - bool multiKernelOn {false}; - std::vector<int> multiKernelLevel; + int diffMod{ 27 }; + int maxlevel{ 0 }; + int coarse, fine; + int factor_gridNZ; + int D3Qxx{ 27 }; + InitCondition ic; + double memsizeGPU; + unsigned int limitOfNodesForVTK; + unsigned int outputCount; + unsigned int timestep; + + // Kernel + std::string mainKernel{ "CumulantK17Comp" }; + bool multiKernelOn{ false }; + std::vector<int> multiKernelLevel; std::vector<std::string> multiKernel; - std::string adKernel; - - ////////////////////////////////////////////////////////////////////////// - //particles - int particleBasicLevel {0}; - int particleInitLevel {0}; - int numberOfParticles {0}; - bool calcParticles {false}; - real stickToSolid {(real) 0.0}; - real startXHotWall {(real) 0.0}; - real endXHotWall {(real) 0.0}; - ////////////////////////////////////////////////////////////////////////// - //CUDA random number generation - curandState* devState; - ////////////////////////////////////////////////////////////////////////// - - //Temperature - TempforBoundaryConditions *TempH, *TempD; - //Temperature Velocity - TempVelforBoundaryConditions *TempVelH, *TempVelD; - //Temperature Pressure - TempPressforBoundaryConditions *TempPressH, *TempPressD; - - //Drehung/////////////// - real Phi, angularVelocity; - unsigned int startTurn; - - //Step of Ensight writing// - unsigned int stepEnsight; - - std::vector<ParameterStruct*> parH; - std::vector<ParameterStruct*> parD; - //LogWriter output; - - void initInterfaceParameter(int level); - real TrafoXtoWorld(int CoordX, int level); - real TrafoYtoWorld(int CoordY, int level); - real TrafoZtoWorld(int CoordZ, int level); + std::string adKernel; + + ////////////////////////////////////////////////////////////////////////// + // particles + int particleBasicLevel{ 0 }; + int particleInitLevel{ 0 }; + int numberOfParticles{ 0 }; + bool calcParticles{ false }; + real startXHotWall{ (real)0.0 }; + real endXHotWall{ (real)0.0 }; + ////////////////////////////////////////////////////////////////////////// + // CUDA random number generation + curandState *devState; + ////////////////////////////////////////////////////////////////////////// + + // Temperature + TempforBoundaryConditions *TempH, *TempD; + // Temperature Velocity + TempVelforBoundaryConditions *TempVelH, *TempVelD; + // Temperature Pressure + TempPressforBoundaryConditions *TempPressH, *TempPressD; + + // Drehung/////////////// + real Phi {0.0}; + real angularVelocity; + unsigned int startTurn; + + // Step of Ensight writing// + unsigned int stepEnsight; + + std::vector<std::shared_ptr<LBMSimulationParameter>> parH; + std::vector<std::shared_ptr<LBMSimulationParameter>> parD; + // LogWriter output; + + void initInterfaceParameter(int level); + real TrafoXtoWorld(int CoordX, int level); + real TrafoYtoWorld(int CoordY, int level); + real TrafoZtoWorld(int CoordZ, int level); + public: - real TrafoXtoMGsWorld(int CoordX, int level); - real TrafoYtoMGsWorld(int CoordY, int level); - real TrafoZtoMGsWorld(int CoordZ, int level); + real TrafoXtoMGsWorld(int CoordX, int level); + real TrafoYtoMGsWorld(int CoordY, int level); + real TrafoZtoMGsWorld(int CoordZ, int level); + private: - //Multi GPGPU/////////////// - //1D domain decomposition - std::vector<std::string> possNeighborFilesSend; - std::vector<std::string> possNeighborFilesRecv; - bool isNeigbor; - //3D domain decomposition - std::vector<std::string> possNeighborFilesSendX, possNeighborFilesSendY, possNeighborFilesSendZ; - std::vector<std::string> possNeighborFilesRecvX, possNeighborFilesRecvY, possNeighborFilesRecvZ; - bool isNeigborX, isNeigborY, isNeigborZ; - - //////////////////////////////////////////////////////////////////////////// + // Multi GPGPU/////////////// + // 1D domain decomposition + std::vector<std::string> possNeighborFilesSend; + std::vector<std::string> possNeighborFilesRecv; + bool isNeigbor; + // 3D domain decomposition + std::vector<std::string> possNeighborFilesSendX, possNeighborFilesSendY, possNeighborFilesSendZ; + std::vector<std::string> possNeighborFilesRecvX, possNeighborFilesRecvY, possNeighborFilesRecvZ; + bool isNeigborX, isNeigborY, isNeigborZ; + + //////////////////////////////////////////////////////////////////////////// // initial condition - std::function<void(real,real,real,real&,real&,real&,real&)> initialCondition; + std::function<void(real, real, real, real &, real &, real &, real &)> initialCondition; }; #endif - -- GitLab