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
Falseif 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. Each rank bins its local cells by their bounding boxes, about one cell per bin on average, and tests a point only against the cells of its bin. The cost then grows with the number of points plus the number of local cells, unless the cell sizes vary so strongly that some bins hold many 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:
field_functions (List[pyopensn.fieldfunc.FieldFunctionGridBased]) – Field functions to evaluate.
points (List[pyopensn.math.Vector3]) – Evaluation points.
- 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.