Beginners question: applying boundary conditions
I am struggling with a very simple problem
unit cube
div(grad(u))=0
du/dn=-1.4 on x=0
du/dn=1.4 on x=1
du/dn+1.
du/dn=0 on y=0,y=1,z=0
below is my attempt with pydolfin, but it gives u=zero everywhere
any help will be much appreciated, thanks, Tom
from dolfin import *
mesh = UnitCube(5, 5, 5)
V = FunctionSpace(mesh, "CG", 1)
subdomains = MeshFunction(
left, right = compile_
btm, top = compile_
top.mark(
right.mark(
left.mark(
v = TestFunction(V);
u = TrialFunction(V);
g = Expression("1.4")
alpha=Expressio
a = inner(grad(v), grad(u))*dx +(alpha*v*u)*ds(1)
L = g*v*ds(2)-g*v*ds(3)
problem = VariationalProb
u = problem.solve()
plot(u, interactive=True)
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Johan Hake
- Solved:
- Last query:
- Last reply: