Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PLAG_BoundaryConditionsSet.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: set boundary conditions or exchange data between adjacent
26 ! regions being on same processor.
27 !
28 ! Description: none.
29 !
30 ! Input: regions = data of all regions
31 ! iReg = index of current region.
32 !
33 ! Output: regions(iReg)%levels%plag = updated values (aiv,arv,cv,dv,tv)
34 ! in destination region.
35 !
36 ! Notes: Current support for conforming region interface only.
37 !
38 !******************************************************************************
39 !
40 ! $Id: PLAG_BoundaryConditionsSet.F90,v 1.3 2008/12/06 08:44:32 mtcampbe Exp $
41 !
42 ! Copyright: (c) 2002 by the University of Illinois
43 !
44 !******************************************************************************
45 
46 SUBROUTINE plag_boundaryconditionsset( regions,iReg )
47 
48  USE moddatatypes
49  USE modbndpatch, ONLY : t_patch
50  USE moddatastruct, ONLY : t_region
51  USE modglobal, ONLY : t_global
52  USE moderror
53  USE modparameters
55  IMPLICIT NONE
56 
57 ! ... parameters
58  TYPE(t_region), POINTER :: regions(:)
59 
60  INTEGER :: ireg
61 
62 ! ... loop variables
63  INTEGER :: ipatch
64 
65 ! ... local variables
66  CHARACTER(CHRLEN) :: rcsidentstring
67 
68  INTEGER :: ilev, npatches, bctype, iregdes, ipatchdes
69 
70  TYPE(t_patch), POINTER :: patch, patchdes
71  TYPE(t_global), POINTER :: global
72 
73 !******************************************************************************
74 
75  rcsidentstring = '$RCSfile: PLAG_BoundaryConditionsSet.F90,v $ $Revision: 1.3 $'
76 
77  global => regions(ireg)%global
78 
79  CALL registerfunction( global,'PLAG_BoundaryConditionsSet',&
80  'PLAG_BoundaryConditionsSet.F90' )
81 
82 ! get dimensions --------------------------------------------------------------
83 
84  ilev = regions(ireg)%currLevel
85  npatches = regions(ireg)%nPatches
86 
87 ! loop over patches -----------------------------------------------------------
88 
89  DO ipatch=1,npatches
90 
91  patch => regions(ireg)%levels(ilev)%patches(ipatch)
92 
93  bctype = patch%bcType
94  iregdes = patch%srcRegion
95  ipatchdes = patch%srcPatch
96 
97 ! - conforming region interface
98 
99  IF (bctype>=bc_regionconf .AND. bctype<=bc_regionconf+bc_range) THEN
100  patchdes => regions(iregdes)%levels(ilev)%patches(ipatchdes)
101 
102  IF (regions(iregdes)%procid == global%myProcid) THEN
103  CALL plag_patchexchangeconf( regions(ireg),regions(iregdes), &
104  patch,patchdes, ireg, iregdes )
105  ENDIF
106 
107 ! - non-conforming region interface (integer)
108 
109  ELSE IF ( (bctype>=bc_regionint .AND. bctype<=bc_regionint+bc_range) .OR. &
110  (bctype>=bc_regnonconf .AND. bctype<=bc_regnonconf+bc_range) .OR. &
111  (bctype>=bc_tra_peri .AND. bctype<=bc_tra_peri+bc_range) .OR. &
112  (bctype>=bc_rot_peri .AND. bctype<=bc_rot_peri+bc_range) ) THEN
113  patchdes => regions(iregdes)%levels(ilev)%patches(ipatchdes)
114 
115  CALL errorstop( global,err_unknown_bc,__line__ )
116 
117  ENDIF ! bcType
118 
119  ENDDO ! iPatch
120 
121 ! finalize --------------------------------------------------------------------
122 
123  CALL deregisterfunction( global )
124 
125 END SUBROUTINE plag_boundaryconditionsset
126 
127 !******************************************************************************
128 !
129 ! RCS Revision history:
130 !
131 ! $Log: PLAG_BoundaryConditionsSet.F90,v $
132 ! Revision 1.3 2008/12/06 08:44:32 mtcampbe
133 ! Updated license.
134 !
135 ! Revision 1.2 2008/11/19 22:17:45 mtcampbe
136 ! Added Illinois Open Source License/Copyright
137 !
138 ! Revision 1.1 2004/12/01 20:56:54 fnajjar
139 ! Initial revision after changing case
140 !
141 ! Revision 1.2 2003/01/13 19:29:35 f-najjar
142 ! Included iReg and iRegDes in calling sequence for PLAG_patchExchangeConf
143 !
144 ! Revision 1.1 2003/01/13 19:14:50 f-najjar
145 ! Initial Import of Multiblock capability
146 !
147 !******************************************************************************
148 
149 
150 
151 
152 
153 
154 
subroutine plag_patchexchangeconf(region, regionDes, patch, patchDes, iReg, iRegDes)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine plag_boundaryconditionsset(regions, iReg)
Definition: patch.h:74
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469