Debian Codegraph @

packages/seacas/libraries/mapvarlib/intrpn.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,INTRPN
9 SUBROUTINE INTRPN(ICONA,SOLNA,IELPT,STRPT,
10 & SOLNB,NDLSTB,XB,YB,ZB,
11 & IDBLK,TIMES,INSUB,SN)
12
13 C ******************************************************************
14
15 C SUBROUTINE TO CONTROL INTERPOLATION OF NODAL RESULTS FROM MESH-A
16 C TO MESH-B
17 C INTERPOLATED SOLUTION IS WRITTEN TO MESH-C EXODUS FILE
18
19 C Calls subroutine SHAPEF, ININOD
20
21 C Called by MAPVAR
22
23 C ******************************************************************
24
25 C ICONA INT Connectivity of donor Mesh (1:nelnda,1:numeba)
26 C SOLNA REAL Nodal variables for donor mesh
27 C IELPT INT The element in donor mesh within which the point
28 C (node in recipient mesh) is found
29 C STRPT REAL The isoparametric coords of point in IELPT element
30 C SOLNB REAL Nodal variables for recipient mesh
31 C NDLSTB INT List of recipient mesh nodes in current element block
32 C SOLN REAL SOLNA vector local to each donor mesh element
33 C TIMES REAL Array of times - just passed through
34 C INSUB INT Number of times into subroutine for this element block
35 C 1-first time; >1-second,etc time;
36 C used to control mapping for many element blocks to one
37
38 C ******************************************************************
39
40 include 'amesh.blk'
41 include 'bmesh.blk'
42 include 'aexds1.blk'
43 include 'contrl.blk'
44 include 'ebbyeb.blk'
45 include 'ex2tp.blk'
46 include 'steps.blk'
47 include 'tapes.blk'
48 include 'varnpt.blk'
49
50 DIMENSION XB(*), YB(*), ZB(*), TIMES(*)
51 DIMENSION ICONA(NELNDA,*), SOLNA(NODESA,NVARNP)
52 DIMENSION SOLNB(NODESB,NVARNP), NDLSTB(*)
53 DIMENSION IELPT(*), STRPT(3,NODESB)
54 DIMENSION SOLN(27), SN(*)
55
56 C ******************************************************************
57
58 C set up time steps
59
60 IF (ISTEP .EQ. -1)THEN
61 NTM = NTIMES
62 ELSE
63 NTM = 1
64 END IF
65
66 DO 5 IST = 1, NTM
67 IF (ISTEP .EQ. -1)THEN
68 ISTP = IST
69 ELSE
70 ISTP = ISTEP
71 END IF
72
73 C Start interpolation
74
75 DO 10 IVAR = 1, NVARNP
76
77 C For IDEF = 2 do mesh annealing (used by GOMA); write out all
78 C displacements as zero.
79
80 IF (IDEF .EQ. 2 .AND. (IVAR .EQ. IXDIS .OR. IVAR .EQ. IYDIS
81 & .OR. IVAR .EQ. IZDIS))GO TO 10
82
83 C If first time into INTRPN for this element block, initialize
84 C else you are mapping many to one and retrieve partially mapped
85 C results from temporary storage in EXODUS
86
87 IF (INSUB .EQ. 1)THEN
88 CALL ININOD(SOLNB,IVAR,TIMES,ISTP,IDBLK,NDLSTB,XB,YB,ZB,
89 & SN)
90 ELSE
91 CALL EXGNV(NTP4EX,IST,IVAR,NODESB,SOLNB(1,IVAR),IERR)
92 END IF
93
94 C Get nodal results on donor mesh
95
96 CALL EXGNV(NTP2EX,ISTP,IVAR,NODESA,SOLNA(1,IVAR),IERR)
97
98 C Loop on nodes in recipient mesh
99
100 DO 30 I = 1,NUMNDB
101 NEL = IELPT(I)
102 IF (NEL .NE. 0) THEN
103
104 C Set parameters for element in donor mesh
105
106 S = STRPT(1,I)
107 T = STRPT(2,I)
108 R = 0.
109 IF (NDIMB.EQ.3) R = STRPT(3,I)
110 C NNODES = NNELM(ITYPE)
111 NNODES = NELNDA
112 IF (ITYPE .EQ. 6) NNODES = 4
113 DO 20 J = 1,NNODES
114 INODE = ICONA(J,NEL)
115 SOLN(J) = SOLNA(INODE,IVAR)
116 20 CONTINUE
117
118 C Shape function
119
120 CALL SHAPEF(ITYPE,S,T,R,SOLN,BVALUE)
121 SOLNB(NDLSTB(I),IVAR) = BVALUE
122 END IF
123 30 CONTINUE
124
125 C Save results, it doesn't matter if they are preliminary or final
126
127 CALL EXPNV(NTP4EX,IST,IVAR,NODESB,SOLNB(1,IVAR),IERR)
128
129 10 CONTINUE
130 5 CONTINUE
131
132 RETURN
133 END