Skip to content

carrier_transfer

Evaluating a Carrier map on a mesh other than the one it was solved on.

Each Stage of a modulator Study meshes its own Window (ADR 0002), so the charge solve's Carrier map has to be carried onto the optical and RF meshes before either solver can see it. :func:transfer_carriers is that step: it interpolates the solved concentrations onto the target mesh's nodes or element centroids, resolves physical-group names internally so callers never map gmsh tags themselves, and fills points the source domain does not cover with a value the caller chooses.

The source domain is the convex hull of the Carrier map's sample points. Interpolation is linear, so a linear field is reproduced exactly and a transfer onto the source mesh itself is a no-op to floating-point tolerance.

Pure meshio/scipy: no solver runtime is needed.

Classes:

Functions:

CarrierMapLike

Bases: Protocol

The part of a Carrier map this module reads.

:class:gsim.tcad.results.CarrierMap satisfies it; so does any object carrying the same four arrays.

TransferredCarriers

Bases: BaseModel

Carrier concentrations sampled on a target mesh.

Attributes:

  • x_um (NDArray[float64]) –

    Target point coordinates (um), in mesh order.

  • y_um (NDArray[float64]) –

    Target point coordinates (um), in mesh order.

  • electrons_cm3 (NDArray[float64]) –

    Electron concentration at each target point (cm^-3).

  • holes_cm3 (NDArray[float64]) –

    Hole concentration at each target point (cm^-3).

  • region (list[str]) –

    Physical-group name of each target point. Element points carry their own group; node points carry the group of one incident element (a node on a region boundary belongs to several, and the lowest-numbered incident element wins).

  • filled (NDArray[bool_]) –

    True where the value came from fill rather than from the Carrier map — outside the source domain, or outside the requested regions.

transfer_carriers

transfer_carriers(
    carriers: CarrierMapLike | Any,
    mesh: Mesh | str | Path,
    *,
    at: Granularity = "nodes",
    fill: Fill = 0.0,
    regions: Sequence[str] | None = None,
) -> TransferredCarriers

Evaluate a Carrier map on another mesh.

Parameters:

  • carriers (CarrierMapLike | Any) –

    The solved Carrier map (anything exposing x_um, y_um, electrons_cm3 and holes_cm3).

  • mesh (Mesh | str | Path) –

    Target mesh (msh v2.2 path or a loaded meshio mesh), in um.

  • at (Granularity, default: 'nodes' ) –

    "nodes" for one value per mesh node, "elements" for one value per triangle, in the mesh's own order.

  • fill (Fill, default: 0.0 ) –

    Value for target points the source domain does not cover: one number for both carriers, an (electrons, holes) pair, or "nearest" to extend the nearest solved sample.

  • regions (Sequence[str] | None, default: None ) –

    Restrict carriers to these physical groups; points in any other group take fill. Group names are resolved from the mesh, so callers never handle gmsh tags.

Returns:

Raises:

  • ValueError –

    When the mesh has no triangles, a requested region is not on the mesh, or the Carrier map columns disagree in length.