Пример #1
0
def test_Stencils():
    from Lattice import Lattice
    N = 30
    L = 1
    nr_dims = 2
    box_depth = 3
    lat = Lattice(N, L, nr_dims)
    lat.setup_boxes(box_depth)
    stencils = Stencils(lat)
    for idx in range(lat.nr_points):
        s = stencils.get_stencil(idx)

    for idx in range(lat.nr_points):
        if not lat.IsCloseToEdgeWithHigherSpacing(idx, 1, nr_dims):
            nr_points = len(lat.get_nearby_points(idx, 1))
        else:
            nr_points = len(lat.get_nearby_points(idx, 2))
        if len(s) != nr_points:
            print(len(s), "\n", nr_points, s)