Skip to content
Snippets Groups Projects
Commit 9ab74306 authored by Martin Schönherr's avatar Martin Schönherr :speech_balloon:
Browse files

refactor advection diffusion inits

parent 8c55a511
No related branches found
No related tags found
1 merge request!295Clean up init GPU
Showing
with 843 additions and 61 deletions
...@@ -32,7 +32,7 @@ F16CompressibleAdvectionDiffusion::F16CompressibleAdvectionDiffusion(std::shared ...@@ -32,7 +32,7 @@ F16CompressibleAdvectionDiffusion::F16CompressibleAdvectionDiffusion(std::shared
this->para = para; this->para = para;
this->level = level; this->level = level;
myPreProcessorTypes.push_back(InitCompAD27); myPreProcessorTypes.push_back(InitAdvectionDiffusionCompressible);
} }
......
...@@ -32,7 +32,7 @@ F16IncompressibleAdvectionDiffusion::F16IncompressibleAdvectionDiffusion(std::sh ...@@ -32,7 +32,7 @@ F16IncompressibleAdvectionDiffusion::F16IncompressibleAdvectionDiffusion(std::sh
this->para = para; this->para = para;
this->level = level; this->level = level;
myPreProcessorTypes.push_back(InitIncompAD27); myPreProcessorTypes.push_back(InitAdvectionDiffusionIncompressible);
} }
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
#include "PreProcessor/PreProcessorImp.h" #include "PreProcessor/PreProcessorImp.h"
#include "PreProcessor/PreProcessorStrategy/InitCompAD7/InitCompAD7.h" #include "PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionCompressibleD3Q7/InitAdvectionDiffusionCompressibleD3Q7.h"
#include "PreProcessor/PreProcessorStrategy/InitCompAD27/InitCompAD27.h" #include "PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionCompressible/InitAdvectionDiffusionCompressible.h"
#include "PreProcessor/PreProcessorStrategy/InitNavierStokesCompressible/InitNavierStokesCompressible.h" #include "PreProcessor/PreProcessorStrategy/InitNavierStokesCompressible/InitNavierStokesCompressible.h"
#include "PreProcessor/PreProcessorStrategy/InitK18K20NavierStokesCompressible/InitK18K20NavierStokesCompressible.h" #include "PreProcessor/PreProcessorStrategy/InitK18K20NavierStokesCompressible/InitK18K20NavierStokesCompressible.h"
#include "PreProcessor/PreProcessorStrategy/InitIncompAD27/InitIncompAD27.h" #include "PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionIncompressible/InitAdvectionDiffusionIncompressible.h"
#include "PreProcessor/PreProcessorStrategy/InitIncompAD7/InitIncompAD7.h" #include "PreProcessor/PreProcessorStrategy/InitAdvectionDiffusionIncompressibleD3Q7/InitAdvectionDiffusionIncompressibleD3Q7.h"
#include "PreProcessor/PreProcessorStrategy/InitNavierStokesIncompressible/InitNavierStokesIncompressible.h" #include "PreProcessor/PreProcessorStrategy/InitNavierStokesIncompressible/InitNavierStokesIncompressible.h"
...@@ -34,17 +34,17 @@ std::shared_ptr<PreProcessorStrategy> PreProcessorFactoryImp::makePreProcessorSt ...@@ -34,17 +34,17 @@ std::shared_ptr<PreProcessorStrategy> PreProcessorFactoryImp::makePreProcessorSt
case InitK18K20NavierStokesCompressible: case InitK18K20NavierStokesCompressible:
return InitK18K20NavierStokesCompressible::getNewInstance(para); return InitK18K20NavierStokesCompressible::getNewInstance(para);
break; break;
case InitIncompAD7: case InitAdvectionDiffusionIncompressibleD3Q7:
return InitIncompAD7::getNewInstance(para); return InitAdvectionDiffusionIncompressibleD3Q7::getNewInstance(para);
break; break;
case InitIncompAD27: case InitAdvectionDiffusionIncompressible:
return InitIncompAD27::getNewInstance(para); return InitAdvectionDiffusionIncompressible::getNewInstance(para);
break; break;
case InitCompAD7: case InitAdvectionDiffusionCompressibleD3Q7:
return InitCompAD7::getNewInstance(para); return InitAdvectionDiffusionCompressibleD3Q7::getNewInstance(para);
break; break;
case InitCompAD27: case InitAdvectionDiffusionCompressible:
return InitCompAD27::getNewInstance(para); return InitAdvectionDiffusionCompressible::getNewInstance(para);
break; break;
default: default:
break; break;
......
//=======================================================================================
// ____ ____ __ ______ __________ __ __ __ __
// \ \ | | | | | _ \ |___ ___| | | | | / \ | |
// \ \ | | | | | |_) | | | | | | | / \ | |
// \ \ | | | | | _ / | | | | | | / /\ \ | |
// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____
// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______|
// \ \ | | ________________________________________________________________
// \ \ | | | ______________________________________________________________|
// \ \| | | | __ __ __ __ ______ _______
// \ | | |_____ | | | | | | | | | _ \ / _____)
// \ | | _____| | | | | | | | | | | \ \ \_______
// \ | | | | |_____ | \_/ | | | | |_/ / _____ |
// \ _____| |__| |________| \_______/ |__| |______/ (_______/
//
// 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()
{
}
//=======================================================================================
// ____ ____ __ ______ __________ __ __ __ __
// \ \ | | | | | _ \ |___ ___| | | | | / \ | |
// \ \ | | | | | |_) | | | | | | | / \ | |
// \ \ | | | | | _ / | | | | | | / /\ \ | |
// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____
// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______|
// \ \ | | ________________________________________________________________
// \ \ | | | ______________________________________________________________|
// \ \| | | | __ __ __ __ ______ _______
// \ | | |_____ | | | | | | | | | _ \ / _____)
// \ | | _____| | | | | | | | | | | \ \ \_______
// \ | | | | |_____ | \_/ | | | | |_/ / _____ |
// \ _____| |__| |________| \_______/ |__| |______/ (_______/
//
// 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
//=======================================================================================
// ____ ____ __ ______ __________ __ __ __ __
// \ \ | | | | | _ \ |___ ___| | | | | / \ | |
// \ \ | | | | | |_) | | | | | | | / \ | |
// \ \ | | | | | _ / | | | | | | / /\ \ | |
// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____
// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______|
// \ \ | | ________________________________________________________________
// \ \ | | | ______________________________________________________________|
// \ \| | | | __ __ __ __ ______ _______
// \ | | |_____ | | | | | | | | | _ \ / _____)
// \ | | _____| | | | | | | | | | | \ \ \_______
// \ | | | | |_____ | \_/ | | | | |_/ / _____ |
// \ _____| |__| |________| \_______/ |__| |______/ (_______/
//
// 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/LB.h"
#include "lbm/constants/D3Q27.h" #include "lbm/constants/D3Q27.h"
#include <basics/constants/NumericConstants.h> #include <basics/constants/NumericConstants.h>
...@@ -6,7 +36,7 @@ using namespace vf::basics::constant; ...@@ -6,7 +36,7 @@ using namespace vf::basics::constant;
using namespace vf::lbm::dir; 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* neighborY,
unsigned int* neighborZ, unsigned int* neighborZ,
unsigned int* geoD, unsigned int* geoD,
......
//=======================================================================================
// ____ ____ __ ______ __________ __ __ __ __
// \ \ | | | | | _ \ |___ ___| | | | | / \ | |
// \ \ | | | | | |_) | | | | | | | / \ | |
// \ \ | | | | | _ / | | | | | | / /\ \ | |
// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____
// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______|
// \ \ | | ________________________________________________________________
// \ \ | | | ______________________________________________________________|
// \ \| | | | __ __ __ __ ______ _______
// \ | | |_____ | | | | | | | | | _ \ / _____)
// \ | | _____| | | | | | | | | | | \ \ \_______
// \ | | | | |_____ | \_/ | | | | |_/ / _____ |
// \ _____| |__| |________| \_______/ |__| |______/ (_______/
//
// 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
//=======================================================================================
// ____ ____ __ ______ __________ __ __ __ __
// \ \ | | | | | _ \ |___ ___| | | | | / \ | |
// \ \ | | | | | |_) | | | | | | | / \ | |
// \ \ | | | | | _ / | | | | | | / /\ \ | |
// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____
// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______|
// \ \ | | ________________________________________________________________
// \ \ | | | ______________________________________________________________|
// \ \| | | | __ __ __ __ ______ _______
// \ | | |_____ | | | | | | | | | _ \ / _____)
// \ | | _____| | | | | | | | | | | \ \ \_______
// \ | | | | |_____ | \_/ | | | | |_/ / _____ |
// \ _____| |__| |________| \_______/ |__| |______/ (_______/
//
// 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()
{
}
//=======================================================================================
// ____ ____ __ ______ __________ __ __ __ __
// \ \ | | | | | _ \ |___ ___| | | | | / \ | |
// \ \ | | | | | |_) | | | | | | | / \ | |
// \ \ | | | | | _ / | | | | | | / /\ \ | |
// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____
// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______|
// \ \ | | ________________________________________________________________
// \ \ | | | ______________________________________________________________|
// \ \| | | | __ __ __ __ ______ _______
// \ | | |_____ | | | | | | | | | _ \ / _____)
// \ | | _____| | | | | | | | | | | \ \ \_______
// \ | | | | |_____ | \_/ | | | | |_/ / _____ |
// \ _____| |__| |________| \_______/ |__| |______/ (_______/
//
// 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
//=======================================================================================
// ____ ____ __ ______ __________ __ __ __ __
// \ \ | | | | | _ \ |___ ___| | | | | / \ | |
// \ \ | | | | | |_) | | | | | | | / \ | |
// \ \ | | | | | _ / | | | | | | / /\ \ | |
// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____
// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______|
// \ \ | | ________________________________________________________________
// \ \ | | | ______________________________________________________________|
// \ \| | | | __ __ __ __ ______ _______
// \ | | |_____ | | | | | | | | | _ \ / _____)
// \ | | _____| | | | | | | | | | | \ \ \_______
// \ | | | | |_____ | \_/ | | | | |_/ / _____ |
// \ _____| |__| |________| \_______/ |__| |______/ (_______/
//
// 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/LB.h"
#include "lbm/constants/D3Q27.h" #include "lbm/constants/D3Q27.h"
#include <basics/constants/NumericConstants.h> #include <basics/constants/NumericConstants.h>
...@@ -6,7 +36,7 @@ using namespace vf::basics::constant; ...@@ -6,7 +36,7 @@ using namespace vf::basics::constant;
using namespace vf::lbm::dir; using namespace vf::lbm::dir;
#include "math.h" #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* neighborY,
unsigned int* neighborZ, unsigned int* neighborZ,
unsigned int* geoD, unsigned int* geoD,
......
//=======================================================================================
// ____ ____ __ ______ __________ __ __ __ __
// \ \ | | | | | _ \ |___ ___| | | | | / \ | |
// \ \ | | | | | |_) | | | | | | | / \ | |
// \ \ | | | | | _ / | | | | | | / /\ \ | |
// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____
// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______|
// \ \ | | ________________________________________________________________
// \ \ | | | ______________________________________________________________|
// \ \| | | | __ __ __ __ ______ _______
// \ | | |_____ | | | | | | | | | _ \ / _____)
// \ | | _____| | | | | | | | | | | \ \ \_______
// \ | | | | |_____ | \_/ | | | | |_/ / _____ |
// \ _____| |__| |________| \_______/ |__| |______/ (_______/
//
// 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
//=======================================================================================
// ____ ____ __ ______ __________ __ __ __ __
// \ \ | | | | | _ \ |___ ___| | | | | / \ | |
// \ \ | | | | | |_) | | | | | | | / \ | |
// \ \ | | | | | _ / | | | | | | / /\ \ | |
// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____
// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______|
// \ \ | | ________________________________________________________________
// \ \ | | | ______________________________________________________________|
// \ \| | | | __ __ __ __ ______ _______
// \ | | |_____ | | | | | | | | | _ \ / _____)
// \ | | _____| | | | | | | | | | | \ \ \_______
// \ | | | | |_____ | \_/ | | | | |_/ / _____ |
// \ _____| |__| |________| \_______/ |__| |______/ (_______/
//
// 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()
{
}
//=======================================================================================
// ____ ____ __ ______ __________ __ __ __ __
// \ \ | | | | | _ \ |___ ___| | | | | / \ | |
// \ \ | | | | | |_) | | | | | | | / \ | |
// \ \ | | | | | _ / | | | | | | / /\ \ | |
// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____
// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______|
// \ \ | | ________________________________________________________________
// \ \ | | | ______________________________________________________________|
// \ \| | | | __ __ __ __ ______ _______
// \ | | |_____ | | | | | | | | | _ \ / _____)
// \ | | _____| | | | | | | | | | | \ \ \_______
// \ | | | | |_____ | \_/ | | | | |_/ / _____ |
// \ _____| |__| |________| \_______/ |__| |______/ (_______/
//
// 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
//=======================================================================================
// ____ ____ __ ______ __________ __ __ __ __
// \ \ | | | | | _ \ |___ ___| | | | | / \ | |
// \ \ | | | | | |_) | | | | | | | / \ | |
// \ \ | | | | | _ / | | | | | | / /\ \ | |
// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____
// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______|
// \ \ | | ________________________________________________________________
// \ \ | | | ______________________________________________________________|
// \ \| | | | __ __ __ __ ______ _______
// \ | | |_____ | | | | | | | | | _ \ / _____)
// \ | | _____| | | | | | | | | | | \ \ \_______
// \ | | | | |_____ | \_/ | | | | |_/ / _____ |
// \ _____| |__| |________| \_______/ |__| |______/ (_______/
//
// 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/LB.h"
#include "lbm/constants/D3Q27.h" #include "lbm/constants/D3Q27.h"
#include <basics/constants/NumericConstants.h> #include <basics/constants/NumericConstants.h>
...@@ -6,7 +36,8 @@ using namespace vf::basics::constant; ...@@ -6,7 +36,8 @@ using namespace vf::basics::constant;
using namespace vf::lbm::dir; using namespace vf::lbm::dir;
#include "math.h" #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* neighborY,
unsigned int* neighborZ, unsigned int* neighborZ,
unsigned int* geoD, unsigned int* geoD,
......
//=======================================================================================
// ____ ____ __ ______ __________ __ __ __ __
// \ \ | | | | | _ \ |___ ___| | | | | / \ | |
// \ \ | | | | | |_) | | | | | | | / \ | |
// \ \ | | | | | _ / | | | | | | / /\ \ | |
// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____
// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______|
// \ \ | | ________________________________________________________________
// \ \ | | | ______________________________________________________________|
// \ \| | | | __ __ __ __ ______ _______
// \ | | |_____ | | | | | | | | | _ \ / _____)
// \ | | _____| | | | | | | | | | | \ \ \_______
// \ | | | | |_____ | \_/ | | | | |_/ / _____ |
// \ _____| |__| |________| \_______/ |__| |______/ (_______/
//
// 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
//=======================================================================================
// ____ ____ __ ______ __________ __ __ __ __
// \ \ | | | | | _ \ |___ ___| | | | | / \ | |
// \ \ | | | | | |_) | | | | | | | / \ | |
// \ \ | | | | | _ / | | | | | | / /\ \ | |
// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____
// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______|
// \ \ | | ________________________________________________________________
// \ \ | | | ______________________________________________________________|
// \ \| | | | __ __ __ __ ______ _______
// \ | | |_____ | | | | | | | | | _ \ / _____)
// \ | | _____| | | | | | | | | | | \ \ \_______
// \ | | | | |_____ | \_/ | | | | |_/ / _____ |
// \ _____| |__| |________| \_______/ |__| |______/ (_______/
//
// 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()
{
}
//=======================================================================================
// ____ ____ __ ______ __________ __ __ __ __
// \ \ | | | | | _ \ |___ ___| | | | | / \ | |
// \ \ | | | | | |_) | | | | | | | / \ | |
// \ \ | | | | | _ / | | | | | | / /\ \ | |
// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____
// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______|
// \ \ | | ________________________________________________________________
// \ \ | | | ______________________________________________________________|
// \ \| | | | __ __ __ __ ______ _______
// \ | | |_____ | | | | | | | | | _ \ / _____)
// \ | | _____| | | | | | | | | | | \ \ \_______
// \ | | | | |_____ | \_/ | | | | |_/ / _____ |
// \ _____| |__| |________| \_______/ |__| |______/ (_______/
//
// 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
//=======================================================================================
// ____ ____ __ ______ __________ __ __ __ __
// \ \ | | | | | _ \ |___ ___| | | | | / \ | |
// \ \ | | | | | |_) | | | | | | | / \ | |
// \ \ | | | | | _ / | | | | | | / /\ \ | |
// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____
// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______|
// \ \ | | ________________________________________________________________
// \ \ | | | ______________________________________________________________|
// \ \| | | | __ __ __ __ ______ _______
// \ | | |_____ | | | | | | | | | _ \ / _____)
// \ | | _____| | | | | | | | | | | \ \ \_______
// \ | | | | |_____ | \_/ | | | | |_/ / _____ |
// \ _____| |__| |________| \_______/ |__| |______/ (_______/
//
// 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/LB.h"
#include "lbm/constants/D3Q27.h" #include "lbm/constants/D3Q27.h"
#include <basics/constants/NumericConstants.h> #include <basics/constants/NumericConstants.h>
...@@ -6,7 +36,8 @@ using namespace vf::basics::constant; ...@@ -6,7 +36,8 @@ using namespace vf::basics::constant;
using namespace vf::lbm::dir; using namespace vf::lbm::dir;
#include "math.h" #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* neighborY,
unsigned int* neighborZ, unsigned int* neighborZ,
unsigned int* geoD, unsigned int* geoD,
......
//=======================================================================================
// ____ ____ __ ______ __________ __ __ __ __
// \ \ | | | | | _ \ |___ ___| | | | | / \ | |
// \ \ | | | | | |_) | | | | | | | / \ | |
// \ \ | | | | | _ / | | | | | | / /\ \ | |
// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____
// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______|
// \ \ | | ________________________________________________________________
// \ \ | | | ______________________________________________________________|
// \ \| | | | __ __ __ __ ______ _______
// \ | | |_____ | | | | | | | | | _ \ / _____)
// \ | | _____| | | | | | | | | | | \ \ \_______
// \ | | | | |_____ | \_/ | | | | |_/ / _____ |
// \ _____| |__| |________| \_______/ |__| |______/ (_______/
//
// 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
#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()
{
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment