How to import a .msh file (2D) in Matlab ?

28 visualizaciones (últimos 30 días)
hakim oueslati
hakim oueslati el 18 de En. de 2023
Editada: hakim oueslati el 18 de En. de 2023
I used GMSH to build a mesh with a simple 2D geometry. So I got an .msh file that I want to read on Matlab to get the (p,e,t) matrices from the pdetoolbox. I have attached the .zip folder containing the .msh file.
I found a script on gmsh2pdetoolbox which is used to read .msh files on Matlab to obtain the 3 matrices (p,e,t) . When trying to run it, the following error is displayed:
Syntax error (no $Nodes/$NOD) in: mesh_PB.msh
Syntax error (no $Elements/$ELM) in: mesh_PB.msh
Dot indexing is not supported for variables of this type.
Error in gmsh2pdetoolbox_rev>load_gmsh4 (line 275)
for i = 1:msh.nbElm
Error in gmsh2pdetoolbox_rev (line 18)
mesh_structure = load_gmsh4(filename,-1);
Error in Script_A_MH_L (line 34)
[p,e,t] = gmsh2pdetoolbox_rev('mesh_PB.msh');
The command used for the execution is :
[p,e,t] = gmsh2pdetoolbox_rev('mesh_PB.msh');
As I understand it, the msh structure does not contain an element called nbElm. Either there is an error in the script I found or there is a detail I am missing.

Respuestas (0)

Etiquetas

Productos


Versión

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by