Пример #1
0
def test_tally36():
    clean(["test_tally.h5"])
    write_arb_n("test_tally.h5","bob_geldof")
    tally = Tally("Current","Neutron",14,"Surface","Surface 14","Neutron Current Across surface 14",100.0)
    
    new_tally = Tally()
    new_tally.from_hdf5("test_tally.h5","bob_geldof",0)
    assert_equal(tally.tally_type,new_tally.tally_type)
Пример #2
0
def test_tally20():
    clean(["test_tally.h5"])
    tally = Tally("Flux","Photon",12,"Volume","Volume 12","Photon Flux in Cell 12",35.0,123.0)
    write_photon("test_tally.h5")

    new_tally = Tally()
    new_tally.from_hdf5("test_tally.h5","tally",0)
    assert_equal(tally.tally_name,new_tally.tally_name)
Пример #3
0
def test_tally36():
    clean(["test_tally.h5"])
    write_arb_n("test_tally.h5", "bob_geldof")
    tally = Tally("Current", "Neutron", 14, "Surface", "Surface 14",
                  "Neutron Current Across surface 14", 100.0)

    new_tally = Tally()
    new_tally.from_hdf5("test_tally.h5", "bob_geldof", 0)
    assert_equal(tally.tally_type, new_tally.tally_type)
Пример #4
0
def test_tally20():
    clean(["test_tally.h5"])
    tally = Tally("Flux", "Photon", 12, "Volume", "Volume 12",
                  "Photon Flux in Cell 12", 35.0, 123.0)
    write_photon("test_tally.h5")

    new_tally = Tally()
    new_tally.from_hdf5("test_tally.h5", "tally", 0)
    assert_equal(tally.tally_name, new_tally.tally_name)
Пример #5
0
def test_tally21a():
    clean(["test_tally_21.h5"])
    tally = Tally("Flux","Photon",12,"Volume","Volume 12","Photon Flux in Cell 12",35.0,123.0)
    write_photon("test_tally_21.h5")

    new_tally = Tally()
    new_tally.from_hdf5("test_tally_21.h5","/tally",0)

    assert_equal(tally.normalization,new_tally.normalization)
Пример #6
0
def test_tally21a():
    clean(["test_tally_21.h5"])
    tally = Tally("Flux", "Photon", 12, "Volume", "Volume 12",
                  "Photon Flux in Cell 12", 35.0, 123.0)
    write_photon("test_tally_21.h5")

    new_tally = Tally()
    new_tally.from_hdf5("test_tally_21.h5", "/tally", 0)

    assert_equal(tally.normalization, new_tally.normalization)
Пример #7
0
def test_tally37():
    clean(["test_tally.h5"])
    write_arb_n("test_tally.h5","bob_geldof")
    write_arb_p("test_tally.h5","bob_geldof")

    tally = Tally("Flux","Photon",12,"Volume","Volume 12","Photon Flux in Cell 12",35.0)
    
    new_tally = Tally()
    new_tally.from_hdf5("test_tally.h5","bob_geldof",1)
    assert_equal(tally.tally_type,new_tally.tally_type)
Пример #8
0
def test_tally35():
    clean(["test_tally.h5"])
    write_photon("test_tally.h5")
    write_neutron("test_tally.h5")

    tally = Tally("Current","Neutron",14,"Surface","Surface 14","Neutron Current Across surface 14",100.0)
    new_tally = Tally()
    new_tally.from_hdf5("test_tally.h5","tally",0)

    assert_not_equal(tally.entity_size,new_tally.entity_size)
Пример #9
0
def test_tally22():
    clean(["test_tally.h5"])
    write_photon("test_tally.h5")
    write_neutron("test_tally.h5")

    # there are now two tallies in the h5 file
    tally = Tally("Current","Neutron",14,"Surface","Surface 14","Neutron Current Across surface 14",100.0) 
    new_tally = Tally()
    new_tally.from_hdf5("test_tally.h5","tally",1)
    assert_equal(tally.tally_type,new_tally.tally_type)
Пример #10
0
def test_tally37():
    clean(["test_tally.h5"])
    write_arb_n("test_tally.h5", "bob_geldof")
    write_arb_p("test_tally.h5", "bob_geldof")

    tally = Tally("Flux", "Photon", 12, "Volume", "Volume 12",
                  "Photon Flux in Cell 12", 35.0)

    new_tally = Tally()
    new_tally.from_hdf5("test_tally.h5", "bob_geldof", 1)
    assert_equal(tally.tally_type, new_tally.tally_type)
Пример #11
0
def test_tally35():
    clean(["test_tally.h5"])
    write_photon("test_tally.h5")
    write_neutron("test_tally.h5")

    tally = Tally("Current", "Neutron", 14, "Surface", "Surface 14",
                  "Neutron Current Across surface 14", 100.0)
    new_tally = Tally()
    new_tally.from_hdf5("test_tally.h5", "tally", 0)

    assert_not_equal(tally.entity_size, new_tally.entity_size)
Пример #12
0
def test_tally22():
    clean(["test_tally.h5"])
    write_photon("test_tally.h5")
    write_neutron("test_tally.h5")

    # there are now two tallies in the h5 file
    tally = Tally("Current", "Neutron", 14, "Surface", "Surface 14",
                  "Neutron Current Across surface 14", 100.0)
    new_tally = Tally()
    new_tally.from_hdf5("test_tally.h5", "tally", 1)
    assert_equal(tally.tally_type, new_tally.tally_type)
Пример #13
0
def test_tally38():
    clean(["test_tally.h5"])

    tally = Tally("Current", ["Neutron", "Proton"], 14, "Surface",
                  "Surface 14", "Neutron Current Across surface 14", 100.0)
    tally.write_hdf5("test_tally.h5", "tally")

    new_tally = Tally()
    new_tally.from_hdf5("test_tally.h5", "tally")

    assert_not_equal(tally.particle_names, new_tally.particle_names)
Пример #14
0
def test_tally30():
    clean(["test_tally.h5"])
    write_photon("test_tally.h5")
    write_neutron("test_tally.h5")

    tally = Tally(
        "Current",
        "Neutron",
        14,
        "Surface",
        "Surface 14",
        "Neutron Current Across surface 14",
        100.0,
    )
    new_tally = Tally()
    new_tally.from_hdf5("test_tally.h5", "tally", 0)

    assert_not_equal(tally.particle_names, new_tally.particle_names)