on_boundary
will always be false if you use method="pointwise"
. If you define Gamma
as
class Gamma(SubDomain):
def inside(self, x, on_boundary):
return near(x[0], lenght, DOLFIN_EPS) and near(x[1], height/2, DOLFIN_EPS)
it will work