Commit 2ceb746f authored by fdrui's avatar fdrui

averaged compression

parent 520a1e59
......@@ -63,7 +63,7 @@ def solve_ocl(m=_m, n=_n, nx=_nx, ny=_ny, Lx=_Lx, Ly=_Ly, Tmax=_Tmax,
dt = cfl * dx / vmax
# compression for output data
ncpr = 512
ncpr = 128
#np_int = 'int8'
ff = "_F"
......
......@@ -765,7 +765,14 @@ __kernel void compress(__global const real *fn, __global real *fncpr){
for(int ik = 0; ik < _N; ik++){
int imem = i + j * _NX + ik * ngrid;
int imemnew = inew + jnew * _NCPR + ik * ngridnew;
fncpr[imemnew] = fn[imem];
fncpr[imemnew] = 0.25*fn[imem];
int inext = (i+1) + j * _NX + ik * ngrid;
fncpr[imemnew] += 0.25*fn[inext];
inext = i + (j+1) * _NX + ik * ngrid;
fncpr[imemnew] += 0.25*fn[inext];
inext = (i+1) + (j+1) * _NX + ik * ngrid;
fncpr[imemnew] += 0.25*fn[inext];
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment