Muscat.Bridges.PacmanBridge module

CheckIntegrity(GUI: bool = False) → str[source]

Check Pacman bridge helpers using the actual Pacman package.

GetFieldTransferPacmanFE(inputField: FEField, targetPoints: ArrayLike, method: str | None = None, elementFilter: FilterLike | None = None) → tuple[ndarray, ndarray][source]
GetFieldTransferPacmanFE(inputMesh: Mesh, targetPoints: ArrayLike, method: str | None = None, elementFilter: FilterLike | None = None) → tuple[dict[str, ndarray], ndarray]

Transfer a finite-element field to target points using Pacman.

Parameters:
  • inputField (FEField, optional) – Source finite-element field. A Mesh can also be passed positionally as the first argument. Provide either inputField or inputMesh, not both.

  • inputMesh (Mesh, optional) – Source mesh containing one or more nodal fields in mesh.nodeFields. Nodal fields are packed before transfer and reconstructed by field name in the returned dictionary.

  • targetPoints (ArrayLike) – Target point coordinates.

  • method (Union[str, None], optional) – Transfer method. Supported values are "Nearest/Nearest", "Interp/Clamp", "Interp/Nearest", "Interp/ZeroFill" and "Interp/Extrap". None selects "Interp/Clamp".

  • elementFilter (FilterLike, optional) – Filter to select elements from the source mesh. By default, all elements with the highest dimensionality are selected.

Returns:

Interpolated values and status. If inputField is provided, values are returned as an array. If inputMesh is provided, values are returned as a dictionary keyed by mesh.nodeFields names. Status can be one of these:

  • 0: “Nearest”

  • 1: “Interp”

  • 2: “Extrap”

  • 3: “Clamp”

  • 4: “ZeroFill”

Return type:

tuple[np.ndarray | dict[str, np.ndarray], np.ndarray]

GetFieldTransferPacmanMLS(inputField: FEField | None = None, inputMesh: Mesh | None = None, targetPoints: ArrayLike | None = None) → ndarray | dict[str, ndarray][source]

Transfer a field to target points using Pacman’s MLS interpolation.

Parameters:
  • inputField (FEField, optional) – Source finite-element field. Its mesh nodes are used as source points.

  • inputMesh (Mesh, optional) – Source mesh containing a scalar nodal field in mesh.nodeFields.

  • targetPoints (ArrayLike) – Target point coordinates.

Returns:

Interpolated target values. Mesh input returns a dictionary keyed by mesh.nodeFields names.

Return type:

np.ndarray | dict[str, np.ndarray]

GetFieldTransferPacmanRBF(inputField: FEField | None = None, inputMesh: Mesh | None = None, targetPoints: ArrayLike | None = None, method: str = 'WENDLANDC2') → ndarray | dict[str, ndarray][source]

Transfer scalar nodal values using Pacman’s RBF interpolation.

GetPacmanExecSpace() → int[source]

Return the default Pacman execution space.

The first available execution space is selected following the order CUDA, HIP, OPENMP and SERIAL. The selected name is cached for subsequent calls.

Returns:

Pacman execution-space identifier.

Return type:

int

Raises:

RuntimeError – If no supported Pacman execution space is available.

MuscatElementTypeToPacman(cellTypes: ArrayLike, inplace: bool = False) → ndarray[source]

Convert Muscat element type identifiers to Pacman identifiers.

Parameters:
  • cellTypes (ArrayLike) – Array of Muscat element type identifier (values).

  • inplace (bool, optional) – If True, overwrite cellTypes with the converted Pacman types. Otherwise, return a converted copy. By default False.

Returns:

Array containing the matching Pacman cell type identifiers.

Return type:

np.ndarray

PacmanStatusToMuscat(status: ArrayLike, inplace: bool = False) → ndarray[source]

Convert Pacman status identifiers to Muscat status identifiers.