PhysicsNeMo Sym Inferencers#

Pointwise Inferencer#

class physicsnemo.sym.domain.inferencer.pointwise.PointwiseInferencer(
nodes: List[Node],
invar: Dict[str, array],
output_names: List[str],
batch_size: int = 1024,
plotter: InferencerPlotter = None,
requires_grad: bool = False,
model=None,
)[source]#

Bases: Inferencer

Pointwise Inferencer that allows inferencing on pointwise data

Parameters:
  • nodes (List[Node]) – List of PhysicsNeMo Nodes to unroll graph with.

  • invar (Dict[str, np.ndarray (N, 1)]) – Dictionary of numpy arrays as input.

  • output_names (List[str]) – List of desired outputs.

  • batch_size (int, optional) – Batch size used when running validation, by default 1024

  • plotter (InferencerPlotter) – PhysicsNeMo plotter for showing results in tensorboard.

  • requires_grad (bool = False) – If automatic differentiation is needed for computing results.

Voxel Inferencer#

class physicsnemo.sym.domain.inferencer.voxel.VoxelInferencer(
bounds: List[List[int]],
npoints: List[int],
nodes: List[Node],
output_names: List[str],
export_map: None | Dict[str, List[str]] = None,
invar: Dict[str, array] = {},
batch_size: int = 1024,
mask_fn: Callable | None = None,
mask_value: float = nan,
plotter=None,
requires_grad: bool = False,
log_iter: bool = False,
model=None,
)[source]#

Bases: PointVTKInferencer

Inferencer for creating volex representations. This inferencer works bu creating a uniform mesh of voxels and masking out the ones defined by a callable function. The result is a voxel based representation of any complex geometery at any resolution.

Parameters:
  • bounds (List[List[int]]) – List of domain bounds to form uniform rectangular domain

  • npoints (List[int]) – Resolution of voxels in each domain

  • nodes (List[Node]) – List of PhysicsNeMo Nodes to unroll graph with.

  • output_names (List[str]) – List of desired outputs.

  • export_map (Dict[str, List[str]], optional) – Export map dictionary with keys that are VTK variables names and values that are lists of output variables. Will use 1:1 mapping if none is provided, by default None

  • invar (Dict[str, np.array], optional) – Dictionary of additional numpy arrays as input, by default {}

  • mask_fn (Union[Callable, None], optional) – Masking function to remove points from inferencing, by default None

  • mask_value (float, optional) – Value to assign masked points, by default Nan

  • plotter (Plotter, optional) – PhysicsNeMo Plotter for showing results in tensorboard., by default None

  • requires_grad (bool, optional) – If automatic differentiation is needed for computing results., by default True

  • log_iter (bool, optional) – Save results to different file each call, by default False

Point VTK Inferencer#

class physicsnemo.sym.domain.inferencer.vtkpointwise.PointVTKInferencer(
vtk_obj: VTKBase,
nodes: List[Node],
input_vtk_map: Dict[str, List[str]],
output_names: List[str],
invar: Dict[str, array] = {},
batch_size: int = 1024,
mask_fn: Callable | None = None,
mask_value: float = nan,
plotter=None,
requires_grad: bool = False,
log_iter: bool = False,
model=None,
)[source]#

Bases: PointwiseInferencer

Pointwise inferencer using mesh points of VTK object

Parameters:
  • vtk_obj (VTKBase) – PhysicsNeMo VTK object to use point locations from

  • nodes (List[Node]) – List of PhysicsNeMo Nodes to unroll graph with.

  • input_vtk_map (Dict[str, List[str]]) – Dictionary mapping from PhysicsNeMo input variables to VTK variable names {“physicsnemo.sym.name”: [“vtk name”]}. Use colons to denote components of multi-dimensional VTK arrays (“name”:# )

  • output_names (List[str]) – List of desired outputs.

  • invar (Dict[str, np.array], optional) – Dictionary of additional numpy arrays as input, by default {}

  • batch_size (int) – Batch size used when running inference

  • mask_fn (Union[Callable, None], optional) – Masking function to remove points from inferencing, by default None

  • mask_value (float, optional) – Value to assign masked points, by default Nan

  • plotter (Plotter, optional) – PhysicsNeMo Plotter for showing results in tensorboard., by default None

  • requires_grad (bool, optional) – If automatic differentiation is needed for computing results., by default True

  • log_iter (bool, optional) – Save results to different file each call, by default False

Inferencer Base#

class physicsnemo.sym.domain.inferencer.inferencer.Inferencer[source]#

Bases: object

Inferencer base class