Commit 89abe5dd authored by ph's avatar ph

add transport solver

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