Getting values from UFL operators
I'm new to the FEnICS package, so hopefully this isn't too far off base, but there are cases where I just want to compute something from a simple UFL operation (like sqrt, dot) without assembly.
Here is a sample program that probably explains what I'm trying to do most simple:
from dolfin import *
mesh = Interval(100, 0, 2*pi)
V = FunctionSpace(mesh, 'CG', 1)
fexp = Expression(
f = interpolate(fexp, V)
a = dot(f,f)
print a
I can't get dolfin to give me the value, I just get something that's useful in an assemble() call, like assemble(a*dx).. But I just want to get value of the dot product.
There are places where I'm trying to verify things, but I'm stuck with things Sum(...), Dot(...), Sqrt(...), and I'd really like to be able to perform the computation described and inspect the values.
Thanks a lot.
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Robert Crim for more information if necessary.