Page 5 - Demo
P. 5
Planar Truss Example for Comrel Add-on RCP Consult, 2023-2026 Page 5 do i=1,nbd NN(n)=NN(n)+keT(i)*de(i) end do end do!!* Visualization if(StrurelPlot) then if(StrurelMode.eq.0.or.StrurelMode.eq.2) then! Local variables: width, heigth, ouput window number, etc. wo=-2.d0; we=26.d0; ho=-2.d0; he=10.d0 title=\ if(StrurelMode.eq.0) then ! 0 - initial deterministic state state=\ else ! 2 - final stochastic solution state=\ end if! Set of 3 plots do np=1,3! Number of figure if(StrurelMode.eq.0) n=1 nf=np*2-n! Initialize an Gnuplot environment Init=GnuplotInit() if(Init) then! Create an output window call GnuplotWindowRelative(nf,40,40,.TRUE.)! Set a title call GnuplotWindowTitle(nf,trim(title)//c_) write(buffer,\ * trim(title),trim(state) call GnuplotPut(nf,trim(buffer)//c_)! Define range for axes write(buffer,\ call GnuplotPut(nf,trim(buffer)//c_) write(buffer,\ call GnuplotPut(nf,trim(buffer)//c_) call GnuplotPut(nf,\ call GnuplotPut(nf,\! Plot a main subtitle of plot write(buffer,\ * \ * trim(StrurelName),trim(StrurelModule),trim(StrurelVersion) call GnuplotPut(nf,trim(buffer)//c_) if(StrurelMode.eq.0) then! Input data at state of mean values call GnuplotPut(nf,\ * \ else! Final data of stochastic solution write(buffer,\ * \ * trim(StrurelIMET),trim(StrurelIOPT) call GnuplotPut(nf,trim(buffer)//c_) write(buffer,\ * \ * \ * StrurelBeta,StrurelPf call GnuplotPut(nf,trim(buffer)//c_) end if select case(np) case(1) !! plot set #1! Set a main subtitle of plot call GnuplotPut(nf,\ * \! Plot initial state of truss sc=2.d0 do n=1,nfe v(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 state call GnuplotPlotData(nf, * \ * v,2,2)! Rod number in the middle of rod length write(buffer, \ * \ * n,(v(1,1)+v(1,2))/2,(v(2,1)+v(2,2))/2 call GnuplotPut(nf,trim(buffer)//c_)! Red color for deformed state v(1,1)=v(1,1)+ac(IEN(1,n)*ned-1)*sc v(2,1)=v(2,1)+ac(IEN(1,n)*ned )*sc v(1,2)=v(1,2)+ac(IEN(2,n)*ned-1)*sc v(2,2)=v(2,2)+ac(IEN(2,n)*ned )*sc call GnuplotPlotData(nf, * \ * v,2,2) end do! Nodal numbers do i=1,nnp write(buffer,\ * \ * i,XY(1,i),XY(2,i) call GnuplotPut(nf,trim(buffer)//c_) end do! Forces with scale factor 0.000025 call MATNUL(fp,ned,nnp) do i=8,nnp fp(2,i)=P(i-7)*0.000025 v(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 vector call GnuplotPlotData(nf, * \ * \! Force value write(buffer,\ * \ * i-7,fp(2,i)*40000.d0,XY(1,i)+0.1d0,XY(2,i)+fp(2,i) call GnuplotPut(nf,trim(buffer)//c_) end do

