1!$Id:$
2      subroutine pltelm(x,ie,ix,scale,nie,ndm,nen1,n1,n2)
3
4!      * * F E A P * * A Finite Element Analysis Program
5
6!....  Copyright (c) 1984-2017: Regents of the University of California
7!                               All rights reserved
8
9!-----[--+---------+---------+---------+---------+---------+---------+-]
10!      Purpose: Place element numbers on plots of mesh
11
12!      Inputs:
13!         x(ndm,*)  - Nodal coordinates of mesh
14!         ie(nie,*) - Assembly data for material sets
15!         ix(nen1,*)- Element nodal connections
16!         scale     - Plot scale factor
17!         nie       - Dimension of ie array
18!         ndm       - Dimension of x array
19!         nen1      - Dimension of ix array
20!         n1        - First element number to display
21!         n2        - Last element number to display
22
23!      Outputs:
24!         none      - Plot outputs to screen/file
25!-----[--+---------+---------+---------+---------+---------+---------+-]
26
27      implicit  none
28
29      include  'pbody.h'
30      include  'pdata2.h'
31      include  'pdata4.h'
32      include  'plflag.h'
33
34      logical   zoom
35      integer   nie,ndm,nen1, i,j,n,ii,jj,nn,ma,nd, n1,n2, iplt(30)
36      real*8    scale,dx1
37
38      integer   ie(nie,*),ix(nen1,*)
39      real*8    x(ndm,*),xx(3)
40
41      save
42
43!     Write element labels
44
45      dx1 = .005d0/scale
46      nd = 5
47      do n = n1,n2
48        ma = ix(nen1,n)
49        if(ix(nen1-1,n).ge.0 .and. ma.gt.0 .and.
50     &            (maplt.eq.0 .or. ma.eq.maplt)) then
51          xx(1) = 0.0d0
52          xx(2) = 0.0d0
53          xx(3) = 0.0d0
54          jj = 0
55          call pltord(ix(1,n),ie(nie-1,ma), nn,iplt)
56          nn = max(1,nn-1)
57          do i = 1,nn
58            j  = iplt(i)
59            ii = ix(j,n)
60            if(ii.gt.0) then
61              jj = jj + 1
62              xx(1) = xx(1) + x(1,ii)
63              if(ndm.ge.2) xx(2) = xx(2) + x(2,ii)
64              if(ndm.ge.3) xx(3) = xx(3) + x(3,ii)
65            endif
66          end do
67          if(jj.gt.0) then
68            xx(1) = xx(1)/jj
69            xx(2) = xx(2)/jj
70            xx(3) = xx(3)/jj
71            if(zoom(xx(1),ndm)) then
72              call plotl(xx(1)-dx1*nd,xx(2)-dx1,xx(3),3)
73              if(clip) call plabl(n)
74            endif
75          endif
76        endif
77      end do
78
79      end
80