def METHOD_NAME(maxArea=0.2, nx=80, grid=True):
    mesh=None
    dens=None
    if grid:
        nx = nx
        ny = nx/2
        mesh = pg.createGrid(x=np.linspace(-10, 10, nx),
                            y=np.linspace(-10, 0, ny))
        density = mesh.cellAttributes()*0.0 + 1.0
        xstart = (nx-1)*int(ny/1.3) + int(nx/2)
        yoff =nx-1
        for i in range(int(ny/20)):
            density[xstart-nx*0.35+i*yoff: xstart+nx*0.35+i*yoff] *= 2
    else:
        layer1 = pt.createRectangle(start=[-10, 0], end=[10, -10], 
                                 marker=1, boundaryMarker=[1, 3, 2, 4])
        block = pt.createRectangle(start=[-10+0.35*10, -1.8918918918918912], 
                                end=[10-0.35*10, -2.2972972972972965], 
                                    marker=2)
        mesh = createMesh([layer1, block], quality=32, area=maxArea,
                          smooth=[1,10])
        density = mesh.cellAttributes()*0.0 + 1.0
        density[mesh.cellMarker()==2] = 2
    return mesh, density