dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #22722
[Question #153567]: Warning: Found no facets matching domain for boundary condition
New question #153567 on DOLFIN:
https://answers.launchpad.net/dolfin/+question/153567
I get "Warning: Found no facets matching domain for boundary condition" error when I run the code below. What could this be caused by?
Thanks!
Kyle
from dolfin import *
"""This code solves the Stokes equation for uncompressible steady-state viscous flow using Taylor-Hood elements (quadratic for velocity, linear for pressure)"""
# MESHING
mesh = Rectangle(0.0, -1.0, 20.0, 1.0, 20, 10, "right/left")
# FUNCTION SPACE
scalar = FunctionSpace(mesh, "CG", 1) #Pressure
vector = VectorFunctionSpace(mesh, "CG", 2) #Velocity
system = vector * scalar #Mixed Function Space
# BOUNDARIES
def right(x, on_boundary): return x[0] > (20.0 - DOLFIN_EPS)
def left(x, on_boundary): return x[0] < DOLFIN_EPS
def top_bottom(x, on_boundary):
return x[1] > 1.0 - DOLFIN_EPS or x[1] < DOLFIN_EPS - 1.0
# NO-SLIP BC FOR TOP-BOTTOM
noslip = Constant((0.0, 0.0))
bc0 = DirichletBC(system.sub(0), noslip, top_bottom)
# INFLOW VELOCITY BC FOR LEFT
inflow = Expression(("2", "0.0"))
bc1 = DirichletBC(system.sub(0), inflow, left)
# OUTFLOW PRESSURE BC FOR RIGHT
zero = Constant(0)
bc2 = DirichletBC(system.sub(1), zero, right)
# STORAGE OF BCs
bcs = [bc0, bc1, bc2]
# VARIATIONAL PROBLEM
(v, q) = TestFunctions(system)
(u, p) = TrialFunctions(system)
f = Constant((0, 0))
nu = 0.2
a = (nu*inner(grad(v), grad(u)) - div(v)*p + q*div(u))*dx
L = inner(v, f)*dx
# SET UP PDE
problem = VariationalProblem(a, L, bcs)
# SOLVE PDE
(U, P) = problem.solve().split()
# FILES FOR PARAVIEW
ufile_pvd = File("velocity.pvd")
ufile_pvd << U
pfile_pvd = File("pressure.pvd")
pfile_pvd << P
# PLOTS
plot(U)
plot(P)
interactive()
--
You received this question notification because you are a member of
DOLFIN Team, which is an answer contact for DOLFIN.