| 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 FNDDIS (NAMECO, NAMENV, DEFOK, IXDEF, |
| 9 |
& IYDEF, IZDEF, DEFFAC, NAMLEN) |
| 10 |
C======================================================================= |
| 11 |
|
| 12 |
C --*** FNDDIS *** (MESH) Find displacement variables |
| 13 |
C -- Written by Amy Gilkey - revised 01/25/88 |
| 14 |
C -- |
| 15 |
C --FNDDIS finds the displacement variables. The first two/three nodal |
| 16 |
C --variables are displacement variables if and only if they begin with |
| 17 |
C --'D' and end with the last character of the corresponding coordinate |
| 18 |
C --name. |
| 19 |
C NAMING CONVENTION FOR DISPLACEMENT VARIABLES |
| 20 |
C FIRST OPTION |
| 21 |
C 1) The nodal variables must be the first two or three variables |
| 22 |
C in the nodal variable names list. |
| 23 |
C 2) Nodal variables must begin with a 'D' |
| 24 |
C 3) The last character of the nodal variable must be equal to |
| 25 |
C the last character in the coordinate name. |
| 26 |
C 4) The names of the displacement variables must be the same |
| 27 |
C except for the last character |
| 28 |
C SECOND OPTION |
| 29 |
C 1) The nodal variables must appear together in the nodal |
| 30 |
C variable names list. |
| 31 |
C 2) The nodal variables must begin with "DISP" |
| 32 |
C 3) The last character of the nodal variable must be equal to |
| 33 |
C the last character in the coordinate name. |
| 34 |
C 4) The names of the displacement variables must be the same |
| 35 |
C except for the last character |
| 36 |
C Sample of valid displacement variable names |
| 37 |
C Coordinate Name: X, Y, Z |
| 38 |
C Nodal Variable Names: DISPLX, DISPLY, DISPLZ |
| 39 |
C Note: Nodal variable names should be written with capital letters |
| 40 |
C -- |
| 41 |
C --Parameters: |
| 42 |
C -- NAMECO - IN - the coordinate names |
| 43 |
C -- NAMENV - IN - the nodal variable names |
| 44 |
C -- DEFOK - OUT - true iff the displacement variables were found |
| 45 |
C -- IXDEF - OUT - index of x displacement variable |
| 46 |
C -- IYDEF - OUT - index of y displacement variable |
| 47 |
C -- IZDEF - OUT - index of z displacement variable |
| 48 |
C -- DEFFAC - OUT - the default displacement magnification |
| 49 |
C -- |
| 50 |
C --Common Variables: |
| 51 |
C -- Uses NDIM, NVARNP, NSTEPW of /DBNUMS/ |
| 52 |
C -- Uses IS3DIM of /D3NUMS/ |
| 53 |
|
| 54 |
include 'params.blk' |
| 55 |
include 'dbnums.blk' |
| 56 |
include 'd3nums.blk' |
| 57 |
|
| 58 |
CHARACTER*(MXSTLN) NAMECO(*) |
| 59 |
CHARACTER*(NAMLEN) NAMENV(*) |
| 60 |
LOGICAL DEFOK |
| 61 |
|
| 62 |
CHARACTER CDUM |
| 63 |
CHARACTER*1024 STRING |
| 64 |
|
| 65 |
IF ((NSTEPW .GT. 0) .AND. (NVARNP .GE. NDIM)) THEN |
| 66 |
|
| 67 |
C --Locate displacement variables |
| 68 |
|
| 69 |
DEFOK = .TRUE. |
| 70 |
NDEF0 = 0 |
| 71 |
LN = MAX (LENSTR (NAMENV(1)), 2) |
| 72 |
DO 100 I = 1, NDIM |
| 73 |
LC = LENSTR (NAMECO(I)) |
| 74 |
C Check if first character is a 'D' |
| 75 |
C Check if all displacement names are the same other |
| 76 |
C than last character |
| 77 |
C Check if the last character in the displacement nodal variable |
| 78 |
C name is equal to the last character in the coordinate name. |
| 79 |
IF ((NAMENV(I)(1:1) .NE. 'D') |
| 80 |
& .OR. (NAMENV(I)(1:LN-1) .NE. NAMENV(1)(1:LN-1)) |
| 81 |
& .OR. (NAMENV(I)(LN:LN) .NE. NAMECO(I)(LC:LC))) |
| 82 |
& DEFOK = .FALSE. |
| 83 |
100 CONTINUE |
| 84 |
|
| 85 |
IF (.NOT. DEFOK) THEN |
| 86 |
DO 300 J = 2, NVARNP |
| 87 |
IF (LENSTR(NAMENV(J)) .GE. 5) THEN |
| 88 |
IF ((NAMENV(J)(1:4) .EQ. "DISP") |
| 89 |
& .AND. (J+NDIM-1 .LE. NVARNP)) THEN |
| 90 |
DEFOK = .TRUE. |
| 91 |
NDEF0 = J-1 |
| 92 |
LN = MAX (LENSTR (NAMENV(J)), 2) |
| 93 |
DO 200 I = 1, NDIM |
| 94 |
LC = LENSTR (NAMECO(I)) |
| 95 |
IF ((NAMENV(I+J-1)(1:4) .NE. "DISP") |
| 96 |
& .OR. (NAMENV(I+J-1)(1:LN-1) .NE. |
| 97 |
& NAMENV(J)(1:LN-1)) |
| 98 |
& .OR. (NAMENV(I+J-1)(LN:LN) .NE. |
| 99 |
& NAMECO(I)(LC:LC))) THEN |
| 100 |
DEFOK = .FALSE. |
| 101 |
ENDIF |
| 102 |
200 CONTINUE |
| 103 |
IF (DEFOK) THEN |
| 104 |
EXIT |
| 105 |
ENDIF |
| 106 |
ENDIF |
| 107 |
ENDIF |
| 108 |
300 CONTINUE |
| 109 |
ENDIF |
| 110 |
|
| 111 |
IF (DEFOK) THEN |
| 112 |
C find the index for the x displacement variable |
| 113 |
CALL DBVIX_BL ('N', NDEF0+1, IXDEF) |
| 114 |
C find the index for the y displacement variable |
| 115 |
CALL DBVIX_BL ('N', NDEF0+2, IYDEF) |
| 116 |
IF (IS3DIM) THEN |
| 117 |
C find the index for the z displacement variable |
| 118 |
CALL DBVIX_BL ('N', NDEF0+3, IZDEF) |
| 119 |
ELSE |
| 120 |
IZDEF = 0 |
| 121 |
END IF |
| 122 |
END IF |
| 123 |
|
| 124 |
ELSE |
| 125 |
C --If no time steps, no displacement variables |
| 126 |
DEFOK = .FALSE. |
| 127 |
END IF |
| 128 |
|
| 129 |
IF (.NOT. DEFOK) THEN |
| 130 |
WRITE (*, 10000) |
| 131 |
10000 FORMAT (/, |
| 132 |
& ' A valid set of displacement functions cannot be found.', / |
| 133 |
& ' Your mesh plots will not be deformed.') |
| 134 |
|
| 135 |
IXDEF = 0 |
| 136 |
IYDEF = 0 |
| 137 |
IZDEF = 0 |
| 138 |
|
| 139 |
DEFFAC = 0.0 |
| 140 |
|
| 141 |
ELSE |
| 142 |
|
| 143 |
WRITE (*, *) |
| 144 |
CALL DBVTYP_BL (IXDEF, CDUM, NXDEF) |
| 145 |
CALL DBVTYP_BL (IYDEF, CDUM, NYDEF) |
| 146 |
IF (.NOT. IS3DIM) THEN |
| 147 |
WRITE (STRING, '(10A)') 'Displacement variables are ', |
| 148 |
& NAMENV(NXDEF), ' ', NAMENV(NYDEF) |
| 149 |
ELSE |
| 150 |
CALL DBVTYP_BL (IZDEF, CDUM, NZDEF) |
| 151 |
WRITE (STRING, '(10A)') 'Displacement variables are ', |
| 152 |
& NAMENV(NXDEF), ' ', NAMENV(NYDEF), ' ', NAMENV(NZDEF) |
| 153 |
END IF |
| 154 |
CALL SQZSTR (STRING, LSTR) |
| 155 |
WRITE (*, 10010) STRING(:LSTR) |
| 156 |
10010 FORMAT (1X, 5A) |
| 157 |
|
| 158 |
DEFFAC = -999.0 |
| 159 |
END IF |
| 160 |
|
| 161 |
RETURN |
| 162 |
END |