欢迎来到天天文库
浏览记录
ID:61289212
大小:560.50 KB
页数:21页
时间:2021-01-24
《有限元三角形单元程序设计教学教材.ppt》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、有限元三角形单元程序设计*三角形单元程序clearallfirst_time=cputime;formatlong%--------------------------------------------%inputdataforcontrolparameters%--------------------------------------------lengthx=4;%lengthofx-axissideofproblemlengthy=2;%lengthofy-axissideofproblememodule=1
2、.0;%elasticmoduluspoisson=0.0;%Poisson'sratiofload=-1;%thetotalload*三角形单元程序lx=16;%numberofelementinx-axisly=8;%numberofelementiny-axisnel=2*lx*ly;%numberofelementnnel=3;%numberofnodesperelementndof=2;%numberofdofspernodennode=(lx+1)*(ly+1);%totalnumberofnodesins
3、ystemsdof=nnode*ndof;%totalsystemdofsedof=nnel*ndof;%degreesoffreedomperelement%-------------------------------------------------------%inputdatafornodalcoordinatevalues%-------------------------------------------------------x0=[];fori=1:lx+1forj=1:ly+1x0=[x0;(i
4、-1)*lengthx/lx-0.5*lengthy*(1+(lx+1-i)/lx)*(1-(j-1)/ly)];endend*三角形单元程序%----------------------------------------------------------------------%inputdatafornodalconnectivityforeachelement%nodes(i,j)wherei->elementno.andj->connectednodes%--------------------------
5、--------------------------------------------nodes=[];fori=1:lxforj=1:lynodes=[nodes;(ly+1)*(i-1)+j(ly+1)*i+j(ly+1)*(i-1)+j+1;];nodes=[nodes;(ly+1)*i+j(ly+1)*i+j+1(ly+1)*(i-1)+j+1;];endend*三角形单元程序%----------------------------------%inputdataforboundaryconditions%
6、----------------------------------bcdof=[];bcval=[];fori=1:ly+1bcdof=[bcdof1+2*(i-1)2+2*(i-1)];bcval=[bcval00];end*三角形单元程序%-------------------------------------------------%initializationofmatricesandvectors%-------------------------------------------------ff=sp
7、arse(sdof,1);%systemforcevectork=sparse(edof,edof);%initializationofelementmatrixkk=sparse(sdof,sdof);%systemmatrixdisp=sparse(sdof,1);%systemdisplacementvectoreldisp=sparse(edof,1);%elementdisplacementvectorstress=zeros(nel,3);%matrixcontainingstresscomponentss
8、train=zeros(nel,3);%matrixcontainingstraincomponentsindex=sparse(edof,1);%indexvectorkinmtx=sparse(3,edof);%kinematicmatrixmatmtx=sparse(3,3);%constitutivematrix%----
此文档下载收益归作者所有