Import mesh from Matlab to Ansys with additional properties of each element

10 vues (au cours des 30 derniers jours)
Maksim
Maksim le 6 Mai 2024
I have obtained a finite element mesh of an image using im2mesh file by JieXian Ma. I want to export it to Ansys, but I need not to just export a mesh (it's already implemented in this file), but first I have to assign Modulus of Elasticity value to each of the node.
From the image I have I've also obtained color intensity matrix (in grayscale). I multiplied it by Elasticity Modulus I have (it represents the non-homogeneity of a bone) and then I need to somehow assign this matrix's values to the mesh.
Mesh consists of verticies (n-by-2) (x and y coordinates) and triangles (m-by-3) (numbers of verticies building up a triangle) vectors. The matrix is a square one.
Also I consider removing zeros from the matrix, as it's not needed in the mesh creation, but then it transforms into a long vector, longer than previous ones and I don't know how to do it normally.
So, maybe someone knows how to assign values to the mesh?
Below are the images of the mesh, bone image and vectors and a color matrix I have.
  10 commentaires
Maksim
Maksim le 12 Mai 2024
Okay, I will try to use this code and tell about results later. And will post a new question 🫡
For now thanks a lot for help with file export and other things!
Maksim
Maksim le 13 Mai 2024
I created a mesh without removing "air" and I still got less nodes than elements in a matrix, so it seems there should be some other way. Or I don't undestand something
numel(unique(vert(:,1))) gave 8743
numel(unique(vert(:,2))) gave 9250

Connectez-vous pour commenter.

Réponses (1)

Jiexian Ma
Jiexian Ma le 6 Avr 2025
Hi Maksim,
In the new version of Im2mesh package, the mesh can be exported as msh file. You can open the msh file in Gmsh (free software) and save the mesh as other file format (see below).
inp (Abaqus), key (LSDYNA),
celum, cgns, diff (Diffpack 3D),
unv (I-deas Universal), ir3 (Iridum), med,
mesh (INRIA Medit), mail (CEA Triangulation),
m (Matlab), bdf (Nastran Bulk Data File),
off (Object File Format), p3d (Plot3D Structured Mesh),
stl (STL surface), wrl (VRML surface), vtk (VTK),
dat (Tochnog), ply2 (PLY2 Surface), su2,
neu (GAMBIT Neutral File), x3d, _0000.rad (RADIOSS BLOCK)
I'm not sure which format is better for ANSYS. Good luck!

Community Treasure Hunt

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

Start Hunting!

Translated by