Closed fgr1986 closed 3 years ago
Hi @fgr1986, thank you for your question. n
is the number of discretisation cells in mesh and it must be an integer. It should be:
import numpy as np
import oommfc as oc
import discretisedfield as df
import micromagneticmodel as mm
# Define a macrospin mesh (i.e. one discretisation cell).
p1 = (0, 0, 0) # first point of the mesh domain (m)
p2 = (10e-9, 10e-9, 1e-9) # second point of the mesh domain (m)
cell = (1e-9, 1e-9, 1e-9) # discretisation cell size (m)
region = df.Region(p1=p1, p2=p2)
mesh = df.Mesh(region=region, cell=cell)
or
import numpy as np
import oommfc as oc
import discretisedfield as df
import micromagneticmodel as mm
# Define a macrospin mesh (i.e. one discretisation cell).
p1 = (0, 0, 0) # first point of the mesh domain (m)
p2 = (10e-9, 10e-9, 1e-9) # second point of the mesh domain (m)
n = (10, 10, 1) # discretisation cell size (m)
region = df.Region(p1=p1, p2=p2)
mesh = df.Mesh(region=region, n=n)
You can have a look at this tutorial: https://github.com/ubermag/discretisedfield/blob/master/docs/ipynb/mesh-basics.ipynb
Thanks, that was a bad copy paste :P
Hi, the following code
produces the following exception. I believe, from the documentation tutorials that the discretisation cell size should be specified in meters.