[FLASH-USERS] Grid_bcApplyToRegionSpecialized
Dongwook Lee
dongwook at flash.uchicago.edu
Thu Aug 20 16:51:09 EDT 2009
Hi Sylvain,
I assume you're applying user BC only on the x=xmin boundary.
If this is not true, and if you're also applying user BC on the
y direction(s) with the current setups of x,y coordinates, this
will not work for you, because your BC_DIR also varies.
My first suggestion is to replace Grid_getCellCoords with
gr_extendedGetCellCoords. This routine has an extended functionality
that should be used internally within the Grid
unit (i.e., should be called from Grid_*.F90) and can give you
coordinate information even for remote blocks.
I suggest your do loop look like (assuming userBC on x=xmin,
i.e., axis=IAXIS, secondDir=JAXIS, thirdDir=KAXIS):
(For more general cases, please have a look how secondDir
and thirdDir are set in gr_bcApplyToOneFace.F90.)
------------------------------------------------------
sizeX = regionSize(axis)
sizeY = regionSize(secondDir)
sizeZ = regionSize(thirdDir)
allocate(xCoord(sizeX))
allocate(yCoord(sizeY))
call gr_extendedGetCellCoords&
(axis, blockHandle, gr_myPE, CENTER, .true., xCoord, sizeX)
call gr_extendedGetCellCoords&
(secondDir, blockHandle, gr_myPE, CENTER, .true., yCoord, sizeY)
do i=1,guard
do j=1,sizeY
regionData(i,j,1:ke,VELY_VAR)=value(xCoord(i),yCoord(j))
enddo
enddo
---------------------------------------------------------
Note again that if you're applying userBC to x=xmax, as well
as y=ymin or y=ymax, then you have to be more careful in
setting up your xCoord and yCoord in using axis, secondDir
as well as proper offsets for face=HIGH.
If you need a BC for that case, I can give you an example
of Grid_bcApplyToRegionSpecialized.F90 I've implemented.
Hope this helps,
Dongwook
----------------------------------------------------
Dongwook Lee, Ph.D., Research Scientist
ASC Center for Astrophysical Thermonuclear Flashes
University of Chicago
5640 S. Ellis, RI 484
(773) 834-6830
More information about the flash-users
mailing list