Beispiel #1
0
def write_arb_n(file_name, path):
    tally = Tally(
        "Current",
        "Neutron",
        14,
        "Surface",
        "Surface 14",
        "Neutron Current Across surface 14",
        100.0,
    )
    tally.write_hdf5(file_name, path)
Beispiel #2
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)
Beispiel #3
0
def write_photon(file_name):
    tally = Tally(
        "Flux",
        "Photon",
        12,
        "Volume",
        "Volume 12",
        "Photon Flux in Cell 12",
        35.0,
        123.0,
    )
    tally.write_hdf5(file_name, "tally")
Beispiel #4
0
def write_tally_h5m(tally_list, filename):
    """
    Function that writes tally objects to ouptut .h5m file
    -------
    tally_list: list of volume id tally pairs of PyNE Material Objects
    filename: filename to write the objects to
    """
    # tally list contains elements of the form ('photon', ('current', ['Surface:4', 'Volume:1']))
    # loop over list
    for tally in tally_list:
        particle_name = tally[0].capitalize()
        tally_type = tally[1][0]
        for k in range(len(tally[1][1])):
            tally_object = tally[1][1][k].split(':')[0]
            object_id = tally[1][1][k].split(':')[1]
            tally_name = particle_name[
                0:2].upper() + tally_type[0: 7 - len(object_id)] + str(object_id)
            new_tally = Tally(tally_type, particle_name,
                              int(object_id), tally_object, str(object_id), tally_name, 0.0, 1.0)
            new_tally.write_hdf5(filename, "/tally")
Beispiel #5
0
def write_arb_p(file_name, path):
    tally = Tally(
        "Flux", "Photon", 12, "Volume", "Volume 12", "Photon Flux in Cell 12", 35.0
    )
    tally.write_hdf5(file_name, path)
Beispiel #6
0
def write_neutron(file_name):
    tally = Tally("Current", "Neutron", 14, "Surface", "Surface 14",
                  "Neutron Current Across surface 14", 100.0)
    tally.write_hdf5(file_name, "tally")
Beispiel #7
0
def write_arb_p(file_name,path):
    tally = Tally("Flux","Photon",12,"Volume","Volume 12","Photon Flux in Cell 12",35.0)
    tally.write_hdf5(file_name,path)
Beispiel #8
0
def write_arb_n(file_name,path):
    tally = Tally("Current","Neutron",14,"Surface","Surface 14","Neutron Current Across surface 14",100.0)
    tally.write_hdf5(file_name,path)
Beispiel #9
0
def write_photon(file_name):
    tally = Tally("Flux","Photon",12,"Volume","Volume 12","Photon Flux in Cell 12",35.0,123.0)
    tally.write_hdf5(file_name,"/tally")