Exchange#
- class micromagneticmodel.Exchange(**kwargs)#
Exchange energy term.
\[w = - A \mathbf{m} \cdot \nabla^{2} \mathbf{m}\]- Parameters:
A (numbers.Real, dict, discretisedfield.Field) – If a single unsigned value
numbers.Real
is passed, a spatially constant parameter is defined. For a spatially varying parameter, either a dictionary, e.g.A={'region1': 1e-12, 'region2': 5e-12}
(if the parameter is defined “per region”) ordiscretisedfield.Field
is passed.
Examples
Defining the exchange energy term using scalar.
>>> import micromagneticmodel as mm ... >>> exchange = mm.Exchange(A=1e-12)
Defining the exchange energy term using dictionary.
>>> exchange = mm.Exchange(A={'region1': 1e-12, 'region2': 2e-12})
Defining the exchange 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)) >>> A = df.Field(mesh, nvdim=1, value=5e-11) >>> exchange = mm.Exchange(A=A)
An attempt to define the exchange energy term using a wrong value.
>>> exchange = mm.Exchange(A='123') # string value Traceback (most recent call last): ... TypeError: ...
Methods
__add__
Binary
+
operator.__dir__
Default dir() implementation.
__eq__
Relational operator
==
.__iter__
Iterator.
__repr__
Representation string.
density
effective_field
energy
Properties
A
Descriptor allowing setting attributes with a value described as
descriptor
or a dictionary.name
Name.