ogs5py.fileclasses.GEMinit
- class ogs5py.fileclasses.GEMinit(lst_name='model-dat.lst', dch=None, ipm=None, dbr=None, task_root=None, task_id='model')[source]
Bases:
object
Class for GEMS3K input file.
lst file that contains the names of
the GEMS data file (dch file),
the GEMS numerical settings (ipm file)
the example setup (dbr file)
used to initialize the GEMS3K kernel.
- Parameters:
lst_name (
str
orNone
, optional) – name of the lst filedch (
LineFile
orNone
) – the GEMS data fileipm (
LineFile
orNone
) – the GEMS data filedbr (
LineFile
orNone
) – the GEMS data filetask_root (str, optional) – Path to the destiny model folder. Default: cwd+”ogs5model”
task_id (str, optional) – Name for the ogs task. Default: “model”
- Attributes:
Methods
check
([verbose])Check if the GEM external file is valid.
Get the OGS file class name.
read_file
(path[, encoding, verbose])Read a given GEM external input lst-file.
reset
()Delete every content.
save
(path)Save the actual GEM external file in the given path.
Write the actual OGS input file to the given folder.
- check(verbose=True)[source]
Check if the GEM external file is valid.
- Parameters:
verbose (bool, optional) – Print information for the executed checks. Default: True
- Returns:
result – Validity.
- Return type:
- read_file(path, encoding=None, verbose=False)[source]
Read a given GEM external input lst-file.
- Parameters:
path (str) – path to the file
Notes
This also reads the given files in the lst-file. (dch, ipm, dbr)
- save(path)[source]
Save the actual GEM external file in the given path.
lst file containing: dch, ipm, dbr
- Parameters:
path (str) – path to where to file should be saved
- write_file()[source]
Write the actual OGS input file to the given folder.
Its path is given by “task_root+task_id+file_ext”.
- property file_ext
The extension of the lst file.
- property file_names
The names of the included files.
- property files
dch, ipm, dbr.
- Type:
List of the included files
- property is_empty
State if the file is empty.
- property name
The name of the lst file.
- property task_root
Get and set the task_root path of the ogs model.