Debian Codegraph @

packages/seacas/applications/blot/fixal3.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 SUBROUTINE FIXAL3 (ALIVE, LENF, IF2EL, IF2EL2, IE2ELB, NEWELB)
9 C=======================================================================
10
11 C --*** FIXAL3 *** (MESH) Adjust for element birth/death (3D)
12 C -- Written by Amy Gilkey - revised 03/10/88
13 C --
14 C --FIXAL3 adjusts the face array to reflect the new element
15 C --states. Faces that are dead are moved to LENF(NELBLK+2).
16 C --
17 C --An element death causes all the faces of the element to be moved
18 C --as follows:
19 C -- Surface -> dead
20 C -- Interior -> surface
21 C --An element birth causes all the faces of the element to be moved
22 C --as follows:
23 C -- Dead -> surface (if one alive element for face) or
24 C -- interior (if two alive elements)
25 C -- Surface -> interior
26 C --
27 C --Parameters:
28 C -- ALIVE - IN - true iff element i is alive
29 C -- LENF - IN - the cumulative face counts by element block
30 C -- IF2EL - IN - the element number of each face
31 C -- IF2EL2 - IN - the secondary element number of each face
32 C -- IE2ELB - IN - the element block for each element
33 C -- NEWELB - OUT - size = LENF(NELBLK+1)
34 C --
35 C --Common Variables:
36 C -- Uses NELBLK of /DBNUMS/
37
38 include 'dbnums.blk'
39 include 'd3nums.blk'
40
41 LOGICAL ALIVE(NUMEL)
42 INTEGER LENF(0:NELBLK+2)
43 INTEGER IF2EL(*), IF2EL2(*)
44 INTEGER IE2ELB(NUMEL)
45 INTEGER NEWELB(*)
46
47 C --Check each face by its defining elements, and move face if necessary
48
49 DO 110 IELB = 1, NELBLK+2
50 DO 100 IFAC = LENF(IELB-1)+1, LENF(IELB)
51
52 C --Determine the number of elements which are alive for this face
53
54 NALIVE = 0
55 IF (ALIVE(IF2EL(IFAC))) NALIVE = NALIVE + 1
56 IEL = IF2EL2(IFAC)
57 IF (IEL .GT. 0) THEN
58 IF (ALIVE(IEL)) NALIVE = NALIVE + 1
59 END IF
60
61 IF (NALIVE .EQ. 0) THEN
62
63 C --If none alive, change to a DEAD face
64 NEWELB(IFAC) = NELBLK+2
65
66 ELSE IF (NALIVE .EQ. 1) THEN
67
68 C --If only one alive, change to a SURFACE face
69
70 IF (ALIVE(IF2EL(IFAC))) THEN
71 NEWELB(IFAC) = IE2ELB(IF2EL(IFAC))
72 ELSE
73 C --Swap nodes to simulate surface being defined by facing element
74 NEWELB(IFAC) = - IE2ELB(IF2EL2(IFAC))
75 END IF
76
77 ELSE IF (NALIVE .EQ. 2) THEN
78
79 C --If both elements are alive, change to an INTERIOR face
80 NEWELB(IFAC) = NELBLK+1
81
82 END IF
83
84 100 CONTINUE
85 110 CONTINUE
86
87 RETURN
88 END