51 l1off,l2off,l1cells,l2cells )
60 TYPE(t_region
),
POINTER :: regionsnew(:)
61 TYPE(t_patch),
POINTER :: patchold
63 INTEGER :: splitdirection, ireg, l1off, l2off, l1cells, l2cells
69 INTEGER :: bctype, lbound, lboundsrc
70 INTEGER ::
ibeg,
jbeg,
kbeg, l1offsrc, l2offsrc, l1cellssrc, l2cellssrc
72 TYPE(t_patch),
POINTER :: patchnew
76 patchnew => regionsnew(ireg)%levels(1)%patches(regionsnew(ireg)%nPatches)
78 patchnew%bcType = patchold%bcType
79 patchnew%lbound = patchold%lbound
80 patchnew%bcCoupled = patchold%bcCoupled
81 patchnew%l1beg =
max(patchold%l1beg-l1off+1,1)
82 patchnew%l1end =
min(patchold%l1end-l1off+1,l1cells)
83 patchnew%l2beg =
max(patchold%l2beg-l2off+1,1)
84 patchnew%l2end =
min(patchold%l2end-l2off+1,l2cells)
88 patchnew%align = patchold%align
89 patchnew%srcLbound = 0
90 patchnew%srcRegion = 0
96 bctype = patchnew%bcType
100 IF ((bctype>=bc_tra_peri .AND. bctype<=bc_tra_peri+bc_range) .OR. &
101 (bctype>=bc_rot_peri .AND. bctype<=bc_rot_peri+bc_range))
THEN
103 patchnew%srcLbound = patchold%srcLbound
104 lboundsrc = patchold%srcLbound
108 IF (((lboundsrc==1 .OR. lboundsrc==2) .AND. splitdirection==1) .OR. &
109 ((lboundsrc==3 .OR. lboundsrc==4) .AND. splitdirection==2) .OR. &
110 ((lboundsrc==5 .OR. lboundsrc==6) .AND. splitdirection==3))
THEN
111 IF (lboundsrc==1 .OR. lboundsrc==3 .OR. lboundsrc==5)
THEN
112 patchnew%srcRegion = 1
114 patchnew%srcRegion = regionsnew(ireg)%global%nRegions
116 patchnew%srcL1beg = patchold%srcL1beg
117 patchnew%srcL1end = patchold%srcL1end
118 patchnew%srcL2beg = patchold%srcL2beg
119 patchnew%srcL2end = patchold%srcL2end
124 patchnew%srcRegion = ireg
125 patchnew%srcL1beg =
max(patchold%srcL1beg-l1off+1,1)
126 patchnew%srcL1end =
min(patchold%srcL1end-l1off+1,l1cells)
127 patchnew%srcL2beg =
max(patchold%srcL2beg-l2off+1,1)
128 patchnew%srcL2end =
min(patchold%srcL2end-l2off+1,l2cells)
133 ELSE IF (bctype>=bc_regionconf .AND. bctype<=bc_regionconf+bc_range)
THEN
135 patchnew%srcLbound = patchold%srcLbound
136 lbound = patchold%lbound
137 lboundsrc = patchold%srcLbound
141 IF (lbound == lboundsrc)
THEN
145 IF (((lbound==1 .OR. lbound==2) .AND. splitdirection==1) .OR. &
146 ((lbound==3 .OR. lbound==4) .AND. splitdirection==2) .OR. &
147 ((lbound==5 .OR. lbound==6) .AND. splitdirection==3))
THEN
148 patchnew%srcRegion = ireg
149 patchnew%srcL1beg = patchold%srcL1beg
150 patchnew%srcL1end = patchold%srcL1end
151 patchnew%srcL2beg = patchold%srcL2beg
152 patchnew%srcL2end = patchold%srcL2end
157 patchnew%srcRegion = regionsnew(ireg)%global%nRegions - ireg + 1
158 IF (patchold%srcL1beg > patchold%srcL1End)
THEN
159 IF (((lbound==1 .OR. lbound==2) .AND. splitdirection==3) .OR. &
160 ((lbound==3 .OR. lbound==4) .AND. splitdirection==1) .OR. &
161 ((lbound==5 .OR. lbound==6) .AND. splitdirection==2))
THEN
162 patchnew%srcRegion = ireg
165 IF (((lbound==1 .OR. lbound==2) .AND. splitdirection==2) .OR. &
166 ((lbound==3 .OR. lbound==4) .AND. splitdirection==3) .OR. &
167 ((lbound==5 .OR. lbound==6) .AND. splitdirection==1))
THEN
168 patchnew%srcRegion = ireg
174 DO ir=1,patchnew%srcRegion-1
175 IF (splitdirection == 1)
THEN
176 ibeg =
ibeg + regionsnew(ir)%levels(1)%grid%ipc
177 ELSE IF (splitdirection == 2)
THEN
178 jbeg =
jbeg + regionsnew(ir)%levels(1)%grid%jpc
180 kbeg =
kbeg + regionsnew(ir)%levels(1)%grid%kpc
183 IF (lbound==1 .OR. lbound==2)
THEN
186 l1cellssrc = regionsnew(patchnew%srcRegion)%levels(1)%grid%jpc
187 l2cellssrc = regionsnew(patchnew%srcRegion)%levels(1)%grid%kpc
188 ELSE IF (lbound==3 .OR. lbound==4)
THEN
191 l1cellssrc = regionsnew(patchnew%srcRegion)%levels(1)%grid%kpc
192 l2cellssrc = regionsnew(patchnew%srcRegion)%levels(1)%grid%ipc
193 ELSE IF (lbound==5 .OR. lbound==6)
THEN
196 l1cellssrc = regionsnew(patchnew%srcRegion)%levels(1)%grid%ipc
197 l2cellssrc = regionsnew(patchnew%srcRegion)%levels(1)%grid%jpc
199 patchnew%srcL1beg =
max(patchold%srcL1beg-l1offsrc+1,1)
200 patchnew%srcL1beg =
min(patchnew%srcL1beg,l1cellssrc)
201 patchnew%srcL1end =
min(patchold%srcL1end-l1offsrc+1,l1cellssrc)
202 patchnew%srcL1end =
max(patchnew%srcL1end,1)
203 patchnew%srcL2beg =
max(patchold%srcL2beg-l2offsrc+1,1)
204 patchnew%srcL2beg =
min(patchnew%srcL2beg,l2cellssrc)
205 patchnew%srcL2end =
min(patchold%srcL2end-l2offsrc+1,l2cellssrc)
206 patchnew%srcL2end =
max(patchnew%srcL2end,1)
215 IF (((lbound==1 .OR. lbound==2) .AND. splitdirection==1) .OR. &
216 ((lbound==3 .OR. lbound==4) .AND. splitdirection==2) .OR. &
217 ((lbound==5 .OR. lbound==6) .AND. splitdirection==3))
THEN
218 IF (lboundsrc==1 .OR. lboundsrc==3 .OR. lboundsrc==5)
THEN
219 patchnew%srcRegion = 1
221 patchnew%srcRegion = regionsnew(ireg)%global%nRegions
223 patchnew%srcL1beg = patchold%srcL1beg
224 patchnew%srcL1end = patchold%srcL1end
225 patchnew%srcL2beg = patchold%srcL2beg
226 patchnew%srcL2end = patchold%srcL2end
231 patchnew%srcRegion = ireg
232 patchnew%srcL1beg =
max(patchold%srcL1beg-l1off+1,1)
233 patchnew%srcL1end =
min(patchold%srcL1end-l1off+1,l1cells)
234 patchnew%srcL2beg =
max(patchold%srcL2beg-l2off+1,1)
235 patchnew%srcL2end =
min(patchold%srcL2end-l2off+1,l2cells)
**********************************************************************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 ibeg
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
**********************************************************************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 knode jbeg
subroutine copypatchdata(regionsNew, patchOld, splitDirection, iReg, l1Off, l2Off, l1Cells, l2Cells)
**********************************************************************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 knode kbeg