{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Field tools\n", "\n", "Class ``Field`` only contains general functionality useful for any type of field. ``discretisedfield.tools`` contains a number of more specialised convenicence functions required for certain usecases. Currently, most functions are focused on applications for micromagnetics.\n", "\n", "All functions need a ``Field`` object as first parameter." ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "tags": [] }, "outputs": [], "source": [ "import discretisedfield as df\n", "import discretisedfield.tools as dft" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "p1 = (0, 0, 0)\n", "p2 = (10, 10, 10)\n", "cell = (1, 1, 1)\n", "mesh = df.Mesh(p1=p1, p2=p2, cell=cell)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 1. Topological charge/topological charge density\n", "\n", "Topological charge and topological charge density can be computed for three-dimensional vector fields (``nvdim=3``) only. It is defined for two-dimensional samples only. Therefore, the field must be sliced.\n", "\n", "Two different methods are available and can be selected using ``method``:\n", "\n", "1. Continuous method:\n", " $$q = \\frac{1}{4\\pi} \\mathbf{n} \\cdot \\left(\\frac{\\partial\n", " \\mathbf{n}}{\\partial x} \\times \\frac{\\partial\n", " \\mathbf{n}}{\\partial y} \\right),$$\n", " \n", " where $\\mathbf{n}$ is the orientation field.\n", "\n", "2. Berg-Luescher method. For Berg-Luescher method the two-dimensional plane is triangulated and contributions to topological charge (density) are computed for each triangle.\n", " \n", " Details can be found in:\n", " - B. Berg and M. Luescher. Definition and statistical distributions of a topological number in the lattice O(3) sigma-model. Nuclear Physics B 190 (2), 412-424 (1981).\n", " - J.-V. Kim and J. Mulkers. On quantifying the topological charge in micromagnetics using a lattice-based approach. IOP SciNotes 1, 025211 (2020).\n", "\n", "Here, we show the calculation for a uniform magnetisation which has a topological charge (density) of zero everywhere." ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "tags": [] }, "outputs": [ { "data": { "text/html": [ "Field\n", "