{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import micromagneticmodel as mm\n", "import oommfc as mc\n", "\n", "import discretisedfield as df # df is here chosen to be an alias for discretisedfield\n", "\n", "p1 = (0, 0, 0)\n", "p2 = (100e-9, 50e-9, 20e-9)\n", "\n", "region = df.Region(p1=p1, p2=p2)" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "import pyvista as pv\n", "\n", "pv.set_jupyter_backend(\"trame\")" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'0.41.1'" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pv.__version__" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "lx, ly, lz = 100e-9, 50e-9, 20e-9\n", "\n", "subregions = {\n", " \"bottom_subregion\": df.Region(p1=(20e-9, 0, 0), p2=(40e-9, 50e-9, 10e-9)),\n", " \"top_subregion\": df.Region(p1=(80e-9, 40e-9, lz / 2), p2=(lx, ly, lz)),\n", "}\n", "\n", "cell = (5e-9, 5e-9, 5e-9)\n", "\n", "region = df.Region(p1=(0, 0, 0), p2=(lx, ly, lz))\n", "mesh = df.Mesh(region=region, cell=cell, subregions=subregions)" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "6b500274c0644f2cb7df85ab278310e4", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Widget(value=\"