Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PLAG_RFLU_AllocMemTStepTile.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: Allocate memory for Lagrangian particles related to time stepping
26 ! on tiles.
27 !
28 ! Description: None.
29 !
30 ! Input:
31 ! pRegion Region pointer
32 !
33 ! Output: None.
34 !
35 ! Notes: None.
36 !
37 !******************************************************************************
38 !
39 ! $Id: PLAG_RFLU_AllocMemTStepTile.F90,v 1.7 2008/12/06 08:44:35 mtcampbe Exp $
40 !
41 ! Copyright: (c) 2004 by the University of Illinois
42 !
43 !******************************************************************************
44 
45 SUBROUTINE plag_rflu_allocmemtsteptile(pRegion)
46 
47  USE moddatatypes
48  USE moderror
49  USE modparameters
50  USE modglobal, ONLY: t_global
51  USE modbndpatch, ONLY: t_patch
52  USE modgrid, ONLY: t_grid
53  USE moddatastruct, ONLY: t_region
54  USE modpartlag, ONLY: t_tile_plag
55  USE modmpi
56 
57  IMPLICIT NONE
58 
59 ! ******************************************************************************
60 ! Definitions and declarations
61 ! ******************************************************************************
62 
63 ! ==============================================================================
64 ! Arguments
65 ! ==============================================================================
66 
67  TYPE(t_region), POINTER :: pregion
68 
69 ! ==============================================================================
70 ! Locals
71 ! ==============================================================================
72 
73  CHARACTER(CHRLEN) :: rcsidentstring
74  INTEGER :: errorflag,ipatch,itile,ivar,ncv,ntiles
75  TYPE(t_grid), POINTER :: pgrid
76  TYPE(t_global), POINTER :: global
77  TYPE(t_patch), POINTER :: ppatch
78  TYPE(t_tile_plag), POINTER :: ptileplag
79 
80 ! ******************************************************************************
81 ! Start
82 ! ******************************************************************************
83 
84  rcsidentstring = '$RCSfile: PLAG_RFLU_AllocMemTStepTile.F90,v $ $Revision: 1.7 $'
85 
86  global => pregion%global
87 
88  CALL registerfunction(global,'PLAG_RFLU_AllocMemTStepTile',&
89  'PLAG_RFLU_AllocMemTStepTile.F90')
90 
91 ! ******************************************************************************
92 ! Set pointers and variables
93 ! ******************************************************************************
94 
95  pgrid => pregion%grid
96 
97 ! ******************************************************************************
98 ! Allocate memory
99 ! ******************************************************************************
100 
101 ! ==============================================================================
102 ! Patch data
103 ! ==============================================================================
104 
105  DO ipatch = 1,pgrid%nPatches
106  ppatch => pregion%patches(ipatch)
107 
108 ! ------------------------------------------------------------------------------
109 ! Allocate memory only for injection boundaries
110 ! Note: Extend to inflow bc for Shock Diffraction problem
111 ! ------------------------------------------------------------------------------
112 
113  IF ( (ppatch%bcType >= bc_injection .AND. ppatch%bcType <= bc_injection + bc_range) .OR. &
114  (ppatch%bcType >= bc_inflow .AND. ppatch%bcType <= bc_inflow + bc_range) ) THEN
115  ptileplag => ppatch%tilePlag
116 
117  ncv = ptileplag%nCv
118 
119  ntiles = ppatch%nBFaces
120 
121  ALLOCATE(ptileplag%cvOld(ncv,ntiles),stat=errorflag)
122  global%error = errorflag
123  IF (global%error /= err_none) THEN
124  CALL errorstop(global, err_allocate,__line__,'pTilePlag%cvOld')
125  END IF ! global%error
126 
127  ALLOCATE(ptileplag%rhs(ncv,ntiles),stat=errorflag)
128  global%error = errorflag
129  IF (global%error /= err_none) THEN
130  CALL errorstop(global,err_allocate,__line__,'pTilePlag%rhs')
131  END IF ! global%error
132 
133  ALLOCATE(ptileplag%rhsSum(ncv,ntiles),stat=errorflag)
134  global%error = errorflag
135  IF (global%error /= err_none) THEN
136  CALL errorstop(global,err_allocate,__line__,'pTilePlag%rhsSum')
137  END IF ! global%error
138 
139  ALLOCATE(ptileplag%nPclsInjc(ntiles),stat=errorflag)
140  global%error = errorflag
141  IF (global%error /= err_none) THEN
142  CALL errorstop(global,err_allocate,__line__,'pTilePlag%nPclsInjc')
143  END IF ! global%error
144  END IF ! pPatch%bcType
145  END DO ! iPatch
146 
147 ! ******************************************************************************
148 ! Initialize memory
149 ! ******************************************************************************
150 
151  DO ipatch = 1,pgrid%nPatches
152  ppatch => pregion%patches(ipatch)
153 
154  IF ( (ppatch%bcType >= bc_injection .AND. ppatch%bcType <= bc_injection + bc_range) .OR. &
155  (ppatch%bcType >= bc_inflow .AND. ppatch%bcType <= bc_inflow + bc_range) ) THEN
156  ptileplag => ppatch%tilePlag
157 
158  ncv = ptileplag%nCv
159 
160  ntiles = ppatch%nBFaces
161 
162  DO itile = 1,ntiles
163  DO ivar = 1,ncv
164  ptileplag%cvOld(ivar,itile) = 0.0_rfreal
165  ptileplag%rhs(ivar,itile) = 0.0_rfreal
166  ptileplag%rhsSum(ivar,itile) = 0.0_rfreal
167  END DO ! iVar
168 
169  ptileplag%nPclsInjc(itile) = 0
170  END DO ! iTile
171  END IF ! pPatch%bcType
172  END DO ! iPatch
173 ! ******************************************************************************
174 ! End
175 ! ******************************************************************************
176 
177  CALL deregisterfunction(global)
178 
179 END SUBROUTINE plag_rflu_allocmemtsteptile
180 
181 !******************************************************************************
182 !
183 ! RCS Revision history:
184 !
185 ! $Log: PLAG_RFLU_AllocMemTStepTile.F90,v $
186 ! Revision 1.7 2008/12/06 08:44:35 mtcampbe
187 ! Updated license.
188 !
189 ! Revision 1.6 2008/11/19 22:17:47 mtcampbe
190 ! Added Illinois Open Source License/Copyright
191 !
192 ! Revision 1.5 2006/09/18 20:32:49 fnajjar
193 ! Activated tile datastructure for inflow bc
194 !
195 ! Revision 1.4 2006/04/07 15:19:24 haselbac
196 ! Removed tabs
197 !
198 ! Revision 1.3 2004/03/08 23:02:28 fnajjar
199 ! Added initialization section within DO-loop construct
200 !
201 ! Revision 1.2 2004/03/03 03:23:07 fnajjar
202 ! Allocated nPclsInjc and defined nTiles
203 !
204 ! Revision 1.1 2004/02/26 21:00:40 haselbac
205 ! Initial revision
206 !
207 !******************************************************************************
208 
209 
210 
211 
212 
213 
214 
subroutine plag_rflu_allocmemtsteptile(pRegion)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469