Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLO_ComputeIntegralValues.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: Compute integrals for GENx checking.
26 !
27 ! Description: None.
28 !
29 ! Input:
30 ! regions Region data
31 !
32 ! Output:
33 ! integ Vector of integrals (for output by Rocman)
34 !
35 ! Notes: None.
36 !
37 !******************************************************************************
38 !
39 ! $Id: RFLO_ComputeIntegralValues.F90,v 1.4 2008/12/06 08:44:26 mtcampbe Exp $
40 !
41 ! Copyright: (c) 2002 by the University of Illinois
42 !
43 !******************************************************************************
44 
45 #ifdef GENX
46 SUBROUTINE rflo_computeintegralvalues(regions,integ)
47 #else
48 SUBROUTINE rflo_computeintegralvalues(regions)
49 #endif
50 
51  USE moddatatypes
52  USE modglobal, ONLY: t_global
53  USE moddatastruct, ONLY: t_region
55  USE moderror
56  USE modparameters
57  USE modmpi
58 
59  IMPLICIT NONE
60 #include "Indexing.h"
61 
62 #ifdef GENX
63  include 'rocmanf90.h'
64 #endif
65 
66 ! ... parameters
67  TYPE(t_region), POINTER :: regions(:)
68 
69 ! ... loop variables
70  INTEGER :: ireg, i, j, k
71 
72 ! ... local variables
73  INTEGER :: ilev, ipcbeg, ipcend, jpcbeg, jpcend, kpcbeg, kpcend
74  INTEGER :: icoff, ijcoff, ijkc
75 
76  REAL(RFREAL) :: enerlocal,ibarealocal,inbarealocal,masslocal,xmomlocal, &
77  ymomlocal,zmomlocal,vollocal
78 #ifdef GENX
79  DOUBLE PRECISION, DIMENSION(MAN_INTEG_SIZE) :: integ
80  REAL(RFREAL), DIMENSION(MAN_INTEG_SIZE) :: globalvals,localvals
81 #else
82  REAL(RFREAL), DIMENSION(2) :: globalvals,localvals
83 #endif
84  REAL(RFREAL), POINTER :: cv(:,:), vol(:)
85 
86  TYPE(t_global), POINTER :: global
87 
88 ! *****************************************************************************
89 
90  global => regions(1)%global
91 
92  CALL registerfunction(global,'RFLO_ComputeIntegralValues',&
93  'RFLO_ComputeIntegralValues.F90')
94 
95 ! get dimensions and pointers -------------------------------------------------
96 
97 ! Compute total volume and total mass -----------------------------------------
98 
99  vollocal = 0.0_rfreal
100  masslocal = 0.0_rfreal
101 
102  DO ireg = 1,global%nRegions
103  IF (regions(ireg)%procid==global%myProcid .AND. & ! region active and
104  regions(ireg)%active==active) THEN ! on my processor
105 
106  ilev = regions(ireg)%currLevel
107 
108  CALL rflo_getdimensphys( regions(ireg),ilev,ipcbeg,ipcend, &
109  jpcbeg,jpcend,kpcbeg,kpcend )
110  CALL rflo_getcelloffset( regions(ireg),ilev,icoff,ijcoff )
111 
112  cv => regions(ireg)%levels(ilev)%mixt%cv
113  vol => regions(ireg)%levels(ilev)%grid%vol
114 
115 ! --- loop over cells ---------------------------------------------------------
116 
117  DO k=kpcbeg,kpcend
118  DO j=jpcbeg,jpcend
119  DO i=ipcbeg,ipcend
120  ijkc = indijk(i,j,k,icoff,ijcoff)
121  vollocal = vollocal + vol(ijkc)
122  masslocal = masslocal + cv(cv_mixt_dens,ijkc)*vol(ijkc)
123  ENDDO
124  ENDDO
125  ENDDO
126  ENDIF
127  ENDDO ! iReg
128 
129 #ifdef GENX
130 ! Compute momenta components and energy ---------------------------------------
131 
132  xmomlocal = 0.0_rfreal ! Not computed at present
133  ymomlocal = 0.0_rfreal
134  zmomlocal = 0.0_rfreal
135  enerlocal = 0.0_rfreal
136 
137 ! Compute interacting surface areas -------------------------------------------
138 
139  inbarealocal = 0.0_rfreal ! Not computed at present
140  ibarealocal = 0.0_rfreal
141 #endif
142 
143 ! *****************************************************************************
144 ! Gather data
145 ! *****************************************************************************
146 
147 #ifdef GENX
148  localvals(man_integ_vol ) = vollocal
149  localvals(man_integ_mass ) = masslocal
150  localvals(man_integ_xmom ) = xmomlocal
151  localvals(man_integ_ymom ) = ymomlocal
152  localvals(man_integ_zmom ) = zmomlocal
153  localvals(man_integ_ener ) = enerlocal
154  localvals(man_integ_ibarea ) = ibarealocal
155  localvals(man_integ_inbarea) = inbarealocal
156 #else
157  localvals(1) = vollocal
158  localvals(2) = masslocal
159 #endif
160 
161 ! Perform reduction operation -------------------------------------------------
162 
163 #ifdef MPI
164  CALL mpi_allreduce( localvals,globalvals,SIZE(localvals),mpi_rfreal,mpi_sum,&
165  global%mpiComm,global%mpierr )
166  IF (global%mpierr /= 0) CALL errorstop( global,err_mpi_trouble,__line__ )
167 #else
168  DO i = 1,SIZE(localvals)
169  globalvals(i) = localvals(i)
170  END DO ! i
171 #endif
172 
173 ! Assign data -----------------------------------------------------------------
174 
175 #ifdef GENX
176  DO i = 1,man_integ_size
177  integ(i) = globalvals(i)
178  END DO ! i
179 #else
180  global%totalVol = globalvals(1)
181  global%totalMass = globalvals(2)
182 #endif
183 
184 ! Finalize --------------------------------------------------------------------
185 
186  CALL deregisterfunction(global)
187 
188 END SUBROUTINE rflo_computeintegralvalues
189 
190 !******************************************************************************
191 !
192 ! RCS Revision history:
193 !
194 ! $Log: RFLO_ComputeIntegralValues.F90,v $
195 ! Revision 1.4 2008/12/06 08:44:26 mtcampbe
196 ! Updated license.
197 !
198 ! Revision 1.3 2008/11/19 22:17:37 mtcampbe
199 ! Added Illinois Open Source License/Copyright
200 !
201 ! Revision 1.2 2006/04/07 15:19:21 haselbac
202 ! Removed tabs
203 !
204 ! Revision 1.1 2005/02/26 04:07:17 wasistho
205 ! added RFLO_ComputeIntegralValues
206 !
207 !
208 !******************************************************************************
209 
210 
211 
212 
213 
214 
215 
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 rflo_computeintegralvalues(regions)
**********************************************************************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 errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine rflo_getdimensphys(region, iLev, ipcbeg, ipcend, jpcbeg, jpcend, kpcbeg, kpcend)