pyopensn.fieldfunc.FieldFunctionGridBased

class pyopensn.fieldfunc.FieldFunctionGridBased

Field function grid based.

Wrapper of opensn::FieldFunctionGridBased.

CanUpdate(self: pyopensn.fieldfunc.FieldFunctionGridBased) → bool

Return whether this field function can currently refresh itself from its owning problem.

This returns False if the field function has no update callback or if the owning problem has already been destroyed.

static ExportMultipleToPVTU(ff_list: list, base_name: str) → None

Export a list of “field function grid based” to parallel VTU format.

Parameters:
  • ff_list (List[opensn.FieldFunctionGridBased]) – List of “field function grid based” to export.

  • base_name (str) – Base name.

static GetPointValues(field_functions: list[pyopensn.fieldfunc.FieldFunctionGridBased], points: list[pyopensn.math.Vector3]) → list[list[list[float]]]

Evaluate multiple grid-based field functions at multiple points.

Each point is located once for all fields, and the results for all points and fields are combined in two MPI reductions, instead of one pair of reductions per point and field. Point location still tests each point against the locally owned cells. All field functions must use the same mesh, and all MPI ranks must call this method with the same points in the same order. A point on a face shared by several cells gets the average of their values. Collective.

Parameters:
Returns:

Values indexed by field function, point, and component.

Return type:

List[List[List[float]]]

Update(self: pyopensn.fieldfunc.FieldFunctionGridBased) → None

Refresh this field function from its owning problem.

Raises an error if the field function is not refreshable or if its owning problem has already been destroyed.