← Back to team overview

dolfin team mailing list archive

[Question #139472]: a boundary condition for sphere geometry

 

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

Hi, all.

With a sphere with radius = 1, I want to give some values for nodes near the crust of it.
So I tried with 2 codes below and both gave me same warnings:
*** Warning: Found no facets matching domain for boundary condition.
Can you suggest me a way to make it work?


1st code:
from dolfin import *
sphere = UnitSphere(10)
x = sphere.coordinate()

Q = FunctionSpace(sphere, "CG", 1)

outer= compile_subdomains(" x[0]**2+x[1]**2+x[2]**2 >  0.9**2 - 5*DOLFIN_EPS) && on_boundary")
g = Constant(1.0)
BC = DirichletBC(Q, g, outer)

2nd code:
from dolfin import *
sphere = UnitSphere(10)
x = sphere.coordinate()

Q = FunctionSpace(sphere, "CG", 1)

boundary = BoundaryMesh(sphere)
outer= compile_subdomains("boundary")
g = Constant(1.0)
BC = DirichletBC(Q, g, outer)


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