Example #1
0
    def test_pt_in_vol(self):

        # there are 4 volumes; (0,0,.2) is in volume 2
        rets = [dagmc.point_in_volume(x, [0, 0, .2]) for x in range(1, 5)]
        self.assertEqual(rets, [False, True, False, False])

        # (1.1,0,0) is in volume 3
        rets = [dagmc.point_in_volume(x, [1.1, 0, 0]) for x in range(1, 5)]
        self.assertEqual(rets, [False, False, True, False])
Example #2
0
    def test_pt_in_vol(self):

        # there are 4 volumes; (0,0,.2) is in volume 2
        rets = [dagmc.point_in_volume(x, [0, 0, .2]) for x in range(1, 5)]
        self.assertEqual(rets, [False, True, False, False])

        # (1.1,0,0) is in volume 3
        rets = [dagmc.point_in_volume(x, [1.1, 0, 0]) for x in range(1, 5)]
        self.assertEqual(rets, [False, False, True, False])
Example #3
0
def pt_in_vol():
    from pyne import dagmc
    dagmc.load(path)

    # there are 4 volumes; (0,0,.2) is in volume 2
    rets1 = [dagmc.point_in_volume(x, [0, 0, .2]) for x in range(1, 5)]

    # (1.1,0,0) is in volume 3
    rets2 = [dagmc.point_in_volume(x, [1.1, 0, 0]) for x in range(1, 5)]

    return [rets1, rets2]
Example #4
0
def pt_in_vol():
    from pyne import dagmc
    dagmc.load(path)

    # there are 4 volumes; (0,0,.2) is in volume 2
    rets = [dagmc.point_in_volume(x, [0, 0, .2]) for x in range(1, 5)]
    assert_equal(rets, [False, True, False, False])

    # (1.1,0,0) is in volume 3
    rets = [dagmc.point_in_volume(x, [1.1, 0, 0]) for x in range(1, 5)]
    assert_equal(rets, [False, False, True, False])
Example #5
0
def pt_in_vol():
    from pyne import dagmc
    dagmc.load(path)
    
    # there are 4 volumes; (0,0,.2) is in volume 2
    rets = [dagmc.point_in_volume(x, [0, 0, .2]) for x in range(1, 5)]
    assert_equal(rets, [False, True, False, False])

    # (1.1,0,0) is in volume 3
    rets = [dagmc.point_in_volume(x, [1.1, 0, 0]) for x in range(1, 5)]
    assert_equal(rets, [False, False, True, False])
Example #6
0
def determine_volid(xyz):
    vol_list = get_volume_list()
    for vol in vol_list:
        if point_in_volume(vol,xyz) == 1:
            return vol
    return 0