# magnum.fd, a fork of MicroMagnum

We present the fork magnum.fd of the finite-difference code MicroMagnum that performs micromagnetic computations on CPU as well as GPU. The original project was developed at the University of Hamburg by the MicroMagnum team. Finite-difference codes are well suited for cuboid structures and magnetic thin films.

This fork is aimed to extend the functionality of MicroMagnum. In the long term we want to change the interface to be compatible to that of magnum.fe. As first extensions we introduce a direct minimization algorithm and a GmshShape class that is able to handle a large number of CAD and mesh file formats for the import of geometries.

The new minimizer can be called on any micromagnetic solver object

solver = create_solver(world, [StrayField, ExchangeField])
solver.minimize()


The GmshShape class is able to read a number of geometry files. Usually you do not only need the shape but also a mesh that fits the geometry of the shape. In order to create the shape and a suitable mesh from a geometry file you can do the following

mesh, shape = GmshShape.with_mesh_from_file("sample.brep", (5e-9, 5e-9, 5e-9))


Here the second argument defines the cell size of the mesh.