Page 10 - Demo
P. 10


                                    Planar Truss Examplefor ComrelAdd-onRCPConsult, 2023-2025Page 10title=\if(StrurelMode.eq.0)then! 0 initial deterministic statestate=\else! 2 final stochastic solutionstate=\endif! Set of 3 plotsdonp=1,3! Number of figureif(StrurelMode.eq.0)n=1nf=np*2n! Initialize an Gnuplot environmentInit=GnuplotInit()if(Init)then! Create an output windowcallGnuplotWindowRelative(nf,40,40,.TRUE.)! Set a titlecallGnuplotWindowTitle(nf,trim(title)//c_)write(buffer,\',a,'''')\trim(title),trim(state);callGnuplotPut(nf,trim(buffer)//c_)! Define range for axeswrite(buffer,\wo,we;callGnuplotPut(nf,trim(buffer)//c_)write(buffer,\ho,he;callGnuplotPut(nf,trim(buffer)//c_)callGnuplotPut(nf,\1\_)callGnuplotPut(nf,\_)! Plot a main subtitle of plotwrite(buffer,\&trim(StrurelName),trim(StrurelModule),trim(StrurelVersion);callGnuplotPut(nf,trim(buffer)//c_)if(StrurelMode.eq.0)then! Input data at state of mean valuescallGnuplotPut(nf,\_)else! Final data of stochastic solutionwrite(buffer,\&trim(StrurelIMET),trim(StrurelIOPT);callGnuplotPut(nf,trim(buffer)//c_)write(buffer,\&StrurelBeta,StrurelPf;callGnuplotPut(nf,trim(buffer)//c_)endifselectcase(np)case(1)!! plot set #1! Set a main subtitle of plotcallGnuplotPut(nf,\_)! Plot initial state of trusssc=2.d0don=1,nfev(1,1)=XY(1,IEN(1,n));v(2,1)=XY(2,IEN(1,n))v(1,2)=XY(1,IEN(2,n));v(2,2)=XY(2,IEN(2,n))! blue color for initial statecallGnuplotPlotData(nf,\_,v,2,2)! rod number in the middle of rod lengthwrite(buffer,\&n,(v(1,1)+v(1,2))/2,(v(2,1)+v(2,2))/2;callGnuplotPut(nf,trim(buffer)//c_)! red color for deformed statev(1,1)=v(1,1)+ac(IEN(1,n)*ned-1)*scv(2,1)=v(2,1)+ac(IEN(1,n)*ned )*scv(1,2)=v(1,2)+ac(IEN(2,n)*ned-1)*scv(2,2)=v(2,2)+ac(IEN(2,n)*ned )*sccallGnuplotPlotData(nf,\_,v,2,2)enddo! nodal numbersdoi=1,nnpwrite(buffer,\&i,XY(1,i),XY(2,i);callGnuplotPut(nf,trim(buffer)//c_)enddo! Forces with scale factor 0.000025callMATNUL(fp,ned,nnp)doi=8,nnpfp(2,i)=P(i-7)*0.000025v(1,1)=XY(1,i);v(2,1)=XY(2,i)+fp(2,i)v(1,2)=0.d0;v(2,2)=fp(2,i)! Single vectorcallGnuplotPlotData(nf,\_,v,4,1)! Force valuewrite(buffer,\&i7,fp(2,i)*40000.d0,XY(1,i)+0.1d0,XY(2,i)+fp(2,i);callGnuplotPut(nf,trim(buffer)//c_)enddo! Value of vertical deflection in node N04write(buffer,\&ac(8),XY(1,4),XY(2,4)+ac(8)*5.d0;callGnuplotPut(nf,trim(buffer)//c_)case(2)!! plot set #2! Set a main subtitle of plotcallGnuplotPut(nf,\_)! Plot internal member force Ndon=1,nfel1=leng(n)/2.d0! length of rectanglel2=dabs(NN(n))*0.0000005d0! 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,nbdXYrot(1,i)=X(i)*cY(i)*s+xcXYrot(2,i)=X(i)*s+Y(i)*c+ycenddo! Need to be closedXYrot(1,nbd+1)=XYrot(1,1)XYrot(2,nbd+1)=XYrot(2,1)! Color of polygonif(NN(n).gt.0.d0)thenco=\elseco=\endifwrite(buffer,\ notitle')\cocallGnuplotPlotData(nf,trim(buffer)//c_,XYrot,ned,nbd+1)
                                
   4   5   6   7   8   9   10   11   12   13   14