资源描述:
《平面刚架静力分析有限元程序》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、有限单元法平面刚架静力分析程序#include#include"string.h"#include"stdlib.h"#include"stdio.h"#include"math.h"voidhbw();voidsncs(intnel);voidfix(intnp);voidtrmat();voidfis(intnel);voidfpj();voidforce();voidstiff();voidaddsm();voidrestr();voidmatmul();voidsoleq()
2、;voidoutdis();floatsm[6][6],tsm[300][30],res[60][2],pj[300],t[6][6],d[6][6],r[300],fo[6],foj[6],pf[200][4],x[100],y[100],ae[10][3],sl,sn,cs,eal,eil;intnj,ne,nt,nr,npj,npf,nn,mbw,jel[100][2],nae[100],is[6];FILE*infile,*outfile;/************主函数********
3、******/voidmain(){charname1[30],name2[30];inti,j,nel,np;printf("pleaseenterdata-filename");scanf("%s",name1);printf("pleaseenterresult-filename");scanf("%s",name2);if((infile=fopen(name1,"r"))!=NULL){fscanf(infile,"%d%d%d%d%d%d",&nj,&ne,&nt,&nr,&
4、npj,&npf);for(i=0;i5、],&res[i][1]);}else{printf("thedata-filenotexit!");exit(1);}nn=3*nj;outfile=fopen(name2,"w");if(outfile==NULL){printf("theresult-filenotexist!");exit(1);}fprintf(outfile,"statisanalysisofplaneframe");fprintf(outfile,"inputdata");fprintf(outfile,"
6、************");fprintf(outfile,"controldata");fprintf(outfile,"thenum.ofnode:%3d",nj);fprintf(outfile,"thenum.ofmem:%3d",ne);fprintf(outfile,"thenum.oftypeofsectioncharacteristic:%3d",nt);fprintf(outfile,"thenum.ofrestricteddegreesoffreedom
7、:%3d",nr);fprintf(outfile,"thenum.ofnodalloads:%3d",npj);fprintf(outfile,"thenum.ofnon-nodalloads:%3d",npf);fprintf(outfile,"thenum.ofnodaldegreesoffreedom:%3d",nn);fprintf(outfile,"informationofmem.");fprintf(outfile,"mem.startnodeendnodet
8、ype");for(i=0;i