Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PLAG_RFLO_SetMetrics.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: update face centroids and face normals for RFLO.
26 !
27 ! Description: none.
28 !
29 ! Input: regions = data of all regions
30 !
31 ! Output: regions%levels%plag%fc = face centroids
32 ! regions%levels%plag%si,sj,sk = face vectors
33 !
34 ! Notes: none.
35 !
36 !******************************************************************************
37 !
38 ! $Id: PLAG_RFLO_SetMetrics.F90,v 1.3 2008/12/06 08:44:35 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2003 by the University of Illinois
41 !
42 !******************************************************************************
43 
44 SUBROUTINE plag_rflo_setmetrics( regions )
45 
46  USE moddatatypes
47  USE moddatastruct, ONLY : t_region
48  USE modglobal, ONLY : t_global
49  USE moderror
50  USE modmpi
51  USE modparameters
58 
59  IMPLICIT NONE
60 
61 ! ... parameters
62  TYPE(t_region), POINTER :: regions(:)
63 
64 ! ... loop variables
65  INTEGER :: ireg
66 
67 ! ... local variables
68  CHARACTER(CHRLEN) :: rcsidentstring
69 
70  TYPE(t_global), POINTER :: global
71 
72 !******************************************************************************
73 
74  rcsidentstring = '$RCSfile: PLAG_RFLO_SetMetrics.F90,v $ $Revision: 1.3 $'
75 
76  global => regions(1)%global
77 
78  CALL registerfunction( global,'PLAG_RFLO_SetMetrics',&
79  'PLAG_RFLO_SetMetrics.F90' )
80 
81 ! check if module is active in any region======================================
82 
83  IF (.NOT. global%plagUsed) goto 999
84 
85 ! Determine the transfomation mapping matrix for corner and edge cells --------
86 
87  CALL plag_rflo_findgridmapping( regions )
88 
89 ! Compute face centroids and normals for corner and edge cells ----------------
90 
91  DO ireg=1,global%nRegions
92  IF (regions(ireg)%procid==global%myProcid .AND. & ! region active and
93  regions(ireg)%active==active ) THEN ! on my processor
94 
95 !#ifdef PLAG_DEBUG
96  IF ( ireg == 1 ) WRITE(*,*) 'Entering PLAG_CalcFaceCentroids: iReg=',ireg
97 !#endif
98  CALL plag_calcfacecentroids( regions(ireg) )
99 
100 !#ifdef PLAG_DEBUG
101  IF ( ireg == 1 ) WRITE(*,*) 'Entering PLAG_CopyFaceVectors: iReg=',ireg
102 !#endif
103  CALL plag_copyfacevectors( regions(ireg) )
104 
105  ENDIF ! regions
106  ENDDO ! iReg
107 
108 ! Load face centroids for corner and edge cells --------------------------------
109 ! On-processor infrastructure --------------------------------------------------
110 
111  DO ireg=1,global%nRegions
112  IF (regions(ireg)%procid==global%myProcid .AND. & ! region active and
113  regions(ireg)%active==active) THEN ! on my processor
114 
115 !#ifdef PLAG_DEBUG
116  IF ( ireg == 1 ) WRITE(*,*) 'Entering PLAG_CECellsFaceCentroids: iReg=',ireg
117 !#endif
118  CALL plag_cecellsfacecentroids( regions, ireg )
119 
120 !#ifdef PLAG_DEBUG
121  IF ( ireg == 1 ) WRITE(*,*) 'Entering PLAG_CECellsFaceVectors: iReg=',ireg
122 !#endif
123  CALL plag_cecellsfacevectors( regions, ireg )
124 
125  ENDIF ! regions
126  ENDDO ! iReg
127 
128 ! Communicate buffer data for off-processor regions ---------------------------
129 
130  CALL plag_rflo_sendrecvmetrics( regions )
131 
132 ! Reevaluate face centroids and normals to deal with degeneracy case ----------
133 ! Note: Degeneracy case arises when odd number of regions intersect -----------
134 ! and the node has three surrounding cells as opposed to four -----------
135 ! It also applies when two regions have communicating faces -------------
136 ! yet edge-corner search algorithm sets them as edge-corner regions -----
137 
138  DO ireg=1,global%nRegions
139  IF (regions(ireg)%procid==global%myProcid .AND. & ! region active and
140  regions(ireg)%active==active ) THEN ! on my processor
141  CALL plag_calcfacecentroids( regions(ireg) )
142  CALL plag_copyfacevectors( regions(ireg) )
143  ENDIF ! regions
144  ENDDO ! iReg
145 
146 ! finalize ====================================================================
147 
148 999 CONTINUE
149  CALL deregisterfunction( global )
150 
151 END SUBROUTINE plag_rflo_setmetrics
152 
153 !******************************************************************************
154 !
155 ! RCS Revision history:
156 !
157 ! $Log: PLAG_RFLO_SetMetrics.F90,v $
158 ! Revision 1.3 2008/12/06 08:44:35 mtcampbe
159 ! Updated license.
160 !
161 ! Revision 1.2 2008/11/19 22:17:47 mtcampbe
162 ! Added Illinois Open Source License/Copyright
163 !
164 ! Revision 1.1 2004/12/01 20:58:15 fnajjar
165 ! Initial revision after changing case
166 !
167 ! Revision 1.5 2004/03/05 22:09:03 jferry
168 ! created global variables for peul, plag, and inrt use
169 !
170 ! Revision 1.4 2004/02/11 23:18:23 fnajjar
171 ! Added a second call to routines for degeneracy case
172 !
173 ! Revision 1.3 2004/02/10 21:24:27 fnajjar
174 ! Added capability to determine index mapping between corner-edge regions
175 !
176 ! Revision 1.2 2004/01/15 21:11:55 fnajjar
177 ! Added MPI-based kernel for corner-edge cell metrics
178 !
179 ! Revision 1.1 2003/11/12 21:35:58 fnajjar
180 ! Initial import of Corner-Edge cells Infrastructure
181 !
182 !******************************************************************************
183 
184 
185 
186 
187 
188 
189 
subroutine plag_cecellsfacecentroids(regions, iReg)
subroutine plag_rflo_setmetrics(regions)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine plag_rflo_findgridmapping(regions)
subroutine plag_rflo_sendrecvmetrics(regions)
subroutine plag_calcfacecentroids(region)
subroutine plag_cecellsfacevectors(regions, iReg)
subroutine plag_copyfacevectors(region)
subroutine deregisterfunction(global)
Definition: ModError.F90:469