FinalFunctional fails in tutorial2.py
When running the example program tutorial2.py from http://
from dolfin import *
from dolfin_adjoint import *
n = 30
mesh = UnitInterval(n)
V = FunctionSpace(mesh, "CG", 2)
ic = project(
u = Function(ic)
u_next = Function(V)
v = TestFunction(V)
nu = Constant(0.0001)
timestep = Constant(1.0/n)
F = ((u_next - u)/timestep*v
+ u_next*
+ nu*grad(
bc = DirichletBC(V, 0.0, "on_boundary")
t = 0.0
end = 0.2
while (t <= end):
solve(F == 0, u_next, bc)
u.assign(u_next)
t += float(timestep)
J = FinalFunctional
dJdic = compute_gradient(J, InitialConditio
dJdnu = compute_gradient(J, ScalarParameter
I get the error message
NameError: name 'FinalFunctional' is not defined
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- Glen D. Granzow
- Solved:
- Last query:
- Last reply: