資源描述:
《有限元編程的c++實(shí)現(xiàn)算例.doc》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在教育資源-天天文庫(kù)。
1、.有限元編程的c++實(shí)現(xiàn)算例read.pudn./downloads76/doc/fileformat/290377/ganjian.cpp__.htm??1.#include????2.#include????3.?????4.?????5.#definene3??????????????????????????????????????????????????//單元數(shù)????6.#definenj4??????????????????????????????????????????????????//節(jié)點(diǎn)數(shù)????7.#definenz6???
2、???????????????????????????????????????????????//支撐數(shù)????8.#definenpj0?????????????????????????????????????????????????//節(jié)點(diǎn)載荷數(shù)????9.#definenpf1?????????????????????????????????????????????????//非節(jié)點(diǎn)載荷數(shù)???10.#definenj312????????????????????????????????????????????????//節(jié)點(diǎn)位移總數(shù)???11.#definedd6?????
3、?????????????????????????????????????????????//半帶寬???12.#definee02.1E8?????????????????????????????????????????????//彈性模量???13.#definea00.008??????????????????????????????????????????????//截面積???14.#definei01.22E-4????????????????????????????????????????????//單元慣性距????15.#definepi3.141592654??
4、?????????????????????????????????16.????17.????18.intjm[ne+1][3]={{0,0,0},{0,1,2},{0,2,3},{0,4,3}};????????????/*gghjghg*/????????????????19.doublegc[ne+1]={0.0,1.0,2.0,1.0};????????????????????????????????20.doublegj[ne+1]={0.0,90.0,0.0,90.0};???21.doublemj[ne+1]={0.0,a0,a0,a0};???22.doublegx
5、[ne+1]={0.0,i0,i0,i0};???23.intzc[nz+1]={0,1,2,3,10,11,12};???24.doublepj[npj+1][3]={{0.0,0.0,0.0}};???25.doublepf[npf+1][5]={{0,0,0,0,0},{0,-20,1.0,2.0,2.0}};???26.doublekz[nj3+1][dd+1],p[nj3+1];???27.doublepe[7],f[7],f0[7],t[7][7];???28.doubleke[7][7],kd[7][7];???29.??..??30.????31.//**kz[][
6、]—整體剛度矩陣???32.//**ke[][]—整體坐標(biāo)下的單元?jiǎng)偠染仃???33.//**kd[][]—局部坐標(biāo)下的單位剛度矩陣???34.//**t[][]—坐標(biāo)變換矩陣???35.????36.//**這是函數(shù)聲明???37.voidjdugd(int);???38.voidzb(int);???39.voidgdnl(int);???40.voiddugd(int);???41.????42.????43.//**主程序開(kāi)始???44.voidmain()???45.{???46.?inti,j,k,e,dh,h,ii,jj,hz,al,bl,m,l,dl,zl,z,j0
7、;???47.?doublecl,wy[7];???48.?intim,in,jn;???49.????50.//***********************************************???51.//<功能:形成矩陣P>???52.//***********************************************???53.????54.?if(npj>0)???55.?{???56.?????for(i=1;i<=npj;i+