Hi,
Unfortunately mumax does not have a good way to do that, that I know of. The easiest way to simulate grain boundaries is to e.g. weaken the exchange between grains using ext_ScaleExchange(). This would account for the grain boundaries implicitly.
In order to explicitly consider grain boundaries, when I did it, what I did was write a separate python/matlab script. You can save a copy of the regions.OVF with the voronoi tessellation done by mumax, and then import the OVF data as a matrix. Then you would want to write a script that looks for 2 cells with different region numbers (which indicates a grain boundary). When it does this, it replaces x cells in each direction with a new region value, and this new region can be set to act as a grain boundary. The number x of cells replaced would correspond to the thickness of the grain boundary.
Instead of just going x cells in each direction, I replaced every cell in a circle (in 3-D, a sphere) around the grain boundary point. This probably isn't necessary, but it gave smoother edges, which seemed more realistic in my case.
The algorithm itself is pretty straightforward, but it can be difficult to restrict yourself to the 256 region limit. I had to use a lot of little tricks to reuse regions. Unfortunately the 256 limit is a hard limit, unless you're willing to recompile mumax.
Best,
Josh L.