Commit 89abe5dd authored by ph's avatar ph

add transport solver

parent 41c39e44
......@@ -24,8 +24,8 @@ _m = 1
_wbord = 0.
# grid size
_nx = 1024
_ny = 1024
_nx = 64
_ny = 64
Lx = 1.
Ly = 1.
......
......@@ -76,17 +76,17 @@ __kernel void time_step(__global float *wn, __global float *wnp1){
int j = id / _NX;
int ngrid = _NX * _NY;
float wnow[_M];
float wnext[_M];
int ngrid = _NX * _NY;
float wnow[_M];
float wnext[_M];
// load middle value
for(int iv = 0; iv < _M; iv++){
int imem = i + j * _NX + iv * ngrid;
wnow[iv] = wn[imem];
wnext[iv] = wnow[iv];
}
// load middle value
for(int iv = 0; iv < _M; iv++){
int imem = i + j * _NX + iv * ngrid;
wnow[iv] = wn[imem];
wnext[iv] = wnow[iv];
}
if (i > 0 && i < _NX - 1 && j > 0 && j < _NY - 1){
float flux[_M];
......
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