def METHOD_NAME(tmpdir):
    import pickle
    mesh = RectangleMesh(10, 4, 5000., 1000.)
    V = FunctionSpace(mesh, 'DG', 1)
    f = Function(V)
    x, *_ = SpatialCoordinate(mesh)
    f.project(sin(2*pi*x/3000.))
    limiter = VertexBasedLimiter(V)
    limiter.apply(f)
    expect = np.asarray([norm(f),
                         norm(limiter.centroids),
                         norm(limiter.min_field),
                         norm(limiter.max_field)])
    tmpfile = tmpdir.join("a")
    code = """