Skip to content

Commit

Permalink
Syntax fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
garth-wells committed Jan 27, 2023
1 parent ff1df80 commit a5de737
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/demo/demo_lagrange_variants.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def saw_tooth(x):
for variant in [basix.LagrangeVariant.equispaced, basix.LagrangeVariant.gll_warped]:
element = basix.create_element(basix.ElementFamily.P, basix.CellType.interval, 10, variant)
ufl_element = basix.ufl_wrapper.BasixElement(element)
V = fem.FunctionSpace(mesh, ufl_element)
V = fem.FunctionSpace(msh, ufl_element)
uh = fem.Function(V)
uh.interpolate(lambda x: saw_tooth(x[0]))
if MPI.COMM_WORLD.size == 1: # Skip this plotting in parallel
Expand Down Expand Up @@ -205,11 +205,11 @@ def saw_tooth(x):
for variant in [basix.LagrangeVariant.equispaced, basix.LagrangeVariant.gll_warped]:
element = basix.create_element(basix.ElementFamily.P, basix.CellType.interval, 10, variant)
ufl_element = basix.ufl_wrapper.BasixElement(element)
V = fem.FunctionSpace(mesh, ufl_element)
V = fem.FunctionSpace(msh, ufl_element)
uh = fem.Function(V)
uh.interpolate(lambda x: saw_tooth(x[0]))
M = fem.form((u_exact - uh)**2 * dx)
error = mesh.comm.allreduce(fem.assemble_scalar(M), op=MPI.SUM)
error = msh.comm.allreduce(fem.assemble_scalar(M), op=MPI.SUM)
print(f"Computed L2 interpolation error ({variant.name}):", error ** 0.5)
# -

Expand Down

0 comments on commit a5de737

Please sign in to comment.