Arc section of Ellipse as boundary

Hello, there is a way to define an arc of an ellipse domain as a boundary? I have look at the API reference for mshr, but there is no reference for arcs. I mean something as the following code:

def contorno_elec_pos(x, on_boundary):
   tol = 1E-14
   return on_boundary and near(x[0], 1, tol)

But instead of specifing x = 1 as the boundary, especify an upper arc in the ellipse as a boundary. I want to define boundary conditions on curved electrodes

Points on the ellipse should satisfy an equation of the form

\frac{x^2}{a^2}+\frac{y^2}{b^2} -1 = 0

so you could do something like

class EllipseTop(SubDomain):
    def __init__(self, a, b):
        self. a, self.b = a**2, b**2
        super().__init__()
    def inside(self, x, on_boundary):
        return on_boundary and near((x[0]**2/self.a)+(x[1]**2/self.b)-1., 0., eps= 1.e-12) and x[1] >= 0.

Hope this helps