# autogenerated file, do not modify
from os import PathLike, curdir
from typing import Union
from flopy.mf6.data.mfdatautil import ArrayTemplateGenerator, ListTemplateGenerator
from flopy.mf6.mfsimbase import MFSimulationBase
[docs]class MFSimulation(MFSimulationBase):
"""
MFSimulation is used to load, build, and/or save a MODFLOW 6 simulation. A MFSimulation object must be created before creating any of the MODFLOW 6 model objects.
Parameters
----------
continue_ : keyword
keyword flag to indicate that the simulation should continue even if one or
more solutions do not converge.
nocheck : keyword
keyword flag to indicate that the model input check routines should not be
called prior to each time step. checks are performed by default.
memory_print_option : string
is a flag that controls printing of detailed memory manager usage to the end of
the simulation list file. none means do not print detailed information.
summary means print only the total memory for each simulation component. all
means print information for each variable stored in the memory manager. none is
default if memory_print_option is not specified.
profile_option : string
is a flag that controls performance profiling and reporting. none disables
profiling. summary means to measure and print a coarse performance profile.
detail means collect and print information with the highest resolution
available. none is default if profile_option is not specified.
maxerrors : integer
maximum number of errors that will be stored and printed.
print_input : keyword
keyword to activate printing of simulation input summaries to the simulation
list file (mfsim.lst). with this keyword, input summaries will be written for
those packages that support newer input data model routines. not all packages
are supported yet by the newer input data model routines.
hpc_data : record hpc6 filein hpc6_filename
Contains data for the hpc package. Data can be passed as a dictionary to the
hpc package with variable names as keys and package data as values. Data for
the hpc_data variable is also acceptable. See hpc package documentation for
more information.
tdis6 : string
is the name of the temporal discretization (tdis) input file.
models : list
is the list of model types, model name files, and model names.
exchanges : list
is the list of exchange types, exchange files, and model names.
mxiter : integer
is the maximum number of outer iterations for this solution group. the default
value is 1. if there is only one solution in the solution group, then mxiter
must be 1.
solutiongroup : list
is the list of solution types and models in the solution.
Methods
-------
load : (sim_name : str, version : string,
exe_name : str or PathLike, sim_ws : str or PathLike, strict : bool,
verbosity_level : int, load_only : list, verify_data : bool,
write_headers : bool, lazy_io : bool, use_pandas : bool,
) : MFSimulation
a class method that loads a simulation from files
"""
def __init__(
self,
sim_name: str = "sim",
version: str = "mf6",
exe_name: Union[str, PathLike] = "mf6",
sim_ws: Union[str, PathLike] = curdir,
verbosity_level: int = 1,
write_headers: bool = True,
use_pandas: bool = True,
lazy_io: bool = False,
continue_=None,
nocheck=None,
memory_print_option=None,
profile_option=None,
maxerrors=None,
print_input=None,
hpc_data=None,
):
"""
MFSimulation is used to load, build, and/or save a MODFLOW 6 simulation. A MFSimulation object must be created before creating any of the MODFLOW 6 model objects.
Parameters
----------
sim_name
The name of the simulation
version
The simulation version
exe_name
The executable name
sim_ws
The simulation workspace
verbosity_level
The verbosity level
write_headers
Whether to write
use_pandas
Whether to use pandas
lazy_io
Whether to use lazy IO
continue_ : keyword
keyword flag to indicate that the simulation should continue even if one or
more solutions do not converge.
nocheck : keyword
keyword flag to indicate that the model input check routines should not be
called prior to each time step. checks are performed by default.
memory_print_option : string
is a flag that controls printing of detailed memory manager usage to the end of
the simulation list file. none means do not print detailed information.
summary means print only the total memory for each simulation component. all
means print information for each variable stored in the memory manager. none is
default if memory_print_option is not specified.
profile_option : string
is a flag that controls performance profiling and reporting. none disables
profiling. summary means to measure and print a coarse performance profile.
detail means collect and print information with the highest resolution
available. none is default if profile_option is not specified.
maxerrors : integer
maximum number of errors that will be stored and printed.
print_input : keyword
keyword to activate printing of simulation input summaries to the simulation
list file (mfsim.lst). with this keyword, input summaries will be written for
those packages that support newer input data model routines. not all packages
are supported yet by the newer input data model routines.
hpc_data : record hpc6 filein hpc6_filename
Contains data for the hpc package. Data can be passed as a dictionary to the
hpc package with variable names as keys and package data as values. Data for
the hpc_data variable is also acceptable. See hpc package documentation for
more information.
tdis6 : string
is the name of the temporal discretization (tdis) input file.
models : list
is the list of model types, model name files, and model names.
exchanges : list
is the list of exchange types, exchange files, and model names.
mxiter : integer
is the maximum number of outer iterations for this solution group. the default
value is 1. if there is only one solution in the solution group, then mxiter
must be 1.
solutiongroup : list
is the list of solution types and models in the solution.
"""
super().__init__(
sim_name=sim_name,
version=version,
exe_name=exe_name,
sim_ws=sim_ws,
verbosity_level=verbosity_level,
write_headers=write_headers,
lazy_io=lazy_io,
use_pandas=use_pandas,
)
self.name_file.continue_.set_data(continue_)
self.continue_ = self.name_file.continue_
self.name_file.nocheck.set_data(nocheck)
self.nocheck = self.name_file.nocheck
self.name_file.memory_print_option.set_data(memory_print_option)
self.memory_print_option = self.name_file.memory_print_option
self.name_file.profile_option.set_data(profile_option)
self.profile_option = self.name_file.profile_option
self.name_file.maxerrors.set_data(maxerrors)
self.maxerrors = self.name_file.maxerrors
self.name_file.print_input.set_data(print_input)
self.print_input = self.name_file.print_input
self.hpc_data = self._create_package("hpc", hpc_data)
[docs] @classmethod
def load(
cls,
sim_name="modflowsim",
version="mf6",
exe_name: Union[str, PathLike] = "mf6",
sim_ws: Union[str, PathLike] = curdir,
strict=True,
verbosity_level=1,
load_only=None,
verify_data=False,
write_headers=True,
lazy_io=False,
use_pandas=True,
):
return MFSimulationBase.load(
cls,
sim_name,
version,
exe_name,
sim_ws,
strict,
verbosity_level,
load_only,
verify_data,
write_headers,
lazy_io,
use_pandas,
)