gridFunc

gridFunc

UserFuncs of kind = gridFunc return a result with information about a <Grid> object.

UserFuncs of kind = gridFunc take one argument, a cell index (a vector of integers with as many elements as spatial dimensions), and return information about that grid cell, depending on the result attribute.

gridFunc parameters

grid

The name of a <Grid> object to query for information.

result (string, required)

Specifies what information the function should return; depending on result, different attributes will apply.

Following is a list of results, the length and type of the vector returned, and the extra attributes (if any) that pertain to each specific result.

nodePos (returns NDIM floats)

result = nodePos returns the position of the cell node.

edgeCenterPos (NDIM floats)

result = edgeCenterPos returns the position of the center of an edge of the cell (the edge that touches the cell node).

dir (required, either 0, 1, or 2)

The direction of the desired edge; e.g., 0 for the cell edge parallel to x that touches the cell node.

faceCenterPos (NDIM floats)

result = faceCenterPos returns the position of the center of a face of the cell (the face that touches the cell node).

dir (required, either 0, 1, or 2)

The direction normal to the desired face; e.g., 2 for the cell face normal parallel to x and y that touches the cell node.

cellCenterPos (NDIM floats)

result = cellCenterPos returns the position of the cell center.

cellVolume (1 float)

result = cellVolume returns the volume of the cell.