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

error in example code "Hydrostatic_3D" #14

Closed S-Nari closed 6 years ago

S-Nari commented 6 years ago

Hello. I'm a beginner at PyTOUGH. I tried running "Hydrostatic_3D" of wiki page, but in line 52(write_vtk), following error appeared;

Traceback (most recent call last): File "test.py", line 51, in dat.grid.write_vtk(geo, 'INFILE.vtu') File "/home/narinari/PyTOUGH-master/build/lib.linux-x86_64-2.7/t2grids.py", line 551, in write_vtk vtu = geo.get_vtk_grid(arrays, surface_snap) File "/home/narinari/PyTOUGH-master/build/lib.linux-x86_64-2.7/mulgrids.py", line 3166, in get_vtk_grid node3d, elt3d = self.grid3d(surface_snap) File "/home/narinari/PyTOUGH-master/build/lib.linux-x86_64-2.7/mulgrids.py", line 3085, in grid3d unique_elevations, columns = unique_values(col_surf, surface_snap) File "/home/narinari/PyTOUGH-master/build/lib.linux-x86_64-2.7/mulgrids.py", line 3074, in unique_values uniques = asort[d > tol] IndexError: boolean index did not match indexed array along dimension 0; dimension is 2 but corresponding boolean dimension is 1

Is there any bug in example code "Hydrostatic_3D" ?

acroucher commented 6 years ago

hi,

I'm guessing you have a recent version of the VTK library on your machine, e.g. VTK 6?

Some non-backwards compatible changes were introduced in VTK 6. I have put a workaround in the PyTOUGH testing branch, so if you try that hopefully you will find it works with VTK 6:

https://github.com/acroucher/PyTOUGH/tree/testing

S-Nari commented 6 years ago

I use vtk 5.8, but when I followed your advice, then "write_vtk()" ran successfully !! Thank you so much.