有限元程序(Finite element program).docVIP

  • 6
  • 0
  • 约7.46千字
  • 约 18页
  • 2017-10-07 发布于河南
  • 举报
有限元程序(Finite element program)

有限元程序(Finite element program) # includes stdio.h int lnods [20] [3], itype, maxnel, maxnod, nhbw, maxlop, ilodpl [20]. float d [3] [3], coords [20] [2], k [6], [6], and mu, t, sum [3], [6], area, astif [40] [40], aload [40], displ [40], eload [20] [6], ast [40] [40], aloha [40], point [20] [2]. / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / void matd () { int i, j; float w, mue, ee. if (itype = = 2) {ee = e / (1.0-mu * mu); mue = mu / (1.0-mu); } else {ee = e; mue = mu;} w = ee / (1.0-mue * mue); for (i = 0; i 3; i + +) for (j = 0, j 3; j + +) d [i] [j] = 0.0. d [0] [0] = w; d [0], [1] = mue * w; d [1], [0] = mue * w; d [1] [1] = w; d [2], [2] = 0.5 * (1.0-mue) * w; } / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / void stif (int in) { int i, j, l; float a [3], b [3], c [3], b [3] [6]. for (i = 0; i 3; i + +) (a [i] = coords [lnods [in] [(i + 1)% 3]] [0] * coords [lnods [in] [(i + 2)% 3]] [1] - coords [lnods [in] [(i + 2)% 3]] [0 coords] * [lnods [in] [(i + 1)% 3]] [1]. b [i] = coords [lnods [in] [(i + 1)% 3]] [1] - coords [lnods [in] [(i + 2)% 3]] [1]. c [i] = coords [lnods [in] [(i + 2)% 3]] [0] - coords [lnods [in] [(i + 1)% 3]] [0]. } for (i = 0; i 3; i + +) for (j = 0, j 6; j + +) b [i] [j] = 0.0. area = ([1] + [2] + [0]) / 2.0. for (i = 0; i 3; i + +) {b [0] [2 *] = b [i] / area / 2.0. b [1] [2 * + 1] = c [i] / area / 2.0. b [2] [2 *] = c [i] / area / 2.0. b [2] [2 * i + 1] = b [i] / area / 2.0. } matd (); for (i = 0; i 3; i + +) for (j = 0, j 6; j + +) {sum [i] [j] = 0.0. for (i = 0; l 3; l + +) sum [i] [j] + = (d [i] [l] b [l] [j]). } for (i = 0; i 6; i + +) for (j = 0, j 6; j + +) {k [i] [j] = 0.0. for (i = 0; l 3; l + +) k [i] [j] + = (b [l] [the] * sum [l] [j] * t * area); } } / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / void mnhbw () { int i, j, r, nh. nhbw = 0; for (i = 0; i maxnel; i + +) for (j = 0, j 3; j + +) for (r = 0 and r 3; r + +) {nh = (lno

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档