- findElements: https://www.mathworks.com/help/pde/ug/pde.femesh.findelements.html
- findNodes: https://www.mathworks.com/help/pde/ug/pde.femesh.findnodes.html
- triangulation: https://www.mathworks.com/help/matlab/ref/triangulation.html
- freeBoundary: https://www.mathworks.com/help/matlab/ref/triangulation.freeboundary.html
gmsh .m files, reading boundaries
조회 수: 42 (최근 30일)
이전 댓글 표시
Is it possible to export the boundary information when exporting gmsh mesh. I want to apply forces to certain boundaries in the mesh. I read that one can identify domains in the mesh, but could not find any information regarding boundaries.
댓글 수: 0
채택된 답변
Jaynik
2024년 5월 16일
Hi Divyaprakash,
Assuming the variable 'msh' contains the mesh information from the Gmsh '.m' file. You can read the following answer to read the file in MATLAB: https://www.mathworks.com/matlabcentral/answers/483115-reading-msh-files-3d-in-matlab.
Once you have loaded the mesh information, you can use the findElements function to find mesh elements belonging to a specific region and the findNodes function to find the nodes that belong to a specific region from the Partial Differential Equation Toolbox.
You can directly use the properties of the 'msh' variable to create a triangulation object and use the freeBoundary function to find the outer surface of the mesh. Following is the code for the same:
nodes = msh.POS'; % Node coordinates
elements = msh.TETS(:, 1:4); % Element connectivity
T = triangulation(elements, nodes);
boundary_faces = freeBoundary(T);
Refer to the following documentation for more details about each function:
For a more detailed solution, it would be beneficial if you could provide additional details about your model.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Geometry and Mesh에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!