NAME
Grid_putPointData
SYNOPSIS
Grid_putPointData(integer(IN) :: blockID,
integer(IN) :: gridDataStruct,
integer(IN) :: structIndex,
integer(IN) :: beginCount,
integer(IN) :: position(MDIM),
real(IN) :: datablock)
DESCRIPTION
Puts a point of simulation data for a single variable into specified data structure The user is allowed to specify if index counting should begin at the exterior edge of the block, (that is including guardcells) or the interior edge of the block
ARGUMENTS
blockID : the local blockid
gridDataStruct : integer value specifying data structure.
The options are defined in constants.h and they are :
CENTER cell centered variables
FACEX face centered variable on faces along IAXIS
FACEY face centered variable on faces along JAXIS
FACEZ face centered variable on faces along KAXIS
WORK single, cell centered variable, valid only
for paramesh
SCRATCH scratch space that can fit cell and face centered variables
SCRATCH_CTR scratch space for cell centered variables
SCRATCH_FACEX scratch space facex variables
SCRATCH_FACEY scratch space facey variables
SCRATCH_FACEZ scratch space facez variables
structIndex : integer value that specifies which variable to put into storage.
for example: DENS_VAR, PRES_VAR as defined in Flash.h
beginCount : tells the routine where to start indice counting. beginCount can
be set to INTERIOR or EXTERIOR. If INTERIOR is specified
guardcell indices are not included and index 1 is the first interior cell.
If EXTERIOR is specified
the first index, 1, is the left most guardcell. See example
below for more explanation. (For most of the FLASH architecture code,
we use EXTERIOR. Some physics routines, however, find it helpful
only to work on the internal parts of the blocks (without
guardcells) and wish to keep loop indicies
going from 1 to NXB without having to worry about finding
the correct offset for the number of guardcells.)
(INTERIOR and EXTERIOR are defined in constants.h)
position(MDIM):
specifies the point to return
position(1) = i
position(2) = j
position(3) = k
If a problem is only 2d, position(3) is ignored. For 1d problems
position(2) and position(3) are ignored.
datablock : a real value containing the data
EXAMPLE
Here is a 3d block example putting a point of data,
for each block on a local processor. We will put the point at
position i=5, j=6 and k=7. beginCount is set to EXTERIOR
meaning that the first cell of the block including guardcells is
index = 1. If in this example, NGUARD = 4 then position 5 is the
first interior cell in a dimension.
(very hard to draw this, especially the j axis.
picture is just meant to help show where
counting begins when "beginCount" is set to EXTERIOR)
j
1 - - - - - - - -
2 - - - - - - - -
3 - - - - - - - -
4 - - - - - - - -
5 - - - -|-|-|-|-|-|-|-|-|- - - -
6 - - - -|-|-|-|-|-|-|-|-|- - - -
7 - - - -|-|-|-|-|-|-|-|-|- - - -
8 - - - -|-|-|-|-|-|-|-|-|- - - -
9 - - - -|-|-|-|-|-|-|-|-|- - - -
10 - - - -|-|-|-|-|-|-|-|-|- - - -
11 - - - -|-|-|-|-|-|-|-|-|- - - -
12 - - - -|-|-|-|-|-|-|-|-|- - - -
13 - - - - - - - -
14 - - - - - - - -
15 - - - - - - - -
16 - - - - - - - -
i 1 2 3 4 5 6 7 8 9 10111213141516
#include "Flash.h"
#include "constants.h"
...
integer :: position(MDIM)
integer :: blockID
real :: dataBlock
position(1) = 5
position(2) = 6
position(3) = 7
do blockID = 1, localNumBlocks
call Grid_putPointData(blockID, CENTER, DENS_VAR, EXTERIOR, &
position, dataBlock)
end do
In this 2d block example we will put a point of data for the pressure variable
for each block on a local processor.
beginCount is set to INTERIOR, meaning that all the position indices
will start where index 1 is the first interior cell of the block.
In this example we will put a point where i=4, j=5
(hard to draw, but this is the idea, stars (*) are the cells to return
notice the where indice counting starts when beginCount is set to INTERIOR)
- - - - - - - -
- - - - - - - -
- - - - - - - -
j - - - - - - - -
1 ----|-|-|-|-|-|-|-|-|----
2 ----|-|-|-|-|-|-|-|-|----
3 ----|-|-|-|-|-|-|-|-|----
4 ----|-|-|-|-|-|-|-|-|----
5 ----|-|-|-|*|-|-|-|-|----
6 ----|-|-|-|-|-|-|-|-|----
7 ----|-|-|-|-|-|-|-|-|----
8 ----|-|-|-|-|-|-|-|-|----
- - - - - - - -
- - - - - - - -
- - - - - - - -
- - - - - - - -
i 1-2-3-4 5-6-7-8
#include "Flash.h"
#include "constants.h"
...
integer :: position(MDIM)
integer :: blockID
real :: dataBlock
position(1) = 4
position(2) = 5
position(3) = 1 !ignored since only 2d problem
do blockID = 1, localNumBlocks
call Grid_putPointData(blockID, CENTER, PRES_VAR, INTERIOR, &
position, dataBlock)
end do