| 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, |
| 9 |
& DEFOK, NDIM, NVARNP, IXDEF, IYDEF, IZDEF) |
| 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 -- |
| 20 |
C --Parameters: |
| 21 |
C -- NAMECO - IN - the coordinate names |
| 22 |
C -- NAMENV - IN - the nodal variable names |
| 23 |
C -- DEFOK - OUT - true iff the displacement variables were found |
| 24 |
C -- NDIM - IN - number of dimensions |
| 25 |
C -- NVARNP - IN - number of nodal variables |
| 26 |
C -- IXDEF, IYDEF, IZDEF - OUT - the indices of the displacement variables |
| 27 |
C -- |
| 28 |
|
| 29 |
LOGICAL IS3DIM |
| 30 |
|
| 31 |
include 'exodusII.inc' |
| 32 |
CHARACTER*(MXSTLN) NAMECO(NDIM) |
| 33 |
CHARACTER*(MXSTLN) NAMENV(NVARNP) |
| 34 |
LOGICAL DEFOK |
| 35 |
|
| 36 |
C ... Size of this string must be large enough to hold 3 names plus other info |
| 37 |
C See print near bottom. |
| 38 |
CHARACTER*400 STRING |
| 39 |
|
| 40 |
IS3DIM = (NDIM .EQ. 3) |
| 41 |
|
| 42 |
IF (NVARNP .GE. NDIM) THEN |
| 43 |
|
| 44 |
C --Locate displacement variables |
| 45 |
|
| 46 |
DEFOK = .TRUE. |
| 47 |
NDEF0 = 0 |
| 48 |
LN = MAX (LENSTR (NAMENV(1)), 2) |
| 49 |
DO 100 I = 1, NDIM |
| 50 |
LC = LENSTR (NAMECO(I)) |
| 51 |
IF ((NAMENV(I)(1:1) .NE. 'D') |
| 52 |
& .OR. (NAMENV(I)(1:LN-1) .NE. NAMENV(1)(1:LN-1)) |
| 53 |
& .OR. (NAMENV(I)(LN:LN) .NE. NAMECO(I)(LC:LC))) |
| 54 |
& DEFOK = .FALSE. |
| 55 |
100 CONTINUE |
| 56 |
|
| 57 |
IF (DEFOK) THEN |
| 58 |
ixdef = ndef0 + 1 |
| 59 |
iydef = ndef0 + 2 |
| 60 |
izdef = ndef0 + 3 |
| 61 |
END IF |
| 62 |
|
| 63 |
ELSE |
| 64 |
C --If not at least NDIM vars, no displacement variables |
| 65 |
DEFOK = .FALSE. |
| 66 |
END IF |
| 67 |
|
| 68 |
IF (.NOT. DEFOK) THEN |
| 69 |
WRITE (*, 10000) |
| 70 |
10000 FORMAT (/, |
| 71 |
& ' A valid set of displacement functions cannot be found.', / |
| 72 |
& ' Your mesh plots will not be deformed.') |
| 73 |
|
| 74 |
IXDEF = 0 |
| 75 |
IYDEF = 0 |
| 76 |
IZDEF = 0 |
| 77 |
|
| 78 |
ELSE |
| 79 |
|
| 80 |
WRITE (*, *) |
| 81 |
IF (.NOT. IS3DIM) THEN |
| 82 |
WRITE (STRING, '(10A)') 'Displacement variables are ', |
| 83 |
& NAMENV(IXDEF), ' ', NAMENV(IYDEF) |
| 84 |
ELSE |
| 85 |
WRITE (STRING, '(10A)') 'Displacement variables are ', |
| 86 |
& NAMENV(IXDEF), ' ', NAMENV(IYDEF), ' ', NAMENV(IZDEF) |
| 87 |
END IF |
| 88 |
CALL SQZSTR (STRING, LSTR) |
| 89 |
WRITE (*, 10010) STRING(:LSTR) |
| 90 |
10010 FORMAT (1X, 5A) |
| 91 |
|
| 92 |
END IF |
| 93 |
|
| 94 |
RETURN |
| 95 |
END |