Skip to content
Snippets Groups Projects
Commit b4bd6304 authored by Cristian Lalescu's avatar Cristian Lalescu
Browse files

use more memory, less fft-s

parent 95ae20aa
No related branches found
No related tags found
No related merge requests found
......@@ -74,8 +74,8 @@ fluid_solver<R>::fluid_solver( \
\
this->cv[1] = FFTW(alloc_complex)(this->cd->local_size);\
this->cv[2] = FFTW(alloc_complex)(this->cd->local_size);\
this->rv[1] = (R*)(this->cv[1]);\
this->rv[2] = (R*)(this->cv[2]);\
this->rv[1] = FFTW(alloc_real)(this->cd->local_size*2);\
this->rv[2] = FFTW(alloc_real)(this->cd->local_size*2);\
\
this->c2r_vorticity = new FFTW(plan);\
this->r2c_vorticity = new FFTW(plan);\
......@@ -164,6 +164,8 @@ fluid_solver<R>::~fluid_solver() \
\
FFTW(free)(this->cv[1]);\
FFTW(free)(this->cv[2]);\
FFTW(free)(this->rv[1]);\
FFTW(free)(this->rv[2]);\
FFTW(free)(this->cvorticity);\
FFTW(free)(this->rvorticity);\
FFTW(free)(this->cvelocity);\
......@@ -233,7 +235,7 @@ void fluid_solver<R>::omega_nonlin( \
this->symmetrize(this->cu, 3); \
/* $\imath k \times DFT(u \times \omega)$ */ \
R tmpx1, tmpy1, tmpz1; \
FFTW(execute)(*((FFTW(plan)*)this->vr2c[src])); \
/* FFTW(execute)(*((FFTW(plan)*)this->vr2c[src]));*/ \
CLOOP( \
tmpx0 = -(this->ky[yindex]*this->cu[cindex*3+2][1] - this->kz[zindex]*this->cu[cindex*3+1][1]); \
tmpy0 = -(this->kz[zindex]*this->cu[cindex*3+0][1] - this->kx[xindex]*this->cu[cindex*3+2][1]); \
......@@ -247,12 +249,12 @@ void fluid_solver<R>::omega_nonlin( \
this->cu[cindex*3+0][1] = tmpx1 / this->normalization_factor;\
this->cu[cindex*3+1][1] = tmpy1 / this->normalization_factor;\
this->cu[cindex*3+2][1] = tmpz1 / this->normalization_factor;\
this->cv[src][cindex*3+0][0] /= this->normalization_factor; \
this->cv[src][cindex*3+0][1] /= this->normalization_factor; \
this->cv[src][cindex*3+1][0] /= this->normalization_factor; \
this->cv[src][cindex*3+1][1] /= this->normalization_factor; \
this->cv[src][cindex*3+2][0] /= this->normalization_factor; \
this->cv[src][cindex*3+2][1] /= this->normalization_factor; \
/*this->cv[src][cindex*3+0][0] /= this->normalization_factor;*/ \
/*this->cv[src][cindex*3+0][1] /= this->normalization_factor;*/ \
/*this->cv[src][cindex*3+1][0] /= this->normalization_factor;*/ \
/*this->cv[src][cindex*3+1][1] /= this->normalization_factor;*/ \
/*this->cv[src][cindex*3+2][0] /= this->normalization_factor;*/ \
/*this->cv[src][cindex*3+2][1] /= this->normalization_factor;*/ \
); \
this->symmetrize(this->cu, 3); \
this->symmetrize(this->cv[src], 3); \
......
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