Run#

toughio.run(exec, input_filename, other_filenames=None, command=None, workers=None, docker=None, wsl=False, working_dir=None, use_temp=False, ignore_patterns=None, silent=False, petsc_args=None, docker_args=None, container_name=None, **kwargs)[source]#

Run TOUGH executable.

Parameters:
  • exec (str or pathlike) – Path to TOUGH executable.

  • input_filename (str or pathlike) – TOUGH input file name.

  • other_filenames (list, dict or None, optional, default None) – Other simulation files to copy to working directory (e.g., MESH, INCON, GENER) if not already present. If other_filenames is a dict, must be in the form {old: new}, where old is the current name of the file to copy, and new is the name of the file copied.

  • command (callable or None, optional, default None) – Command to execute TOUGH. Must be in the form f(exec, inp, [out]), where exec is the path to TOUGH executable, inp is the input file name, and out is the output file name (optional).

  • workers (int or None, optional, default None) – Number of MPI workers to invoke.

  • docker (str, optional, default None) – Name of Docker image.

  • wsl (bool, optional, default False) – Only for Windows. If True, run the final command as a Bash command.

  • working_dir (str, pathlike or None, optional, default None) – Working directory. Input and output files will be generated in this directory.

  • use_temp (bool, optional, default False) – If True, run simulation in a temporary directory, and copy simulation files to working_dir at the end of the simulation. This option may be required when running TOUGH through a Docker.

  • ignore_patterns (list or None, optional, default None) – If provided, output files that match the glob-style patterns will be discarded.

  • silent (bool, optional, default False) – If True, nothing will be printed to standard output.

  • petsc_args (list or None, optional, default None) – List of arguments passed to PETSc solver (written to .petscrc).

  • docker_args (list or None, optional, default None) – List of arguments passed to docker run command.

  • container_name (str or None, optional, default None) – Name of Docker container.

  • block (str {'all', 'gener', 'mesh', 'incon'} or None, optional, default None) –

    Only if file_format = "tough". Blocks to be written:

    • ’all’: write all blocks,

    • ’gener’: only write block GENER,

    • ’mesh’: only write blocks ELEME, COORD and CONNE,

    • ’incon’: only write block INCON,

    • None: write all blocks except blocks defined in ignore_blocks.

  • ignore_blocks (list of str or None, optional, default None) – Only if file_format = "tough" and block is None. Blocks to ignore.

  • space_between_blocks (bool, optional, default True) – Only if file_format = "tough". Add an empty record between blocks.

  • space_between_blocks – Only if file_format = "tough". Add a white space between floating point values.

  • eos (str or None, optional, default None) – Only if file_format = "tough". Equation of State. If eos is defined in parameters, this option will be ignored.

  • mopr_10 (int, optional, default 0) – Only if file_format = "toughreact-solute". MOPR(10) value in file ‘flow.inp’.

  • mopr_11 (int, optional, default 0) – Only if file_format = "toughreact-solute". MOPR(11) value in file ‘flow.inp’.

  • verbose (bool, optional, default True) – Only if file_format in {“toughreact-solute”, “toughreact-chemical”}. If True, add comments to describe content of file.

Returns:

Subprocess completion status.

Return type:

subprocess.CompletedProcess