confusion with grad(f), f.dx(0), f.dx(1), f.dx(0,1)
Asked by
Chaffra Affouda
In ufl, what is the difference between grad(f) and f.dx(0)? If f is a function what does it mean to write f.dx(1) instead of f.dx(0)?
You can't extract vector component from f.dx(0) for example but I thought it was the same as grad(f): f.dx(0)[0] breaks.
Also how do you extract the vector component from graf(f) ayt a given position
mesh = UnitSquare(10,10)
Q = FunctionSpace(
expr = Expression(
f = project(expr,Q)
df = grad(f)
df[0]([0.5,0.5]) = 1.5689657305885802
df[1]([0.5,0.5]) = 1.5689657305885802 #SHOULD BE ZERO!
df([0.5,0.5]) #breaks with Keyerror
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Martin Sandve Alnæs
- Solved:
- Last query:
- Last reply:
To post a message you must log in.