# 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.mfpackage import MFChildPackages, MFPackage
[docs]class ModflowGnc(MFPackage):
"""
ModflowGnc defines a GNC package.
Parameters
----------
print_input : keyword
keyword to indicate that the list of gnc information will be written to the
listing file immediately after it is read.
print_flows : keyword
keyword to indicate that the list of gnc flow rates will be printed to the
listing file for every stress period time step in which 'budget print' is
specified in output control. if there is no output control option and
'print_flows' is specified, then flow rates are printed for the last time step
of each stress period.
explicit : keyword
keyword to indicate that the ghost node correction is applied in an explicit
manner on the right-hand side of the matrix. the explicit approach will likely
require additional outer iterations. if the keyword is not specified, then the
correction will be applied in an implicit manner on the left-hand side. the
implicit approach will likely converge better, but may require additional
memory. if the explicit keyword is not specified, then the bicgstab linear
acceleration option should be specified within the linear block of the sparse
matrix solver.
numgnc : integer
is the number of gnc entries.
numalphaj : integer
is the number of contributing factors.
gncdata : [list]
"""
gncdata = ListTemplateGenerator(("gnc", "gncdata", "gncdata"))
package_abbr = "gnc"
_package_type = "gnc"
dfn_file_name = "gwf-gnc.dfn"
dfn = [
["header"],
[
"block options",
"name print_input",
"type keyword",
"reader urword",
"optional true",
],
[
"block options",
"name print_flows",
"type keyword",
"reader urword",
"optional true",
],
[
"block options",
"name explicit",
"type keyword",
"tagged true",
"reader urword",
"optional true",
],
[
"block dimensions",
"name numgnc",
"type integer",
"reader urword",
"optional false",
],
[
"block dimensions",
"name numalphaj",
"type integer",
"reader urword",
"optional false",
],
[
"block gncdata",
"name gncdata",
"type recarray cellidn cellidm cellidsj alphasj",
"shape (maxbound)",
"reader urword",
],
[
"block gncdata",
"name cellidn",
"type integer",
"shape",
"tagged false",
"in_record true",
"reader urword",
"numeric_index true",
],
[
"block gncdata",
"name cellidm",
"type integer",
"shape",
"tagged false",
"in_record true",
"reader urword",
"numeric_index true",
],
[
"block gncdata",
"name cellidsj",
"type integer",
"shape (numalphaj)",
"tagged false",
"in_record true",
"reader urword",
"numeric_index true",
],
[
"block gncdata",
"name alphasj",
"type double precision",
"shape (numalphaj)",
"tagged false",
"in_record true",
"reader urword",
],
]
def __init__(
self,
parent_model_or_package,
loading_package=False,
print_input=None,
print_flows=None,
explicit=None,
numgnc=None,
numalphaj=None,
gncdata=None,
filename=None,
pname=None,
**kwargs,
):
"""
ModflowGnc defines a GNC package.
Parameters
----------
parent_model_or_package
Parent_model_or_package that this package is a part of. Package is automatically
added to parent_model_or_package when it is initialized.
loading_package : bool
Do not set this parameter. It is intended for debugging and internal
processing purposes only.
print_input : keyword
keyword to indicate that the list of gnc information will be written to the
listing file immediately after it is read.
print_flows : keyword
keyword to indicate that the list of gnc flow rates will be printed to the
listing file for every stress period time step in which 'budget print' is
specified in output control. if there is no output control option and
'print_flows' is specified, then flow rates are printed for the last time step
of each stress period.
explicit : keyword
keyword to indicate that the ghost node correction is applied in an explicit
manner on the right-hand side of the matrix. the explicit approach will likely
require additional outer iterations. if the keyword is not specified, then the
correction will be applied in an implicit manner on the left-hand side. the
implicit approach will likely converge better, but may require additional
memory. if the explicit keyword is not specified, then the bicgstab linear
acceleration option should be specified within the linear block of the sparse
matrix solver.
numgnc : integer
is the number of gnc entries.
numalphaj : integer
is the number of contributing factors.
gncdata : [list]
filename : str
File name for this package.
pname : str
Package name for this package.
parent_file : MFPackage
Parent package file that references this package. Only needed for
utility packages (mfutl*). For example, mfutllaktab package must have
a mfgwflak package parent_file.
"""
super().__init__(
parent_model_or_package, "gnc", filename, pname, loading_package, **kwargs
)
self.print_input = self.build_mfdata("print_input", print_input)
self.print_flows = self.build_mfdata("print_flows", print_flows)
self.explicit = self.build_mfdata("explicit", explicit)
self.numgnc = self.build_mfdata("numgnc", numgnc)
self.numalphaj = self.build_mfdata("numalphaj", numalphaj)
self.gncdata = self.build_mfdata("gncdata", gncdata)
self._init_complete = True
[docs]class GncPackages(MFChildPackages):
"""
GncPackages is a container class for the ModflowGnc class.
Methods
-------
initialize
Initializes a new ModflowGnc package removing any sibling child
packages attached to the same parent package. See ModflowGnc init
documentation for definition of parameters.
append_package
Adds a new ModflowGnc package to the container. See ModflowGnc
init documentation for definition of parameters.
"""
package_abbr = "gncpackages"
[docs] def initialize(
self,
print_input=None,
print_flows=None,
explicit=None,
numgnc=None,
numalphaj=None,
gncdata=None,
filename=None,
pname=None,
):
new_package = ModflowGnc(
self._cpparent,
print_input=print_input,
print_flows=print_flows,
explicit=explicit,
numgnc=numgnc,
numalphaj=numalphaj,
gncdata=gncdata,
filename=filename,
pname=pname,
child_builder_call=True,
)
self.init_package(new_package, filename)
[docs] def append_package(
self,
print_input=None,
print_flows=None,
explicit=None,
numgnc=None,
numalphaj=None,
gncdata=None,
filename=None,
pname=None,
):
new_package = ModflowGnc(
self._cpparent,
print_input=print_input,
print_flows=print_flows,
explicit=explicit,
numgnc=numgnc,
numalphaj=numalphaj,
gncdata=gncdata,
filename=filename,
pname=pname,
child_builder_call=True,
)
self._append_package(new_package, filename)