-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_advancing_front.py
More file actions
89 lines (73 loc) · 2.64 KB
/
test_advancing_front.py
File metadata and controls
89 lines (73 loc) · 2.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
from graphviz import Digraph
def create_mesh_generation_flowchart():
# 创建有向图
dot = Digraph(comment='Mesh Generation Flowchart')
dot.attr(rankdir='TB') # 从上到下的布局
# 设置节点样式
dot.attr('node', shape='box', style='rounded')
# 添加主要流程节点
dot.node('A', '开始')
dot.node('B', '读取边界数据')
dot.node('C', '初始化AFT_stack\n活动前沿堆栈')
dot.node('D', '加载神经网络模型')
# 添加神经网络预处理子图
with dot.subgraph(name='cluster_0') as s:
s.attr(label='神经网络输入准备')
s.node('E1', '获取当前前进面\nnode1, node2')
s.node('E2', '寻找相邻点\nnode0, node3, node4')
s.node('E3', '坐标变换\n标准化处理')
s.node('E4', '构建输入向量\n[node0,...,node4]')
# 添加神经网络预测子图
with dot.subgraph(name='cluster_1') as s:
s.attr(label='神经网络预测')
s.node('F1', '神经网络前向传播')
s.node('F2', '获取预测模式(1-10)')
# 添加网格生成子图
with dot.subgraph(name='cluster_2') as s:
s.attr(label='网格生成')
s.node('G1', '模式1:\n生成两个新点')
s.node('G2', '模式2-4:\n生成/选择一个点')
s.node('G3', '模式5:\n生成中间点')
s.node('G4', '模式6-10:\n特殊情况处理')
# 添加质量控制子图
with dot.subgraph(name='cluster_3') as s:
s.attr(label='质量控制')
s.node('H1', '计算步长')
s.node('H2', '相交性检查')
s.node('H3', '质量评估')
s.node('H4', '更新数据结构')
dot.node('I', '更新AFT_stack')
dot.node('J', '结束')
# 添加边
dot.edge('A', 'B')
dot.edge('B', 'C')
dot.edge('C', 'D')
dot.edge('D', 'E1')
# 神经网络输入准备流程
dot.edge('E1', 'E2')
dot.edge('E2', 'E3')
dot.edge('E3', 'E4')
dot.edge('E4', 'F1')
# 神经网络预测流程
dot.edge('F1', 'F2')
# 分支到不同模式
dot.edge('F2', 'G1')
dot.edge('F2', 'G2')
dot.edge('F2', 'G3')
dot.edge('F2', 'G4')
# 质量控制流程
dot.edge('G1', 'H1')
dot.edge('G2', 'H1')
dot.edge('G3', 'H1')
dot.edge('G4', 'H1')
dot.edge('H1', 'H2')
dot.edge('H2', 'H3')
dot.edge('H3', 'H4')
# 循环或结束
dot.edge('H4', 'I')
dot.edge('I', 'E1', '继续')
dot.edge('I', 'J', '完成')
# 保存为SVG格式
dot.render('mesh_generation_flowchart', format='svg', cleanup=True)
# 生成流程图
create_mesh_generation_flowchart()