← Back to team overview

dolfin team mailing list archive

[Question #138176]: defining forms with an implicit function

 

New question #138176 on DOLFIN:
https://answers.launchpad.net/dolfin/+question/138176

Hello,
   I'm trying to solve a non-linear 1D differential equation that
requires a call to a previously computed solution and it's gradient in
2D evaluated at points (x,u(x)), where u(x) is the Trial Function for
the 1D equation.

say,

mesh = UnitInterval(25)
Q = FunctionSpace(mesh,'Lagrange',2)

mesh2 = UnitSquare(25,25)
Q2 = FunctionSpace(mesh,'Lagrange',2)

f = Function(Q2,"solution.xml.gz")  #presume this has been computed
g = project(inner(grad(f),grad(f)))

u = TrialFunction(Q)
v = TestFunction(Q)

how would I compile a form with a meaning, for example, like

a = grad(u)*grad(v)*dx
L = g([x,u(x)])*f([x,u(x)])*dx

where x and grad have there 1D meanings?  Is there a way to define
implicit functions g2,f2 say so that g2(x) = g([x,u(x)]), f2(x) =
f([x,u(x)]), albeit they would need to be updated as u is varied so that
we can compile with

a = grad(u)*grad(v)*dx
L = g2*f2*dx

?  Any suggestions?

Thank you very much,
  Nathan Borggren

-- 
You received this question notification because you are a member of
DOLFIN Team, which is an answer contact for DOLFIN.