Question on using geometryFromMesh

11 visualizaciones (últimos 30 días)
Shengyue Shan
Shengyue Shan el 20 de Nov. de 2019
Comentada: Shengyue Shan el 21 de Nov. de 2019
Hi all,
I came across a problem when using geometryFromMesh. I have a mesh file for a 3D geometry generated from COMSOL, and I would like to use it in pde toolbox in MATLAB. The COMSOL file contains the coordinates for the nodes, which is a Nnodes-by-3 matrix and the element information which is a Nelements-by-4 matrix. I rearranged the node matrix and element matrix, and put them in the form in 3-by-Nodes form and 4-by-Nelements form as indicated in https://www.mathworks.com/help/pde/ug/pde.pdemodel.geometryfrommesh.html#buvjb86-nodes
However, there is still a warning saying that there is node ID missing and it should start from 1. However, if I add a row for node ID the matrix will not be 3-by-Nodes.
Is there anything that I missed that caused this problem?
Than you very much!
Best regards,
Shengyue

Respuesta aceptada

Ravi Kumar
Ravi Kumar el 21 de Nov. de 2019
It looks like the node IDs from COMSOL might be 0 based. That is first node ID in COMSOL may be 0, in MATLAB it must be 1. You can check this by:
min(elementMatrix,[],'all')
If the answer is 0, then you need to just add 1 to elementMatrix:
elementMatrix = elementMatrix+1;
Regards,
Ravi
  1 comentario
Shengyue Shan
Shengyue Shan el 21 de Nov. de 2019
Hi Ravi,
Thanks for your answer! It works!
Best regards,
Shengyue Shan

Iniciar sesión para comentar.

Más respuestas (0)

Productos


Versión

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by