def METHOD_NAME(self, pc, test, trial):
    def alpha(d):
        alphabar = 2.5e4
        q = 0.1
        return alphabar * q * ((q + 1)/(d + q) - 1)
    ctx = self.get_appctx(pc)
    d = split(ctx["state"])[0]
    (u, p) = split(trial)
    (v, q) = split(test)
    K = (alpha(d) * inner(u, v)*dx
         + inner(grad(u), grad(v))*dx
         - inner(p, div(v))*dx
         - inner(q, div(u))*dx)
    expr = BoundaryConditions(test.function_space().mesh())
    bcs = [DirichletBC(test.function_space().sub(0), expr, "on_boundary")]
    return (K, bcs)