Field Classes#
All field classes follow the same interface:
compute(magnetization)– returns the effective field as an(n, 3)arrayenergy(magnetization)– returns the energy as a scalar (Joules)
Magnetization m is always an (n, 3) array of unit vectors.
DemagFieldFK#
Demagnetizing field via the Fredkin-Koehler scalar potential method. This is the primary solver and supports multiple BEM backends.
DemagFieldFK(coordinates, elements, Ms, *,
scale=1.0, tolerance=1e-8,
solver=SolverType.AMG_CG,
h2_cache="", h2params=None,
fmm_params=None, backend=None,
tree_type=None)| Parameter | Type | Description |
|---|---|---|
coordinates | (n, 3) | Node positions |
elements | (ntet, 4) | Tetrahedral connectivity, 0-indexed |
Ms | (n,) | Saturation magnetization per node (A/m) |
scale | float | Length unit: 1.0 = m, 1e-9 = nm |
tolerance | float | Iterative solver tolerance |
solver | SolverType | GPU solver preset |
h2_cache | str | H2 matrix cache file path (empty = no caching) |
h2params | ParamsFKH2Lib | H2-matrix compression parameters |
fmm_params | ParamsFKFMM | GPU FMM parameters |
backend | BemBackend | BEM backend (default: FMM_GPU) |
tree_type | TreeType or str | FMM tree strategy |
Additional methods: