| 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 SCAL3D (MSCTYP, ROTMAT, ROTCEN, ALMESH, D2MESH) |
| 9 |
C======================================================================= |
| 10 |
|
| 11 |
C --*** SCAL3D *** (MESH) Find the 2D limits of a 3D mesh |
| 12 |
C -- Written by Amy Gilkey - revised 06/30/86 |
| 13 |
C -- |
| 14 |
C --SCAL3D takes the mesh limits and scales them in one of two ways: |
| 15 |
C -- 1) it finds the 2D limits enclosing the smallest sphere enclosing |
| 16 |
C -- a cube from the maximum 3D limits |
| 17 |
C -- 2) it finds the 2D limits of the rotated mesh |
| 18 |
C --The mesh limits are expanded a little. |
| 19 |
C -- |
| 20 |
C --Parameters: |
| 21 |
C -- MSCTYP - IN - mesh scaling flag (as in /MSHLIM/) |
| 22 |
C -- ROTMAT - IN - the rotation matrix |
| 23 |
C -- ROTCEN - IN - the mesh center for the rotation |
| 24 |
C -- ALMESH - IN - the mesh limits |
| 25 |
C -- D2MESH - OUT - the 2D rotated mesh limits |
| 26 |
|
| 27 |
PARAMETER (KLFT=1, KRGT=2, KBOT=3, KTOP=4, KNEA=5, KFAR=6) |
| 28 |
|
| 29 |
CHARACTER*(*) MSCTYP |
| 30 |
REAL ROTMAT(3,3), ROTCEN(3) |
| 31 |
REAL ALMESH(KFAR), D2MESH(KTOP) |
| 32 |
|
| 33 |
IF (MSCTYP .EQ. 'ALL') THEN |
| 34 |
RMAX = MAX (ALMESH(KRGT)-ROTCEN(1), ROTCEN(1)-ALMESH(KLFT) |
| 35 |
& , ALMESH(KTOP)-ROTCEN(2), ROTCEN(2)-ALMESH(KBOT) |
| 36 |
& , ALMESH(KFAR)-ROTCEN(3), ROTCEN(3)-ALMESH(KNEA)) |
| 37 |
RAD = SQRT(3.0) * RMAX |
| 38 |
D2MESH(KLFT) = - RAD |
| 39 |
D2MESH(KRGT) = + RAD |
| 40 |
D2MESH(KBOT) = - RAD |
| 41 |
D2MESH(KTOP) = + RAD |
| 42 |
|
| 43 |
ELSE |
| 44 |
CALL BL_ROTATE (1, 1, ROTMAT, ROTCEN, |
| 45 |
& ALMESH(KLFT), ALMESH(KBOT), ALMESH(KNEA), X1, Y1, RDUM) |
| 46 |
CALL BL_ROTATE (1, 1, ROTMAT, ROTCEN, |
| 47 |
& ALMESH(KRGT), ALMESH(KTOP), ALMESH(KFAR), X2, Y2, RDUM) |
| 48 |
D2MESH(KLFT) = MIN (X1, X2) |
| 49 |
D2MESH(KRGT) = MAX (X1, X2) |
| 50 |
D2MESH(KBOT) = MIN (Y1, Y2) |
| 51 |
D2MESH(KTOP) = MAX (Y1, Y2) |
| 52 |
END IF |
| 53 |
|
| 54 |
CALL EXPLIM (2, D2MESH, D2MESH) |
| 55 |
|
| 56 |
RETURN |
| 57 |
END |