Current Sheets#
A current sheet is an idealized surface over which an electric current flows continuously. Instead of current being distributed throughout a volume, it is concentrated in an infinitesimally thin layer, described by a surface current density \(\vec{j}\) with units of A/m.
Magpylib provides an implementation for computing the magnetic field generated by an arbitrary current flowing along a triangular surface. This feature allows the construction of complex surface current distributions through superposition of multiple triangular elements.
The object-oriented interface offers two dedicated classes for this purpose:
Triangle Strip#
The TriangleStrip class provides a convenient way to construct a current-carrying strip, band, or ribbon by simply supplying a sequence of vertices. These vertices should follow the alternating top-and-bottom pattern described in the class documentation.
We visualize the magnetic field of this current strip in the x–z plane, following the Matplotlib streamplot example. Notice how the streamlines differ: on the left side, where the strip is oriented upright, the field appears distinctly different from the right side, where the strip lies in-plane.
Current strips can also be used to create complex magnet prisms using the Equivalent Current Method.
Triangle Sheet#
The TriangleSheet class is used to construct arbitrary current sheets from a collection of individual triangle elements, each carrying its own specified surface current density. This enables detailed modeling of complex surface current distributions with good control over geometry and current flow.
If you already have a triangulated surface along with corresponding current density vectors—e.g., from a finite element simulation—this data can be directly passed to the TriangleSheet class.
In the following example, we generate a triangular mesh covering a square region and define a spatially varying current density using a custom function.
This setup corresponds to a circular surface current with increasing amplitude towards the edges of a rectangular sheet. Notice that we can tune the mesh styling.
Now we use a pixel field quiver plot to visualize the resulting magnetic field with minimal effort:
We observe that the B-field closely resembles the field of a classical current loop. Possibly this is the result of the current’s increase in amplitude with distance from the center of the sheet.