Commit cf6082e3 authored by Philippe Helluy's avatar Philippe Helluy

start 1d transport test

parent 13db8cbf
...@@ -84,15 +84,18 @@ npts = deg+1 ...@@ -84,15 +84,18 @@ npts = deg+1
dx = 1./raf dx = 1./raf
cfl = 0.1 cfl = 0.05
dt = dx * cfl dt = dx * cfl
t = 0. t = 0.
tmax = 0.05 tmax = 1.
while t < tmax: while t < tmax:
tnow = np.float32(t)
dtwn.fill(0.)
prg.DGFlux(queue, (raf+1, row_size, row_size), (1, 1, 1), prg.DGFlux(queue, (raf+1, row_size, row_size), (1, 1, 1),
ie, point_gpu,tnow, wn.base_data,dtwn.base_data).wait() ie, point_gpu,tnow, wn.base_data,dtwn.base_data).wait()
...@@ -103,6 +106,8 @@ while t < tmax: ...@@ -103,6 +106,8 @@ while t < tmax:
dtwn.fill(0.) dtwn.fill(0.)
t = t + dt/2
tnow = np.float32(t)
prg.DGFlux(queue, (raf+1, row_size, row_size), (1, 1, 1), prg.DGFlux(queue, (raf+1, row_size, row_size), (1, 1, 1),
ie, point_gpu,tnow, wnp1.base_data,dtwn.base_data).wait() ie, point_gpu,tnow, wnp1.base_data,dtwn.base_data).wait()
...@@ -111,7 +116,9 @@ while t < tmax: ...@@ -111,7 +116,9 @@ while t < tmax:
wn = wn + dt * dtwn wn = wn + dt * dtwn
t = t + dt t = t + dt/2
tnow = np.float32(t)
print("t=",t) print("t=",t)
......
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