Debian Codegraph @

packages/seacas/applications/blot/unrot.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 UNROT (NUM, NPROT, ROTMAT, ROTCEN,
9 & HZ, VT, PD, XN, YN, ZN)
10 C=======================================================================
11
12 C --*** UNROT *** (MESH) "Unrotate" 3D coordinates
13 C -- Written by Amy Gilkey - revised 07/08/86
14 C --
15 C --UNROT returns the original coordinates from the rotated coordinates.
16 C --It multiplies by the inverse of the rotation matrix and adds the
17 C --rotation center.
18 C --
19 C --Parameters:
20 C -- NUM - IN - the number of nodes to rotate
21 C -- NPROT - IN - the node numbers of the nodes to rotate
22 C -- ROTMAT - IN - the rotation matrix
23 C -- ROTCEN - IN - the center of the rotation
24 C -- HZ, VT, PD - IN - the rotated nodal coordinates
25 C -- XN, YN, ZN - OUT - the original nodal coordinates
26
27 INTEGER NPROT(NUM)
28 REAL ROTMAT(3,3), ROTCEN(3)
29 REAL HZ(*), VT(*), PD(*)
30 REAL XN(*), YN(*), ZN(*)
31
32 DO 100 IX = 1, NUM
33 INP = NPROT(IX)
34 X = HZ(INP)
35 Y = VT(INP)
36 Z = PD(INP)
37 XN(INP) = X*ROTMAT(1,1) + Y*ROTMAT(1,2) + Z*ROTMAT(1,3)
38 YN(INP) = X*ROTMAT(2,1) + Y*ROTMAT(2,2) + Z*ROTMAT(2,3)
39 ZN(INP) = X*ROTMAT(3,1) + Y*ROTMAT(3,2) + Z*ROTMAT(3,3)
40 XN(INP) = XN(INP) + ROTCEN(1)
41 YN(INP) = YN(INP) + ROTCEN(2)
42 ZN(INP) = ZN(INP) + ROTCEN(3)
43 100 CONTINUE
44
45 RETURN
46 END