From 9ab7430634c7067f5c0416a175041836b7b5f98c Mon Sep 17 00:00:00 2001 From: Martin Schoenherr <m.schoenherr@tu-braunschweig.de> Date: Tue, 14 Nov 2023 13:36:02 +0100 Subject: [PATCH] refactor advection diffusion inits --- .../F16/F16CompressibleAdvectionDiffusion.cu | 2 +- .../F16IncompressibleAdvectionDiffusion.cu | 2 +- .../PreProcessorFactoryImp.cpp | 24 +++--- .../InitAdvectionDiffusionCompressible.cu | 73 +++++++++++++++++++ .../InitAdvectionDiffusionCompressible.h | 53 ++++++++++++++ ...tAdvectionDiffusionCompressible_Device.cu} | 32 +++++++- ...tAdvectionDiffusionCompressible_Device.cuh | 50 +++++++++++++ .../InitAdvectionDiffusionCompressibleD3Q7.cu | 73 +++++++++++++++++++ .../InitAdvectionDiffusionCompressibleD3Q7.h | 52 +++++++++++++ ...ectionDiffusionCompressibleD3Q7_Device.cu} | 32 +++++++- ...ectionDiffusionCompressibleD3Q7_Device.cuh | 50 +++++++++++++ .../InitAdvectionDiffusionIncompressible.cu | 73 +++++++++++++++++++ .../InitAdvectionDiffusionIncompressible.h | 53 ++++++++++++++ .../InitIncompAD27_Device.cu | 33 ++++++++- .../InitIncompAD27_Device.cuh | 50 +++++++++++++ ...nitAdvectionDiffusionIncompressibleD3Q7.cu | 73 +++++++++++++++++++ ...InitAdvectionDiffusionIncompressibleD3Q7.h | 53 ++++++++++++++ .../InitIncompAD7_Device.cu | 33 ++++++++- .../InitIncompAD7_Device.cuh | 50 +++++++++++++ .../InitCompAD27/InitCompAD27.cu | 43 ----------- .../InitCompAD27/InitCompAD27.h | 23 ------ .../InitCompAD27/InitCompAD27_Device.cuh | 19 ----- .../InitCompAD7/InitCompAD7.cu | 43 ----------- .../InitCompAD7/InitCompAD7.h | 22 ------ .../InitCompAD7/InitCompAD7_Device.cuh | 19 ----- .../InitIncompAD27/InitIncompAD27.cu | 43 ----------- .../InitIncompAD27/InitIncompAD27.h | 23 ------ .../InitIncompAD27/InitIncompAD27_Device.cuh | 19 ----- .../InitIncompAD7/InitIncompAD7.cu | 43 ----------- .../InitIncompAD7/InitIncompAD7.h | 23 ------ .../InitIncompAD7/InitIncompAD7_Device.cuh | 19 ----- src/gpu/core/PreProcessor/PreProcessorType.h | 8 +- 32 files changed, 847 insertions(+), 361 deletions(-) create mode 100644 src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionCompressible/InitAdvectionDiffusionCompressible.cu create mode 100644 src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionCompressible/InitAdvectionDiffusionCompressible.h rename src/gpu/core/PreProcessor/PreProcessorStrategy/{InitCompAD27/InitCompAD27_Device.cu => InitAdvectionDiffusionCompressible/InitAdvectionDiffusionCompressible_Device.cu} (83%) create mode 100644 src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionCompressible/InitAdvectionDiffusionCompressible_Device.cuh create mode 100644 src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionCompressibleD3Q7/InitAdvectionDiffusionCompressibleD3Q7.cu create mode 100644 src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionCompressibleD3Q7/InitAdvectionDiffusionCompressibleD3Q7.h rename src/gpu/core/PreProcessor/PreProcessorStrategy/{InitCompAD7/InitCompAD7_Device.cu => InitAdvectionDiffusionCompressibleD3Q7/InitAdvectionDiffusionCompressibleD3Q7_Device.cu} (61%) create mode 100644 src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionCompressibleD3Q7/InitAdvectionDiffusionCompressibleD3Q7_Device.cuh create mode 100644 src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionIncompressible/InitAdvectionDiffusionIncompressible.cu create mode 100644 src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionIncompressible/InitAdvectionDiffusionIncompressible.h rename src/gpu/core/PreProcessor/PreProcessorStrategy/{InitIncompAD27 => InitAdvectionDiffusionIncompressible}/InitIncompAD27_Device.cu (80%) create mode 100644 src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionIncompressible/InitIncompAD27_Device.cuh create mode 100644 src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionIncompressibleD3Q7/InitAdvectionDiffusionIncompressibleD3Q7.cu create mode 100644 src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionIncompressibleD3Q7/InitAdvectionDiffusionIncompressibleD3Q7.h rename src/gpu/core/PreProcessor/PreProcessorStrategy/{InitIncompAD7 => InitAdvectionDiffusionIncompressibleD3Q7}/InitIncompAD7_Device.cu (60%) create mode 100644 src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionIncompressibleD3Q7/InitIncompAD7_Device.cuh delete mode 100644 src/gpu/core/PreProcessor/PreProcessorStrategy/InitCompAD27/InitCompAD27.cu delete mode 100644 src/gpu/core/PreProcessor/PreProcessorStrategy/InitCompAD27/InitCompAD27.h delete mode 100644 src/gpu/core/PreProcessor/PreProcessorStrategy/InitCompAD27/InitCompAD27_Device.cuh delete mode 100644 src/gpu/core/PreProcessor/PreProcessorStrategy/InitCompAD7/InitCompAD7.cu delete mode 100644 src/gpu/core/PreProcessor/PreProcessorStrategy/InitCompAD7/InitCompAD7.h delete mode 100644 src/gpu/core/PreProcessor/PreProcessorStrategy/InitCompAD7/InitCompAD7_Device.cuh delete mode 100644 src/gpu/core/PreProcessor/PreProcessorStrategy/InitIncompAD27/InitIncompAD27.cu delete mode 100644 src/gpu/core/PreProcessor/PreProcessorStrategy/InitIncompAD27/InitIncompAD27.h delete mode 100644 src/gpu/core/PreProcessor/PreProcessorStrategy/InitIncompAD27/InitIncompAD27_Device.cuh delete mode 100644 src/gpu/core/PreProcessor/PreProcessorStrategy/InitIncompAD7/InitIncompAD7.cu delete mode 100644 src/gpu/core/PreProcessor/PreProcessorStrategy/InitIncompAD7/InitIncompAD7.h delete mode 100644 src/gpu/core/PreProcessor/PreProcessorStrategy/InitIncompAD7/InitIncompAD7_Device.cuh diff --git a/src/gpu/core/Kernel/Compressible/AdvectionDiffusion/F16/F16CompressibleAdvectionDiffusion.cu b/src/gpu/core/Kernel/Compressible/AdvectionDiffusion/F16/F16CompressibleAdvectionDiffusion.cu index e8ff6ea34..d9b102757 100644 --- a/src/gpu/core/Kernel/Compressible/AdvectionDiffusion/F16/F16CompressibleAdvectionDiffusion.cu +++ b/src/gpu/core/Kernel/Compressible/AdvectionDiffusion/F16/F16CompressibleAdvectionDiffusion.cu @@ -32,7 +32,7 @@ F16CompressibleAdvectionDiffusion::F16CompressibleAdvectionDiffusion(std::shared this->para = para; this->level = level; - myPreProcessorTypes.push_back(InitCompAD27); + myPreProcessorTypes.push_back(InitAdvectionDiffusionCompressible); } diff --git a/src/gpu/core/Kernel/Incompressible/AdvectionDiffusion/F16/F16IncompressibleAdvectionDiffusion.cu b/src/gpu/core/Kernel/Incompressible/AdvectionDiffusion/F16/F16IncompressibleAdvectionDiffusion.cu index 2e2807465..9ea0fe2a8 100644 --- a/src/gpu/core/Kernel/Incompressible/AdvectionDiffusion/F16/F16IncompressibleAdvectionDiffusion.cu +++ b/src/gpu/core/Kernel/Incompressible/AdvectionDiffusion/F16/F16IncompressibleAdvectionDiffusion.cu @@ -32,7 +32,7 @@ F16IncompressibleAdvectionDiffusion::F16IncompressibleAdvectionDiffusion(std::sh this->para = para; this->level = level; - myPreProcessorTypes.push_back(InitIncompAD27); + myPreProcessorTypes.push_back(InitAdvectionDiffusionIncompressible); } diff --git a/src/gpu/core/PreProcessor/PreProcessorFactory/PreProcessorFactoryImp.cpp b/src/gpu/core/PreProcessor/PreProcessorFactory/PreProcessorFactoryImp.cpp index 9f72e8515..bbed493b6 100644 --- a/src/gpu/core/PreProcessor/PreProcessorFactory/PreProcessorFactoryImp.cpp +++ b/src/gpu/core/PreProcessor/PreProcessorFactory/PreProcessorFactoryImp.cpp @@ -2,12 +2,12 @@ #include "PreProcessor/PreProcessorImp.h" -#include "PreProcessor/PreProcessorStrategy/InitCompAD7/InitCompAD7.h" -#include "PreProcessor/PreProcessorStrategy/InitCompAD27/InitCompAD27.h" +#include "PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionCompressibleD3Q7/InitAdvectionDiffusionCompressibleD3Q7.h" +#include "PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionCompressible/InitAdvectionDiffusionCompressible.h" #include "PreProcessor/PreProcessorStrategy/InitNavierStokesCompressible/InitNavierStokesCompressible.h" #include "PreProcessor/PreProcessorStrategy/InitK18K20NavierStokesCompressible/InitK18K20NavierStokesCompressible.h" -#include "PreProcessor/PreProcessorStrategy/InitIncompAD27/InitIncompAD27.h" -#include "PreProcessor/PreProcessorStrategy/InitIncompAD7/InitIncompAD7.h" +#include "PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionIncompressible/InitAdvectionDiffusionIncompressible.h" +#include "PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionIncompressibleD3Q7/InitAdvectionDiffusionIncompressibleD3Q7.h" #include "PreProcessor/PreProcessorStrategy/InitNavierStokesIncompressible/InitNavierStokesIncompressible.h" @@ -34,17 +34,17 @@ std::shared_ptr<PreProcessorStrategy> PreProcessorFactoryImp::makePreProcessorSt case InitK18K20NavierStokesCompressible: return InitK18K20NavierStokesCompressible::getNewInstance(para); break; - case InitIncompAD7: - return InitIncompAD7::getNewInstance(para); + case InitAdvectionDiffusionIncompressibleD3Q7: + return InitAdvectionDiffusionIncompressibleD3Q7::getNewInstance(para); break; - case InitIncompAD27: - return InitIncompAD27::getNewInstance(para); + case InitAdvectionDiffusionIncompressible: + return InitAdvectionDiffusionIncompressible::getNewInstance(para); break; - case InitCompAD7: - return InitCompAD7::getNewInstance(para); + case InitAdvectionDiffusionCompressibleD3Q7: + return InitAdvectionDiffusionCompressibleD3Q7::getNewInstance(para); break; - case InitCompAD27: - return InitCompAD27::getNewInstance(para); + case InitAdvectionDiffusionCompressible: + return InitAdvectionDiffusionCompressible::getNewInstance(para); break; default: break; diff --git a/src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionCompressible/InitAdvectionDiffusionCompressible.cu b/src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionCompressible/InitAdvectionDiffusionCompressible.cu new file mode 100644 index 000000000..659edc342 --- /dev/null +++ b/src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionCompressible/InitAdvectionDiffusionCompressible.cu @@ -0,0 +1,73 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// 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/>. +// +//! \author Martin Schoenherr +//======================================================================================= +#include "InitAdvectionDiffusionCompressible.h" + +#include "InitAdvectionDiffusionCompressible_Device.cuh" +#include "Parameter/Parameter.h" +#include <cuda_helper/CudaGrid.h> + +std::shared_ptr<PreProcessorStrategy> InitAdvectionDiffusionCompressible::getNewInstance(std::shared_ptr<Parameter> para) +{ + return std::shared_ptr<PreProcessorStrategy>(new InitAdvectionDiffusionCompressible(para)); +} + +void InitAdvectionDiffusionCompressible::init(int level) +{ + vf::cuda::CudaGrid grid = vf::cuda::CudaGrid(para->getParD(level)->numberofthreads, para->getParD(level)->numberOfNodes); + + InitAdvectionDiffusionCompressible_Device <<< grid.grid, grid.threads >>>( + para->getParD(level)->neighborX, + para->getParD(level)->neighborY, + para->getParD(level)->neighborZ, + para->getParD(level)->typeOfGridNode, + para->getParD(level)->concentration, + para->getParD(level)->velocityX, + para->getParD(level)->velocityY, + para->getParD(level)->velocityZ, + para->getParD(level)->numberOfNodes, + para->getParD(level)->distributionsAD.f[0], + para->getParD(level)->isEvenTimestep); + getLastCudaError("InitAdvectionDiffusionCompressible_Device execution failed"); +} + +bool InitAdvectionDiffusionCompressible::checkParameter() +{ + return false; +} + +InitAdvectionDiffusionCompressible::InitAdvectionDiffusionCompressible(std::shared_ptr<Parameter> para) +{ + this->para = para; +} + +InitAdvectionDiffusionCompressible::InitAdvectionDiffusionCompressible() +{ +} diff --git a/src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionCompressible/InitAdvectionDiffusionCompressible.h b/src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionCompressible/InitAdvectionDiffusionCompressible.h new file mode 100644 index 000000000..868ac3944 --- /dev/null +++ b/src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionCompressible/InitAdvectionDiffusionCompressible.h @@ -0,0 +1,53 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// 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/>. +// +//! \author Martin Schoenherr +//======================================================================================= +#ifndef InitAdvectionDiffusionCompressible_H +#define InitAdvectionDiffusionCompressible_H + +#include "PreProcessor/PreProcessorStrategy/PreProcessorStrategy.h" + +#include <memory> + +class Parameter; + +class InitAdvectionDiffusionCompressible : public PreProcessorStrategy +{ +public: + static std::shared_ptr<PreProcessorStrategy> getNewInstance(std::shared_ptr< Parameter> para); + void init(int level); + bool checkParameter(); + +private: + InitAdvectionDiffusionCompressible(); + InitAdvectionDiffusionCompressible(std::shared_ptr< Parameter> para); + std::shared_ptr< Parameter> para; +}; + +#endif \ No newline at end of file diff --git a/src/gpu/core/PreProcessor/PreProcessorStrategy/InitCompAD27/InitCompAD27_Device.cu b/src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionCompressible/InitAdvectionDiffusionCompressible_Device.cu similarity index 83% rename from src/gpu/core/PreProcessor/PreProcessorStrategy/InitCompAD27/InitCompAD27_Device.cu rename to src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionCompressible/InitAdvectionDiffusionCompressible_Device.cu index ccb72094e..8030c0de6 100644 --- a/src/gpu/core/PreProcessor/PreProcessorStrategy/InitCompAD27/InitCompAD27_Device.cu +++ b/src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionCompressible/InitAdvectionDiffusionCompressible_Device.cu @@ -1,3 +1,33 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// 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/>. +// +//! \author Martin Schoenherr +//======================================================================================= #include "LBM/LB.h" #include "lbm/constants/D3Q27.h" #include <basics/constants/NumericConstants.h> @@ -6,7 +36,7 @@ using namespace vf::basics::constant; using namespace vf::lbm::dir; -__global__ void LB_Init_Comp_AD_27(unsigned int* neighborX, +__global__ void InitAdvectionDiffusionCompressible_Device(unsigned int* neighborX, unsigned int* neighborY, unsigned int* neighborZ, unsigned int* geoD, diff --git a/src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionCompressible/InitAdvectionDiffusionCompressible_Device.cuh b/src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionCompressible/InitAdvectionDiffusionCompressible_Device.cuh new file mode 100644 index 000000000..a14605fa0 --- /dev/null +++ b/src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionCompressible/InitAdvectionDiffusionCompressible_Device.cuh @@ -0,0 +1,50 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// 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/>. +// +//! \author Martin Schoenherr +//======================================================================================= +#ifndef InitAdvectionDiffusionCompressible_Device_H +#define InitAdvectionDiffusionCompressible_Device_H + +#include <DataTypes.h> +#include <curand.h> + +__global__ void InitAdvectionDiffusionCompressible_Device( + unsigned int* neighborX, + unsigned int* neighborY, + unsigned int* neighborZ, + unsigned int* geoD, + real* Conc, + real* ux, + real* uy, + real* uz, + unsigned int size_Mat, + real* DD27, + bool EvenOrOdd); + +#endif \ No newline at end of file diff --git a/src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionCompressibleD3Q7/InitAdvectionDiffusionCompressibleD3Q7.cu b/src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionCompressibleD3Q7/InitAdvectionDiffusionCompressibleD3Q7.cu new file mode 100644 index 000000000..2db77de45 --- /dev/null +++ b/src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionCompressibleD3Q7/InitAdvectionDiffusionCompressibleD3Q7.cu @@ -0,0 +1,73 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// 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/>. +// +//! \author Martin Schoenherr +//======================================================================================= +#include "InitAdvectionDiffusionCompressibleD3Q7.h" + +#include "InitAdvectionDiffusionCompressibleD3Q7_Device.cuh" +#include "Parameter/Parameter.h" +#include <cuda_helper/CudaGrid.h> + +std::shared_ptr<InitAdvectionDiffusionCompressibleD3Q7> InitAdvectionDiffusionCompressibleD3Q7::getNewInstance(std::shared_ptr<Parameter> para) +{ + return std::shared_ptr<InitAdvectionDiffusionCompressibleD3Q7>(new InitAdvectionDiffusionCompressibleD3Q7(para)); +} + +void InitAdvectionDiffusionCompressibleD3Q7::init(int level) +{ + vf::cuda::CudaGrid grid = vf::cuda::CudaGrid(para->getParD(level)->numberofthreads, para->getParD(level)->numberOfNodes); + + InitAdvectionDiffusionCompressibleD3Q7_Device <<< grid.grid, grid.threads >>>( + para->getParD(level)->neighborX, + para->getParD(level)->neighborY, + para->getParD(level)->neighborZ, + para->getParD(level)->typeOfGridNode, + para->getParD(level)->concentration, + para->getParD(level)->velocityX, + para->getParD(level)->velocityY, + para->getParD(level)->velocityZ, + para->getParD(level)->numberOfNodes, + para->getParD(level)->distributionsAD7.f[0], + para->getParD(level)->isEvenTimestep); + getLastCudaError("InitAdvectionDiffusionCompressibleD3Q7_Device execution failed"); +} + +bool InitAdvectionDiffusionCompressibleD3Q7::checkParameter() +{ + return false; +} + +InitAdvectionDiffusionCompressibleD3Q7::InitAdvectionDiffusionCompressibleD3Q7(std::shared_ptr<Parameter> para) +{ + this->para = para; +} + +InitAdvectionDiffusionCompressibleD3Q7::InitAdvectionDiffusionCompressibleD3Q7() +{ +} diff --git a/src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionCompressibleD3Q7/InitAdvectionDiffusionCompressibleD3Q7.h b/src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionCompressibleD3Q7/InitAdvectionDiffusionCompressibleD3Q7.h new file mode 100644 index 000000000..2c68fca2f --- /dev/null +++ b/src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionCompressibleD3Q7/InitAdvectionDiffusionCompressibleD3Q7.h @@ -0,0 +1,52 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// 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/>. +// +//! \author Martin Schoenherr +//======================================================================================= +#ifndef InitAdvectionDiffusionCompressibleD3Q7_H +#define InitAdvectionDiffusionCompressibleD3Q7_H + +#include "PreProcessor/PreProcessorStrategy/PreProcessorStrategy.h" + +#include <memory> + +class Parameter; + +class InitAdvectionDiffusionCompressibleD3Q7 : public PreProcessorStrategy +{ +public: + static std::shared_ptr<InitAdvectionDiffusionCompressibleD3Q7> getNewInstance(std::shared_ptr< Parameter> para); + void init(int level); + bool checkParameter(); + +private: + InitAdvectionDiffusionCompressibleD3Q7(); + InitAdvectionDiffusionCompressibleD3Q7(std::shared_ptr< Parameter> para); + std::shared_ptr< Parameter> para; +}; +#endif \ No newline at end of file diff --git a/src/gpu/core/PreProcessor/PreProcessorStrategy/InitCompAD7/InitCompAD7_Device.cu b/src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionCompressibleD3Q7/InitAdvectionDiffusionCompressibleD3Q7_Device.cu similarity index 61% rename from src/gpu/core/PreProcessor/PreProcessorStrategy/InitCompAD7/InitCompAD7_Device.cu rename to src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionCompressibleD3Q7/InitAdvectionDiffusionCompressibleD3Q7_Device.cu index 537cc4463..b9265e83b 100644 --- a/src/gpu/core/PreProcessor/PreProcessorStrategy/InitCompAD7/InitCompAD7_Device.cu +++ b/src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionCompressibleD3Q7/InitAdvectionDiffusionCompressibleD3Q7_Device.cu @@ -1,3 +1,33 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// 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/>. +// +//! \author Martin Schoenherr +//======================================================================================= #include "LBM/LB.h" #include "lbm/constants/D3Q27.h" #include <basics/constants/NumericConstants.h> @@ -6,7 +36,7 @@ using namespace vf::basics::constant; using namespace vf::lbm::dir; #include "math.h" -__global__ void LB_Init_Comp_AD_7(unsigned int* neighborX, +__global__ void InitAdvectionDiffusionCompressibleD3Q7_Device(unsigned int* neighborX, unsigned int* neighborY, unsigned int* neighborZ, unsigned int* geoD, diff --git a/src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionCompressibleD3Q7/InitAdvectionDiffusionCompressibleD3Q7_Device.cuh b/src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionCompressibleD3Q7/InitAdvectionDiffusionCompressibleD3Q7_Device.cuh new file mode 100644 index 000000000..fca4430fe --- /dev/null +++ b/src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionCompressibleD3Q7/InitAdvectionDiffusionCompressibleD3Q7_Device.cuh @@ -0,0 +1,50 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// 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/>. +// +//! \author Martin Schoenherr +//======================================================================================= +#ifndef InitAdvectionDiffusionCompressibleD3Q7_Device_H +#define InitAdvectionDiffusionCompressibleD3Q7_Device_H + +#include <DataTypes.h> +#include <curand.h> + +__global__ void InitAdvectionDiffusionCompressibleD3Q7_Device( + unsigned int* neighborX, + unsigned int* neighborY, + unsigned int* neighborZ, + unsigned int* geoD, + real* Conc, + real* ux, + real* uy, + real* uz, + unsigned int size_Mat, + real* DD7, + bool EvenOrOdd); + +#endif \ No newline at end of file diff --git a/src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionIncompressible/InitAdvectionDiffusionIncompressible.cu b/src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionIncompressible/InitAdvectionDiffusionIncompressible.cu new file mode 100644 index 000000000..fa79630f0 --- /dev/null +++ b/src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionIncompressible/InitAdvectionDiffusionIncompressible.cu @@ -0,0 +1,73 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// 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/>. +// +//! \author Martin Schoenherr +//======================================================================================= +#include "InitAdvectionDiffusionIncompressible.h" + +#include "InitIncompAD27_Device.cuh" +#include "Parameter/Parameter.h" +#include <cuda_helper/CudaGrid.h> + +std::shared_ptr<PreProcessorStrategy> InitAdvectionDiffusionIncompressible::getNewInstance(std::shared_ptr<Parameter> para) +{ + return std::shared_ptr<PreProcessorStrategy>(new InitAdvectionDiffusionIncompressible(para)); +} + +void InitAdvectionDiffusionIncompressible::init(int level) +{ + vf::cuda::CudaGrid grid = vf::cuda::CudaGrid(para->getParD(level)->numberofthreads, para->getParD(level)->numberOfNodes); + + InitAdvectionDiffusionIncompressible_Device <<< grid.grid, grid.threads >>>( + para->getParD(level)->neighborX, + para->getParD(level)->neighborY, + para->getParD(level)->neighborZ, + para->getParD(level)->typeOfGridNode, + para->getParD(level)->concentration, + para->getParD(level)->velocityX, + para->getParD(level)->velocityY, + para->getParD(level)->velocityZ, + para->getParD(level)->numberOfNodes, + para->getParD(level)->distributionsAD.f[0], + para->getParD(level)->isEvenTimestep); + getLastCudaError("InitAdvectionDiffusionIncompressible_Device execution failed"); +} + +bool InitAdvectionDiffusionIncompressible::checkParameter() +{ + return false; +} + +InitAdvectionDiffusionIncompressible::InitAdvectionDiffusionIncompressible(std::shared_ptr<Parameter> para) +{ + this->para = para; +} + +InitAdvectionDiffusionIncompressible::InitAdvectionDiffusionIncompressible() +{ +} diff --git a/src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionIncompressible/InitAdvectionDiffusionIncompressible.h b/src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionIncompressible/InitAdvectionDiffusionIncompressible.h new file mode 100644 index 000000000..c60512e64 --- /dev/null +++ b/src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionIncompressible/InitAdvectionDiffusionIncompressible.h @@ -0,0 +1,53 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// 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/>. +// +//! \author Martin Schoenherr +//======================================================================================= +#ifndef InitAdvectionDiffusionIncompressible_H +#define InitAdvectionDiffusionIncompressible_H + +#include "PreProcessor/PreProcessorStrategy/PreProcessorStrategy.h" + +#include <memory> + +class Parameter; + +class InitAdvectionDiffusionIncompressible : public PreProcessorStrategy +{ +public: + static std::shared_ptr<PreProcessorStrategy> getNewInstance(std::shared_ptr< Parameter> para); + void init(int level); + bool checkParameter(); + +private: + InitAdvectionDiffusionIncompressible(); + InitAdvectionDiffusionIncompressible(std::shared_ptr< Parameter> para); + std::shared_ptr< Parameter> para; +}; + +#endif \ No newline at end of file diff --git a/src/gpu/core/PreProcessor/PreProcessorStrategy/InitIncompAD27/InitIncompAD27_Device.cu b/src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionIncompressible/InitIncompAD27_Device.cu similarity index 80% rename from src/gpu/core/PreProcessor/PreProcessorStrategy/InitIncompAD27/InitIncompAD27_Device.cu rename to src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionIncompressible/InitIncompAD27_Device.cu index a2933ca68..55c3a9540 100644 --- a/src/gpu/core/PreProcessor/PreProcessorStrategy/InitIncompAD27/InitIncompAD27_Device.cu +++ b/src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionIncompressible/InitIncompAD27_Device.cu @@ -1,3 +1,33 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// 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/>. +// +//! \author Martin Schoenherr +//======================================================================================= #include "LBM/LB.h" #include "lbm/constants/D3Q27.h" #include <basics/constants/NumericConstants.h> @@ -6,7 +36,8 @@ using namespace vf::basics::constant; using namespace vf::lbm::dir; #include "math.h" -__global__ void LB_Init_Incomp_AD_27(unsigned int* neighborX, +__global__ void InitAdvectionDiffusionIncompressible_Device( + unsigned int* neighborX, unsigned int* neighborY, unsigned int* neighborZ, unsigned int* geoD, diff --git a/src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionIncompressible/InitIncompAD27_Device.cuh b/src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionIncompressible/InitIncompAD27_Device.cuh new file mode 100644 index 000000000..ec01ab24d --- /dev/null +++ b/src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionIncompressible/InitIncompAD27_Device.cuh @@ -0,0 +1,50 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// 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/>. +// +//! \author Martin Schoenherr +//======================================================================================= +#ifndef InitAdvectionDiffusionIncompressible_Device_H +#define InitAdvectionDiffusionIncompressible_Device_H + +#include <DataTypes.h> +#include <curand.h> + +__global__ void InitAdvectionDiffusionIncompressible_Device( + unsigned int* neighborX, + unsigned int* neighborY, + unsigned int* neighborZ, + unsigned int* geoD, + real* Conc, + real* ux, + real* uy, + real* uz, + unsigned int size_Mat, + real* DD27, + bool EvenOrOdd); + +#endif \ No newline at end of file diff --git a/src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionIncompressibleD3Q7/InitAdvectionDiffusionIncompressibleD3Q7.cu b/src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionIncompressibleD3Q7/InitAdvectionDiffusionIncompressibleD3Q7.cu new file mode 100644 index 000000000..8aaf2f712 --- /dev/null +++ b/src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionIncompressibleD3Q7/InitAdvectionDiffusionIncompressibleD3Q7.cu @@ -0,0 +1,73 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// 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/>. +// +//! \author Martin Schoenherr +//======================================================================================= +#include "InitAdvectionDiffusionIncompressibleD3Q7.h" + +#include "InitIncompAD7_Device.cuh" +#include "Parameter/Parameter.h" +#include <cuda_helper/CudaGrid.h> + +std::shared_ptr<PreProcessorStrategy> InitAdvectionDiffusionIncompressibleD3Q7::getNewInstance(std::shared_ptr<Parameter> para) +{ + return std::shared_ptr<PreProcessorStrategy>(new InitAdvectionDiffusionIncompressibleD3Q7(para)); +} + +void InitAdvectionDiffusionIncompressibleD3Q7::init(int level) +{ + vf::cuda::CudaGrid grid = vf::cuda::CudaGrid(para->getParD(level)->numberofthreads, para->getParD(level)->numberOfNodes); + + InitAdvectionDiffusionIncompressibleD3Q7_Device <<< grid.grid, grid.threads >>>( + para->getParD(level)->neighborX, + para->getParD(level)->neighborY, + para->getParD(level)->neighborZ, + para->getParD(level)->typeOfGridNode, + para->getParD(level)->concentration, + para->getParD(level)->velocityX, + para->getParD(level)->velocityY, + para->getParD(level)->velocityZ, + para->getParD(level)->numberOfNodes, + para->getParD(level)->distributionsAD.f[0], + para->getParD(level)->isEvenTimestep); + getLastCudaError("InitAdvectionDiffusionIncompressibleD3Q7_Device execution failed"); +} + +bool InitAdvectionDiffusionIncompressibleD3Q7::checkParameter() +{ + return false; +} + +InitAdvectionDiffusionIncompressibleD3Q7::InitAdvectionDiffusionIncompressibleD3Q7(std::shared_ptr<Parameter> para) +{ + this->para = para; +} + +InitAdvectionDiffusionIncompressibleD3Q7::InitAdvectionDiffusionIncompressibleD3Q7() +{ +} diff --git a/src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionIncompressibleD3Q7/InitAdvectionDiffusionIncompressibleD3Q7.h b/src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionIncompressibleD3Q7/InitAdvectionDiffusionIncompressibleD3Q7.h new file mode 100644 index 000000000..4ece3ee7d --- /dev/null +++ b/src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionIncompressibleD3Q7/InitAdvectionDiffusionIncompressibleD3Q7.h @@ -0,0 +1,53 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// 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/>. +// +//! \author Martin Schoenherr +//======================================================================================= +#ifndef InitAdvectionDiffusionIncompressibleD3Q7_H +#define InitAdvectionDiffusionIncompressibleD3Q7_H + +#include "PreProcessor/PreProcessorStrategy/PreProcessorStrategy.h" + +#include <memory> + +class Parameter; + +class InitAdvectionDiffusionIncompressibleD3Q7 : public PreProcessorStrategy +{ +public: + static std::shared_ptr<PreProcessorStrategy> getNewInstance(std::shared_ptr< Parameter> para); + void init(int level); + bool checkParameter(); + +private: + InitAdvectionDiffusionIncompressibleD3Q7(); + InitAdvectionDiffusionIncompressibleD3Q7(std::shared_ptr< Parameter> para); + std::shared_ptr< Parameter> para; +}; + +#endif \ No newline at end of file diff --git a/src/gpu/core/PreProcessor/PreProcessorStrategy/InitIncompAD7/InitIncompAD7_Device.cu b/src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionIncompressibleD3Q7/InitIncompAD7_Device.cu similarity index 60% rename from src/gpu/core/PreProcessor/PreProcessorStrategy/InitIncompAD7/InitIncompAD7_Device.cu rename to src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionIncompressibleD3Q7/InitIncompAD7_Device.cu index a5898729a..441e8c7ad 100644 --- a/src/gpu/core/PreProcessor/PreProcessorStrategy/InitIncompAD7/InitIncompAD7_Device.cu +++ b/src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionIncompressibleD3Q7/InitIncompAD7_Device.cu @@ -1,3 +1,33 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// 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/>. +// +//! \author Martin Schoenherr +//======================================================================================= #include "LBM/LB.h" #include "lbm/constants/D3Q27.h" #include <basics/constants/NumericConstants.h> @@ -6,7 +36,8 @@ using namespace vf::basics::constant; using namespace vf::lbm::dir; #include "math.h" -__global__ void LB_Init_Incomp_AD_7(unsigned int* neighborX, +__global__ void InitAdvectionDiffusionIncompressibleD3Q7_Device( + unsigned int* neighborX, unsigned int* neighborY, unsigned int* neighborZ, unsigned int* geoD, diff --git a/src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionIncompressibleD3Q7/InitIncompAD7_Device.cuh b/src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionIncompressibleD3Q7/InitIncompAD7_Device.cuh new file mode 100644 index 000000000..3d0efb3a8 --- /dev/null +++ b/src/gpu/core/PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionIncompressibleD3Q7/InitIncompAD7_Device.cuh @@ -0,0 +1,50 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// 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/>. +// +//! \author Martin Schoenherr +//======================================================================================= +#ifndef InitAdvectionDiffusionIncompressibleD3Q7_Device_H +#define InitAdvectionDiffusionIncompressibleD3Q7_Device_H + +#include <DataTypes.h> +#include <curand.h> + +__global__ void InitAdvectionDiffusionIncompressibleD3Q7_Device( + unsigned int* neighborX, + unsigned int* neighborY, + unsigned int* neighborZ, + unsigned int* geoD, + real* Conc, + real* ux, + real* uy, + real* uz, + unsigned int size_Mat, + real* DD7, + bool EvenOrOdd); + +#endif \ No newline at end of file diff --git a/src/gpu/core/PreProcessor/PreProcessorStrategy/InitCompAD27/InitCompAD27.cu b/src/gpu/core/PreProcessor/PreProcessorStrategy/InitCompAD27/InitCompAD27.cu deleted file mode 100644 index d343b8bfa..000000000 --- a/src/gpu/core/PreProcessor/PreProcessorStrategy/InitCompAD27/InitCompAD27.cu +++ /dev/null @@ -1,43 +0,0 @@ -#include "InitCompAD27.h" - -#include "InitCompAD27_Device.cuh" -#include "Parameter/Parameter.h" -#include <cuda_helper/CudaGrid.h> - -std::shared_ptr<PreProcessorStrategy> InitCompAD27::getNewInstance(std::shared_ptr<Parameter> para) -{ - return std::shared_ptr<PreProcessorStrategy>(new InitCompAD27(para)); -} - -void InitCompAD27::init(int level) -{ - vf::cuda::CudaGrid grid = vf::cuda::CudaGrid(para->getParD(level)->numberofthreads, para->getParD(level)->numberOfNodes); - - LB_Init_Comp_AD_27 <<< grid.grid, grid.threads >>>( - para->getParD(level)->neighborX, - para->getParD(level)->neighborY, - para->getParD(level)->neighborZ, - para->getParD(level)->typeOfGridNode, - para->getParD(level)->concentration, - para->getParD(level)->velocityX, - para->getParD(level)->velocityY, - para->getParD(level)->velocityZ, - para->getParD(level)->numberOfNodes, - para->getParD(level)->distributionsAD.f[0], - para->getParD(level)->isEvenTimestep); - getLastCudaError("LB_Init_Comp_AD_27 execution failed"); -} - -bool InitCompAD27::checkParameter() -{ - return false; -} - -InitCompAD27::InitCompAD27(std::shared_ptr<Parameter> para) -{ - this->para = para; -} - -InitCompAD27::InitCompAD27() -{ -} diff --git a/src/gpu/core/PreProcessor/PreProcessorStrategy/InitCompAD27/InitCompAD27.h b/src/gpu/core/PreProcessor/PreProcessorStrategy/InitCompAD27/InitCompAD27.h deleted file mode 100644 index 9990f1227..000000000 --- a/src/gpu/core/PreProcessor/PreProcessorStrategy/InitCompAD27/InitCompAD27.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef Init_COMP_AD_27_H -#define Init_COMP_AD_27_H - -#include "PreProcessor/PreProcessorStrategy/PreProcessorStrategy.h" - -#include <memory> - -class Parameter; - -class InitCompAD27 : public PreProcessorStrategy -{ -public: - static std::shared_ptr<PreProcessorStrategy> getNewInstance(std::shared_ptr< Parameter> para); - void init(int level); - bool checkParameter(); - -private: - InitCompAD27(); - InitCompAD27(std::shared_ptr< Parameter> para); - std::shared_ptr< Parameter> para; -}; - -#endif \ No newline at end of file diff --git a/src/gpu/core/PreProcessor/PreProcessorStrategy/InitCompAD27/InitCompAD27_Device.cuh b/src/gpu/core/PreProcessor/PreProcessorStrategy/InitCompAD27/InitCompAD27_Device.cuh deleted file mode 100644 index dff2bb8a8..000000000 --- a/src/gpu/core/PreProcessor/PreProcessorStrategy/InitCompAD27/InitCompAD27_Device.cuh +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef LB_INIT_COMP_AD_27_H -#define LB_INIT_COMP_AD_27_H - -#include <DataTypes.h> -#include <curand.h> - -__global__ void LB_Init_Comp_AD_27(unsigned int* neighborX, - unsigned int* neighborY, - unsigned int* neighborZ, - unsigned int* geoD, - real* Conc, - real* ux, - real* uy, - real* uz, - unsigned int size_Mat, - real* DD27, - bool EvenOrOdd); - -#endif \ No newline at end of file diff --git a/src/gpu/core/PreProcessor/PreProcessorStrategy/InitCompAD7/InitCompAD7.cu b/src/gpu/core/PreProcessor/PreProcessorStrategy/InitCompAD7/InitCompAD7.cu deleted file mode 100644 index b6a3ef4c4..000000000 --- a/src/gpu/core/PreProcessor/PreProcessorStrategy/InitCompAD7/InitCompAD7.cu +++ /dev/null @@ -1,43 +0,0 @@ -#include "InitCompAD7.h" - -#include "InitCompAD7_Device.cuh" -#include "Parameter/Parameter.h" -#include <cuda_helper/CudaGrid.h> - -std::shared_ptr<InitCompAD7> InitCompAD7::getNewInstance(std::shared_ptr<Parameter> para) -{ - return std::shared_ptr<InitCompAD7>(new InitCompAD7(para)); -} - -void InitCompAD7::init(int level) -{ - vf::cuda::CudaGrid grid = vf::cuda::CudaGrid(para->getParD(level)->numberofthreads, para->getParD(level)->numberOfNodes); - - LB_Init_Comp_AD_7 <<< grid.grid, grid.threads >>>( - para->getParD(level)->neighborX, - para->getParD(level)->neighborY, - para->getParD(level)->neighborZ, - para->getParD(level)->typeOfGridNode, - para->getParD(level)->concentration, - para->getParD(level)->velocityX, - para->getParD(level)->velocityY, - para->getParD(level)->velocityZ, - para->getParD(level)->numberOfNodes, - para->getParD(level)->distributionsAD7.f[0], - para->getParD(level)->isEvenTimestep); - getLastCudaError("LB_Init_Comp_AD_7 execution failed"); -} - -bool InitCompAD7::checkParameter() -{ - return false; -} - -InitCompAD7::InitCompAD7(std::shared_ptr<Parameter> para) -{ - this->para = para; -} - -InitCompAD7::InitCompAD7() -{ -} diff --git a/src/gpu/core/PreProcessor/PreProcessorStrategy/InitCompAD7/InitCompAD7.h b/src/gpu/core/PreProcessor/PreProcessorStrategy/InitCompAD7/InitCompAD7.h deleted file mode 100644 index c1e76f8ec..000000000 --- a/src/gpu/core/PreProcessor/PreProcessorStrategy/InitCompAD7/InitCompAD7.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef INIT_COMP_AD_7_H -#define INIT_COMP_AD_7_H - -#include "PreProcessor/PreProcessorStrategy/PreProcessorStrategy.h" - -#include <memory> - -class Parameter; - -class InitCompAD7 : public PreProcessorStrategy -{ -public: - static std::shared_ptr<InitCompAD7> getNewInstance(std::shared_ptr< Parameter> para); - void init(int level); - bool checkParameter(); - -private: - InitCompAD7(); - InitCompAD7(std::shared_ptr< Parameter> para); - std::shared_ptr< Parameter> para; -}; -#endif \ No newline at end of file diff --git a/src/gpu/core/PreProcessor/PreProcessorStrategy/InitCompAD7/InitCompAD7_Device.cuh b/src/gpu/core/PreProcessor/PreProcessorStrategy/InitCompAD7/InitCompAD7_Device.cuh deleted file mode 100644 index cd12cd1a9..000000000 --- a/src/gpu/core/PreProcessor/PreProcessorStrategy/InitCompAD7/InitCompAD7_Device.cuh +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef LB_INIT_COMP_AD_7_H -#define LB_INIT_COMP_AD_7_H - -#include <DataTypes.h> -#include <curand.h> - -__global__ void LB_Init_Comp_AD_7(unsigned int* neighborX, - unsigned int* neighborY, - unsigned int* neighborZ, - unsigned int* geoD, - real* Conc, - real* ux, - real* uy, - real* uz, - unsigned int size_Mat, - real* DD7, - bool EvenOrOdd); - -#endif \ No newline at end of file diff --git a/src/gpu/core/PreProcessor/PreProcessorStrategy/InitIncompAD27/InitIncompAD27.cu b/src/gpu/core/PreProcessor/PreProcessorStrategy/InitIncompAD27/InitIncompAD27.cu deleted file mode 100644 index f09d98336..000000000 --- a/src/gpu/core/PreProcessor/PreProcessorStrategy/InitIncompAD27/InitIncompAD27.cu +++ /dev/null @@ -1,43 +0,0 @@ -#include "InitIncompAD27.h" - -#include "InitIncompAD27_Device.cuh" -#include "Parameter/Parameter.h" -#include <cuda_helper/CudaGrid.h> - -std::shared_ptr<PreProcessorStrategy> InitIncompAD27::getNewInstance(std::shared_ptr<Parameter> para) -{ - return std::shared_ptr<PreProcessorStrategy>(new InitIncompAD27(para)); -} - -void InitIncompAD27::init(int level) -{ - vf::cuda::CudaGrid grid = vf::cuda::CudaGrid(para->getParD(level)->numberofthreads, para->getParD(level)->numberOfNodes); - - LB_Init_Incomp_AD_27 <<< grid.grid, grid.threads >>>( - para->getParD(level)->neighborX, - para->getParD(level)->neighborY, - para->getParD(level)->neighborZ, - para->getParD(level)->typeOfGridNode, - para->getParD(level)->concentration, - para->getParD(level)->velocityX, - para->getParD(level)->velocityY, - para->getParD(level)->velocityZ, - para->getParD(level)->numberOfNodes, - para->getParD(level)->distributionsAD.f[0], - para->getParD(level)->isEvenTimestep); - getLastCudaError("LB_Init_Incomp_AD_27 execution failed"); -} - -bool InitIncompAD27::checkParameter() -{ - return false; -} - -InitIncompAD27::InitIncompAD27(std::shared_ptr<Parameter> para) -{ - this->para = para; -} - -InitIncompAD27::InitIncompAD27() -{ -} diff --git a/src/gpu/core/PreProcessor/PreProcessorStrategy/InitIncompAD27/InitIncompAD27.h b/src/gpu/core/PreProcessor/PreProcessorStrategy/InitIncompAD27/InitIncompAD27.h deleted file mode 100644 index 9654345cf..000000000 --- a/src/gpu/core/PreProcessor/PreProcessorStrategy/InitIncompAD27/InitIncompAD27.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef INIT_INCOMP_AD27_H -#define INIT_INCOMP_AD27_H - -#include "PreProcessor/PreProcessorStrategy/PreProcessorStrategy.h" - -#include <memory> - -class Parameter; - -class InitIncompAD27 : public PreProcessorStrategy -{ -public: - static std::shared_ptr<PreProcessorStrategy> getNewInstance(std::shared_ptr< Parameter> para); - void init(int level); - bool checkParameter(); - -private: - InitIncompAD27(); - InitIncompAD27(std::shared_ptr< Parameter> para); - std::shared_ptr< Parameter> para; -}; - -#endif \ No newline at end of file diff --git a/src/gpu/core/PreProcessor/PreProcessorStrategy/InitIncompAD27/InitIncompAD27_Device.cuh b/src/gpu/core/PreProcessor/PreProcessorStrategy/InitIncompAD27/InitIncompAD27_Device.cuh deleted file mode 100644 index b81cf31d3..000000000 --- a/src/gpu/core/PreProcessor/PreProcessorStrategy/InitIncompAD27/InitIncompAD27_Device.cuh +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef LB_INIT_INCOMP_AD27_H -#define LB_INIT_INCOMP_AD27_H - -#include <DataTypes.h> -#include <curand.h> - -__global__ void LB_Init_Incomp_AD_27(unsigned int* neighborX, - unsigned int* neighborY, - unsigned int* neighborZ, - unsigned int* geoD, - real* Conc, - real* ux, - real* uy, - real* uz, - unsigned int size_Mat, - real* DD27, - bool EvenOrOdd); - -#endif \ No newline at end of file diff --git a/src/gpu/core/PreProcessor/PreProcessorStrategy/InitIncompAD7/InitIncompAD7.cu b/src/gpu/core/PreProcessor/PreProcessorStrategy/InitIncompAD7/InitIncompAD7.cu deleted file mode 100644 index d987cbeed..000000000 --- a/src/gpu/core/PreProcessor/PreProcessorStrategy/InitIncompAD7/InitIncompAD7.cu +++ /dev/null @@ -1,43 +0,0 @@ -#include "InitIncompAD7.h" - -#include "InitIncompAD7_Device.cuh" -#include "Parameter/Parameter.h" -#include <cuda_helper/CudaGrid.h> - -std::shared_ptr<PreProcessorStrategy> InitIncompAD7::getNewInstance(std::shared_ptr<Parameter> para) -{ - return std::shared_ptr<PreProcessorStrategy>(new InitIncompAD7(para)); -} - -void InitIncompAD7::init(int level) -{ - vf::cuda::CudaGrid grid = vf::cuda::CudaGrid(para->getParD(level)->numberofthreads, para->getParD(level)->numberOfNodes); - - LB_Init_Incomp_AD_7 <<< grid.grid, grid.threads >>>( - para->getParD(level)->neighborX, - para->getParD(level)->neighborY, - para->getParD(level)->neighborZ, - para->getParD(level)->typeOfGridNode, - para->getParD(level)->concentration, - para->getParD(level)->velocityX, - para->getParD(level)->velocityY, - para->getParD(level)->velocityZ, - para->getParD(level)->numberOfNodes, - para->getParD(level)->distributionsAD.f[0], - para->getParD(level)->isEvenTimestep); - getLastCudaError("LB_Init_Incomp_AD_7 execution failed"); -} - -bool InitIncompAD7::checkParameter() -{ - return false; -} - -InitIncompAD7::InitIncompAD7(std::shared_ptr<Parameter> para) -{ - this->para = para; -} - -InitIncompAD7::InitIncompAD7() -{ -} diff --git a/src/gpu/core/PreProcessor/PreProcessorStrategy/InitIncompAD7/InitIncompAD7.h b/src/gpu/core/PreProcessor/PreProcessorStrategy/InitIncompAD7/InitIncompAD7.h deleted file mode 100644 index 33bb82c78..000000000 --- a/src/gpu/core/PreProcessor/PreProcessorStrategy/InitIncompAD7/InitIncompAD7.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef INIT_INCOMP_AD7_H -#define INIT_INCOMP_AD7_H - -#include "PreProcessor/PreProcessorStrategy/PreProcessorStrategy.h" - -#include <memory> - -class Parameter; - -class InitIncompAD7 : public PreProcessorStrategy -{ -public: - static std::shared_ptr<PreProcessorStrategy> getNewInstance(std::shared_ptr< Parameter> para); - void init(int level); - bool checkParameter(); - -private: - InitIncompAD7(); - InitIncompAD7(std::shared_ptr< Parameter> para); - std::shared_ptr< Parameter> para; -}; - -#endif \ No newline at end of file diff --git a/src/gpu/core/PreProcessor/PreProcessorStrategy/InitIncompAD7/InitIncompAD7_Device.cuh b/src/gpu/core/PreProcessor/PreProcessorStrategy/InitIncompAD7/InitIncompAD7_Device.cuh deleted file mode 100644 index f773ae81f..000000000 --- a/src/gpu/core/PreProcessor/PreProcessorStrategy/InitIncompAD7/InitIncompAD7_Device.cuh +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef LB_INIT_INCOMP_AD7_H -#define LB_INIT_INCOMP_AD7_H - -#include <DataTypes.h> -#include <curand.h> - -__global__ void LB_Init_Incomp_AD_7(unsigned int* neighborX, - unsigned int* neighborY, - unsigned int* neighborZ, - unsigned int* geoD, - real* Conc, - real* ux, - real* uy, - real* uz, - unsigned int size_Mat, - real* DD7, - bool EvenOrOdd); - -#endif \ No newline at end of file diff --git a/src/gpu/core/PreProcessor/PreProcessorType.h b/src/gpu/core/PreProcessor/PreProcessorType.h index 1fb9b78fc..20230c4b0 100644 --- a/src/gpu/core/PreProcessor/PreProcessorType.h +++ b/src/gpu/core/PreProcessor/PreProcessorType.h @@ -36,9 +36,9 @@ enum PreProcessorType InitNavierStokesIncompressible, InitNavierStokesCompressible, InitK18K20NavierStokesCompressible, - InitIncompAD7, - InitIncompAD27, - InitCompAD7, - InitCompAD27 + InitAdvectionDiffusionIncompressibleD3Q7, + InitAdvectionDiffusionIncompressible, + InitAdvectionDiffusionCompressibleD3Q7, + InitAdvectionDiffusionCompressible }; #endif \ No newline at end of file -- GitLab