diff --git a/apps/gpu/LBM/DrivenCavity/DrivenCavity.cpp b/apps/gpu/LBM/DrivenCavity/DrivenCavity.cpp index 72942b001e6d839b6f86c452a0f9db562f43562d..42f33feb73f8c7d326656bdeaf76714e51905b6d 100644 --- a/apps/gpu/LBM/DrivenCavity/DrivenCavity.cpp +++ b/apps/gpu/LBM/DrivenCavity/DrivenCavity.cpp @@ -50,7 +50,6 @@ #include "VirtualFluids_GPU/PreProcessor/PreProcessorFactory/PreProcessorFactoryImp.h" #include "VirtualFluids_GPU/GPU/CudaMemoryManager.h" -#include "VirtualFluids_GPU/Kernel/Utilities/Mapper/KernelMapper/KernelMapper.h" ////////////////////////////////////////////////////////////////////////// @@ -97,10 +96,10 @@ const real dt = (real)1.0e-3; //0.5e-3; const uint nx = 64; -std::string path("F:/Work/Computations/out/DrivenCavity/"); //LEGOLAS -//std::string path("E:/DrivenCavity/results/"); //TESLA03 +//std::string path("F:/Work/Computations/out/DrivenCavity/"); //LEGOLAS +std::string path("D:/out/DrivenCavity"); //Mollok -std::string simulationName("DrivenCavity_chim_XY_fast_Re500_inversePrecond"); +std::string simulationName("DrivenCavity"); const uint timeStepOut = 10000; const uint timeStepEnd = 250000; @@ -156,7 +155,6 @@ void multipleLevel(const std::string& configPath) //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// SPtr<Parameter> para = Parameter::make(configData, comm); - SPtr<KernelMapper> kernelMapper = KernelMapper::getInstance(); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -188,11 +186,14 @@ void multipleLevel(const std::string& configPath) para->setVelocityRatio(velocity/ velocityLB); - // para->setMainKernel(kernelMapper->getEnum("BGKCompSP27")); - //para->setMainKernel(kernelMapper->getEnum("BGKPlusCompSP27")); - //para->setMainKernel(kernelMapper->getEnum("CumulantOneCompSP27")); - //para->setMainKernel(kernelMapper->getEnum("CumulantAA2016CompSP27")); - //para->setMainKernel(kernelMapper->getEnum("CumulantOnePreconditionedChimCompSP27")); + para->setMainKernel("CumulantK17Comp"); + + para->setInitialCondition([&](real coordX, real coordY, real coordZ, real &rho, real &vx, real &vy, real &vz) { + rho = (real)0.0; + vx = (real)0.0; //(6 * velocityLB * coordZ * (L - coordZ) / (L * L)); + vy = (real)0.0; + vz = (real)0.0; + }); para->setTOut( timeStepOut ); para->setTEnd( timeStepEnd ); diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Utilities/KernelFactory/KernelFactory.h b/src/gpu/VirtualFluids_GPU/Kernel/Utilities/KernelFactory/KernelFactory.h index 34a16e564023de43503b70246b12253f746a2bc8..26c68f74a3650ea43261fdd66b567ecbd391cb10 100644 --- a/src/gpu/VirtualFluids_GPU/Kernel/Utilities/KernelFactory/KernelFactory.h +++ b/src/gpu/VirtualFluids_GPU/Kernel/Utilities/KernelFactory/KernelFactory.h @@ -1,7 +1,6 @@ #ifndef KERNEL_FACTORY_H #define KERNEL_FACTORY_H -#include "Kernel/Utilities/KernelType.h" #include <memory> #include <string> diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Utilities/KernelFactory/KernelFactoryImp.cpp b/src/gpu/VirtualFluids_GPU/Kernel/Utilities/KernelFactory/KernelFactoryImp.cpp index 1a5870d82064b9b47bad87352dc88cef64f895d3..ae13c9234cc239ab7b72ed39711b46febd15554b 100644 --- a/src/gpu/VirtualFluids_GPU/Kernel/Utilities/KernelFactory/KernelFactoryImp.cpp +++ b/src/gpu/VirtualFluids_GPU/Kernel/Utilities/KernelFactory/KernelFactoryImp.cpp @@ -81,164 +81,124 @@ void KernelFactoryImp::setPorousMedia(std::vector<std::shared_ptr<PorousMedia>> this->pm = pm; } -void KernelFactoryImp::setKernelAtLevel(std::vector<std::shared_ptr<Kernel>> kernels, std::shared_ptr<Parameter> para, KernelType kernel, int level) +void KernelFactoryImp::setKernelAtLevel(std::vector<std::shared_ptr<Kernel>> kernels, std::shared_ptr<Parameter> para, std::string kernel, int level) { kernels.at(level) = makeKernel(para, kernel, level); } -std::shared_ptr<Kernel> KernelFactoryImp::makeKernel(std::shared_ptr<Parameter> para, KernelType kernel, int level) +std::shared_ptr<Kernel> KernelFactoryImp::makeKernel(std::shared_ptr<Parameter> para, std::string kernel, int level) { std::shared_ptr<KernelImp> newKernel; std::shared_ptr<CheckParameterStrategy> checkStrategy; - switch (kernel) - { - case LB_BGKCompSP27: - newKernel = BGKCompSP27::getNewInstance(para, level); - checkStrategy = AdvecCompStrategy::getInstance(); - break; - case LB_BGKPlusCompSP27: - newKernel = BGKPlusCompSP27::getNewInstance(para, level); - checkStrategy = AdvecCompStrategy::getInstance(); - break; - case LB_CascadeCompSP27: - newKernel = CascadeCompSP27::getNewInstance(para, level); - checkStrategy = AdvecCompStrategy::getInstance(); - break; - case LB_CumulantCompSP27: - newKernel = CumulantCompSP27::getNewInstance(para, level); - checkStrategy = AdvecCompStrategy::getInstance(); - break; - case LB_CumulantK17Comp: - newKernel = CumulantK17Comp::getNewInstance(para, level); - checkStrategy = AdvecCompStrategy::getInstance(); - break; - case LB_CumulantK17BulkComp: - newKernel = CumulantK17BulkComp::getNewInstance(para, level); - checkStrategy = AdvecCompStrategy::getInstance(); - break; - case LB_CumulantAll4CompSP27: - newKernel = CumulantAll4CompSP27::getNewInstance(para, level); - checkStrategy = AdvecCompStrategy::getInstance(); - break; - case LB_CumulantK18Comp: - newKernel = CumulantK18Comp::getNewInstance(para, level); - checkStrategy = AdvecCompStrategy::getInstance(); - break; - case LB_CumulantK20Comp: - newKernel = CumulantK20Comp::getNewInstance(para, level); - checkStrategy = AdvecCompStrategy::getInstance(); - break; - case LB_CumulantK15Comp: - newKernel = CumulantK15Comp::getNewInstance(para, level); - checkStrategy = AdvecCompStrategy::getInstance(); - break; - case LB_CumulantK15BulkComp: - newKernel = CumulantK15Comp::getNewInstance(para, level); - checkStrategy = AdvecCompStrategy::getInstance(); - break; - case LB_CumulantK15SpongeComp: - newKernel = CumulantK15SpongeComp::getNewInstance(para, level); - checkStrategy = AdvecCompStrategy::getInstance(); - break; - case LB_MRTCompSP27: - newKernel = MRTCompSP27::getNewInstance(para, level); - checkStrategy = AdvecCompStrategy::getInstance(); - break; - - - case LB_BGKIncompSP27: - newKernel = BGKIncompSP27::getNewInstance(para, level); - checkStrategy = AdvecIncompStrategy::getInstance(); - break; - case LB_BGKPlusIncompSP27: - newKernel = BGKPlusIncompSP27::getNewInstance(para, level); - checkStrategy = AdvecIncompStrategy::getInstance(); - break; - case LB_CascadeIncompSP27: - newKernel = CascadeIncompSP27::getNewInstance(para, level); - checkStrategy = AdvecIncompStrategy::getInstance(); - break; - case LB_Cumulant1hIncompSP27: - newKernel = Cumulant1hIncompSP27::getNewInstance(para, level); - checkStrategy = AdvecIncompStrategy::getInstance(); - break; - case LB_CumulantIsoIncompSP27: - newKernel = CumulantIsoIncompSP27::getNewInstance(para, level); - checkStrategy = AdvecIncompStrategy::getInstance(); - break; - case LB_CumulantK15Incomp: - newKernel = CumulantK15Incomp::getNewInstance(para, level); - checkStrategy = AdvecIncompStrategy::getInstance(); - break; - case LB_MRTIncompSP27: - newKernel = MRTIncompSP27::getNewInstance(para, level); - checkStrategy = AdvecIncompStrategy::getInstance(); - break; - - case LB_PMCumulantOneCompSP27: - newKernel = PMCumulantOneCompSP27::getNewInstance(para, pm, level); - checkStrategy = PMAdvecCompStrategy::getInstance(); - break; - - - - case LB_WaleCumulantK17Comp: - newKernel = WaleCumulantK17Comp::getNewInstance(para, level); - checkStrategy = WaleAdvecCompStrategy::getInstance(); - break; - case LB_WaleCumulantK17DebugComp: - newKernel = WaleCumulantK17DebugComp::getNewInstance(para, level); - checkStrategy = WaleAdvecCompStrategy::getInstance(); - break; - case LB_WaleCumulantK15Comp: - newKernel = WaleCumulantK15Comp::getNewInstance(para, level); - checkStrategy = WaleAdvecCompStrategy::getInstance(); - break; - case LB_WaleBySoniMalavCumulantK15Comp: - newKernel = WaleBySoniMalavCumulantK15Comp::getNewInstance(para, level); - checkStrategy = WaleAdvecCompStrategy::getInstance(); - break; - default: - break; - } - - if (newKernel) { - newKernel->setCheckParameterStrategy(checkStrategy); - return newKernel; - } - else - throw std::runtime_error("KernelFactory does not know the KernelType."); - + if ( kernel == "BGKCompSP27") { + newKernel = BGKCompSP27::getNewInstance(para, level); // compressible + checkStrategy = AdvecCompStrategy::getInstance(); // || + } else if (kernel == "BGKPlusCompSP27") { // \/ + newKernel = BGKPlusCompSP27::getNewInstance(para, level); + checkStrategy = AdvecCompStrategy::getInstance(); + } else if (kernel == "MRTCompSP27") { + newKernel = MRTCompSP27::getNewInstance(para, level); + checkStrategy = AdvecCompStrategy::getInstance(); + } else if (kernel == "CascadeCompSP27") { + newKernel = CascadeCompSP27::getNewInstance(para, level); + checkStrategy = AdvecCompStrategy::getInstance(); + } else if (kernel == "CumulantCompSP27") { + newKernel = CumulantCompSP27::getNewInstance(para, level); + checkStrategy = AdvecCompStrategy::getInstance(); + } else if (kernel == "CumulantK17Comp") { + newKernel = CumulantK17Comp::getNewInstance(para, level); + checkStrategy = AdvecCompStrategy::getInstance(); + } else if (kernel == "CumulantK17BulkComp") { + newKernel = CumulantK17BulkComp::getNewInstance(para, level); + checkStrategy = AdvecCompStrategy::getInstance(); + } else if (kernel == "CumulantAll4CompSP27") { + newKernel = CumulantAll4CompSP27::getNewInstance(para, level); + checkStrategy = AdvecCompStrategy::getInstance(); + } else if (kernel == "CumulantK18Comp") { + newKernel = CumulantK18Comp::getNewInstance(para, level); + checkStrategy = AdvecCompStrategy::getInstance(); + } else if (kernel == "CumulantK20Comp") { + newKernel = CumulantK20Comp::getNewInstance(para, level); + checkStrategy = AdvecCompStrategy::getInstance(); + } else if (kernel == "CumulantK15Comp") { + newKernel = CumulantK15Comp::getNewInstance(para, level); + checkStrategy = AdvecCompStrategy::getInstance(); + } else if (kernel == "CumulantK15BulkComp") { + newKernel = CumulantK15BulkComp::getNewInstance(para, level); + checkStrategy = AdvecCompStrategy::getInstance(); + } else if (kernel == "CumulantK15SpongeComp") { // /\ // + newKernel = CumulantK15SpongeComp::getNewInstance(para, level); // || + checkStrategy = AdvecCompStrategy::getInstance(); // compressible + } //=============== + else if ( kernel == "BGKIncompSP27") { // incompressible + newKernel = BGKIncompSP27::getNewInstance(para, level); // || + checkStrategy = AdvecIncompStrategy::getInstance(); // \/ + } else if (kernel == "BGKPlusIncompSP27") { + newKernel = BGKPlusIncompSP27::getNewInstance(para, level); + checkStrategy = AdvecIncompStrategy::getInstance(); + } else if (kernel == "MRTIncompSP27") { + newKernel = MRTIncompSP27::getNewInstance(para, level); + checkStrategy = AdvecIncompStrategy::getInstance(); + } else if (kernel == "CascadeIncompSP27") { + newKernel = CascadeIncompSP27::getNewInstance(para, level); + checkStrategy = AdvecIncompStrategy::getInstance(); + } else if (kernel == "Cumulant1hIncompSP27") { + newKernel = Cumulant1hIncompSP27::getNewInstance(para, level); + checkStrategy = AdvecIncompStrategy::getInstance(); + } else if (kernel == "CumulantIsoIncompSP27") { + newKernel = CumulantIsoIncompSP27::getNewInstance(para, level); + checkStrategy = AdvecIncompStrategy::getInstance(); + } else if (kernel == "CumulantK15Incomp") { // /\ // + newKernel = CumulantK15Incomp::getNewInstance(para, level); // || + checkStrategy = AdvecIncompStrategy::getInstance(); // incompressible + } //=============== + else if (kernel == "PMCumulantOneCompSP27") { // porous media + newKernel = PMCumulantOneCompSP27::getNewInstance(para, pm, level); // || + checkStrategy = PMAdvecCompStrategy::getInstance(); // porous media + } //=============== + else if (kernel == "WaleCumulantK17Comp") { // wale model + newKernel = WaleCumulantK17Comp::getNewInstance(para, level); // || + checkStrategy = WaleAdvecCompStrategy::getInstance(); // \/ + } else if (kernel == "WaleCumulantK17DebugComp") { + newKernel = WaleCumulantK17DebugComp::getNewInstance(para, level); + checkStrategy = WaleAdvecCompStrategy::getInstance(); + } else if (kernel == "WaleCumulantK15Comp") { + newKernel = WaleCumulantK15Comp::getNewInstance(para, level); + checkStrategy = WaleAdvecCompStrategy::getInstance(); + } else if (kernel == "WaleBySoniMalavCumulantK15Comp") { // /\ // + newKernel = WaleBySoniMalavCumulantK15Comp::getNewInstance(para, level);// || + checkStrategy = WaleAdvecCompStrategy::getInstance(); // wale model + } //=============== + else { + throw std::runtime_error("KernelFactory does not know the KernelType."); + } + + newKernel->setCheckParameterStrategy(checkStrategy); + return newKernel; } -std::shared_ptr<ADKernel> KernelFactoryImp::makeAdvDifKernel(std::shared_ptr<Parameter> para, ADKernelType kernel, int level) +std::shared_ptr<ADKernel> KernelFactoryImp::makeAdvDifKernel(std::shared_ptr<Parameter> para, std::string kernel, int level) { std::shared_ptr<ADKernel> newKernel; std::shared_ptr<CheckParameterStrategy> checkStrategy; - switch (kernel) - { - case LB_ADComp27: - newKernel = ADComp27::getNewInstance(para, level); - checkStrategy = ADMod27CompStrategy::getInstance(); - break; - case LB_ADComp7: - newKernel = ADComp7::getNewInstance(para, level); - checkStrategy = ADMod7CompStrategy::getInstance(); - break; - case LB_ADIncomp27: - newKernel = ADIncomp27::getNewInstance(para, level); - checkStrategy = ADMod27IncompStrategy::getInstance(); - break; - case LB_ADIncomp7: - newKernel = ADIncomp7::getNewInstance(para, level); - checkStrategy = ADMod7IncompStrategy::getInstance(); - break; - default: - break; - } + if (kernel == "ADComp27") { + newKernel = ADComp27::getNewInstance(para, level); + checkStrategy = ADMod27CompStrategy::getInstance(); + } else if(kernel == "ADComp7") { + newKernel = ADComp7::getNewInstance(para, level); + checkStrategy = ADMod7CompStrategy::getInstance(); + } else if (kernel == "ADIncomp27") { + newKernel = ADIncomp27::getNewInstance(para, level); + checkStrategy = ADMod7CompStrategy::getInstance(); + } else if (kernel == "ADIncomp7") { + newKernel = ADIncomp7::getNewInstance(para, level); + checkStrategy = ADMod7CompStrategy::getInstance(); + } else { + throw std::runtime_error("KernelFactory does not know the KernelType."); + } if (newKernel) { newKernel->setCheckParameterStrategy(checkStrategy); diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Utilities/KernelFactory/KernelFactoryImp.h b/src/gpu/VirtualFluids_GPU/Kernel/Utilities/KernelFactory/KernelFactoryImp.h index d8fba02b345c24fba1a310448a86b084cdf3bce8..8373988df0c035007209f1a266723e6d50bcb5d7 100644 --- a/src/gpu/VirtualFluids_GPU/Kernel/Utilities/KernelFactory/KernelFactoryImp.h +++ b/src/gpu/VirtualFluids_GPU/Kernel/Utilities/KernelFactory/KernelFactoryImp.h @@ -17,9 +17,9 @@ public: private: KernelFactoryImp(); - std::shared_ptr< Kernel> makeKernel(std::shared_ptr<Parameter> para, KernelType kernel, int level); - std::shared_ptr< ADKernel> makeAdvDifKernel(std::shared_ptr<Parameter> para, ADKernelType kernel, int level); - void setKernelAtLevel(std::vector< std::shared_ptr<Kernel>> kernels, std::shared_ptr<Parameter> para, KernelType kernel, int level); + std::shared_ptr<Kernel> makeKernel(std::shared_ptr<Parameter> para, std::string kernel, int level); + std::shared_ptr<ADKernel> makeAdvDifKernel(std::shared_ptr<Parameter> para, std::string kernel, int level); + void setKernelAtLevel(std::vector< std::shared_ptr<Kernel>> kernels, std::shared_ptr<Parameter> para, std::string kernel, int level); std::vector<std::shared_ptr<PorousMedia>> pm; }; diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Utilities/KernelType.h b/src/gpu/VirtualFluids_GPU/Kernel/Utilities/KernelType.h deleted file mode 100644 index 14b64e496767d5ec21d48462f92ec2d8b1559c4f..0000000000000000000000000000000000000000 --- a/src/gpu/VirtualFluids_GPU/Kernel/Utilities/KernelType.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef KERNEL_TYPE_H -#define KERNEL_TYPE_H - - -enum KernelType { - LB_BGKCompSP27, - LB_BGKPlusCompSP27, - LB_CascadeCompSP27, - LB_CumulantCompSP27, - LB_CumulantK17Comp, - LB_CumulantK17BulkComp, - LB_CumulantAll4CompSP27, - LB_CumulantK18Comp, - LB_CumulantK20Comp, - LB_CumulantK15Comp, - LB_CumulantK15BulkComp, - LB_CumulantK15SpongeComp, - LB_MRTCompSP27, - - LB_BGKIncompSP27, - LB_BGKPlusIncompSP27, - LB_CascadeIncompSP27, - LB_Cumulant1hIncompSP27, - LB_CumulantIsoIncompSP27, - LB_CumulantK15Incomp, - LB_MRTIncompSP27, - - LB_PMCumulantOneCompSP27, - - LB_WaleCumulantK17Comp, - LB_WaleCumulantK17DebugComp, - LB_WaleCumulantK15Comp, - LB_WaleBySoniMalavCumulantK15Comp -}; - -enum ADKernelType -{ - LB_ADComp27, - LB_ADComp7, - - LB_ADIncomp27, - LB_ADIncomp7 -}; -#endif \ No newline at end of file diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Utilities/Mapper/ADKernelMapper/ADKernelMapper.cpp b/src/gpu/VirtualFluids_GPU/Kernel/Utilities/Mapper/ADKernelMapper/ADKernelMapper.cpp deleted file mode 100644 index 3b0732ffed2aefff0a3bf92b6d82025c14606b7a..0000000000000000000000000000000000000000 --- a/src/gpu/VirtualFluids_GPU/Kernel/Utilities/Mapper/ADKernelMapper/ADKernelMapper.cpp +++ /dev/null @@ -1,27 +0,0 @@ -#include "ADKernelMapper.h" - -std::shared_ptr<ADKernelMapper> ADKernelMapper::getInstance() -{ - static std::shared_ptr<ADKernelMapper> uniqueInstance; - if (!uniqueInstance) - uniqueInstance = std::shared_ptr<ADKernelMapper>(new ADKernelMapper()); - return uniqueInstance; -} - -std::string ADKernelMapper::getString(ADKernelType enumeration) -{ - return myEnumMapper.getString(enumeration); -} - -ADKernelType ADKernelMapper::getEnum(std::string name) -{ - return myEnumMapper.getEnum(name); -} - -ADKernelMapper::ADKernelMapper() -{ - myEnumMapper.addEnum(LB_ADComp27, "ADComp27"); - myEnumMapper.addEnum(LB_ADComp7, "ADComp7"); - myEnumMapper.addEnum(LB_ADIncomp27, "ADIncomp27"); - myEnumMapper.addEnum(LB_ADIncomp7, "ADIncomp7"); -} \ No newline at end of file diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Utilities/Mapper/ADKernelMapper/ADKernelMapper.h b/src/gpu/VirtualFluids_GPU/Kernel/Utilities/Mapper/ADKernelMapper/ADKernelMapper.h deleted file mode 100644 index 14c1b6ceac9edcfd1164763023be08b0db0220e0..0000000000000000000000000000000000000000 --- a/src/gpu/VirtualFluids_GPU/Kernel/Utilities/Mapper/ADKernelMapper/ADKernelMapper.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef AD_KERNEL_MAPPER_H -#define AD_KERNEL_MAPPER_H - -#include "Utilities/EnumMapper/EnumMapperImp.h" -#include "Kernel//Utilities/KernelType.h" - -#include "VirtualFluids_GPU_export.h" - -#include <memory> -#include <string> - -class VIRTUALFLUIDS_GPU_EXPORT ADKernelMapper -{ -public: - static std::shared_ptr<ADKernelMapper> getInstance(); - - std::string getString(ADKernelType enumeration); - ADKernelType getEnum(std::string name); - -private: - ADKernelMapper(); - - EnumMapperImp<ADKernelType> myEnumMapper; -}; -#endif \ No newline at end of file diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Utilities/Mapper/KernelMapper/KernelMapper.cpp b/src/gpu/VirtualFluids_GPU/Kernel/Utilities/Mapper/KernelMapper/KernelMapper.cpp deleted file mode 100644 index 1276b919aee0dc4fa1916d220e21a62ffdfe2503..0000000000000000000000000000000000000000 --- a/src/gpu/VirtualFluids_GPU/Kernel/Utilities/Mapper/KernelMapper/KernelMapper.cpp +++ /dev/null @@ -1,48 +0,0 @@ -#include "KernelMapper.h" - -std::shared_ptr<KernelMapper> KernelMapper::getInstance() -{ - static std::shared_ptr<KernelMapper> uniqueInstance; - if (!uniqueInstance) - uniqueInstance = std::shared_ptr<KernelMapper>(new KernelMapper()); - return uniqueInstance; -} - -std::string KernelMapper::getString(KernelType enumeration) -{ - return myEnumMapper.getString(enumeration); -} - -KernelType KernelMapper::getEnum(std::string name) -{ - return myEnumMapper.getEnum(name); -} - -KernelMapper::KernelMapper() -{ - myEnumMapper.addEnum(LB_BGKCompSP27, "BGKCompSP27"); - myEnumMapper.addEnum(LB_BGKPlusCompSP27, "BGKPlusCompSP27"); - myEnumMapper.addEnum(LB_CascadeCompSP27, "CascadeCompSP27"); - myEnumMapper.addEnum(LB_CumulantCompSP27, "CumulantCompSP27"); - myEnumMapper.addEnum(LB_CumulantK17Comp, "CumulantK17Comp"); - myEnumMapper.addEnum(LB_CumulantK17BulkComp, "CumulantK17BulkComp"); - myEnumMapper.addEnum(LB_CumulantAll4CompSP27, "CumulantAll4CompSP27"); - myEnumMapper.addEnum(LB_CumulantK18Comp, "CumulantK18Comp"); - myEnumMapper.addEnum(LB_CumulantK20Comp, "CumulantK20Comp"); - myEnumMapper.addEnum(LB_CumulantK15Comp, "CumulantK15Comp"); - myEnumMapper.addEnum(LB_CumulantK15BulkComp, "CumulantK15BulkComp"); - myEnumMapper.addEnum(LB_CumulantK15SpongeComp, "CumulantK15SpongeComp"); - myEnumMapper.addEnum(LB_MRTCompSP27, "MRTCompSP27"); - myEnumMapper.addEnum(LB_BGKIncompSP27, "BGKIncompSP27"); - myEnumMapper.addEnum(LB_BGKPlusIncompSP27, "BGKPlusIncompSP27"); - myEnumMapper.addEnum(LB_CascadeIncompSP27, "CascadeIncompSP27"); - myEnumMapper.addEnum(LB_Cumulant1hIncompSP27, "Cumulant1hIncompSP27"); - myEnumMapper.addEnum(LB_CumulantIsoIncompSP27, "CumulantIsoIncompSP27"); - myEnumMapper.addEnum(LB_CumulantK15Incomp, "CumulantK15Incomp"); - myEnumMapper.addEnum(LB_MRTIncompSP27, "MRTIncompSP27"); - myEnumMapper.addEnum(LB_PMCumulantOneCompSP27, "PMCumulantOneCompSP27"); - myEnumMapper.addEnum(LB_WaleCumulantK17Comp, "WaleCumulantK17Comp"); - myEnumMapper.addEnum(LB_WaleCumulantK17DebugComp, "WaleCumulantK17DebugComp"); - myEnumMapper.addEnum(LB_WaleCumulantK15Comp, "WaleCumulantK15Comp"); - myEnumMapper.addEnum(LB_WaleBySoniMalavCumulantK15Comp, "WaleBySoniMalavCumulantK15Comp"); -} \ No newline at end of file diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Utilities/Mapper/KernelMapper/KernelMapper.h b/src/gpu/VirtualFluids_GPU/Kernel/Utilities/Mapper/KernelMapper/KernelMapper.h deleted file mode 100644 index c493ca8f154b7b999a49c977fdcce51754720ba9..0000000000000000000000000000000000000000 --- a/src/gpu/VirtualFluids_GPU/Kernel/Utilities/Mapper/KernelMapper/KernelMapper.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef KERNEL_MAPPER_H -#define KERNEL_MAPPER_H - -#include "Utilities/EnumMapper/EnumMapperImp.h" -#include "Kernel//Utilities/KernelType.h" - -#include "VirtualFluids_GPU_export.h" - -#include <memory> -#include <string> - -class VIRTUALFLUIDS_GPU_EXPORT KernelMapper -{ -public: - static std::shared_ptr<KernelMapper> getInstance(); - - std::string getString(KernelType enumeration); - KernelType getEnum(std::string name); - -private: - KernelMapper(); - - EnumMapperImp<KernelType> myEnumMapper; -}; -#endif \ No newline at end of file diff --git a/src/gpu/VirtualFluids_GPU/Parameter/Parameter.cpp b/src/gpu/VirtualFluids_GPU/Parameter/Parameter.cpp index fda9a458d2326dd849b3748654e71b0ce6ea22b7..d0a99c9f718145fb6764b3ef044c47fcc389f4d0 100644 --- a/src/gpu/VirtualFluids_GPU/Parameter/Parameter.cpp +++ b/src/gpu/VirtualFluids_GPU/Parameter/Parameter.cpp @@ -18,7 +18,6 @@ #include "Core/Input/ConfigData/ConfigData.h" #include "Core/StringUtilities/StringUtil.h" #include "Communication/Communicator.h" -#include "Kernel/Utilities/Mapper/KernelMapper/KernelMapper.h" //#ifdef WIN32 // #include <Winsock2.h> //#endif @@ -40,8 +39,6 @@ Parameter::Parameter() } Parameter::Parameter(SPtr<ConfigData> configData, Communicator* comm) { - std::shared_ptr<KernelMapper> kernelMapper = KernelMapper::getInstance(); - ////////////////////////////////////////////////////////////////////////// this->setNumprocs(comm->getNummberOfProcess()); this->setMyID(comm->getPID()); @@ -527,9 +524,9 @@ Parameter::Parameter(SPtr<ConfigData> configData, Communicator* comm) //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Kernel if (configData->isMainKernelInConfigFile()) - this->setMainKernel(kernelMapper->getEnum(configData->getMainKernel())); + this->setMainKernel(configData->getMainKernel()); else - this->setMainKernel(kernelMapper->getEnum("CumulantK15Comp")); + this->setMainKernel("CumulantK15Comp"); if (configData->isMultiKernelOnInConfigFile()) this->setMultiKernelOn(configData->getMultiKernelOn()); @@ -551,23 +548,23 @@ Parameter::Parameter(SPtr<ConfigData> configData, Communicator* comm) this->setMultiKernelLevel(std::vector<int>(0)); if (configData->isMultiKernelNameInConfigFile()) { - std::vector<KernelType> kernels; + std::vector<std::string> kernels; for (std::size_t i = 0; i < configData->getMultiKernelName().size(); i++) { - kernels.push_back(kernelMapper->getEnum(configData->getMultiKernelName().at(i))); + kernels.push_back(configData->getMultiKernelName().at(i)); } this->setMultiKernel(kernels); } else if (this->getMultiKernelOn()) { - std::vector<KernelType> tmp; + std::vector<std::string> tmp; for (int i = 0; i < this->getMaxLevel()+1; i++) { - tmp.push_back(kernelMapper->getEnum("CumulantK15Comp")); + tmp.push_back("CumulantK15Comp"); } this->setMultiKernel(tmp); } else { - std::vector<KernelType> tmp; + std::vector<std::string> tmp; this->setMultiKernel(tmp); } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -4272,7 +4269,7 @@ void Parameter::setOutflowBoundaryNormalZ(std::string outflowNormalZ) { ic.outflowNormalZ = outflowNormalZ; } -void Parameter::setMainKernel(KernelType kernel) +void Parameter::setMainKernel(std::string kernel) { this->mainKernel = kernel; } @@ -4284,11 +4281,11 @@ void Parameter::setMultiKernelLevel(std::vector< int> kernelLevel) { this->multiKernelLevel = kernelLevel; } -void Parameter::setMultiKernel(std::vector< KernelType> kernel) +void Parameter::setMultiKernel(std::vector< std::string> kernel) { this->multiKernel = kernel; } -void Parameter::setADKernel(ADKernelType adKernel) +void Parameter::setADKernel(std::string adKernel) { this->adKernel = adKernel; } @@ -5222,7 +5219,7 @@ curandState* Parameter::getRandomState() return this->devState; } -KernelType Parameter::getMainKernel() +std::string Parameter::getMainKernel() { return mainKernel; } @@ -5234,11 +5231,11 @@ std::vector< int> Parameter::getMultiKernelLevel() { return multiKernelLevel; } -std::vector< KernelType> Parameter::getMultiKernel() +std::vector< std::string> Parameter::getMultiKernel() { return multiKernel; } -ADKernelType Parameter::getADKernel() +std::string Parameter::getADKernel() { return adKernel; } diff --git a/src/gpu/VirtualFluids_GPU/Parameter/Parameter.h b/src/gpu/VirtualFluids_GPU/Parameter/Parameter.h index c053add832331ad9f89d1657a33b8486a38739e6..c7696eac31203a8bf26724141071ad84ba27bcda 100644 --- a/src/gpu/VirtualFluids_GPU/Parameter/Parameter.h +++ b/src/gpu/VirtualFluids_GPU/Parameter/Parameter.h @@ -26,8 +26,6 @@ #include "VirtualFluids_GPU_export.h" -#include "Kernel/Utilities/KernelType.h" - class ConfigData; class Communicator; @@ -789,12 +787,12 @@ public: void setOutflowBoundaryNormalY(std::string outflowNormalY); void setOutflowBoundaryNormalZ(std::string outflowNormalZ); //Kernel - void setMainKernel(KernelType kernel); + void setMainKernel(std::string kernel); void setMultiKernelOn(bool isOn); - void setMultiKernelLevel(std::vector< int> kernelLevel); - void setMultiKernel(std::vector< KernelType> kernel); + void setMultiKernelLevel(std::vector<int> kernelLevel); + void setMultiKernel(std::vector<std::string> kernel); - void setADKernel(ADKernelType adKernel); + void setADKernel(std::string adKernel); //getter double* getForcesDouble(); @@ -1002,12 +1000,12 @@ public: //CUDA random number curandState* getRandomState(); //Kernel - KernelType getMainKernel(); + std::string getMainKernel(); bool getMultiKernelOn(); - std::vector< int> getMultiKernelLevel(); - std::vector< KernelType> getMultiKernel(); + std::vector<int> getMultiKernelLevel(); + std::vector<std::string> getMultiKernel(); - ADKernelType getADKernel(); + std::string getADKernel(); ~Parameter(); @@ -1047,12 +1045,12 @@ private: //Kernel - KernelType mainKernel; + std::string mainKernel; bool multiKernelOn; - std::vector< int> multiKernelLevel; - std::vector< KernelType> multiKernel; + std::vector<int> multiKernelLevel; + std::vector<std::string> multiKernel; - ADKernelType adKernel; + std::string adKernel; ////////////////////////////////////////////////////////////////////////// //particles