flopy.mt3d.mtgcg Module

class flopy.mt3d.mtgcg.Mt3dGcg(model, mxiter=1, iter1=50, isolve=3, ncrs=0, accl=1, cclose=1e-05, iprgcg=0, extension='gcg', unitnumber=None, filenames=None)

MT3DMS Generalized Conjugate Gradient Package Class.


model : model object

The model object (of type flopy.mt3d.mt.Mt3dms) to which this package will be added.

mxiter : int

is the maximum number of outer iterations; it should be set to an integer greater than one only when a nonlinear sorption isotherm is included in simulation. (default is 1)

iter1 : int

is the maximum number of inner iterations; a value of 30-50 should be adequate for most problems. (default is 50)

isolve : int

is the type of preconditioners to be used with the Lanczos/ORTHOMIN acceleration scheme: = 1, Jacobi = 2, SSOR = 3, Modified Incomplete Cholesky (MIC) (MIC usually converges faster, but it needs significantly more memory) (default is 3)

ncrs : int

is an integer flag for treatment of dispersion tensor cross terms: = 0, lump all dispersion cross terms to the right-hand-side (approximate but highly efficient). = 1, include full dispersion tensor (memory intensive). (default is 0)

accl : float

is the relaxation factor for the SSOR option; a value of 1.0 is generally adequate. (default is 1)

cclose : float

is the convergence criterion in terms of relative concentration; a real value between 10-4 and 10-6 is generally adequate. (default is 1.E-5)

iprgcg : int

IPRGCG is the interval for printing the maximum concentration changes of each iteration. Set IPRGCG to zero as default for printing at the end of each stress period. (default is 0)

extension : string

Filename extension (default is ‘gcg’)

unitnumber : int

File unit number (default is None).

filenames : str or list of str

Filenames to use for the package. If filenames=None the package name will be created using the model name and package extension. If a single string is passed the package will be set to the string. Default is None.


>>> import flopy
>>> m = flopy.mt3d.Mt3dms()
>>> gcg = flopy.mt3d.Mt3dGcg(m)
check(f=None, verbose=True, level=1)

Check package data for common errors.


f : str or file handle

String defining file name or file handle for summary file of check method output. If a sting is passed a file handle is created. If f is None, check method does not write results to a summary file. (default is None)

verbose : bool

Boolean flag used to determine if check method results are written to the screen

level : int

Check method analysis level. If level=0, summary checks are performed. If level=1, full checks are performed.




>>> import flopy
>>> m = flopy.modflow.Modflow.load('model.nam')
>>> m.dis.check()
static load(f, model, ext_unit_dict=None)

Load an existing package.


f : filename or file handle

File to load.

model : model object

The model object (of type flopy.mt3d.mt.Mt3dms) to which this package will be added.

ext_unit_dict : dictionary, optional

If the arrays in the file are specified using EXTERNAL, or older style array control records, then f should be a file handle. In this case ext_unit_dict is required, which can be constructed using the function flopy.utils.mfreadnam.parsenamefile.


gcg : Mt3dGcg object

Mt3dGcg object.


>>> import flopy
>>> mt = flopy.mt3d.Mt3dms()
>>> gcg = flopy.mt3d.Mt3dGcg.load('test.gcg', m)

Plot 2-D, 3-D, transient 2-D, and stress period list (MfList) package input data


**kwargs : dict

filename_base : str

Base file name that will be used to automatically generate file names for output image files. Plots will be exported as image files if file_name_base is not None. (default is None)

file_extension : str

Valid matplotlib.pyplot file extension for savefig(). Only used if filename_base is not None. (default is ‘png’)

mflay : int

MODFLOW zero-based layer number to return. If None, then all all layers will be included. (default is None)

kper : int

MODFLOW zero-based stress period number to return. (default is zero)

key : str

MfList dictionary key. (default is None)


axes : list

Empty list is returned if filename_base is not None. Otherwise a list of matplotlib.pyplot.axis are returned.


>>> import flopy
>>> ml = flopy.modflow.Modflow.load('test.nam')
>>> ml.dis.plot()
to_shapefile(filename, **kwargs)

Export 2-D, 3-D, and transient 2-D model data to shapefile (polygons). Adds an attribute for each layer in each data array


filename : str

Shapefile name to write




>>> import flopy
>>> ml = flopy.modflow.Modflow.load('test.nam')
>>> ml.lpf.to_shapefile('test_hk.shp')

Write the package file