watts.PluginMCNP#

class watts.PluginMCNP(template_file, executable='mcnp6', xsdir=None, extra_inputs=None, extra_template_inputs=None, show_stdout=False, show_stderr=False)[source]#

Plugin for running MCNP

In addition to the basic capability to use placeholders in MCNP input files, this class also provides a custom Jinja filter called expand_element that allows you to specify natural elements in MCNP material definitions and have them automatically expanded based on what isotopes appear in the xsdir file.

Parameters:
  • template_file (str) – Templated MCNP input

  • executable (Union[str, bytes, PathLike]) – Path to MCNP executable

  • xsdir (Union[str, bytes, PathLike, None]) – Path to the xsdir file used for natural element expansion. Defaults to the file named ‘xsdir’ under the directory specified by the DATAPATH environment variable.

  • extra_inputs (Optional[List[str]]) – List of extra (non-templated) input files that are needed

  • extra_template_inputs (Optional[List[Union[str, bytes, PathLike]]]) – Extra templated input files

  • show_stdout (bool) – Whether to display output from stdout when MCNP is run

  • show_stderr (bool) – Whether to display output from stderr when MCNP is run

executable#

Path to MCNP executable

execute_command#

List of command-line arguments used to call the executable

Methods