-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ubermag with mumax3 #208
Comments
Hi @Siyuanq, unfortunately mumax3 does not currently have a package that you can install via python. We recommend downloading it directly from the mumax3 website and adding it to your |
What is the equivalent command for "export OOMMFTCL="/path/to/your/oommf.tcl"" in the case of mumax3? |
Hi @Siyuanq, as @samjrholt mentioned already, you have to manually install Mumax3 and ensure it is in To then use Mumax3 from within ubermag please install ubermag version |
@Siyuanq ,By reading the source code of API and mumax3c project, I summed up a feasible method for your reference, and asked @lang-m to check its correctness.
This method can be used without adding Mumax3 to |
Hi @Siyuanq as already suggested by @code-whale (thank you!) you can use Mumax3 installed in a custom directory by passing the full path to you Mumax3 executable to import mumax3c as mc
mc.runner.runner = mc.mumax3.ExeMumax3Runner(mumax3_exe='Full\\Path\\To\\Mumax3\\mumax3.exe')
# adjust path depending on your operating system
# the syntax for 'mc.runner.runner' might change in the future
...
td = mc.TimeDriver()
td.drive(system, t=1e-9, n=10) # internally uses mc.runner.runner to find the default runner |
Hi. But when I try running this example https://github.com/ubermag/workshop/blob/2022-06-29/tutorials/01_vortex.ipynb (changing oomfc to mumax3c and oc with mc) I receive an error "mumax3 not found". The docs and API don't say that I need to change anything else. I see the above responses in this issue to use mc.runner.runner but I have mumax3 added to the path. Should this not be sufficient? UPD. I managed to run the example with added "mc.runner.runner", but it's still not clear why PATH is not sufficient |
Hi @SeregaKR, normally Ubermag should find |
Hopefully this is what you need. @lang-m
If you need some additional logs, please write. The PATH variable screenshot is attached. When I use: |
Hi @SeregaKR , thank you for posting the log messages. Could you please let us know what As a temporary solution you could try
|
@samjrholt Already tried a temporary solution you offered - it works fine. I just wanted to understand why mumax3 installation is not detected automatically |
@SeregaKR Thanks for the log messages and your other tests. Your case is really strange. It would be great if we could find out what is going on there. Could you please check/report a few more things:
|
@lang-m, the responses are attached.
It seems that python doesn't import full PATH. Just for reference - I add mumax3 in PATH by .bashrc file in the Home folder like this:
|
@SeregaKR Apparently your Jupyter notebook is started from a different environment (without conda activated (?)) that does not have the path to mumax3 in the PATH variable. How do you normally start your jupyter notebook? Do you know if your Could you please try the following in a shell: conda activate <your ubermag environment>
echo $PATH
...
python -c "import os; print(os.environ['PATH'])"
...
jupyter notebook # please run the same "import shutil; shutil.which('mumax3')" in that notebook. |
@lang-m, ok - I tried this and now it looks like it's working. Which is very strange. I used Pyzo as an IDE usually and there were no problems before. I run Jupiter from the .desktop shortcut (attached) - which still should work. I'll try to troubleshoot it and write back. Thank you for the assistance |
@SeregaKR I can't see the .desktop attachment but I assume it starts from some environment that does not source your |
I have a problem when import mumax3c. it says |
AttributeError Traceback (most recent call last)
Input In [1], in <cell line: 6>()
4 import discretisedfield as df
5 import micromagneticmodel as mm
----> 6 import mumax3c as mc
7 mc.runner.runner = mc.mumax3.ExeMumax3Runner(mumax3_exe='/home/siyuanq3/mumax/mumax')
File ~/anaconda3/envs/mumax/lib/python3.8/site-packages/mumax3c/__init__.py:5, in <module>
2 import pkg_resources
3 import pytest
----> 5 import mumax3c.mumax3
6 import mumax3c.scripts
8 # from .compute import compute # compute is not yet supported
File ~/anaconda3/envs/mumax/lib/python3.8/site-packages/mumax3c/mumax3/__init__.py:1, in <module>
----> 1 from .mumax3 import ExeMumax3Runner, Mumax3Runner, Runner, overhead
File ~/anaconda3/envs/mumax/lib/python3.8/site-packages/mumax3c/mumax3/mumax3.py:17, in <module>
12 import mumax3c as mc
14 log = logging.getLogger("mumax3c")
---> 17 class Mumax3Runner(mm.ExternalRunner):
18 """Abstract class for running mumax3."""
20 @property
21 def package_name(self):
AttributeError: module 'micromagneticmodel' has no attribute 'ExternalRunner' Above is the detailed error report |
@Siyuanq Apparently, you have an older version of |
Hello again. I'm checking documentation about making hysteresis loops. It seems that the mumax3c module doesn't have this function from the box yet. It's possible to do this now in a roundabout way by setting Zeeman energy directly and doing minimize and relax functions afterward. But this is not described in examples and docs very well. The code below shows how I tried implementing it (I needed only the Bx component changed). The code is only for the virgin curve. But now, each step generates 2 files for each field (minimize and relax) which is a bit too much.
and then the same can be done for the downward and upward curves. The corresponding code in mumax3 is also attached for reference.
I hope that in the future, HysteresisDriver will be implemented from the box for mumax3. It took me an embarrassingly long time to find that you can set system.energy.zeeman.H |
Instructions how to use different calculators are now available on the website: https://ubermag.github.io/installation.html#installing-a-calculator |
The conda install method will install ubermag and oommf together. Is there any way to install ubermag with mumax?
The text was updated successfully, but these errors were encountered: