subroutine plotv(v,s,sp,etot,eplas,ecreep,t,m,nn,layer,ndi0, * nshear0,jpltcd) c* * * * * * c c select a variable contour plotting (user subroutine). c c v variable c t current temperature c m(1) user element number c m(2) internal element number c nn integration point number c layer layer number c ndi number of direct stress components c nshear number of shear stress components c jpltcd the absolute value of the user entered code c c* * * * * * c c This routine computes and outputs: c c - total electrical power of the domain c - total current flowing through the domain c - total impedance of the domain under fixed voltage c C for Electro-Static analyses. c c The domain is composed of elements numbered from 1 to numel. c If a part of the domain needs to be excluded in above calculation, c one can use a if-statement to exclude this group of elements. c c The post code assigned by the user in Mentat is as: c c - 1 for electrical power c - 2 for total current c - 3 for total impedance c c The numerical value for the calculated variables are printed c out in file:fort.9 c c c Andrew Chen c Nov. 21, 1997 c c* * * * * * c implicit real*8 (a-h,o-z) dp dimension s(1),etot(1),eplas(1),ecreep(1),sp(1),m(2) include '../common/dimen' include '../common/elmcom' include '../common/nzro1' include '../common/strnen' c include '../common/far' c include '../common/lass' include '../common/arrays' include '../common/array2' include '../common/space' include '../common/concom' if (m(1).eq.1.and.nn.eq.1) then c c electric power c power = 0.0 potlow = 0.0 pothigh = 0.0 do i = 1, numel lofr = (i-1)*nelstr la2 = ijacoc + lofr do j =1, nstres call elmvar(130,i,j,layer,pot) call elmvar(131,i,j,layer,ex) call elmvar(132,i,j,layer,ey) call elmvar(133,i,j,layer,ez) call elmvar(134,i,j,layer,cx) call elmvar(135,i,j,layer,cy) call elmvar(136,i,j,layer,cz) ajacob = vars(la2 + j -1) power = power + ex*cx+ey*cy+ez*cz*ajacob if(pot.gt.pothigh) pothigh = pot if(pot.lt.potlow) potlow = pot enddo enddo c c total current of the domain c voltage = pothigh - potlow if(abs(voltage).le.1.0e-6) then current = 0.0 else current = power/voltage endif c c total impedence of the system c if(abs(current).le.1.0e-6) then resist = 0.0 else resist = voltage/current endif write(9,*) 'total power = ', power write(9,*) 'total current = ', current write(9,*) 'total impedance = ', resist endif if(jpltcd .eq. 1) then v = power else if(jpltcd.eq.2) then v = current else if(jpltcd.eq.3) then v = resist endif return end