<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Ferrolith on ferrolith</title><link>https://www.ferrolith.org/</link><description>Recent content in Ferrolith on ferrolith</description><generator>Hugo</generator><language>en-gb</language><lastBuildDate>Mon, 16 Mar 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://www.ferrolith.org/index.xml" rel="self" type="application/rss+xml"/><item><title>Demagnetising field</title><link>https://www.ferrolith.org/posts/benchmarks/demag-field/</link><pubDate>Sun, 15 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.ferrolith.org/posts/benchmarks/demag-field/</guid><description>&lt;p&gt;Convergence of the volume-averaged demagnetising field $\langle H_z \rangle$ for uniformly magnetised bodies ($M_s$ = 800,000 A/m, magnetised along $z$). The analytical reference is $\langle H_z \rangle = -\mu_0 M_s^2 N_z$ where $N_z$ is the demagnetising factor.&lt;/p&gt;
&lt;p&gt;All methods use the same underlying FEM mesh for the body region. The x-axis shows the number of nodes in the &lt;strong&gt;body&lt;/strong&gt; (material region), giving a fair comparison between plain and shell meshes. Field values are volume-weighted averages using the FEM nodal volumes.&lt;/p&gt;</description></item><item><title>Meshes</title><link>https://www.ferrolith.org/posts/resources/meshes/</link><pubDate>Sun, 15 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.ferrolith.org/posts/resources/meshes/</guid><description>&lt;p&gt;All meshes were generated using &lt;a href="https://gmsh.info/"&gt;gmsh&lt;/a&gt; and can be downloaded here:
&lt;a href="https://www.ferrolith.org/meshes.tar.bz2"&gt;meshes.tar.bz2&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Each mesh set contains 15 meshes with logarithmically spaced characteristic lengths from coarse to fine. Plain meshes contain only the magnetic body. Shell meshes add a &amp;ldquo;space&amp;rdquo; region (free space around the body) and a &amp;ldquo;transform&amp;rdquo; region (coordinate-transformed shell mapping to infinity).&lt;/p&gt;
&lt;h2 id="sphere"&gt;Sphere&lt;a class="anchor" href="#sphere"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Unit sphere (radius 0.5) centered at the origin.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Geometry:&lt;/strong&gt; Radius: 0.5&lt;br&gt;
&lt;strong&gt;Extent:&lt;/strong&gt; [-0.49, 0.49] × [-0.50, 0.50] × [-0.50, 0.50]&lt;/p&gt;</description></item><item><title>Getting Started</title><link>https://www.ferrolith.org/posts/introduction/getting-started-with-ferrolith/</link><pubDate>Sun, 08 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.ferrolith.org/posts/introduction/getting-started-with-ferrolith/</guid><description>&lt;h2 id="building-the-python-module"&gt;Building the Python Module&lt;a class="anchor" href="#building-the-python-module"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Ferrolith requires a C++17 compiler, CUDA (tested with 12.5), and NetCDF. All other dependencies (Eigen, H2Lib, AMGCL, pybind11) are fetched automatically by CMake.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;cmake -B build -DFERROLITH_PYTHON&lt;span style="color:#f92672"&gt;=&lt;/span&gt;ON
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;cmake --build build -j&lt;span style="color:#66d9ef"&gt;$(&lt;/span&gt;nproc&lt;span style="color:#66d9ef"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To manually set the GPU architecture:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;cmake -B build -DFERROLITH_PYTHON&lt;span style="color:#f92672"&gt;=&lt;/span&gt;ON &lt;span style="color:#ae81ff"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; -DFERROLITH_FIND_CUDA_ARCH&lt;span style="color:#f92672"&gt;=&lt;/span&gt;OFF &lt;span style="color:#ae81ff"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; -DFERROLITH_SET_CUDA_ARCHS&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;61;75&amp;#34;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The compiled module is placed in &lt;code&gt;build/python/&lt;/code&gt;. Add it to your Python path:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;export PYTHONPATH&lt;span style="color:#f92672"&gt;=&lt;/span&gt;build/python:$PYTHONPATH&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="quick-start"&gt;Quick Start&lt;a class="anchor" href="#quick-start"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The simplest way to compute a demagnetizing field is with &lt;code&gt;DemagFieldFK&lt;/code&gt;:&lt;/p&gt;</description></item><item><title>µMAG Standard Problem #2</title><link>https://www.ferrolith.org/posts/benchmarks/mumag-sp2/</link><pubDate>Mon, 16 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.ferrolith.org/posts/benchmarks/mumag-sp2/</guid><description>&lt;p&gt;&lt;a href="https://www.ctcms.nist.gov/~rdm/mumag.org.html"&gt;μMAG Standard Problem #2&lt;/a&gt; studies the switching behaviour of a Permalloy thin-film rectangular element (length $5d$, width $d$, thickness $0.1d$) as a function of the particle size $d$ measured in exchange lengths $l_{\mathrm{ex}} = \sqrt{2A / \mu_0 M_s^2}$. A saturating field is applied along the diagonal of the film (1,1,0.1) direction, then reversed to obtain the hysteresis loop.&lt;/p&gt;
&lt;p&gt;The key results are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;$H_c / M_s$&lt;/strong&gt; — coercive field (normalised by $M_s$)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;$M_{rx} / M_s$&lt;/strong&gt; — remanent magnetisation, $x$-component&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;$M_{ry} / M_s$&lt;/strong&gt; — remanent magnetisation, $y$-component&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In the small-particle limit ($d/l_{\mathrm{ex}} \to 0$) the magnetisation is nearly uniform and a 3D Stoner-Wohlfarth analysis gives $H_c / M_s = 0.05707$.&lt;/p&gt;</description></item><item><title>µMAG Standard Problem #3</title><link>https://www.ferrolith.org/posts/benchmarks/mumag-sp3/</link><pubDate>Mon, 16 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.ferrolith.org/posts/benchmarks/mumag-sp3/</guid><description>&lt;p&gt;&lt;a href="https://www.ctcms.nist.gov/~rdm/std3/spec3.html"&gt;μMAG Standard Problem #3&lt;/a&gt; determines the single domain limit of a cubic magnetic particle — the critical edge length $L$ (in units of exchange length $l_{\mathrm{ex}} = \sqrt{A / K_m}$, where $K_m = \frac{1}{2} \mu_0 M_s^2$) at which the &amp;ldquo;flower state&amp;rdquo; and &amp;ldquo;vortex state&amp;rdquo; have equal total energy.&lt;/p&gt;
&lt;p&gt;The uniaxial anisotropy constant is $K_u = 0.1,K_m$ with the easy axis along $z$. All energies are normalised by $K_m L^3$.&lt;/p&gt;
&lt;p&gt;The expected result is $L \approx 8.47,l_{\mathrm{ex}}$.&lt;/p&gt;</description></item><item><title>Python API Reference</title><link>https://www.ferrolith.org/posts/introduction/python-api/</link><pubDate>Sat, 14 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.ferrolith.org/posts/introduction/python-api/</guid><description>&lt;h2 id="field-classes"&gt;Field Classes&lt;a class="anchor" href="#field-classes"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;All field classes follow the same interface:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;compute(magnetization)&lt;/code&gt; &amp;ndash; returns the effective field as an &lt;code&gt;(n, 3)&lt;/code&gt; array&lt;/li&gt;
&lt;li&gt;&lt;code&gt;energy(magnetization)&lt;/code&gt; &amp;ndash; returns the energy as a scalar (Joules)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Magnetization &lt;code&gt;m&lt;/code&gt; is always an &lt;code&gt;(n, 3)&lt;/code&gt; array of unit vectors.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id="demagfieldfk"&gt;DemagFieldFK&lt;a class="anchor" href="#demagfieldfk"&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Demagnetizing field via the Fredkin-Koehler scalar potential method. This is the primary solver and supports multiple BEM backends.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;DemagFieldFK(coordinates, elements, Ms, &lt;span style="color:#f92672"&gt;*&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; scale&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#ae81ff"&gt;1.0&lt;/span&gt;, tolerance&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#ae81ff"&gt;1e-8&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; solver&lt;span style="color:#f92672"&gt;=&lt;/span&gt;SolverType&lt;span style="color:#f92672"&gt;.&lt;/span&gt;AMG_CG,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; h2_cache&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;&amp;#34;&lt;/span&gt;, h2params&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#66d9ef"&gt;None&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; fmm_params&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#66d9ef"&gt;None&lt;/span&gt;, backend&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#66d9ef"&gt;None&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; tree_type&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#66d9ef"&gt;None&lt;/span&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Parameter&lt;/th&gt;
 &lt;th&gt;Type&lt;/th&gt;
 &lt;th&gt;Description&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;coordinates&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;(n, 3)&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;Node positions&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;elements&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;(ntet, 4)&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;Tetrahedral connectivity, 0-indexed&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;Ms&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;(n,)&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;Saturation magnetization per node (A/m)&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;scale&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;float&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;Length unit: &lt;code&gt;1.0&lt;/code&gt; = m, &lt;code&gt;1e-9&lt;/code&gt; = nm&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;tolerance&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;float&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;Iterative solver tolerance&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;solver&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;SolverType&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;GPU solver preset&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;h2_cache&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;str&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;H2 matrix cache file path (empty = no caching)&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;h2params&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;ParamsFKH2Lib&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;H2-matrix compression parameters&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;fmm_params&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;ParamsFKFMM&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;GPU FMM parameters&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;backend&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;BemBackend&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;BEM backend (default: &lt;code&gt;FMM_GPU&lt;/code&gt;)&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;tree_type&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;TreeType&lt;/code&gt; or &lt;code&gt;str&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;FMM tree strategy&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Additional methods:&lt;/p&gt;</description></item><item><title>µMAG Standard Problem #4</title><link>https://www.ferrolith.org/posts/benchmarks/mumag-sp4/</link><pubDate>Mon, 16 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.ferrolith.org/posts/benchmarks/mumag-sp4/</guid><description>&lt;p&gt;&lt;a href="https://www.ctcms.nist.gov/~rdm/std4/spec4.html"&gt;μMAG Standard Problem #4&lt;/a&gt; studies the time-dependent magnetisation reversal of a thin-film Permalloy rectangle (500 nm × 125 nm × 3 nm) with material parameters $M_s$ = 8 × 10⁵ A/m, $A$ = 1.3 × 10⁻¹¹ J/m, $\alpha$ = 0.02.&lt;/p&gt;
&lt;p&gt;The system is initialised in an S-state (obtained by relaxing from saturation along the [1, 1, 1] direction) and then subjected to a reversing field:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Field 1:&lt;/strong&gt; $\mu_0 H$ = −25 mT at 170° from the $+x$ axis&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Field 2:&lt;/strong&gt; $\mu_0 H$ = −36 mT at 190° from the $+x$ axis&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The reported quantities are the spatially averaged magnetisation components $\langle M_x \rangle / M_s$, $\langle M_y \rangle / M_s$, $\langle M_z \rangle / M_s$ as a function of time.&lt;/p&gt;</description></item><item><title>Heistracher et al. — Domain wall pinning</title><link>https://www.ferrolith.org/posts/benchmarks/heistracher-sp/</link><pubDate>Mon, 16 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.ferrolith.org/posts/benchmarks/heistracher-sp/</guid><description>&lt;p&gt;The &lt;a href="https://doi.org/10.1016/j.jmmm.2021.168875"&gt;Heistracher et al. standard problem&lt;/a&gt; tests domain wall pinning at the interface of a two-phase magnetic rod. It is sensitive to discontinuities in the exchange constant $A$, uniaxial anisotropy $K$, and spontaneous polarisation $J_s$ between phases, making it a targeted test for correct interface handling.&lt;/p&gt;
&lt;p&gt;P. Heistracher, C. Abert, F. Bruckner, T. Schrefl, D. Suess, J. Magn. Magn. Mater. &lt;strong&gt;548&lt;/strong&gt;, 168875 (2022).&lt;/p&gt;
&lt;h2 id="problem-setup"&gt;Problem setup&lt;a class="anchor" href="#problem-setup"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A cuboid rod (80 nm × 1 nm × 1 nm) is divided into two equal halves:&lt;/p&gt;</description></item></channel></rss>