Page 11 - Demo
P. 11
Planar Truss Example for Comrel Add-on RCP Consult, 2023-2026 Page 11 write(buffer,\ NN(n),xc,yc; call GnuplotPut(nf,trim(buffer)//c_) end do case(3) !! plot set #3! Set a main subtitle of plot call GnuplotPut(nf, & \c_)! Prepare color mapping - take Jet palette call GnuplotPut(nf, & \ & 5 '#ffee00',6 '#ff7000',7 '#ee0000',8 '#7f0000')\! Find minimal and maximal values of von Mises stress minA=1.d6; maxA=-1.d6 do n=1,nfe vs=dabs(NN(n)/Area(n)*1.d-6) minA=dmin1(minA, vs) maxA=dmax1(maxA, vs) end do ddA=maxA-minA! Prepare colorbar data call GnuplotPut(nf,\ write(buffer,\call GnuplotPut(nf, trim(buffer)//c_)! Plot of von Mises stress for internal member do n=1,nfe Sv=dabs(NN(n)/Area(n)*1.d-6) l1=leng(n)/2.d0 ! length of rectangle l2=Sv/ddA*0.2d0 ! height of rectangle X(1)=-l1; X(2)=l1; X(3)=l1; X(4)=-l1 Y(1)=-l2; Y(2)=-l2; Y(3)=l2; Y(4)=l2 rad=theta(n)*PI/180.d0 c=dcos(rad) s=dsin(rad) xc=(XY(1,IEN(1,n))+XY(1,IEN(2,n)))/2 yc=(XY(2,IEN(1,n))+XY(2,IEN(2,n)))/2 do i=1,nbd XYten(1,i)=X(i)*c-Y(i)*s+xc XYten(2,i)=X(i)*s+Y(i)*c+yc XYten(3,i)=Sv end do! Need to be closed XYten(1,nbd+1)=XYten(1,1) XYten(2,nbd+1)=XYten(2,1) XYten(3,nbd+1)=XYten(3,1) call GnuplotPlotData(nf,\ & XYten,ned+1,nbd+1) write(buffer,\ int(Sv+0.1),xc,yc; call GnuplotPut(nf, trim(buffer)//c_) end do end select! Plot values of input data write(buffer,\ call GnuplotPut(nf,trim(buffer)//c_) write(buffer,\ call GnuplotPut(nf,trim(buffer)//c_) write(buffer,\ call GnuplotPut(nf,trim(buffer)//c_) write(buffer,\ call GnuplotPut(nf,trim(buffer)//c_)! Invoked versions of gnuplot and engine write(buffer,\ call GnuplotPut(nf,trim(buffer)//c_) write(buffer,\ call GnuplotPut(nf,trim(buffer)//c_)! Show/Export a plot if(StrurelPlotMode.eq.1.or.StrurelPlotMode.eq.3) then call GnuplotShow(nf) end if if(StrurelPlotMode.eq.2.or.StrurelPlotMode.eq.3) then StrurelPlotCount=StrurelPlotCount+1 write(buffer,\ call GnuplotExport(nf,trim(buffer)//c_) end if call GnuplotEnd() end if end do end ifend ifier=0!! Return value of export functionPlanarTruss=ac(8) ! vertical deflection u_y at bottom center (N04) end functionsubroutine MATNUL(x,m,n)!.....Zeroes matrix X(M,N)implicit real*8(a-h,o-z)dimension x(m*n)mn=m*ndo i=1,mn x(i)=0.end doreturnendsubroutine MATRAN(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)implicit real*8(a-h,o-z)dimension a(m,n),b(n,m)do j=1,n do i=1,m b(j,i)=a(i,j) end do

