Mixed Function Space: I Know One, I Want the Other
I have, through nefarious means, obtained the pressure of a particular system. Now, I want to know the velocity of that system by relating the two through a variational form and solving over a mixed function space.
I know that assigning the pressure function to a shallow copy of the scalar component of a function on the mixed space is the first step, but solving this system produces NaN's in the velocity field. Minimal code follows--anyone have an idea what's going on?
Space = FunctionSpace(mesh, "CG", 2)
VSpace = VectorFunctionS
W = VSpace*Space
v = TestFunction(Space)
P = TrialFunction(
(r,q) = TestFunctions(W)
(u,Pv) = TrialFunctions(W)
PNext = Function(Space)
PhiNext = TrialFunction(
Phi = Function(Space)
Phi.interpolate
pLeft = -inner(
pRight = Dx(Phi**n,1)*v*dx
P = Function(Space)
# Phi time-dependence problem set-up
a = PhiNext*v*dx
L = (Phi+dt*
A = assemble(a)
vv = div(u)*q*dx-Pv*q*dx
f = Constant(0.0)
vRight = f*q*dx
bigu= Function(W)
while t <= T:
# Phi, Pressure step
pl = assemble(pLeft)
pr = assemble(pRight)
b = assemble(L)
# Velocity step
VL = assemble(vv)
VR = assemble(vRight)
uv, us = bigu.split(
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 Stav Gold for more information if necessary.