Repository navigation
Besides a variety of new shapes, this update introduces several useful functions like CustomQuantity(slice) which can turn a Go slice into a custom quantity. In combination with the new CellIndices() or the old LoadFile(), NewScalarMask() or NewVectorMask(), this enables the efficient generation of custom fields inside .mx3 scripts. It is now also possible to automatically interrupt minimize() and relax() after a given real time has passed. As always, new functions prefixed by ext_ may exhibit unintuitive behavior in some edge cases, so always double-check their output when used in more complex simulations (e.g., with moving windows or rotating systems).
Important bugfixes include restoring the ability to obtain stray fields in regions where Msat==0, and a scaling issue in ExchCoupling and DindCoupling.
Changelog
New functionality in input scripts
New functions
CustomQuantity(slice): turns a*data.Sliceinto aQuantity, allowing more complex fields to be used in operations likeAdd,Mul, ... without having to abuse builtin quantities. A slice can be made with, e.g.,NewScalarMask,LoadFile, ... #384 by @jplauzie.CellIndices(): returns a 4D*data.Slicewith the indexix, iy, izof each cell, starting at 0 in the (-X, -Y, -Z) corner. #384.CurrentMag(): returns a snapshot of the current magnetization as aConfig. #388 by @jplauzie.ext_grainboundaries(startregion, numgrains, offset, boundarythickness, zeroflag): generates grain boundaries as regions. Given a distribution of regions, the region index of cells in regionsstartregiontostartregion+numgrainsthat lay withinboundarythicknessof a region boundary will be incremented byoffset. See also:ext_grainboundary_edgeXetc. #387 by @jplauzie.ExpectB(msg, have, want): technical function for test scripts that panics if twobools are not equal. #392.
New Shapes
-
Superball(diameter, p): smooth interpolation between cube (p=∞), circle (p=1), octahedron (p=0.5) and beyond. #374 by @JLeliaert. -
Line(x1, y1, z1, x2, y2, z2, diam, linecap)andLine2D(x1, y1, x2, y2, diam, linecap): lines of a given diameter in 3D and 2D, respectively, with a few different options for the line caps. #383 by @JonathanMaes. -
VoxelShape(voxels, dx, dy, dz): elements >0.5 in the slicevoxelsbecomedx$\times$ dy$\times$ dzcuboids at the corresponding position, with the center of the slice at the origin. Introduced in #311 by @Artemkth, exposed to users in #390 by @jplauzie. -
ext_AllRegionShapes(): returns a functionfunc(int)which, given a region index, yields its correspondingShape. #385 by @jplauzie. -
ext_geomEdge(axis): returns aShapeof all cells on an edge of the geometry.axiscan be+X,-X,+Y,-Y,+Z,-Z. #386 by @jplauzie.
New variables
MinimizeWallClockTimeandRelaxWallClockTime: if set to a positive value,Minimize()andRelax()will be interrupted after this amount of real-time seconds unless they converge earlier. #388 by @jplauzie.NREGION: read-only value representing the maximum number of regions (=256). #389 by @jplauzie.ext_grainboundary_edgeX,Y,Z: affects the behavior ofext_grainboundaries()at the edges of the simulation box. #387 by @jplauzie.
Other changes
Minimize()andRelax()now return a boolean value indicating whether convergence was achieved. #388 by @jplauzie.
Bugfixes
- A fix in 3.11.1 made
B_demagunavailable whereMsat == 0, preventing users from obtaining stray fields. Fixed in #381, originally reported by @ac2290. ExchCouplingandDindCouplingwere 4x or 6x larger than they should be. Fixed in #377, originally reported by Elizabeth Martín Jefremovas.-httpflag had no effect on GUI port when running multiple files in a queue (e.g.,mumax3 -http="" file1 file2served GUI regardless).- Warning for extreme aspect ratios (>100) will no longer throw a fatal error. Changed in #382, originally requested by @janmasell.
- Warnings for non-7-smooth grid and high aspect ratios did not appear
log.txt. Fixed in #382. - Region 256 was allowed in some places. Fixed in #389.