def METHOD_NAME(outside, version, capfd):
    geo = CSGeometry()
    top = Plane(Pnt(0,0,0.5), Vec(0,0,1))
    bot = Plane(Pnt(0,0,0.1), Vec(0,0,-1))
    bigpart = OrthoBrick(Pnt(-5,-5,0), Pnt(1,1,1))
    part = bigpart* top * bot
    outer = ((OrthoBrick(Pnt(-1,-1,-1), Pnt(2,2,3)).bc("outer") * Plane(Pnt(2,2,2), Vec(0,0,1)).bc("outertop")))
    geo.Add((part * outer).mat("part"))
    if version == 1:
        geo.Add((outer-part).mat("rest"))
    else:
        geo.Add((outer-top).mat("rest"))
        geo.Add((outer-bot).mat("rest"))
        geo.Add((outer*top*bot-bigpart).mat("rest"))
    geo.CloseSurfaces(top, bot, [])
    mesh = geo.GenerateMesh()
    should_ne = mesh.ne + 2 * GetNSurfaceElements(mesh, ["default"], "part")
    layersize = 0.025
    mesh.BoundaryLayer("default", [layersize, layersize], "part", domains="part", outside=outside)
    assert mesh.ne == should_ne
    assert not "elements are not matching" in capfd.readouterr().out
    # import netgen.gui
    ngs = pytest.importorskip("ngsolve")
    ngs.Draw(ngs.Mesh(mesh))
    mesh = ngs.Mesh(mesh)
    assert ngs.Integrate(1, mesh.Materials("part")) == pytest.approx(0.5*2.05*2.05 if outside else 0.4*2*2)
    assert ngs.Integrate(1, mesh) == pytest.approx(3**3)