flash.pyFlash4.Grid.Block

class Block(self: flash.pyFlash4.Grid.Block, blockID: int = 1, dataStruct: int = 2)

Bases: pybind11_object

Holds the grid data on a block for a single data structure either CENTER or FACE[XYZ].

Can be cast to a numpy array

myBlock = Block(blockID)
solnVec = np.array(myBlock, copy=False)

Using copy=False allows solnVec to use the same block pointer as myBlock.

the data may be accessed i.e.,

solnVec[var,i,j,k]
Parameters:
  • blockID (int) – local block id

  • dataStruct

    specifies the data structure (optional)

    - The options are defined in constantsH and they are :
    - CENTER cell centered variables (default)
    - FACEX face centered variable on faces along IAXIS
    - FACEY face centered variable on faces along JAXIS
    - FACEZ face centered variable on faces along IAXIS
    - 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

Methods

Attributes

delta

array[3] with the cell widths

hi

array[3] holding the index of the last interior cell + 1

hiGC

array[3] holding the index of the last guard cell +1

lo

array[3] holding the index of the first interior cell of the block

loGC

array[3] holding the index of the first guard cell of the block

nVars

number of variables held in this grid data structure

xCoord

physical coordinates in DIR_X

yCoord

physical coordinates in DIR_Y

zCoord

physical coordinates in DIR_Z

__getitem__(self: flash.pyFlash4.Grid.Block, *args) float

Access the grid data at (var,BC_DIR,SECOND_DIR,THIRD_DIR).

Parameters:
  • var (int) – 0-indexed grid variable, such as any of *_VAR from FlashH.

  • i (int) – 0-indexed to IAXIS in the region

  • j (int) – 0-indexed to JAXIS in the region

  • k (int) – 0-indexed to KAXIS in the region

__setitem__(self: flash.pyFlash4.Grid.Block, *args) None

Assigns the grid data at (var,BC_DIR,SECOND_DIR,THIRD_DIR).

Parameters:
  • *args

    (var,i,j,k)

  • var (int) – 1-indexed grid variable, such as any of *_VAR from FlashH.

  • i (int) – 0-indexed to IAXIS in the region

  • j (int) – 0-indexed to JAXIS in the region

  • k (int) – 0-indexed to KAXIS in the region

property delta

array[3] with the cell widths

property hi

array[3] holding the index of the last interior cell + 1

property hiGC

array[3] holding the index of the last guard cell +1

property lo

array[3] holding the index of the first interior cell of the block

property loGC

array[3] holding the index of the first guard cell of the block

property nVars

number of variables held in this grid data structure

property xCoord

physical coordinates in DIR_X

property yCoord

physical coordinates in DIR_Y

property zCoord

physical coordinates in DIR_Z