smash.Model.mesh#
- property Model.mesh[source]#
Model mesh.
- Returns:
- mesh
MeshDT
It returns a Fortran derived type containing the variables relating to the mesh.
- mesh
Examples
>>> from smash.factory import load_dataset >>> setup, mesh = load_dataset("cance") >>> model = smash.Model(setup, mesh)
Access to Model mesh
>>> model.mesh MeshDT active_cell: array([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], ... ymax: 6478000.0 yres: 1000.0
Access to specific values
>>> model.mesh.nrow, model.setup.ncol (28, 28) >>> model.mesh.flwdir array([[1, 5, 6, 1, 1, 8, 8, 1, 1, 8, 8, 1, 5, 6, 5, 3, 2, 2, 3, 3, 3, 3, 3, 4, 5, 8, 5, 6], ... [2, 1, 1, 8, 5, 5, 6, 2, 1, 1, 4, 3, 2, 2, 7, 1, 2, 2, 2, 1, 4, 3, 2, 1, 3, 2, 2, 5]], dtype=int32)
If you are using IPython, tab completion allows you to visualize all the attributes and methods
>>> model.mesh.<TAB> model.mesh.active_cell model.mesh.gauge_pos model.mesh.area model.mesh.local_active_cell model.mesh.area_dln model.mesh.nac model.mesh.code model.mesh.ncol model.mesh.copy() model.mesh.ncpar model.mesh.cpar_to_rowcol model.mesh.ng model.mesh.cscpar model.mesh.npar model.mesh.dx model.mesh.nrow model.mesh.dy model.mesh.rowcol_to_ind_ac model.mesh.flwacc model.mesh.xmin model.mesh.flwdir model.mesh.xres model.mesh.flwdst model.mesh.ymax model.mesh.flwpar model.mesh.yres model.mesh.from_handle(