User Forum of Software BASEMENT

BASEMENT
Basic Simulation Environment for computation of environmental flow and natural hazard simulation
Laboratory of Hydraulics, Hydrology and Glaciology (VAW)
ETH Zurich
Basement_Logo

You are not logged in.

#1 2019-09-20 15:38:20

sua87
User
From: Bern
Registered: 2017-05-26
Posts: 21

BASEmesh v1.4.4 MatID issue

Hi Basement Team

I might be wrong but I have possibly found a bug in the v1.4.4.: the MatID is not allocated correctly to the mesh elements. When I use the standard "Create Quality Mesh" function, the MatIDs are transferred to the Quality Mesh shapefile without any problems. However using the "XL Mesh" function, the MatID is lost somewhere in the process and is finally set to 1 for all elements in the 2dm file.

Is this really a bug or am I misunderstanding something?

Thanks

Offline

#2 2019-09-20 16:34:01

Matthias Bürgler
Developer
From: Zürich
Registered: 2019-04-04
Posts: 150

Re: BASEmesh v1.4.4 MatID issue

I tested the "XL Mesh" function with tutorial 3 of the tutorial Pre-Processing in QGIS with BASEmesh and the material ID was written to the .2dm file without any problems.

Maybe you can compare you "region" data with the one from the tutorial and find the problem?

Best regards
Matthias

Offline

#3 2019-09-23 08:00:32

sua87
User
From: Bern
Registered: 2017-05-26
Posts: 21

Re: BASEmesh v1.4.4 MatID issue

Hi Matthias
Thanks for your reply. Unfortunately your suggestion did not help. My region data has the exact same structure as the tutorial data. 

Also I could not reproduce your test results with the tutorial data, an error was thrown when I used the XL Mesh function: "ValueError: Input must be >= 1-d." The standard quality meshing process with the tutorial data worked fine again.

I'm using QGIS 2.14 Essen, which so far worked perfectly fine for all BaseMesh tasks. I tried 2.18 Las Palmas too, but there BaseMesh 1.4.4 cannot be installed properly, altough the repository states up to v2.99.

To me the problem is not (yet) explainable, since it is only the XL function that causes the MatID issue.
Do you have any other suggestions?
Thanks in advance

Offline

#4 2019-09-23 13:26:59

Matthias Bürgler
Developer
From: Zürich
Registered: 2019-04-04
Posts: 150

Re: BASEmesh v1.4.4 MatID issue

I am also using BASEmesh 1.44 with QGIS 2.18.28, so this should not be the problem. My guess is that you are missing some python packages. Maybe you can post the entire error message, or other warnings that might pop up when starting QGIS.

Best regards
Matthias

Offline

#5 2019-09-23 13:47:12

sua87
User
From: Bern
Registered: 2017-05-26
Posts: 21

Re: BASEmesh v1.4.4 MatID issue

Ok, thanks for the next hint - I will reinstall QGIS properly (upgrade to 2.18.28) and delete all previous versions on the computer, try again and let you know. In case the errors persist, I will post the full error messages.
Thanks and best regards in the meantime.
Andi

Last edited by sua87 (2019-09-23 13:47:35)

Offline

#6 2019-09-25 15:31:17

sua87
User
From: Bern
Registered: 2017-05-26
Posts: 21

Re: BASEmesh v1.4.4 MatID issue

Hi Matthias

For some reason I cannot get BASEmesh to run on QGIS 2.18.x. Depending on the version (I tried 2.18.3 and 2.18.28) there are different error codes for the installation (even on a freshly set up computer, with nothing else on it besides QGIS and Python 2.7):
- 2.18.03: cannot import name reverse_cuthill_mckee
- 2.18.28: cannot import numpy_mkl
However, v1.4.4 works fine on QGIS 2.14.19, so I will stick with this for the moment, since the above is a different problem.

---------------

Using the tutorial data you mentioned above, the XL-Meshing function throws the following error:

Error Message wrote:

An error has occurred while executing Python code:

ValueError: Input must be >= 1-d.
Traceback (most recent call last):
  File "C:/Users/gis-user/.qgis2/python/plugins\BASEmesh\largeMesh\largeMesh_dialog.py", line 376, in accept
    largeMesh = LARGEMESH(directory=wd, filename=projectName, mType='plane2x3x' , interpolationType=interpolationType, demFile=elevationData.dataProvider().dataSourceUri())
  File "C:/Users/gis-user/.qgis2/python/plugins\BASEmesh\largeMesh\largeMesh_dialog.py", line 452, in __init__
    self.__DEM = dem.getInterpolator()
  File "C:/Users/gis-user/.qgis2/python/plugins\BASEmesh\tools\meshModel.py", line 54, in getInterpolator
    np.transpose(np.flipud(self.__data)),
  File "C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages\numpy\lib\twodim_base.py", line 135, in flipud
    raise ValueError("Input must be >= 1-d.")
