mag2exp.magnetometry.magnetisation#

mag2exp.magnetometry.magnetisation(field)#

Calculation of the magnetisation.

Calculates the magnetisation in the regions where the norm is non-zero.

Parameters:

field (discretisedfield.Field) – Magnetisation field.

Returns:

Magnetisation – Magnetisation in \(\textrm{Am}^{-1}\).

Return type:

tuple

Examples

1.Uniform magnetisation in \(z\) direction.

>>> import discretisedfield as df
>>> import micromagneticmodel as mm
>>> import mag2exp
>>> mesh = df.Mesh(p1=(-25e-9, -25e-9, -2e-9),
...                p2=(25e-9, 25e-9, 50e-9),
...                cell=(1e-9, 1e-9, 2e-9))
>>> field= df.Field(mesh, nvdim=3, value=(0,0,1), norm=1e6)
>>> mag2exp.magnetometry.magnetisation(field)
array([      0.,       0., 1000000.])
  1. Spatially dependent magnetisation.

>>> import discretisedfield as df
>>> import micromagneticmodel as mm
>>> import mag2exp
>>> mesh = df.Mesh(p1=(-25e-9, -25e-9, -2e-9),
...                p2=(25e-9, 25e-9, 50e-9),
...                cell=(1e-9, 1e-9, 2e-9))
>>> def v_fun(point):
...     x, y, z = point
...     if x < -2e-9:
...         return (0, 0, 1)
...     elif x < 2e-9:
...         return (0, 1, 0)
...     else:
...         return (-1, 1, 0)
>>> field= df.Field(mesh, nvdim=3, value=v_fun, norm=1e6)
>>> mag2exp.magnetometry.magnetisation(field)
array([-325269.11934575,  405269.1193456 ,  460000.        ])