Skip to content
Snippets Groups Projects

Basic fusion

Merged Andreas Klöckner requested to merge basic-fusion into master
Files
9
+ 10
8
@@ -35,12 +35,19 @@ def main(write_output=True, order=4):
@@ -35,12 +35,19 @@ def main(write_output=True, order=4):
cl_ctx = cl.create_some_context()
cl_ctx = cl.create_some_context()
queue = cl.CommandQueue(cl_ctx)
queue = cl.CommandQueue(cl_ctx)
dims = 2
dims = 3
from meshmode.mesh.generation import generate_regular_rect_mesh
from meshmode.mesh.generation import generate_regular_rect_mesh
mesh = generate_regular_rect_mesh(
mesh = generate_regular_rect_mesh(
a=(-0.5,)*dims,
a=(-0.5,)*dims,
b=(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)
discr = Discretization(cl_ctx, mesh, order=order)
@@ -77,17 +84,12 @@ def main(write_output=True, order=4):
@@ -77,17 +84,12 @@ def main(write_output=True, order=4):
# print(sym.pretty(op.sym_operator()))
# print(sym.pretty(op.sym_operator()))
bound_op = bind(discr, op.sym_operator())
bound_op = bind(discr, op.sym_operator())
print(bound_op)
# print(bound_op)
# 1/0
# 1/0
def rhs(t, w):
def rhs(t, w):
return bound_op(queue, t=t, w=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)
dt_stepper = set_up_rk4("w", dt, fields, rhs)
final_t = 10
final_t = 10
Loading