Function conditional on subdomain
Hi there,
I'm trying to create a scalar function which is zero on the boundary of my mesh and 1 everywhere else.
I have seen this question (https:/
mesh = UnitCircle(r)
S = FunctionSpace(mesh, "CG", 2)
boundary_parts = MeshFunction(
boundary_
class Boundary(
def inside(self, x, on_boundary):
tol = 1
return on_boundary and abs(x[0]
Gamma_0 = Boundary()
Gamma_0.
class const_h(
def eval_cell(self, values, x, cell):
k = boundary_
if k==5:
values[0] = 1.0
else:
values[0] = 0.0
hconst = const_h()
h = interpolate(
This doesn't appear to be producing my desired function, most likely because I don't really understand what I'm doing.
Any help would be appreciated.
Chris
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: