Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FaceVector.F90
Go to the documentation of this file.
1 ! *********************************************************************
2 ! * Rocstar Simulation Suite *
3 ! * Copyright@2015, Illinois Rocstar LLC. All rights reserved. *
4 ! * *
5 ! * Illinois Rocstar LLC *
6 ! * Champaign, IL *
7 ! * www.illinoisrocstar.com *
8 ! * sales@illinoisrocstar.com *
9 ! * *
10 ! * License: See LICENSE file in top level of distribution package or *
11 ! * http://opensource.org/licenses/NCSA *
12 ! *********************************************************************
13 ! *********************************************************************
14 ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *
15 ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES *
16 ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND *
17 ! * NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR *
18 ! * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
19 ! * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
20 ! * Arising FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
21 ! * USE OR OTHER DEALINGS WITH THE SOFTWARE. *
22 ! *********************************************************************
23 !******************************************************************************
24 !
25 ! Purpose: calculate the face vector of a polygon.
26 !
27 ! Description: file contains the following subroutines:
28 !
29 ! - faceVectorTria = triangle
30 ! - FaceVectorQuad = quadrilateral
31 !
32 ! Input: xyzNodes = coordinates (1st index) of the nodes (2nd index) of the
33 ! polygon (clockwise ordered).
34 !
35 ! Output: fVecX, fVecY, fVecZ = x-,y-,z-component of the face vector.
36 !
37 ! Notes: Gauss formula is used to calculate the face vector. The coordinates
38 ! should be ordered clockwise (when looking from inside the volume) to
39 ! obtain an outward facing vector.
40 !
41 !******************************************************************************
42 !
43 ! $Id: FaceVector.F90,v 1.3 2008/12/06 08:44:09 mtcampbe Exp $
44 !
45 ! Copyright: (c) 2001 by the University of Illinois
46 !
47 !******************************************************************************
48 
49 SUBROUTINE facevectortria( xyzNodes,fVecX,fVecY,fVecZ )
50 
51  USE moddatatypes
52  IMPLICIT NONE
53 
54 ! ... parameters
55  REAL(RFREAL) :: xyznodes(3,3)
56  REAL(RFREAL) :: fvecx, fvecy, fvecz
57 
58 ! ... local variables
59  REAL(RFREAL) :: dxa,dxb,dya,dyb,dza,dzb
60 
61 !******************************************************************************
62 
63  dxa = xyznodes(1,1) - xyznodes(1,2)
64  dya = xyznodes(2,1) - xyznodes(2,2)
65  dza = xyznodes(3,1) - xyznodes(3,2)
66 
67  dxb = xyznodes(1,1) - xyznodes(1,3)
68  dyb = xyznodes(2,1) - xyznodes(2,3)
69  dzb = xyznodes(3,1) - xyznodes(3,3)
70 
71  fvecx = 0.5_rfreal*(dya*dzb - dyb*dza)
72  fvecy = -0.5_rfreal*(dxa*dzb - dxb*dza)
73  fvecz = 0.5_rfreal*(dxa*dyb - dxb*dya)
74 
75 END SUBROUTINE facevectortria
76 
77 ! #############################################################################
78 ! #############################################################################
79 
80 SUBROUTINE facevectorquad( xyzNodes,fVecX,fVecY,fVecZ )
81 
82  USE moddatatypes
83  IMPLICIT NONE
84 
85 ! ... parameters
86  REAL(RFREAL) :: xyznodes(3,4)
87  REAL(RFREAL) :: fvecx, fvecy, fvecz
88 
89 ! ... local variables
90  REAL(RFREAL) :: dxa, dya, dza, dxb, dyb, dzb
91 
92 !******************************************************************************
93 
94  dxa = xyznodes(1,3) - xyznodes(1,1)
95  dya = xyznodes(2,3) - xyznodes(2,1)
96  dza = xyznodes(3,3) - xyznodes(3,1)
97 
98  dxb = xyznodes(1,2) - xyznodes(1,4)
99  dyb = xyznodes(2,2) - xyznodes(2,4)
100  dzb = xyznodes(3,2) - xyznodes(3,4)
101 
102  fvecx = 0.5_rfreal*(dza*dyb-dya*dzb)
103  fvecy = 0.5_rfreal*(dxa*dzb-dza*dxb)
104  fvecz = 0.5_rfreal*(dya*dxb-dxa*dyb)
105 
106 END SUBROUTINE facevectorquad
107 
108 !******************************************************************************
109 !
110 ! RCS Revision history:
111 !
112 ! $Log: FaceVector.F90,v $
113 ! Revision 1.3 2008/12/06 08:44:09 mtcampbe
114 ! Updated license.
115 !
116 ! Revision 1.2 2008/11/19 22:17:22 mtcampbe
117 ! Added Illinois Open Source License/Copyright
118 !
119 ! Revision 1.1 2004/12/01 16:48:34 haselbac
120 ! Initial revision after changing case
121 !
122 ! Revision 1.2 2003/03/27 14:28:47 haselbac
123 ! Substantially simplified faceVectorTria
124 !
125 ! Revision 1.1 2002/01/08 22:09:16 jblazek
126 ! Added calculation of face vectors and volumes.
127 !
128 !******************************************************************************
129 
130 
131 
132 
133 
134 
subroutine facevectortria(xyzNodes, fVecX, fVecY, fVecZ)
Definition: FaceVector.F90:49
subroutine facevectorquad(xyzNodes, fVecX, fVecY, fVecZ)
Definition: FaceVector.F90:80