Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLO_CalcCellCentroids.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 cell centroids (optionally).
26 !
27 ! Description: none.
28 !
29 ! Input: region%levels%grid = dimensions, coordinates (current region)
30 !
31 ! Output: region%levels%grid%cofg = cell centroids
32 !
33 ! Notes: centroids are defined only for the physical cells.
34 !
35 !******************************************************************************
36 !
37 ! $Id: RFLO_CalcCellCentroids.F90,v 1.3 2008/12/06 08:44:06 mtcampbe Exp $
38 !
39 ! Copyright: (c) 2001 by the University of Illinois
40 !
41 !******************************************************************************
42 
43 SUBROUTINE rflo_calccellcentroids( region )
44 
45  USE moddatatypes
46  USE moddatastruct, ONLY : t_region
49  USE moderror
50  USE modparameters
51  IMPLICIT NONE
52 
53 #include "Indexing.h"
54 
55 ! ... parameters
56  TYPE(t_region) :: region
57 
58 ! ... loop variables
59  INTEGER :: ilev, i, j, k
60 
61 ! ... local variables
62  INTEGER :: ipcbeg, ipcend, jpcbeg, jpcend, kpcbeg, kpcend
63  INTEGER :: icoff, ijcoff, inoff, ijnoff, corner(8), ijkcell
64 
65  REAL(RFREAL) :: xyzhexa(3,8)
66  REAL(RFREAL), POINTER :: xyz(:,:), cofg(:,:)
67 
68 !******************************************************************************
69 
70  CALL registerfunction( region%global,'RFLO_CalcCellCentroids',&
71  'RFLO_CalcCellCentroids.F90' )
72 
73 ! loop over all grid levels
74 
75  DO ilev=1,region%nGridLevels
76 
77  IF (ASSOCIATED(region%levels(ilev)%grid%cofg)) THEN ! CG needed
78  CALL rflo_getdimensphys( region,ilev,ipcbeg,ipcend, &
79  jpcbeg,jpcend,kpcbeg,kpcend )
80  CALL rflo_getcelloffset( region,ilev,icoff,ijcoff )
81  CALL rflo_getnodeoffset( region,ilev,inoff,ijnoff )
82 
83  xyz => region%levels(ilev)%grid%xyz
84  cofg => region%levels(ilev)%grid%cofg
85 
86  DO k=kpcbeg,kpcend
87  DO j=jpcbeg,jpcend
88  DO i=ipcbeg,ipcend
89  ijkcell = indijk(i,j,k,icoff,ijcoff)
90  corner(1) = indijk(i ,j ,k ,inoff,ijnoff)
91  corner(2) = indijk(i ,j ,k+1,inoff,ijnoff)
92  corner(3) = indijk(i ,j+1,k+1,inoff,ijnoff)
93  corner(4) = indijk(i ,j+1,k ,inoff,ijnoff)
94  corner(5) = indijk(i+1,j ,k ,inoff,ijnoff)
95  corner(6) = indijk(i+1,j ,k+1,inoff,ijnoff)
96  corner(7) = indijk(i+1,j+1,k+1,inoff,ijnoff)
97  corner(8) = indijk(i+1,j+1,k ,inoff,ijnoff)
98 
99  xyzhexa(1:3,1) = xyz(1:3,corner(1))
100  xyzhexa(1:3,2) = xyz(1:3,corner(2))
101  xyzhexa(1:3,3) = xyz(1:3,corner(3))
102  xyzhexa(1:3,4) = xyz(1:3,corner(4))
103  xyzhexa(1:3,5) = xyz(1:3,corner(5))
104  xyzhexa(1:3,6) = xyz(1:3,corner(6))
105  xyzhexa(1:3,7) = xyz(1:3,corner(7))
106  xyzhexa(1:3,8) = xyz(1:3,corner(8))
107 
108  CALL centroidhexa( xyzhexa, &
109  cofg(xcoord,ijkcell), &
110  cofg(ycoord,ijkcell), &
111  cofg(zcoord,ijkcell) )
112  ENDDO ! i
113  ENDDO ! j
114  ENDDO ! k
115  ENDIF ! cofg allocated?
116 
117  ENDDO ! iLev
118 
119 ! finalize
120 
121  CALL deregisterfunction( region%global )
122 
123 END SUBROUTINE rflo_calccellcentroids
124 
125 !******************************************************************************
126 !
127 ! RCS Revision history:
128 !
129 ! $Log: RFLO_CalcCellCentroids.F90,v $
130 ! Revision 1.3 2008/12/06 08:44:06 mtcampbe
131 ! Updated license.
132 !
133 ! Revision 1.2 2008/11/19 22:17:19 mtcampbe
134 ! Added Illinois Open Source License/Copyright
135 !
136 ! Revision 1.1 2004/11/29 21:25:15 wasistho
137 ! lower to upper case
138 !
139 ! Revision 1.6 2003/11/20 16:40:34 mdbrandy
140 ! Backing out RocfluidMP changes from 11-17-03
141 !
142 ! Revision 1.3 2003/05/15 02:57:01 jblazek
143 ! Inlined index function.
144 !
145 ! Revision 1.2 2002/09/05 17:40:19 jblazek
146 ! Variable global moved into regions().
147 !
148 ! Revision 1.1 2002/08/15 19:48:05 jblazek
149 ! Implemented grid deformation capability.
150 !
151 ! Revision 1.3 2002/02/21 23:25:05 jblazek
152 ! Blocks renamed as regions.
153 !
154 ! Revision 1.2 2002/01/23 03:51:25 jblazek
155 ! Added low-level time-stepping routines.
156 !
157 ! Revision 1.1 2002/01/08 22:09:17 jblazek
158 ! Added calculation of face vectors and volumes.
159 !
160 !******************************************************************************
161 
162 
163 
164 
165 
166 
167 
subroutine rflo_calccellcentroids(region)
j indices k indices k
Definition: Indexing.h:6
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE kpcbeg
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE jpcbeg
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE ipcend
subroutine centroidhexa(xyzNodes, cofgX, cofgY, cofgZ)
subroutine rflo_getnodeoffset(region, iLev, iNodeOffset, ijNodeOffset)
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE ipcbeg
blockLoc i
Definition: read.cpp:79
subroutine rflo_getcelloffset(region, iLev, iCellOffset, ijCellOffset)
j indices j
Definition: Indexing.h:6
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE jpcend
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine rflo_getdimensphys(region, iLev, ipcbeg, ipcend, jpcbeg, jpcend, kpcbeg, kpcend)