Skip to content
Snippets Groups Projects
Commit 01f93b10 authored by Anna Wellmann's avatar Anna Wellmann
Browse files

Refactor calculateTurbuulenceIntensity (minor changes)

parent 638f73a1
No related branches found
No related tags found
1 merge request!104Add Communication Hiding to GPU version
......@@ -14,7 +14,8 @@ void allocTurbulenceIntensity(Parameter *para, CudaMemoryManager *cudaManager, u
{
int lev = para->getFine();
cudaManager->cudaAllocTurbulenceIntensity(lev, size);
resetTurbulenceIntensity(para, cudaManager, size);
resetVelocityFluctuationsAndMeans(para, cudaManager, size);
para->getParH(lev)->turbulenceIntensity.resize(size);
}
......@@ -43,11 +44,10 @@ void calcVelocityAndFluctuations(Parameter *para, CudaMemoryManager *cudaManager
void calcTurbulenceIntensity(Parameter *para, CudaMemoryManager *cudaManager, uint tdiff, uint size) {
calcVelocityAndFluctuations(para, cudaManager, tdiff, size);
int lev = para->getFine();
para->getParH(lev)->turbulenceIntensity.resize(size);
real fluc_squared;
real v_mean_squared;
for (uint i = 0; i < size; i++) {
......@@ -61,7 +61,7 @@ void calcTurbulenceIntensity(Parameter *para, CudaMemoryManager *cudaManager, ui
}
void resetTurbulenceIntensity(Parameter *para, CudaMemoryManager *cudaManager, uint size)
void resetVelocityFluctuationsAndMeans(Parameter *para, CudaMemoryManager *cudaManager, uint size)
{
int lev = para->getFine();
......
......@@ -9,7 +9,7 @@
extern "C" void allocTurbulenceIntensity(Parameter *para, CudaMemoryManager *cudaManager, uint size);
extern "C" void calcVelocityAndFluctuations(Parameter *para, CudaMemoryManager *cudaManager, uint tdiff, uint size);
extern "C" void calcTurbulenceIntensity(Parameter *para, CudaMemoryManager *cudaManager, uint tdiff, uint size);
extern "C" void resetTurbulenceIntensity(Parameter *para, CudaMemoryManager *cudaManager, uint size);
extern "C" void resetVelocityFluctuationsAndMeans(Parameter *para, CudaMemoryManager *cudaManager, uint size);
void writeTurbulenceIntensityToFile(Parameter *para, uint timestep, int *vectorOfSparseIndices);
......
......@@ -968,7 +968,7 @@ void Simulation::run()
calcTurbulenceIntensity(para.get(), cudaManager.get(), t_diff, para->getParH(para->getFine())->QGeom.kQ);
writeTurbulenceIntensityToFile(para.get(), t, para->getParH(para->getFine())->QGeom.k);
t_turbulenceIntensity = t;
resetTurbulenceIntensity(para.get(), cudaManager.get(), para->getParH(para->getFine())->QGeom.kQ);
resetVelocityFluctuationsAndMeans(para.get(), cudaManager.get(), para->getParH(para->getFine())->QGeom.kQ);
}
////////////////////////////////////////////////////////////////////////
dataWriter->writeTimestep(para, t);
......
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