예제 #1
0
파일: fmm.py 프로젝트: naoyam/tapas-reduce
def fmm_m2l(c1, c2):
    c1_grand_parent = get_grand_parent(c1)
    c2_grand_parent = get_grand_parent(c2)
    if c1_grand_parent != None and c2_grand_parent != None and \
       c1_grand_parent == c2_grand_parent:
        # reflect long-range interaction force mutually
        f = m2l(c1, c2)
        c1.l += f
        c2.l += -f # actual M2L force calculation look probably different
    elif (c1.is_root() and c2.is_root()) or \
         c1.get_parent() == c2.get_parent():
        for i, j in taco.product(c1.get_sub_cells(), c2.get_sub_cells()):
            fmm_m2l(i, j)
예제 #2
0
파일: fmm.py 프로젝트: naoyam/tapas-reduce
def fmm_m2l(c1, c2):
    c1_grand_parent = get_grand_parent(c1)
    c2_grand_parent = get_grand_parent(c2)
    if c1_grand_parent != None and c2_grand_parent != None and \
       c1_grand_parent == c2_grand_parent:
        # reflect long-range interaction force mutually
        f = m2l(c1, c2)
        c1.l += f
        c2.l += -f  # actual M2L force calculation look probably different
    elif (c1.is_root() and c2.is_root()) or \
         c1.get_parent() == c2.get_parent():
        for i, j in taco.product(c1.get_sub_cells(), c2.get_sub_cells()):
            fmm_m2l(i, j)
예제 #3
0
def interact(c1, c2, s):
    if c1.get_num_particles() <= s and \
       c2.get_num_particles() <= s:

        common.direct([c1.particles[i] for i in c1.indices],
                      [c2.particles[i] for i in c2.indices],
                      c1.region == c2.region)
    else:
        if c1.get_num_particles() > s:
            c1_children = c1.get_sub_cells()
        else:
            c1_children = [c1]
        if c2.get_num_particles() > s:
            c2_children = c2.get_sub_cells()
        else:
            c2_children = [c2]
        for i, j in taco.product(c1_children, c2_children):
            interact(i, j, s)
    return
예제 #4
0
def interact(c1, c2, s):
    if c1.get_num_particles() <= s and \
       c2.get_num_particles() <= s:

        common.direct([c1.particles[i] for i in c1.indices],
                      [c2.particles[i] for i in c2.indices],
                      c1.region == c2.region)
    else:
        if c1.get_num_particles() > s:
            c1_children = c1.get_sub_cells()
        else:
            c1_children = [c1]
        if c2.get_num_particles() > s:
            c2_children = c2.get_sub_cells()
        else:
            c2_children = [c2]
        for i, j in taco.product(c1_children, c2_children):
            interact(i, j, s)
    return