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 or None, optional) – name of the lst file

  • dch (LineFile or None) – the GEMS data file

  • ipm (LineFile or None) – the GEMS data file

  • dbr (LineFile or None) – the GEMS data file

  • task_root (str, optional) – Path to the destiny model folder. Default: cwd+”ogs5model”

  • task_id (str, optional) – Name for the ogs task. Default: “model”

Attributes:
file_ext

The extension of the lst file.

file_names

The names of the included files.

files

List of the included files: dch, ipm, dbr.

is_empty

State if the file is empty.

name

The name of the lst file.

task_root

Get and set the task_root path of the ogs model.

Methods

check([verbose])

Check if the GEM external file is valid.

get_file_type()

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_file()

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:

bool

get_file_type()[source]

Get the OGS file class name.

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)

reset()[source]

Delete every content.

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.