Skip to content
Snippets Groups Projects
Commit 9ab74306 authored by Martin Schönherr's avatar Martin Schönherr 💬
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 4 additions and 300 deletions
#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
#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
#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()
{
}
#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
#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
#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()
{
}
#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
#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
#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()
{
}
#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
#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
......@@ -36,9 +36,9 @@ enum PreProcessorType
InitNavierStokesIncompressible,
InitNavierStokesCompressible,
InitK18K20NavierStokesCompressible,
InitIncompAD7,
InitIncompAD27,
InitCompAD7,
InitCompAD27
InitAdvectionDiffusionIncompressibleD3Q7,
InitAdvectionDiffusionIncompressible,
InitAdvectionDiffusionCompressibleD3Q7,
InitAdvectionDiffusionCompressible
};
#endif
\ No newline at end of file
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