Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)