Page 11 - Demo
P. 11
Planar Truss Examplefor ComrelAdd-onRCPConsult, 2023-2025Page 11write(buffer,\&NN(n),xc,yc;callGnuplotPut(nf,trim(buffer)//c_)enddocase(3)!! plot set #3! Set a main subtitle of plotcallGnuplotPut(nf,&\ label 'Internal member von Mises stress {/Symbol s}_v [MPa]' at 12.,8. center font 'Arial,16'\! Prepare color mapping -take Jet palettecallGnuplotPut(nf,&\ palette defined (0 '#000090',1 '#000fff',2 '#0090ff',3 '#0fffee',4 '#90ff70', &&5 '#ffee00',6 '#ff7000',7 '#ee0000',8 '#7f0000')\_)! Find minimal and maximal values of von Mises stressminA=1.d6;maxA=-1.d6don=1,nfevs=dabs(NN(n)/Area(n)*1.d-6)minA=dmin1(minA,vs)maxA=dmax1(maxA,vs)enddoddA=maxA-minA! Prepare colorbar datacallGnuplotPut(nf,\_)write(buffer,\minA,maxA;callGnuplotPut(nf,trim(buffer)//c_)! Plot of von Mises stress for internal memberdon=1,nfeSv=dabs(NN(n)/Area(n)*1.d6)l1=leng(n)/2.d0! length of rectanglel2=Sv/ddA*0.2d0! height of rectangleX(1)=-l1;X(2)=l1;X(3)=l1;X(4)=-l1Y(1)=-l2;Y(2)=-l2;Y(3)=l2;Y(4)=l2rad=theta(n)*PI/180.d0c=dcos(rad)s=dsin(rad)xc=(XY(1,IEN(1,n))+XY(1,IEN(2,n)))/2yc=(XY(2,IEN(1,n))+XY(2,IEN(2,n)))/2doi=1,nbdXYten(1,i)=X(i)*c-Y(i)*s+xcXYten(2,i)=X(i)*s+Y(i)*c+ycXYten(3,i)=Svenddo! Need to be closedXYten(1,nbd+1)=XYten(1,1)XYten(2,nbd+1)=XYten(2,1)XYten(3,nbd+1)=XYten(3,1)callGnuplotPlotData(nf,\_,&XYten,ned+1,nbd+1)write(buffer,\&int(Sv+0.1),xc,yc;callGnuplotPut(nf,trim(buffer)//c_)enddoendselect! Plot values of input datawrite(buffer,\A1callGnuplotPut(nf,trim(buffer)//c_)write(buffer,\A2callGnuplotPut(nf,trim(buffer)//c_)write(buffer,\E1callGnuplotPut(nf,trim(buffer)//c_)write(buffer,\E2callGnuplotPut(nf,trim(buffer)//c_)! Invoked versions of gnuplot and enginewrite(buffer,\trim(GnuplotVersion)callGnuplotPut(nf,trim(buffer)//c_)write(buffer,\trim(StrurelEngine)callGnuplotPut(nf,trim(buffer)//c_)! Show/Export a plotif(StrurelPlotMode.eq.1.or.StrurelPlotMode.eq.3)thencallGnuplotShow(nf)endifif(StrurelPlotMode.eq.2.or.StrurelPlotMode.eq.3)thenStrurelPlotCount=StrurelPlotCount+1write(buffer,\trim(StrurelPlotName),StrurelPlotCount,trim(StrurelPlotType)callGnuplotExport(nf,trim(buffer)//c_)endifcallGnuplotEnd()endifenddoendifendifier=0!! Return value of export functionPlanarTruss=ac(8)! vertical deflection u_y at bottom center (N04)endfunctionsubroutineMATNUL(x,m,n)!.....Zeroes matrix X(M,N)implicitreal*8(a-h,o-z)dimensionx(m*n)mn=m*ndoi=1,mnx(i)=0.enddoreturnendsubroutineMATRAN(a,b,m,n)!.....Transposes a matrix A(M,N).!.....Result will be stored in matrix B(N,M)!.....Calling: dimension a(m,n),b(n,m)!..... call MATRAN(a,b,m,n)implicitreal*8(ah,oz)dimensiona(m,n),b(n,m)doj=1,ndoi=1,mb(j,i)=a(i,j)enddo