Export triangle values of vertex and color after solve() is used to make a finite element analisys

2 次查看(过去 30 天)
Say we have an stl model imported, using importGeometry, later meshed with generateMesh, setting some structural properties and using solve to make an analysis, th is OK, then we use the command pdeplot3D and we get a colored version of the model showing stress, etc.
What we need is to get all values of the vertex of all triangles and also the color of each vertex and stress values so can be printed in a table or exported to a .csv file.
Already done or an example available?

回答(1 个)

Poorna
Poorna 2024-3-31
Hi alberto,
I see you want to get the traingle vertices of the mesh generated by "generateMesh" function. Those values are part of the mesh properties. Specifically, the Elements property within the FEMesh Properties holds the indices corresponding to the nodes of each triangle generated by the mesh.
model = createpde;
importGeometry(model,"Block.stl");
mesh = generateMesh(model,'GeometricOrder', 'linear');
processMesh(mesh.Elements); %define your own processMesh function to export the values.
To retrieve the actual vertex values, you can look into the NodalSolution property found in the results returned by the "solvepde" function. This property provides the solution values at the mesh nodes
Later, you can use "writeMatrix" or 'writeTable" functions to export the values to .csv files.
To know more about FEMesh properties refer to the following documentation:
To know more about the NodalSolution property refer to the below documentation:
Hope this Helps!

类别

Help CenterFile Exchange 中查找有关 Geometry and Mesh 的更多信息

标签

产品


版本

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by