acroucher / PyTOUGH

A Python library for automating TOUGH2 simulations of subsurface fluid and heat flow
GNU Lesser General Public License v3.0
96 stars 36 forks source link

Issues when importing a 2_D gmsh mesh into a geometry object #33

Closed uqzhaozicheng closed 2 years ago

uqzhaozicheng commented 2 years ago

Hi Adrian,

Recently I have been trying to use gmsh to construct the the domain of a 2D hydrological model. When I run the following code: geo = mulgrid().from_gmsh(filename='XXX.gmsh', layers=[1.0, 1.2]) I came across the following error: image

I think there might be an error in mulgrids.py line 1657. image

When you look at the definition of this method in line 1597, there are 5 arguments; whereas there are only 4 in line 1657. I think when executing line 1657, the parameter [spaces], which is a bool value, is mistakenly identified as the [chars].
image Error disappeared when I specified chars=ascii_lowercase in line 1657.

acroucher commented 2 years ago

Thanks, I think I have fixed this now - on the 'testing' branch. The problem was that the 'justify' parameter to from_gmsh() was missing. This is then passed in to add_layers() - it was missing from that too.

I have added a unit test for from_gmsh() and it is passing now. Can you please test it yourself? If it's working for you we can close the issue.

uqzhaozicheng commented 2 years ago

Yes. It works well now! Great thanks!