how to compute W_{1,\infty} semi-norm
I do not know how to compute the W_{1,\infty} semi-norm a finite solution with FEniCS.
For example I solve a standard elliptic equation as below, and I get
the solution u, now I want to compute L-inf norm of du/dx and du/dy.
I cannot make sure I am correct, any help is great apprieciated.
#------
from dolfin import *
mesh = UnitSquareMesh(100, 100)
V = FunctionSpace(mesh, "CG", 1)
def boundary(x):
return x[0] < DOLFIN_EPS or x[0] > 1.0 - DOLFIN_EPS
u0 = Constant(0.0)
bc = DirichletBC(V, u0, boundary)
u = TrialFunction(V)
v = TestFunction(V)
f = Expression(
g = Expression(
a = inner(grad(u), grad(v))*dx
L = f*v*dx + g*v*ds
u = Function(V)
solve(a == L, u, bc)
#------
# compute the W_{1,\infty} semi-norm
#------
A = project(
ux , uy = A.split(
tempx = norm(ux.
tempy = norm(uy.
linf = max(tempx,tempy)
print linf
#------
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Jan Blechta
- Solved:
- Last query:
- Last reply: