UniaxialAnisotropy#
- class micromagneticmodel.UniaxialAnisotropy(**kwargs)#
Uniaxial anisotropy energy term.
\[w = -K/K_{1} (\mathbf{m} \cdot \mathbf{u})^{2} - K_{2} (\mathbf{m} \cdot \mathbf{u})^{4}\]- Parameters:
K (numbers.Real, dict, discretisedfield.Field) – If a single value
numbers.Realis passed, a spatially constant parameter is defined. For a spatially varying parameter, either a dictionary, e.g.K={'region1': 1e6, 'region2': 5e5}(if the parameter is defined “per region”) ordiscretisedfield.Fieldis passed.K1 (numbers.Real, dict, discretisedfield.Field) – If a single value
numbers.Realis passed, a spatially constant parameter is defined. For a spatially varying parameter, either a dictionary, e.g.K={'region1': 1e6, 'region2': 5e5}(if the parameter is defined “per region”) ordiscretisedfield.Fieldis passed.K2 (numbers.Real, dict, discretisedfield.Field) – If a single value
numbers.Realis passed, a spatially constant parameter is defined. For a spatially varying parameter, either a dictionary, e.g.K={'region1': 1e6, 'region2': 5e5}(if the parameter is defined “per region”) ordiscretisedfield.Fieldis passed.u ((3,) array_like, dict, discretisedfield.Field) – If a single length-3 array_like (tuple, list,
numpy.ndarray) is passed, which consists ofnumbers.Real, a spatially constant parameter is defined. For a spatially varying parameter, either a dictionary, e.g.u={'region1': (0, 0, 1), 'region2': (1, 0, 0)}(if the parameter is defined “per region”) ordiscretisedfield.Fieldis passed.
Examples
Defining the uniaxial anisotropy energy term using single values.
>>> import micromagneticmodel as mm ... >>> ua = mm.UniaxialAnisotropy(K=1e5, u=(0, 0, 1))
Defining the uniaxial anisotropy energy term using dictionary.
>>> K = {'region1': 1e6, 'region2': 1e5} >>> u = {'region1': (0, 0, 1), 'region2': (1, 0, 0)} >>> ua = mm.UniaxialAnisotropy(K=K, u=u)
3. Defining the uniaxial anisotropy energy term using
discretisedfield.Field.>>> import discretisedfield as df ... >>> region = df.Region(p1=(0, 0, 0), p2=(5e-9, 5e-9, 5e-9)) >>> mesh = df.Mesh(region=region, n=(5, 5, 5)) >>> K = df.Field(mesh, nvdim=1, value=1e6) >>> u = df.Field(mesh, nvdim=3, value=(0, 1, 0)) >>> ua = mm.UniaxialAnisotropy(K=K, u=u)
Defining higher-order uniaxial anisotropy
>>> ua = mm.UniaxialAnisotropy(K1=1e5, K2=2e3, u=(0, 0, 1))
5. An attempt to define the uniaxial anisotropy energy term using a wrong value.
>>> ua = mm.UniaxialAnisotropy(K=1e5, u=(0, 0, 1, 0)) # length-4 vector Traceback (most recent call last): ... ValueError: ...
Methods
__add__Binary
+operator.__dir__Default dir() implementation.
__eq__Relational operator
==.__iter__Iterator.
__repr__Representation string.
densityeffective_fieldenergyProperties
KDescriptor allowing setting attributes with a value described as
descriptoror a dictionary.K1Descriptor allowing setting attributes with a value described as
descriptoror a dictionary.K2Descriptor allowing setting attributes with a value described as
descriptoror a dictionary.nameName.
uDescriptor allowing setting attributes with a value described as
descriptoror a dictionary.