1. Input and output files¶
1.1. Input parameters¶
-
toughio.
read_input
(filename, file_format=None, **kwargs)¶ Read TOUGH input file.
Parameters: - filename (str) – Input file name.
- file_format (str ('tough', 'json') or None, optional, default None) – Input file format.
Other Parameters: label_length (int or None, optional, default None) – Only if
file_format = "tough"
. Number of characters in cell labels.Returns: TOUGH input parameters.
Return type: dict
Note
If
file_format == 'tough'
, can also read MESH, INCON and GENER files.
-
toughio.
write_input
(filename, parameters, file_format=None, **kwargs)¶ Write TOUGH input file.
Parameters: - filename (str) – Output file name.
- parameters (dict) – Parameters to export.
- file_format (str ('tough', 'json') or None, optional, default None) – Output file format.
1.2. Simulation outputs¶
-
toughio.
read_history
(filename)[source]¶ Read history file.
Parameters: filename (str) – Input file name. Returns: History data. Return type: dict
-
toughio.
read_output
(filename, labels_order=None, connection=False, label_length=None, **kwargs)¶ Read TOUGH SAVE or output file for each time step.
Parameters: - filename (str) – Input file name.
- labels_order (list of array_like or None, optional, default None) – List of labels.
- connection (bool, optional, default False) – Only for standard TOUGH output file. If True, return data related to connections.
- label_length (int or None, optional, default None) – Only for standard TOUGH output file. Number of characters in cell labels.
Returns: namedtuple (type, format, time, labels, data) or list of namedtuple for each time step.
Return type: namedtuple or list of namedtuple
-
toughio.
write_output
(filename, output, file_format=None, **kwargs)¶ Write TOUGH output file.
Parameters: - filename (str) – Input file name.
- output (namedtuple or list of namedtuple) – namedtuple (type, format, time, labels, data) or list of namedtuple for each time step to export.
- file_format (str or None, optional, default None) – Output file format.