分享

gmsh学习——基础

 蓝色飘零 2012-04-29
鼠标操作
左键       旋转、选择。
Ctrl+左键 套索缩放或开始套索选择/取消选择
中键       缩放、取消选择、接受套索缩放或套索取消选择
Ctrl+中键 正交显示
右键       平移,取消套索缩放或套索选择/取消选择,弹出后处理菜单
Ctrl+右键 重新设置缺省视图(误操作后恢复视图用)

脚本
脚本使用C和C++风格注释。
两种常数类型,real和string,没有整数类型。
用户定义函数没有参数,call语句等价于在调用位置插入语句,函数中可以包含任意Gmsh命令,用Return命令结束定义。Gmsh脚本的缺点是所有变量全局可见

网格划分
目前2D无结构网格有3种算法,3D无结构网格有2种算法。所有的2D无结构算法先用所有1D网格的点构造Delaunay网格,丢失的边用edge swaps算法恢复,经过这步初始步骤后可以选择3种算法生成网格,这3种算法评价如下
                      稳定性 性能 单元质量
MeshAdapt    1         3         2
Delaunay           2         1         2
Frontal               3         2         1
复杂曲面生成网格最好选择MeshAdapt,而生成网格质量重要时可以用Frontal算法,生成大规模平面网格时Delaunay算法最快。
3D网格算法有“Tetgen+Delaunay”和“Netgen”,前一种算法稳定且最快,但是这个算法有时修改表面网格,因此不适合生成混合网格和无结构网格,此时需要用Netgen算法,两种算法网格质量差不多,如果单元质量比较重要应该用优化算法进行优化。

文件格式
MSH格式保存网格和相关的后处理数据,可以是文本格式或二进制格式。
$MeshFormat中为附加信息,后面有节点$Nodes、单元$Elements、region名称$PhysicalName、后处理数据($NodeData,$ElementData,$ElementNodeData)。
非关键字开头的部分被忽略,因此可以在类似$Comments/$EndComments部分加入注释。
各部分可以重复,后处理部分可以放入单独的一个或多个文件。
例子
$MeshFormat
2.0 0 8               版本2.0,文件类型(0ASCII格式),浮点数字节数8
$EndMeshFormat
$Nodes
6                     6个节点
1 0.0 0.0 0.0         节点1坐标(0.0, 0.0, 0.0)
2 1.0 0.0 0.0         节点2坐标(1.0, 0.0, 0.0)
3 1.0 1.0 0.0         。。。
4 0.0 1.0 0.0
5 2.0 0.0 0.0
6 2.0 1.0 0.0
$EndNodes
$Elements
2                     2个单元
1 3 2 99 2 1 2 3 4    单元1:类型3,physical 99, elementary 2, 节点 1 2 3 4
2 3 2 99 2 2 5 6 3    单元2:类型3,physical 99, elementary 2, 节点 2 5 6 3
$EndElements
$NodeData
1                     一个字符串tag
"A scalar view"       view名称("A scalar view")
1                     一个实数tag
0.0                   the time value (0.0)
3                     3个整数tag
0                     the time step (0; time steps always start at 0)
1                     1-component (scalar) field
6                     six associated nodal values
1 0.0                 value associated with node #1 (0.0)
2 0.1                 value associated with node #2 (0.1)
3 0.2                 etc.
4 0.0
5 0.2
6 0.4
$EndNodeData

支持的单元类型
1 2节点线
2 3节点三角形
3 4节点四边形quadrangle
4 4节点四面体tetrahedron
5 8节点六面体hexahedron
6 6节点棱柱prism
7 5节点金字塔pyramid
8 3节点二阶线(2节点在两端,1节点在边上)
9 6节点二阶三角形(3个在顶点,3个在边上)
10 9节点四边形
11 10节点四面体
12 27节点六面体
13 18节点棱柱(6个顶点,9个在边上,3个在四边形面上)
14 14节点金字塔(5个顶点,8个在边上,1个在四边形面上)
15 1节点的点
16 8节点四边形
17 20节点六面体
18 15节点棱柱(6个顶点,9个在边上)
19 13节点金字塔(5个顶点,8个在边上)
20 9节点三阶不完全(?)三角形(3节点在顶点,6个在边上)
21 10节点三阶三角形(3节点在顶点,6个在边上,1个在面上)
22 12节点四阶不完全三角形(3节点在顶点,9个在边上)
23 15节点四阶三角形(3节点在顶点,9个在边上,3个在面上)
24 15-node fifth order incomplete triangle (3 nodes associated with the vertices, 12 with the edges)
25 21-node fifth order complete triangle (3 nodes associated with the vertices, 12 with the edges, 6 with the face)
26 4-node third order edge (2 nodes associated with the vertices, 2 internal to the edge)
27 5-node fourth order edge (2 nodes associated with the vertices, 3 internal to the edge)
28 6-node fifth order edge (2 nodes associated with the vertices, 4 internal to the edge)
29 20节点三阶四面体(4 nodes associated with the vertices, 12 with the edges, 4 with the faces)
30 35节点四阶四面体(4 nodes associated with the vertices, 18 with the edges, 12 with the faces, 1 in the volume)
31 56节点五阶四面体(4 nodes associated with the vertices, 24 with the edges, 24 with the faces, 4 in the volume)

20090712 add
GUI视频教程
http://www./gmsh/screencasts/
包括
创建3D模型 http://www./gmsh/screencasts/gmsh_3d.mov
后处理操作 http://www./gmsh/screencasts/gmsh_postpro.mov

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多