diff --git a/examples/wave/wave-min.py b/examples/wave/wave-min.py index bf2cc843f19314fd13463e1263499150817cba7c..6e2baa1bcc328af322a8e45cc1d04c2f78613a8b 100644 --- a/examples/wave/wave-min.py +++ b/examples/wave/wave-min.py @@ -35,12 +35,19 @@ def main(write_output=True, order=4): cl_ctx = cl.create_some_context() queue = cl.CommandQueue(cl_ctx) - dims = 2 + dims = 3 from meshmode.mesh.generation import generate_regular_rect_mesh mesh = generate_regular_rect_mesh( a=(-0.5,)*dims, b=(0.5,)*dims, - n=(8,)*dims) + n=(16,)*dims) + + if mesh.dim == 2: + dt = 0.04 + elif mesh.dim == 3: + dt = 0.02 + + print("%d elements" % mesh.nelements) discr = Discretization(cl_ctx, mesh, order=order) @@ -77,17 +84,12 @@ def main(write_output=True, order=4): # print(sym.pretty(op.sym_operator())) bound_op = bind(discr, op.sym_operator()) - print(bound_op) + # print(bound_op) # 1/0 def rhs(t, w): return bound_op(queue, t=t, w=w) - if mesh.dim == 2: - dt = 0.04 - elif mesh.dim == 3: - dt = 0.02 - dt_stepper = set_up_rk4("w", dt, fields, rhs) final_t = 10