def METHOD_NAME(dim=2, use_ebcs=True):
    assert_(dim in (2, 3))
    if dim == 2:
        filename_mesh = data_dir + '/meshes/2d/square_quad.mesh'
    else:
        filename_mesh = data_dir + '/meshes/3d/cube_medium_tetra.mesh'
    options = {
        'nls' : 'newton',
        'ls' : 'ls',
        'post_process_hook' : 'post_process'
    }
    def get_constraints(ts, coors, region=None):
        mtx = nm.ones((coors.shape[0], 1, dim), dtype=nm.float64)
        rhs = nm.arange(coors.shape[0], dtype=nm.float64)[:, None]
        rhs *= 0.1 / (coors.shape[0] - 1)
        return mtx, rhs
    functions = {
        'get_constraints' : (get_constraints,),
    }
    fields = {
        'displacement': ('real', dim, 'Omega', 1),
    }
    materials = {
        'm' : ({
            'D' : stiffness_from_lame(dim, lam=5.769, mu=3.846),
        },),
        'load' : ({'val' : -1.0},),
    }
    variables = {
        'u' : ('unknown field', 'displacement', 0),
        'v' : ('test field', 'displacement', 'u'),
    }
    regions = {
        'Omega' : 'all',
        'Bottom' : ('vertices in (y < -0.499) -v r.Left', 'facet'),
        'Top' : ('vertices in (y > 0.499) -v r.Left', 'facet'),
        'Left' : ('vertices in (x < -0.499)', 'facet'),
        'Right' : ('vertices in (x > 0.499) -v (r.Bottom +v r.Top)', 'facet'),
    }
    if dim == 2:
        lcbcs = {
            'nlcbc1' : ('Top', {'u.all' : None}, None, 'nodal_combination',
                        ([[1.0, -1.0]], [0.0])),
            'nlcbc2' : ('Bottom', {'u.all' : None}, None, 'nodal_combination',
                        ([[1.0, 1.0]], [-0.1])),
            'nlcbc3' : ('Right', {'u.all' : None}, None, 'nodal_combination',
                        'get_constraints'),
        }
    else:
        lcbcs = {
            'nlcbc1' : ('Top', {'u.all' : None}, None, 'nodal_combination',
                        ([[1.0, -1.0, 1.0], [1.0, 0.5, 0.1]], [0.0, 0.05])),
            'nlcbc2' : ('Bottom', {'u.[2,1]' : None}, None, 'nodal_combination',
                        ([[1.0, -0.1]], [0.2])),
            'nlcbc3' : ('Right', {'u.all' : None}, None, 'nodal_combination',
                        'get_constraints'),
        }
    if use_ebcs:
        ebcs = {
            'fix' : ('Left', {'u.all' : 0.0}),
        }
    else:
        ebcs = {}
        lcbcs.update({
            'nlcbc4' : ('Left', {'u.all' : None}, None, 'nodal_combination',
                        (nm.eye(dim), nm.zeros(dim))),
        })
    equations = {
        'elasticity' : """
            dw_lin_elastic.2.Omega(m.D, v, u)
            = -dw_surface_ltr.2.Right(load.val, v)
        """,
    }
    solvers = {
        'ls' : ('ls.scipy_direct', {}),
        'newton' : ('nls.newton', {
            'i_max'      : 1,
            'eps_a'      : 1e-10,
        }),
    }
    return locals()