Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import numbers
import oommfc.util as ou
import discretisedfield as df
import micromagneticmodel as mm
class Exchange(mm.Exchange):
"""Exchange energy term.
This energy term models ferromagnetic exchange energy term,
defined by the exchange energy constant `A`.
.. math::
w_{ex} = A(\\nabla\\mathbf{m})^{2}
`A` is a scalar value with J/m units.
`A` can be either contant in space or spatially varying. If it is
constant, a single value is passed, e.g. `A = 1e-12`. On the other
hand, if it varies in space, there are two ways how that can be
defined. The first one is using a dictionary, where the keys must
be the same as the names of regions used when the mesh was defined