fusion-energy / openmc_geometry_plot

Create axis slice plots of OpenMC geomtry with specified zoom
6 stars 0 forks source link

openmc plot mode used for speed #10

Closed shimwell closed 1 year ago

shimwell commented 1 year ago

This is another option for speeding up the slicing.

This runs openmc in plot mode and loads up the resulting ppm into a 2d pixel array.

The main disadvantage is that we currently need nuclear data when running in plot mode. Perhaps this is something that can be changed in openmc

TODO

handy function for timing the method to see the speed improvement

import time
for x in range(2):
    start_time = time.time()
    data_slice = my_geometry.get_slice_of_material_ids(view_direction='x')
    print("--- %s seconds ---" % (time.time() - start_time))

method is about 10 times quicker than current method for tokamak example