结构有限元frame3程序系统源程序列表是用啥语言编写的

结构有限元frame3程序系统源程序列表是用啥语言编写的,第1张

高级语言编写源程序。程序包含数据结构,算法,存储方式编译等,经过语言翻译程序解释程序和编译程序转换成机器接受的指令。以上就是结构有限元frame3程序系统源程序列表是用高级语言编写源程序编写的相关内容。

Public E As Integer, tt As Integer, I As Integer

Private Sub Command1_Click()

' 平面刚架结构计算程序(FEM) '

FileName$ = InputBox("

输入数据原始文件名:") FileName$ = "F:\VB2\

工程计算\DATA1.TXT"

Open FileName$ For Input As #1

' 读入节点单元信息

Input #1, NJ, NE, NP, NF, NI

For E = 1 To NE: Input #1, JM(E, 1), JM(E, 2): Next E

For E = 1 To NE: Input #1, DH(E, 1), DH(E, 2), DH(E, 3), DH(E, 4), DH(E, 5), DH(E,

6): Next E

For E = 1 To NE: Input #1, GP(E, 1), GP(E, 2), GP(E, 3), GP(E, 4), GP(E, 5): Next E

If NP <>0 Then

For I = 1 To NP: Input #1, JP(I), PJ(I): Next I

End If

If NF <>0 Then

For I = 1 To NF: Input #1, PF(I, 1), PF(I, 2), PF(I, 3), PF(I, 4), PF(I, 5): Next I

End If

Close #1

‘返回节点和单元信息,并形成节点力列阵'

FileName$ = InputBox("

输入数据结果文件名

:") FileName$ = "F:\VB2\

工程计算

\DATA2.TXT"

Open FileName$ For Output As #2

Print #2, "节点和单元信息"

Print #2, NJ, NE, NP, NF, NI

For E = 1 To NE: Print #2, JM(E, 1), JM(E, 2): Next E

For E = 1 To NE: Print #2, DH(E, 1), DH(E, 2), DH(E, 3), DH(E, 4), DH(E, 5), DH(E,

6): Next E

For E = 1 To NE: Print #2, GP(E, 1), GP(E, 2), GP(E, 3), GP(E, 4), GP(E, 5): Next E

For I = 1 To NI: P(I) = 0: Next I

If NP <>0 Then

For I = 1 To NP: Print #2, JP(I), PJ(I): Next I

For I = 1 To NP: II = JP(I): P(II) = P(II) + PJ(I): Next I

End If

If NF <>0 Then

For I = 1 To NF: Print #2, PF(I, 1), PF(I, 2), PF(I, 3), PF(I, 4), PF(I, 5): Next I

For I = 1 To NF: E = PF(I, 1): tt = PF(I, 2)

Call zbzh(E, t())

If tt = 1 Then Call zyhz1(I, FF())

If tt = 2 Then Call zyhz2(I, FF())

If tt = 3 Then Call zyhz3(I, FF())

If tt = 4 Then Call zyhz4(I, FF())

For L1 = 1 To 6

PE(L1) = 0

For M1 = 1 To 6

PE(L1) = PE(L1) - t(M1, L1) * FF(M1)

Next M1

Next L1

For j = 1 To 6

II = DH(E, j)

If II >0 Then P(II) = P(II) + PE(j)

Next j

Next I

End If

' 调用单元刚度矩阵子程序,组集结构刚度矩阵

For I = 1 To NI

For j = 1 To NI

K(I, j) = 0

Next j

Next I

For E = 1 To NE

Call dygd(E, ke())

For H = 1 To 6

jh = DH(E, H)

If jh <>0 Then

For L = 1 To 6

JL = DH(E, L)

If JL <>0 Then

K(jh, JL) = K(jh, JL) + ke(H, L)

End If

Next L

End If

Next H

Next E

' 调用高斯消元法求解总刚方程,得到节点位移列阵

n = NI

For K1 = 1 To n - 1: For I = K1 + 1 To n: C = -K(I, K1) / K(K1, K1): P(I) = P(I) + P(K1)

* C

For j = K1 + 1 To n: K(I, j) = K(I, j) + K(K1, j) * C: Next j: Next I

Next K1

D(n) = P(n) / K(n, n)

For I = n - 1 To 1 Step -1

For j = I + 1 To n: P(I) = P(I) - K(I, j) * D(j): Next j

D(I) = P(I) / K(I, I)

Next I

' 输出节点位移

Print "节点位移计算结果:"

Print #2, "节点位移计算结果:"

For K1 = 1 To NI

Print K1, D(K1)

Print #2, "第"K1"个节点位移="D(K1)

Next K1

' 计算各单元杆端内力(轴力、剪力和弯矩)

Print "单元杆端内力(轴力、剪力和弯矩)计算结果:"

Print #2, "单元杆端内力(轴力、剪力和弯矩)计算结果:"

For E = 1 To NE: Call dygd(E, ke()): Call zbzh(E, t())

For II = 1 To 6: JJ = DH(E, II)

If JJ = 0 Then

DE(II) = 0

Else

DE(II) = D(JJ)

End If

Next II

For I = 1 To 6

FE(I) = 0

For j = 1 To 6

For K1 = 1 To 6

FE(I) = FE(I) + t(I, j) * ke(j, K1) * DE(K1)

Next K1: Next j: Next I

If NF <>0 Then

For I = 1 To NF

If PF(I, 1) = E Then

tt = PF(I, 2)

If tt = 1 Then Call zyhz1(I, FF())

If tt = 2 Then Call zyhz2(I, FF())

If tt = 3 Then Call zyhz3(I, FF())

If tt = 4 Then Call zyhz4(I, FF())

For j = 1 To 6: FE(j) = FE(j) + FF(j): Next j

End If

Next I

End If

If GP(E, 2) = 0 Then

Print #2, "单元:"E, "节点:"JM(E, 1)"--->"JM(E, 2), "轴力单元"

Print #2, "N1="-FE(1)"N2="FE(4)

Print "单元:"E, "节点:"JM(E, 1)"--->"JM(E, 2), "轴力单元"

Print "N1="-FE(1)"N2="FE(4)

End If

If GP(E, 2) <>0 Then

If GP(E, 3) = 0 Then

Print #2, "单元:"E, "节点:"JM(E, 1)"--->"JM(E, 2), "弯曲单元"


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/11297083.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-15
下一篇 2023-05-15

发表评论

登录后才能评论

评论列表(0条)

保存