Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLU_PickRegionsCoord.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: Pick regions by coordinate range.
26 !
27 ! Description: Check whether a given region is inside a user-specified
28 ! bounding box; if yes, flag region as active, otherwise as inactive.
29 !
30 ! Input:
31 ! pRegion Pointer to region data
32 !
33 ! Output: None.
34 !
35 ! Notes:
36 ! 1. If a given region is not inside the bounding box, then postActiveFlag
37 ! is set to FALSE.
38 !
39 ! ******************************************************************************
40 !
41 ! $Id: RFLU_PickRegionsCoord.F90,v 1.5 2008/12/06 08:45:04 mtcampbe Exp $
42 !
43 ! Copyright: (c) 2003-2004 by the University of Illinois
44 !
45 ! ******************************************************************************
46 
47 SUBROUTINE rflu_pickregionscoord(pRegion)
48 
49  USE moddatatypes
50  USE modglobal, ONLY: t_global
51  USE moddatastruct, ONLY: t_region
52  USE modgrid, ONLY: t_grid
53  USE moderror
54  USE modmpi
55  USE modparameters
56 
57  IMPLICIT NONE
58 
59 ! ******************************************************************************
60 ! Declarations and definitions
61 ! ******************************************************************************
62 
63 ! ==============================================================================
64 ! Arguments
65 ! ==============================================================================
66 
67  TYPE(t_region), POINTER :: pregion
68 
69 ! ==============================================================================
70 ! Local variables
71 ! ==============================================================================
72 
73  CHARACTER(CHRLEN) :: rcsidentstring
74  REAL(RFREAL) :: xmax,xmin,ymax,ymin,zmax,zmin
75  TYPE(t_global), POINTER :: global
76  TYPE(t_grid), POINTER :: pgrid
77 
78 ! ******************************************************************************
79 ! Start
80 ! ******************************************************************************
81 
82  rcsidentstring = '$RCSfile: RFLU_PickRegionsCoord.F90,v $ $Revision: 1.5 $'
83 
84  global => pregion%global
85 
86  CALL registerfunction(global,'RFLU_PickRegionsCoord',&
87  'RFLU_PickRegionsCoord.F90')
88 
89  IF ( global%myProcid == masterproc .AND. &
90  global%verbLevel > verbose_none ) THEN
91  WRITE(stdout,'(A,1X,A)') solver_name,'Picking region by coordinates...'
92  END IF ! global%verbLevel
93 
94 ! ******************************************************************************
95 ! Pick by bounding box
96 ! ******************************************************************************
97 
98  pgrid => pregion%grid
99 
100  xmin = minval(pgrid%xyz(xcoord,1:pgrid%nVertTot))
101  xmax = maxval(pgrid%xyz(xcoord,1:pgrid%nVertTot))
102  ymin = minval(pgrid%xyz(ycoord,1:pgrid%nVertTot))
103  ymax = maxval(pgrid%xyz(ycoord,1:pgrid%nVertTot))
104  zmin = minval(pgrid%xyz(zcoord,1:pgrid%nVertTot))
105  zmax = maxval(pgrid%xyz(zcoord,1:pgrid%nVertTot))
106 
107  IF ( xmin > global%pickXCoordLow .AND. xmax < global%pickXCoordUpp .AND. &
108  ymin > global%pickYCoordLow .AND. ymax < global%pickYCoordUpp .AND. &
109  zmin > global%pickZCoordLow .AND. zmax < global%pickZCoordUpp ) THEN
110  pregion%postActiveFlag = .true.
111 
112  IF ( global%verbLevel > verbose_low ) THEN
113  WRITE(stdout,'(A,3X,A,1X,I6)') solver_name,'Picked region:', &
114  pregion%iRegionGlobal
115  END IF ! global%verbLevel
116  ELSE
117  pregion%postActiveFlag = .false.
118 
119  IF ( global%verbLevel > verbose_low ) THEN
120  WRITE(stdout,'(A,3X,A,1X,I6,1X,A)') solver_name,'Region:', &
121  pregion%iRegionGlobal,'not picked.'
122  END IF ! global%verbLevel
123  END IF ! xMin
124 
125 ! ******************************************************************************
126 ! End
127 ! ******************************************************************************
128 
129  IF ( (global%myProcid == masterproc) .AND. &
130  (global%verbLevel > verbose_none) ) THEN
131  WRITE(stdout,'(A,1X,A)') solver_name,'Picking region by coordinates done.'
132  END IF ! global%verbLevel
133 
134  CALL deregisterfunction(global)
135 
136 END SUBROUTINE rflu_pickregionscoord
137 
138 ! ******************************************************************************
139 !
140 ! RCS Revision history:
141 !
142 ! $Log: RFLU_PickRegionsCoord.F90,v $
143 ! Revision 1.5 2008/12/06 08:45:04 mtcampbe
144 ! Updated license.
145 !
146 ! Revision 1.4 2008/11/19 22:18:15 mtcampbe
147 ! Added Illinois Open Source License/Copyright
148 !
149 ! Revision 1.3 2005/12/10 23:29:34 haselbac
150 ! Renamed geom post variables, cosmetics
151 !
152 ! Revision 1.2 2004/10/19 19:30:08 haselbac
153 ! Added output statement, cosmetics
154 !
155 ! Revision 1.1 2003/08/07 15:14:40 haselbac
156 ! Initial revision
157 !
158 ! ******************************************************************************
159 
160 
161 
162 
163 
164 
165 
double ymin() const
double xmax() const
double xmin() const
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine rflu_pickregionscoord(pRegion)
double zmin() const
double zmax() const
double ymax() const
subroutine deregisterfunction(global)
Definition: ModError.F90:469