Debian Codegraph @

packages/seacas/libraries/mapvarlib/seton0.f

raw
1 C Copyright(C) 1999-2020 National Technology & Engineering Solutions
2 C of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
3 C NTESS, the U.S. Government retains certain rights in this software.
4 C
5 C See packages/seacas/LICENSE for details
6
7 C========================================================================
8 * DECK, SETON0
9 SUBROUTINE SETON0(ICONA,NELTN,SOLEA,SOLENA,IDBLK,XA,YA,ZA,ISTP,
10 & ITT,iblk)
11 C
12 C *********************************************************************
13 C
14 C Subroutine SETON0 extracts nodal values of shell element variables by
15 C looping over each element and summing the value of the variable
16 C in that element to each node in the connectivity list for that
17 C element. Then the nodal summation of element variables is divided
18 C by the number of elements that contributed to that node (resulting
19 C in a nodal average of the element value.) This is done for the old
20 C mesh elements and nodes to facilitate interpolation.
21 C
22 C Each element block must be processed independently in order to
23 C avoid averaging element variables across material boundaries.
24 C Note: the last set of DO loops acts over all nodes; to make sense
25 C one element block must be completely processed before another
26 C element block is sent into this subroutine.
27 C
28 C Calls subroutine VOL
29 C
30 c Called by MAPVAR
31 C
32 C *********************************************************************
33 C
34 C ICONA mesh-A connectivity (1:nelnda,1:numeba)
35 C NELTN number of elements tied to each node (1:nodesa)
36 C SOLEA element variables (1:numeba,1:nvarel)
37 C SOLENA element variables at nodes (1:nodesa,1:nvarel)
38 C IDBLK current element block I.D.
39 C XA,YA,ZA coordinates
40 C XX,YY,ZZ vector of coordinates of nodes for an element
41 C ISTP current time step
42 C ITT truth table
43 C iblk element block being processed (not ID)
44 C
45 C *********************************************************************
46 C
47 include 'aexds1.blk'
48 include 'aexds2.blk'
49 include 'amesh.blk'
50 include 'ebbyeb.blk'
51 include 'ex2tp.blk'
52 include 'tapes.blk'
53 C
54 DIMENSION ICONA(NELNDA,*), NELTN(*)
55 DIMENSION SOLEA(NUMEBA,*), SOLENA(NODESA,NVAREL), ITT(NVAREL,*)
56 DIMENSION XA(*), YA(*), ZA(*), XX(27), YY(27), ZZ(27)
57 C
58 C *********************************************************************
59 C
60 NNODES = 4
61 DO I = 1, NODESA
62 NELTN(I) = 0
63 DO J = 1, NVAREL
64 SOLENA(I,J) = 0.
65 end do
66 end do
67 C
68 DO NEL = 1, NUMEBA
69 DO I = 1, NNODES
70 C
71 C number of elements associated with each node - used for
72 C computing an average later on
73 C
74 NELTN(ICONA(I,NEL)) = NELTN(ICONA(I,NEL)) + 1
75 end do
76 end do
77 C
78 DO IVAR = 1, NVAREL
79 IF (ITT(IVAR,iblk) .EQ. 0)GO TO 40
80 CALL EXGEV(NTP2EX,ISTP,IVAR,IDBLK,NUMEBA,SOLEA(1,IVAR),IERR)
81 C
82 IF (NAMVAR(nvargp+IVAR)(1:6) .EQ. 'ELMASS') THEN
83 C
84 C replace element mass with nodal density for interpolation
85 C
86 DO IEL = 1, NUMEBA
87 DO I = 1, NNODES
88 XX(I) = XA(ICONA(I,IEL))
89 YY(I) = YA(ICONA(I,IEL))
90 ZZ(I) = ZA(ICONA(I,IEL))
91 end do
92 CALL VOL(ITYPE,XX,YY,ZZ,VOLUME)
93 SOLEA(IEL,IVAR) = SOLEA(IEL,IVAR) / VOLUME
94 end do
95 END IF
96 C
97 C accumulate element variables to nodes
98 C
99 DO NEL = 1, NUMEBA
100 DO I = 1, NNODES
101 SOLENA(ICONA(I,NEL),IVAR) =
102 & SOLENA(ICONA(I,NEL),IVAR) + SOLEA(NEL,IVAR)
103 end do
104 end do
105 C
106 C divide by number of elements contributing to each node (average)
107 C
108 DO I = 1, NODESA
109 IF(NELTN(I) .NE. 0)THEN
110 SOLENA(I,IVAR) = SOLENA(I,IVAR) / dble(NELTN(I))
111 END IF
112 end do
113 40 CONTINUE
114 end do
115 RETURN
116 END