diff --git a/openmc/lib/core.py b/openmc/lib/core.py index 4dd01ebda5..0da24aab88 100644 --- a/openmc/lib/core.py +++ b/openmc/lib/core.py @@ -126,6 +126,24 @@ def current_batch(): return c_int.in_dll(_dll, 'current_batch').value +def export_properties(filename=None): + """Export physical properties. + + Parameters + ---------- + filename : str or None + Filename to export properties to (defaults to "properties.h5") + + See Also + -------- + openmc.lib.import_properties + + """ + if filename is not None: + filename = c_char_p(filename.encode()) + _dll.openmc_properties_export(filename) + + def finalize(): """Finalize simulation and free memory""" _dll.openmc_finalize() @@ -184,6 +202,22 @@ def hard_reset(): _dll.openmc_hard_reset() +def import_properties(filename): + """Import physical properties. + + Parameters + ---------- + filename : str + Filename to import properties from + + See Also + -------- + openmc.lib.export_properties + + """ + _dll.openmc_properties_import(filename.encode()) + + def init(args=None, intracomm=None): """Initialize OpenMC @@ -313,32 +347,6 @@ def plot_geometry(): _dll.openmc_plot_geometry() -def properties_export(filename=None): - """Export physical properties. - - Parameters - ---------- - filename : str or None - Filename to export properties to (defaults to "properties.h5") - - """ - if filename is not None: - filename = c_char_p(filename.encode()) - _dll.openmc_properties_export(filename) - - -def properties_import(filename): - """Import physical properties. - - Parameters - ---------- - filename : str - Filename to import properties from - - """ - _dll.openmc_properties_import(filename.encode()) - - def reset(): """Reset tally results""" _dll.openmc_reset()