Plotting Unstructured Grids (DISU / Quadtree)

108 views
Skip to first unread message

Janek G

unread,
Jun 27, 2023, 10:27:26 AM6/27/23
to MODFLOW Users Group
Hello everyone!
I developed a MF6 model with the GMS software. The model grid is an unstructured, geo-referenced , quadtree-refined grid built with the DISU package. In order to apply  data assimilation to the model, I am importing it to an Python IDE via Flopy. I want to plot the results from time to time and while I managed to plot with some interpolation algorithmn, combined with a shapefile intersection, I am wondering, why plotting is not working with the Flopy capabilitites. A reduced snippet of the code is use is:

# Retrieving head data from model
head = model.output.head().get_data(idx=0)
# Defining the model map based on unstructured model grid
mm = flopy.plot.PlotMapView(model=model, modelgrid = model.modelgrid)
# plotting contourlines
cs = mm.contour_array(head)

which results in a ValueError: x and y arrays must have a length of at least 3
the model.modelgrid object contains over 30000 cells with x and y values associated to it. Has anyone a fix for this problem? Thank you sincerely

Reply all
Reply to author
Forward
0 new messages