FLASH-X
Doxygen Generated Documentation From Interface Source Code
Functions/Subroutines
Grid_correctFluxData_xtra.F90 File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine Grid_correctFluxData_xtra (blockDesc, scaleF, fluxBufX, fluxBufY, fluxBufZ, lo, scaleC, fluxOldX, fluxOldY, fluxOldZ, isFluxDensity)
 

Function/Subroutine Documentation

◆ Grid_correctFluxData_xtra()

subroutine Grid_correctFluxData_xtra ( type(Grid_tile_t)  blockDesc,
real  scaleF,
real  fluxBufX,
real  fluxBufY,
real  fluxBufZ,
integer, dimension(3), intent(in)  lo,
real  scaleC,
real  fluxOldX,
real  fluxOldY,
real  fluxOldZ,
logical  isFluxDensity 
)

Correct data in flux arrays by replacing fluxes in certain locations with a linear combination of data from a higher refinement level and a previously computed approximation of coarse fluxes.

fluxBuf := scaleF*"communicated fine fluxes" + scaleC*fluxOld AT coarse side of f/c bdry; unmodified ELSEWHERE.

By proper choice of the sign of the scaling factors, the previously computed coarse fluxes can effectively be subtracted from the fluxes that come from a higher refinement level.

Finer-level data (where needed) must have been stored to SPFS, typically by calling Grid_putFluxData_block on relevant neigboring blocks, and communication must have been triggered, typically by calling Grid_communicateFluxes, before this interface is invoked for a block.

Only fluxes at locations that represent the coarse side of fine/coarse block boundaries are modified, other elements of the flux buffers are left unmodified by calling this interface.

blockDesc : descriptor for one block. !!DEV: can it be a proper tile?

scaleF : coefficient for fluxes computed at finer resolution

fluxBufX : fluxes for IAXIS direction

fluxBufY : fluxes for JAXIS direction

fluxBufZ : fluxes for KAXIS direction

lo : lower bounds for the spatial indices of the flux buffers

scaleC : coefficient for previously computed coarse fluxes

fluxOldX : previously computed coarse fluxes for IAXIS direction

fluxOldY : previously computed coarse fluxes for JAXIS direction

fluxOldZ : previously computed coarse fluxes for KAXIS direction

isFluxDensity : are the fluxes actually fluxes or flux densities?

NOTES

This subroutine is available under the generic name Grid_correctFluxData as well as under the specifc name Grid_correctFluxData_xtra. The calling code should refer to the appropriate name in a statement use Grid_interface, ONLY: ...

The arrays fluxOldX, fluxOldY, fluxOldZ are subject to index reordering. The arrays fluxBufX, fluxBufY, fluxBufZ are index-reorder indirectly, by having bounds that depend on the shape on the corresponding fluxOldX, fluxOldY, fluxOldZ arrays.

flux buffer arrays and flux correction arrays should contain space for fluxes of all valid cells in the block, excluding guard cells.

This interface does not require level-wide fluxes to be allocated.

SPFS means semi-permanent flux storage. When using a Grid implementation based on AMReX, SPFS is implemented by an AMReX flux register class, such as FlashFluxRegister.

SEE ALSO

Grid_putFluxData_block Grid_communicateFluxes Grid_correctFluxData

Definition at line 94 of file Grid_correctFluxData_xtra.F90.