ValueError: Input must be >= 1-d.


Python version: 2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)]
QGIS version: 2.14.19-Essen Essen, df0ae5d395

Python Path:
C:/PROGRA~1/QGIS2~1.14/apps/qgis-ltr/./python/plugins\processing
C:/PROGRA~1/QGIS2~1.14/apps/qgis-ltr/./python
C:/Users/gis-user/.qgis2/python
C:/Users/gis-user/.qgis2/python/plugins
C:/PROGRA~1/QGIS2~1.14/apps/qgis-ltr/./python/plugins
C:\PROGRA~1\QGIS2~1.14\bin\python27.zip
C:\PROGRA~1\QGIS2~1.14\apps\Python27\DLLs
C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib
C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\plat-win
C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\lib-tk
C:\PROGRA~1\QGIS2~1.14\bin
C:\PROGRA~1\QGIS2~1.14\apps\Python27
C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages
C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages\jinja2-2.7.2-py2.7.egg
C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages\markupsafe-0.23-py2.7-win-amd64.egg
C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages\win32
C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages\win32\lib
C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages\Pythonwin
C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages\Shapely-1.2.18-py2.7-win-amd64.egg
C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages\wx-2.8-msw-unicode
C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages\xlrd-0.9.2-py2.7.egg
C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages\xlwt-0.7.5-py2.7.egg
C:/Users/gis-user/.qgis2//python
C:\PROGRA~1\QGIS2~1.14\apps\qgis-ltr\python\plugins\fTools\tools


With my own data, the function runs fine but does not tranfer the MatID correctly.

Do you have any further suggestions / ideas what could be wrong?
Thanks

Andi

Offline

#7 2019-09-25 16:22:56

Matthias Bürgler
Developer
From: Zürich
Registered: 2019-04-04
Posts: 150

Re: BASEmesh v1.4.4 MatID issue

Hi Andi

- 2.18.03: cannot import name reverse_cuthill_mckee
- 2.18.28: cannot import numpy_mkl

This looks like a problem with the installed numpy or scipy packages. I found a similar problem here: https://stackoverflow.com/questions/372 … -numpy-mkl.

Two points regarding the other error message:

  1. From the error message it looks like you are using raster (...data self.__DEM = dem.getInterpolator()...) for the elevation interpolation, but the tutorial I used is based on elevation mesh data (points and polygons). Maybe you can post a screenshot of the XL-Mesh Windows before you generate the mesh.

  2. Also from the error message it seems to be a problem related to the python module "numpy" (...\numpy\lib\twodim_base.py...). This could therefore even be related to your problem of installing QGIS 2.18. I would try to reinstall numpy and scipy https://www.scipy.org/install.html

I hope this helps!

Best regards
Matthias

Offline

#8 2019-09-25 16:33:44

sua87
User
From: Bern
Registered: 2017-05-26
Posts: 21

Re: BASEmesh v1.4.4 MatID issue

Hi Matthias
Thanks for the quick answer. Yes, I was using a DEM for both cases with the XL Meshing tool. For my own data it worked fine, this seems random to me. Anyway, I will try to fix the python packages first... I'll update you once I know more.
Have a good evening,
Andi

Offline

#9 2019-09-27 14:06:20

sua87
User
From: Bern
Registered: 2017-05-26
Posts: 21

Re: BASEmesh v1.4.4 MatID issue

Hi Matthias

So I solved my problem. I've had two, and I will try to sum them up for other users. Maybe it will help someone sometime.

1: Installation of BASEMesh in QGIS 2.18.28
  - There was an error for the installation of the experimental BASEMesh version 1.44 - "cannot import numpy_mkl".
  - I downloaded a wheel file from this link: https://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy (--> numpy‑1.16.5+mkl‑cp27‑cp27m‑win_amd64.whl for python 2.7)
  - Open OSGeo4W Shell (not your regular cmd window - QGIS has its own python environment)
  - enter the command "python -m pip install <Path/filename.whl> --user"
  - install BASEMesh from the Basement repository as normal

I don't know why this package is not installed when installing QGIS or if I'm the only one with this issue.


2: Missing MatID Numbers in .2dm File:
- The MatIDs were there in the first place! However I looked at the 2dm using the software SMS
- Due to the second header row that is written by the new XL-function (NUM-MATERIAL_PER_ELEM), SMS did not recongnise the MatID for some reason... The mesh itself displayed correctly.
- If this row is deleted, the MatID shows correctly in SMS. However I do now know, whether this could cause any problems in BM2.x or BM3.0

Sorry for the confusion and for the use of SMS, it's just a very convenient software for checking meshes...

Have a good weekend,
Andi

Last edited by sua87 (2019-09-27 15:03:03)

Offline

Board footer

Powered by FluxBB