New build system migration (issue #298 + 2 more improvements)#311
Closed
Artemkth wants to merge 1 commit intomumax:3.11from
Closed
New build system migration (issue #298 + 2 more improvements)#311Artemkth wants to merge 1 commit intomumax:3.11from
Artemkth wants to merge 1 commit intomumax:3.11from
Conversation
Contributor
|
Thank you for your contribution! The two improvements have been merged in dc06ce3. The function This allows loading arbitrary OVF geometries, as in the example below. The change to a Go module was not yet merged. What is the benefit of putting |
Closed
jplauzie
pushed a commit
to jplauzie/mumax3
that referenced
this pull request
Feb 16, 2026
In 3.11, the function VoxelShape was no longer exposed to users since mx3 scripts do not allow for arbitrary arrays mumax#311 (comment). However, Voxelshape actually takes a slice as input, and therefore works with newScalarMask() without any other changes required. A minimal example is below: Nx := 64 Ny := 64 Nz := 32 SetGridSize(Nx, Ny, Nz) SetCellSize(5e-9, 5e-9, 5e-9) mask := NewScalarMask(Nx, Ny, Nz) for i:=0; i<Nx; i++{ for j:=0; j<Ny; j++{ for k:=0; k<Nz; k++{ r := index2coord(i, j, k) x2 := pow(r.X(),2) y2 := pow(r.Y(),2) z2 := pow(r.Z(),2) if pow((x2+y2+z2),0.5)< 50e-9{ mask.Set(0, i, j, k, 1) } } } } geomfrommask := VoxelShape(mask, 5e-9, 5e-9, 5e-9) SetGeom(geomfrommask)
jplauzie
added a commit
to jplauzie/mumax3
that referenced
this pull request
Mar 18, 2026
In 3.11, the function VoxelShape was no longer exposed to users since mx3 scripts do not allow for arbitrary arrays mumax#311 (comment). However, Voxelshape actually takes a slice as input, and therefore works with newScalarMask() without any other changes required.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

I have done several changes to original repo since I have forked, the most major of which is move to the new go 'module' system. which allows building the Mumax3. Using old legacy arrangements for whatever reason selects wrong tag in git repo(v3.9.3), and produces no executables (highlighted in issues section #298).
Implementing proper build system is trivial for the project as there is no significant external dependencies, and just involves appending v3 to all the mumax3 imported modules per the new convention. And it also allows easier forking, as building is now possible outside of
$GOPATH. Check out my personal fork repo readme to how it is done.I also have added few more features of my own over the years, I didn't knew how to split the pull request so please consider those as well:
InitGeomFromOVFwhich takes an external file name as an argument. It initialises both the mesh parameters, as well as sets the internal geometry to be the one from the external file. This allows to bake profiles externally in, for example, Wolfram Mathematica or Python. Example simulation, Permalloy pig head, r~1um. The code for baking profiles I will release later. Geometry feature I extensively tested over last year, and haven't found any more bugs, yet, than I fixed in this PR.This version compiles for me, although, some minor changes to your CI scripts might be needed. Self tests run well, except the convergence test having a delta ~2e-5 higher than 1e-5 target.