Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLU_ModGridUtils.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: Collection of utility routines for grid.
26 !
27 ! Description: None.
28 !
29 ! Notes: None.
30 !
31 ! ******************************************************************************
32 !
33 ! $Id: RFLU_ModGridUtils.F90,v 1.3 2008/12/06 08:44:22 mtcampbe Exp $
34 !
35 ! Copyright: (c) 2006 by the University of Illinois
36 !
37 ! ******************************************************************************
38 
40 
41  USE modparameters
42  USE moddatatypes
43  USE modglobal, ONLY: t_global
44  USE modgrid, ONLY: t_grid
45  USE modbndpatch, ONLY: t_patch
46  USE moddatastruct, ONLY: t_region
47  USE moderror
48  USE modmpi
49 
50  IMPLICIT NONE
51 
52 ! ******************************************************************************
53 ! Definitions and declarations
54 ! ******************************************************************************
55 
56 ! ==============================================================================
57 ! Private data
58 ! ==============================================================================
59 
60  CHARACTER(CHRLEN), PRIVATE :: &
61  RCSIdentString = '$RCSfile: RFLU_ModGridUtils.F90,v $ $Revision: 1.3 $'
62 
63 ! ==============================================================================
64 ! Public functions
65 ! ==============================================================================
66 
67  PUBLIC :: rflu_distortgrid
68 
69 ! ==============================================================================
70 ! Private functions
71 ! ==============================================================================
72 
73 
74 
75 ! ******************************************************************************
76 ! Routines
77 ! ******************************************************************************
78 
79  CONTAINS
80 
81 
82 
83 
84 
85 ! ******************************************************************************
86 !
87 ! Purpose: Distort grid.
88 !
89 ! Description: None.
90 !
91 ! Input:
92 ! pRegion Pointer to region data
93 !
94 ! Output: None.
95 !
96 ! Notes: None.
97 !
98 ! ******************************************************************************
99 
100 SUBROUTINE rflu_distortgrid(pRegion)
101 
102  USE modrandom, ONLY: rand1uniform
103 
105 
106  IMPLICIT NONE
107 
108 ! ******************************************************************************
109 ! Declarations and definitions
110 ! ******************************************************************************
111 
112 ! ==============================================================================
113 ! Arguments
114 ! ==============================================================================
115 
116  TYPE(t_region), POINTER :: pregion
117 
118 ! ==============================================================================
119 ! Locals
120 ! ==============================================================================
121 
122  INTEGER :: errorflag,ivg
123  REAL(RFREAL) :: dx,dy,dz,xrand,yrand,zrand
124  TYPE(t_global), POINTER :: global
125  TYPE(t_grid), POINTER :: pgrid
126 
127 ! ******************************************************************************
128 ! Start
129 ! ******************************************************************************
130 
131  global => pregion%global
132 
133  CALL registerfunction(global,'RFLU_DistortGrid',&
134  'RFLU_ModGridUtils.F90')
135 
136  IF ( global%myProcid == masterproc .AND. &
137  global%verbLevel > verbose_none ) THEN
138  WRITE(stdout,'(A,1X,A)') solver_name, &
139  'Distorting grid...'
140  END IF ! global%verbLevel
141 
142 ! ******************************************************************************
143 ! Set pointers and variables
144 ! ******************************************************************************
145 
146  pgrid => pregion%grid
147 
148  dx = global%distortX
149  dy = global%distortY
150  dz = global%distortZ
151 
152 ! ******************************************************************************
153 ! Loop over vertices
154 ! ******************************************************************************
155 
156  DO ivg = 1,pgrid%nVertTot
157  IF ( rflu_testisboundaryvertex(pregion,ivg) .EQV. .false. ) THEN
158  xrand = rand1uniform(pregion%randData)
159  yrand = rand1uniform(pregion%randData)
160  zrand = rand1uniform(pregion%randData)
161 
162  pgrid%xyz(xcoord,ivg) = pgrid%xyz(xcoord,ivg) + xrand*dx
163  pgrid%xyz(ycoord,ivg) = pgrid%xyz(ycoord,ivg) + yrand*dy
164  pgrid%xyz(zcoord,ivg) = pgrid%xyz(zcoord,ivg) + zrand*dz
165  END IF ! RFLU_TestIsBoundaryVertex
166  END DO ! iPatch
167 
168 ! ******************************************************************************
169 ! End
170 ! ******************************************************************************
171 
172  IF ( global%myProcid == masterproc .AND. &
173  global%verbLevel > verbose_none ) THEN
174  WRITE(stdout,'(A,1X,A)') solver_name, &
175  'Distorting grid done ..'
176  END IF ! global%verbLevel
177 
178  CALL deregisterfunction(global)
179 
180 END SUBROUTINE rflu_distortgrid
181 
182 
183 
184 
185 
186 
187 END MODULE rflu_modgridutils
188 
189 ! ******************************************************************************
190 !
191 ! RCS Revision history:
192 !
193 ! $Log: RFLU_ModGridUtils.F90,v $
194 ! Revision 1.3 2008/12/06 08:44:22 mtcampbe
195 ! Updated license.
196 !
197 ! Revision 1.2 2008/11/19 22:17:33 mtcampbe
198 ! Added Illinois Open Source License/Copyright
199 !
200 ! Revision 1.1 2006/08/04 02:59:30 haselbac
201 ! Initial revision
202 !
203 ! ******************************************************************************
204 
205 
206 
207 
208 
209 
210 
211 
212 
LOGICAL function, public rflu_testisboundaryvertex(pRegion, ivg)
NT dx
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
REAL(RFREAL) function rand1uniform(rdata)
Definition: ModRandom.F90:345
RT dz() const
Definition: Direction_3.h:133
subroutine, public rflu_distortgrid(pRegion)
NT dy
subroutine deregisterfunction(global)
Definition: ModError.F90:469