6.1.1.5.1.7. thyrsis.simulation.metis module¶
METIS specific functions
- class thyrsis.simulation.metis.Metis(database, command)¶
Bases:
object
Metis process class
- check_maillage(a, b, c)¶
Unused
- compute(compute_dir, total_time, MPI=None)¶
computes saturated or unsaturated
- Parameters
compute_dir (string) – path of compute folder
total_time (float) – simulation time duration in second
- compute_hynverse(compute_dir)¶
computes saturated for inversion
- Parameters
compute_dir (string) – path of compute folder
- compute_probes(compute_dir)¶
modifies results file _probes.sat in order to obtain a gnuplot readable file _probes_plot.sat
- Parameters
compute_dir (string) – path of compute folder
- convert_infiltration_transitoire_insature(compute_dir)¶
Copy transient infiltration file to compute_dir
- Parameters
compute_dir (string) – path of compute folder
- convert_infiltration_transitoire_sature(compute_dir)¶
Copy transient infiltration file to compute_dir
- Parameters
compute_dir (string) – path of compute folder
- create_debit_sat(sat_dir, flux)¶
builds the input file for METIS in case of no unsaturated calculation
- Parameters
sat_dir (string) – path of saturated folder
flux – flux value list
- create_hydrostationary_files(sat_dir, with_permeabilies=True)¶
builds the input files for METIS saturated stationary flow and inversion
- Parameters
sat_dir (string) – path of saturated folder
with_permeabilies (boolean) – boolean used to create or not the permeability file
- create_insat_files(insat_dir, simulation_data, injection_data, param, settings, znodes)¶
builds the input files for METIS unsaturated
- Parameters
insat_dir (string) – path of insaturated folder
simulation_data (dict) – dictionnary of simulation data
injections_data (list) – list, containing a dictionnary for each injection
param (dict) – parameters dictionnary
settings (Settings) – Thyrsis settings
znodes (list) – znodes (list of z coordinate)
- create_maillage_insat(insat_dir, znodes)¶
creates the METIS mesh files for unsaturated computations
- Parameters
insat_dir (string) – path of insaturated folder
znodes (list) – znodes (list of z coordinate)
- create_maillage_sat(sat_dir, cur)¶
builds the mesh saturated METIS file
- Parameters
sat_dir (string) – path of saturated folder
cur (sqlite3.Cursor) – cursor
- create_mnt_sat(sat_dir, cur)¶
builds the mnt saturated METIS file
- Parameters
sat_dir (string) – path of saturated folder
cur (sqlite3.Cursor) – cursor
- create_mur_sat(sat_dir, cur)¶
builds the mur saturated METIS file
- Parameters
sat_dir (string) – path of saturated folder
cur (sqlite3.Cursor) – cursor
- create_permeabilities_sat(sat_dir, cur=None, liste_pm=None)¶
builds the permeabilities saturated METIS file
- Parameters
sat_dir (string) – path of saturated folder
cur (sqlite3.Cursor) – cursor
liste_pm (list) – permeabilities data per mesh element
- create_sat_files(sat_dir, simulation_data, param, settings)¶
builds the input files for METIS saturated
- Parameters
sat_dir (string) – path of saturated folder
simulation_data (dict) – dictionnary of simulation data
param (dict) – parameters dictionnary
settings (Settings) – Thyrsis settings
- create_velocities_sat(sat_dir, cur=None, liste_vm=None, init=False)¶
builds the velocities saturated METIS file (unused)
- Parameters
sat_dir (string) – path of saturated folder
cur (sqlite3.Cursor) – cursor
liste_vm (list) – velocities data per mesh element
init (boolean) – boolean, True if only initialisation to (0 0 0)
- file_exists(result_file)¶
Returns True if the result file exists (useful for other codes than METIS)
- Returns
path of result file
- Return type
string
- get_hynverse_options()¶
Specific options for inversion process METIS
- Returns
Metis options
- Return type
dict
- get_options()¶
Specific options for METIS
- Returns
Metis options
- Return type
dict
- get_second_milieu()¶
Return if second milieu is used
- Returns
True/False
- Return type
bool
- modif_data(rep, tini=0.0)¶
modifies the METIS data file and corrects the initial time
- Parameters
rep (string) – file path
tini (float) – initial time
- nok(log_file)¶
Returns False if the METIS computation is OK, by testing the ‘fin du job metis’ string in the log file
- Parameters
log_file (string) – log file path
- Returns
success state
- Return type
bool
- read_dates_binaire(result_file)¶
reads a METIS binary results file and returns the dates and the number of dates
- Parameters
result_file (string) – path of the result file
- Return dates
list of dates
- Rtype dates
list
- Return nbVal
number of values
- Rtype nbVal
integer
- read_dates_formate(result_file)¶
reads a METIS results file and returns the dates and the number of dates
- Parameters
result_file (string) – path of the result file
- Return dates
list of dates
- Rtype dates
list
- Return nbVal
number of values
- Rtype nbVal
integer
- read_file(result_file, dates, convert=False)¶
reads an METIS results file
- Parameters
result_file (string) – path of the result file
dates (list) – list of dates
convert (bool) – convert flag to get ZNS columns data
- Returns
result
- Return type
numpy.ndarray
- read_file_binaire(result_file, metis_dates, dates, nbVal, convert=False)¶
reads an METIS binary results file, adding values in case of missing dates
- Parameters
result_file (string) – path of the result file
metis_dates (list) – list of metis dates
dates (list) – list of dates
nbVal (integer) – number of values
convert (bool) – convert flag to get ZNS columns data
- Returns
result
- Return type
numpy.ndarray
- read_file_formate(result_file, metis_dates, dates, nbVal, convert=False)¶
reads an METIS results file, adding values in case of missing dates
- Parameters
result_file (string) – path of the result file
metis_dates (list) – list of metis dates
dates (list) – list of dates
nbVal (integer) – number of values
convert (bool) – convert flag to get ZNS columns data
- Returns
result
- Return type
numpy.ndarray
- read_insat_flux(insat_dir, name='debit')¶
reads the outgoing flux from a ZNS column
- Parameters
insat_dir (string) – path of insaturated folder
name (string) – flux name
- Return ldates
dates list
- Rtype ldates
list
- Return lflux
outgoing flux value list
- Rtype lflux”
list
- read_mesh_insat(insat_dir)¶
Reads the METIS mesh file and returns the nodes number and the nodes surfaces
- Parameters
insat_dir (string) – path of insaturated folder
- Return nnodes
nodes number
- Rtype nnodes
list
- Return surfaces
nodes surfaces
- Rtype surfaces
list
- read_potential_at_nodes(sat_dir, dates)¶
Reads the potential at node for each dates
- Parameters
sat_dir (string) – path of insaturated folder
dates (list) – list of dates
- Returns
result
- Return type
numpy.ndarray
- settings_to_dict(settings)¶
save settings in dictionnary
- Parameters
settings (Settings) – Thyrsis settings
- update_database(conn, compute_dir)¶
update database after inversion
- Parameters
conn (sqlite3.Connection) – conn on a sqlite database
compute_dir (string) – path of compute folder
- write_sat_flux(sat_dir, name, dates, nodes, meshes, ldates, lnodes, lmeshes, lflux)¶
creates the file giving the incoming flux into the groundwater
- Parameters
sat_dir (string) – path of saturated folder
name (string) – flux name
dates (list) – list of dates
nodes (list) – total injection nodes list
meshes (list) – total injection meshes list
ldates (list) – dates list
lnodes (list) – list of injection nodes lists per injection
lmeshes (list) – list of injection meshes lists per injection
lflux – list of time-dependant flux lists per injection