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 2021-06-07 09:24:08

davidz
User
Registered: 2016-02-01
Posts: 16

Error: Missing required card: NUM_MATERIALS_PER_ELEM

Hi,

I tried to interpolate the elevation from an old .2dm file to my new quality-mesh.
I tried several options with a defined KBS and without.
I used the "basic mode" in Basemesh-interpolation

Below you can find the error-message.

Is there something wrong with python?
I use:
Python-Version: 3.7.0
QGIS-Version: 3.16.4

Thanks for your help.
David




Ein Fehler trat bei der Ausführung von Python-Code auf:

py2dm.errors.MissingCardError: Missing required card NUM_MATERIALS_PER_ELEM
Traceback (most recent call last):
  File "C:/Users/dz/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\basemesh\plugin\gui\interpol.py", line 129, in accept
    sources = [Mesh.open(layer.source())]
  File "C:/Users/dz/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\basemesh\core\mesh.py", line 314, in open
    with py2dm.Reader(filename) as file_:
  File "C:\Users\dz\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\basemesh\packages\py2dm-0.1.0-py3-none-any.whl\py2dm\read.py", line 47, in __enter__
    self.open()
  File "C:\Users\dz\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\basemesh\packages\py2dm-0.1.0-py3-none-any.whl\py2dm\read.py", line 361, in open
    self._check_header()
  File "C:\Users\dz\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\basemesh\packages\py2dm-0.1.0-py3-none-any.whl\py2dm\read.py", line 186, in _check_header
    raise MissingCardError(f'Missing required card {nmpe_card}')
py2dm.errors.MissingCardError: Missing required card NUM_MATERIALS_PER_ELEM


Python-Version: 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)]
QGIS-Version: 3.16.4-Hannover Hannover, 654e76b3cb

Python-Pfad:
C:/PROGRA~1/QGIS3~1.16/apps/qgis-ltr/./python
C:/Users/dz/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/dz/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
C:/PROGRA~1/QGIS3~1.16/apps/qgis-ltr/./python/plugins
C:\PROGRA~1\QGIS3~1.16\apps\Python37
C:\PROGRA~1\QGIS3~1.16\apps\Python37\Scripts
C:\Program Files\QGIS 3.16\bin\python37.zip
C:\PROGRA~1\QGIS3~1.16\apps\Python37\DLLs
C:\PROGRA~1\QGIS3~1.16\apps\Python37\lib
C:\Program Files\QGIS 3.16\bin
C:\PROGRA~1\QGIS3~1.16\apps\Python37\lib\site-packages
C:\PROGRA~1\QGIS3~1.16\apps\Python37\lib\site-packages\win32
C:\PROGRA~1\QGIS3~1.16\apps\Python37\lib\site-packages\win32\lib
C:\PROGRA~1\QGIS3~1.16\apps\Python37\lib\site-packages\Pythonwin
C:/Users/dz/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/dz/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\basemesh\algorithms
C:/Users/dz/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\basemesh\packages\typing_extensions-3.7.4.3-py3-none-any.whl
C:/Users/dz/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\basemesh\packages\py2dm-0.1.0-py3-none-any.whl
C:/Users/dz/AppData/Roaming/QGIS/QGIS3\profiles\default\python\plugins\basemesh\packages\markdown2-2.3.8-py2.py3-none-any.whl
C:\Users\dz\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\crayfish\gui\..\pyqtgraph-0.10.0-py2.py3-none-any.whl
.

Offline

#2 2021-06-14 11:41:31

Matteo Facchini
Developer
From: Trento
Registered: 2014-09-05
Posts: 278

Re: Error: Missing required card: NUM_MATERIALS_PER_ELEM

Hi david,
try and open your old mesh witha a text editor and check if it has the NUM_MATERIALS_PER_ELEM defined (it should be in the first lines).
You could also copy-paste here the first e.g. 10 lines of your old 2dm file
Best
Matteo

Offline

#3 2021-06-14 12:24:32

davidz
User
Registered: 2016-02-01
Posts: 16

Re: Error: Missing required card: NUM_MATERIALS_PER_ELEM

Hi Matteo.

There's no NUM_MATERIALS_PER_ELEM defined.
It's an 2dm file from an older Basement simulation.

Here the first few lines:

MESH2D   #created automatically via BASEmesh-Plugin for QGIS
E3T       1   16132   19709   10593       2
E3T       2  183591  183572  183587       2
E3T       3    8813    2341    8816       2
E3T       4    8810    2339    2340       2
E3T       5   10593   19709   23549       2
E3T       6    3134    2741    3655       2
E3T       7    1970    7607    1969       2
E3T       8    8812  261603    2339       2
E3T       9  274890  274880  274886       2

Best
David

Offline

#4 2021-06-15 08:10:42

Matteo Facchini
Developer
From: Trento
Registered: 2014-09-05
Posts: 278

Re: Error: Missing required card: NUM_MATERIALS_PER_ELEM

Hi David,

in the basement 3.x manual you'll find the instruction to convert this mesh to the new version, I think after that you might be good-to-go!

Best
Matteo

Offline

Board footer

Powered by FluxBB