Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import sys
import numbers
import micromagneticmodel as mm
class DMI(mm.DMI):
"""Dzyaloshinskii-Moriya energy term.
This energy term models DM energy term, defined by the DM energy
constant `D` and crystalographic class `crystalclass`. `D` is a
scalar value with J/m2 units.
.. math::
\\mathbf{w_\\text{dmi}} = \\left\\{
\\begin{array}{ll}
D \\mathbf{m} \\cdot (\\nabla \\times \\mathbf{m}), &
\\text{for}\\,\\,T(O) \\\\ D ( \\mathbf{m} \\cdot \\nabla m_{z} -
m_{z} \\nabla \\cdot \\mathbf{m}), & \\text{for}\\,\\,C_{nv} \\\\
D\\mathbf{m} \\cdot \\left( \\frac{\\partial
\\mathbf{m}}{\\partial x} \\times \\hat{x} - \\frac{\\partial
\\mathbf{m}}{\partial y} \\times \\hat{y} \\right), &