mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
Use names import_properties and export_properties for Python API
This commit is contained in:
parent
d135cc2721
commit
33f7d09f71
1 changed files with 34 additions and 26 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue