Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CellCentroid.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 centroid of a cell.
26 !
27 ! Description: file contains the following subroutines:
28 !
29 ! - CentroidTetra = tetrahedron
30 ! - CentroidPyramid = pyramid
31 ! - CentroidPrism = prism
32 ! - CentroidHexa = hexahedra
33 !
34 ! Input: xyzNodes = coordinates (1st index) of the nodes (2nd index) of the
35 ! control volume (must be ordered!).
36 !
37 ! Output: cofgX,cofgY,cofgZ = x-,y-,z-coordinate of the centroid.
38 !
39 ! Notes: none.
40 !
41 !******************************************************************************
42 !
43 ! $Id: CellCentroid.F90,v 1.3 2008/12/06 08:44:08 mtcampbe Exp $
44 !
45 ! Copyright: (c) 2001 by the University of Illinois
46 !
47 !******************************************************************************
48 
49 SUBROUTINE centroidtetra( xyzNodes,cofgX,cofgY,cofgZ )
50 
51  USE moddatatypes
52  IMPLICIT NONE
53 
54 ! ... parameters
55  REAL(RFREAL) :: xyznodes(3,4)
56  REAL(RFREAL) :: cofgx, cofgy, cofgz
57 
58 ! ... local variables
59 
60 
61 !******************************************************************************
62 
63 END SUBROUTINE centroidtetra
64 
65 ! #############################################################################
66 ! #############################################################################
67 
68 SUBROUTINE centroidpyramid( xyzNodes,cofgX,cofgY,cofgZ )
69 
70  USE moddatatypes
71  IMPLICIT NONE
72 
73 ! ... parameters
74  REAL(RFREAL) :: xyznodes(3,5)
75  REAL(RFREAL) :: cofgx, cofgy, cofgz
76 
77 ! ... local variables
78 
79 
80 !******************************************************************************
81 
82 END SUBROUTINE centroidpyramid
83 
84 ! #############################################################################
85 ! #############################################################################
86 
87 SUBROUTINE centroidprism( xyzNodes,cofgX,cofgY,cofgZ )
88 
89  USE moddatatypes
90  IMPLICIT NONE
91 
92 ! ... parameters
93  REAL(RFREAL) :: xyznodes(3,6)
94  REAL(RFREAL) :: cofgx, cofgy, cofgz
95 
96 ! ... local variables
97 
98 
99 !******************************************************************************
100 
101 END SUBROUTINE centroidprism
102 
103 ! #############################################################################
104 ! #############################################################################
105 
106 SUBROUTINE centroidhexa( xyzNodes,cofgX,cofgY,cofgZ )
107 
108  USE moddatatypes
109  IMPLICIT NONE
110 
111 ! ... parameters
112  REAL(RFREAL) :: xyznodes(3,8)
113  REAL(RFREAL) :: cofgx, cofgy, cofgz
114 
115 !******************************************************************************
116 
117  cofgx = 0.125_rfreal*(xyznodes(1,1)+xyznodes(1,2)+xyznodes(1,3)+ &
118  xyznodes(1,4)+xyznodes(1,5)+xyznodes(1,6)+ &
119  xyznodes(1,7)+xyznodes(1,8))
120  cofgy = 0.125_rfreal*(xyznodes(2,1)+xyznodes(2,2)+xyznodes(2,3)+ &
121  xyznodes(2,4)+xyznodes(2,5)+xyznodes(2,6)+ &
122  xyznodes(2,7)+xyznodes(2,8))
123  cofgz = 0.125_rfreal*(xyznodes(3,1)+xyznodes(3,2)+xyznodes(3,3)+ &
124  xyznodes(3,4)+xyznodes(3,5)+xyznodes(3,6)+ &
125  xyznodes(3,7)+xyznodes(3,8))
126 
127 END SUBROUTINE centroidhexa
128 
129 !******************************************************************************
130 !
131 ! RCS Revision history:
132 !
133 ! $Log: CellCentroid.F90,v $
134 ! Revision 1.3 2008/12/06 08:44:08 mtcampbe
135 ! Updated license.
136 !
137 ! Revision 1.2 2008/11/19 22:17:22 mtcampbe
138 ! Added Illinois Open Source License/Copyright
139 !
140 ! Revision 1.1 2004/12/01 16:48:18 haselbac
141 ! Initial revision after changing case
142 !
143 ! Revision 1.1 2002/01/08 22:09:16 jblazek
144 ! Added calculation of face vectors and volumes.
145 !
146 !******************************************************************************
147 
148 
149 
150 
151 
152 
subroutine centroidtetra(xyzNodes, cofgX, cofgY, cofgZ)
subroutine centroidhexa(xyzNodes, cofgX, cofgY, cofgZ)
subroutine centroidprism(xyzNodes, cofgX, cofgY, cofgZ)
subroutine centroidpyramid(xyzNodes, cofgX, cofgY, cofgZ)