【源码】从Ansys导入mesh到MATLAB的小程序

【源码】从Ansys导入mesh到MATLAB的小程序

如果在Ansys Workbench中生成了有限元网格,并希望将其导入到Matlab中,请执行以下操作:

If you have a finite element mesh generated in Ansys Workbench and want to import it into Matlab, do the following:

  • in Ansys workbench: Create an “input file” (in the model, select “solution” in the tree, click “tools”->Write input file)

  • in Matlab: pass the file name of the input file to the function ‘importMesh_ansys2D’.

函数从.dat文件中读取顶点坐标和连通性,并将它们存储到Matlab数组中。有关示例,请参见文件“test_importMesh”。

The function reads the vertex coordinates and connectivity from the .dat file and stores them into Matlab arrays. For an example, see the file ‘test_importMesh’.

注意:

-仅适用于2D作品。但是,通过在连接中选择相应的列,对3D的扩展应该很简单。

-忽略附加节点(在二次形状函数的情况下)。

-对于三角形元素,连通性表重复第三个顶点。此格式采用Ansys。

Notes:

  • Works for 2D only. However, the extension to 3D should be straightforward by selecting the corresponding columns in the connectivity.

  • The additional nodes (in case of quadratic shape functions) are ignored.

  • For triangular elements, the connectivity table repeats the third vertex. This format is adopted from Ansys.

更多精彩文章请关注公众号:【源码】从Ansys导入mesh到MATLAB的小程序