Commit bcd69818 by Jigyasa Watwani

error in function approximation

parent b59af6e5
Showing with 11 additions and 0 deletions
import dolfin as df
import numpy as np
import matplotlib.pyplot as plt
f = df.Expression('2*x[0] - x[0]*x[0]', degree=1)
Nx , L = 32,1
mesh = df.IntervalMesh(Nx, 0, L)
V = df.FunctionSpace(mesh, 'P', 1)
u = df.interpolate(f, V)
error = df.errornorm(f,u,'L2')
print(error)
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 sign in to comment