mammos_mumag.hysteresis#
Functions for evaluating and processin the hysteresis loop.
Functions
|
Run hysteresis loop. |
Classes
|
Hysteresis loop Result. |
- class mammos_mumag.hysteresis.Result(H, M, energy_density=None, configuration_type=None, configurations=None)#
Hysteresis loop Result.
- Parameters:
- configuration_type: ndarray | None = None#
Array of indices of representative configurations for the field strengths.
- plot(duplicate=True, duplicate_change_color=True, configuration_marks=False, ax=None, label=None, **kwargs)#
Plot hysteresis loop.
- Parameters:
duplicate (bool) – Also plot loop with -M and -H to simulate full hysteresis.
configuration_marks (bool) – Show markers where a configuration has been saved.
ax (matplotlib.axes.Axes | None) – Matplotlib axes object to which the plot is added. A new one is create if not passed.
kwargs – Additional keyword arguments passed to ax.plot when plotting the hysteresis lines.
duplicate_change_color (bool)
label (str | None)
- Returns:
The matplotlib.axes.Axes object which was used to plot the hysteresis loop
- Return type:
matplotlib.axes.Axes
- mammos_mumag.hysteresis.run(Ms, A, K1, mesh_filepath, hstart, hfinal, hstep=None, hnsteps=20, outdir='hystloop')#
Run hysteresis loop.
- Parameters:
Ms (float | Quantity | Entity) – Spontaneous magnetisation in \(\mathrm{A}/\mathrm{m}\).
A (float | Quantity | Entity) – Exchange stiffness constant in \(\mathrm{J}/\mathrm{m}\).
K1 (float | Quantity | Entity) – First magnetocrystalline anisotropy constant in \(\mathrm{J}/\mathrm{m}^3\).
mesh_filepath (Path) – TODO
hstart (float | Quantity) – Initial strength of the external field.
hfinal (float | Quantity) – Final strength of the external field.
hnsteps (int) – Number of steps in the field sweep.
outdir (str | Path) – Directory where simulation results are written to.
- Returns:
Result object.
- Return type: