Skip to content
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

timesolver.solve often breaks everything #25

Open
lamoreel opened this issue Oct 4, 2024 · 3 comments
Open

timesolver.solve often breaks everything #25

lamoreel opened this issue Oct 4, 2024 · 3 comments
Assignees

Comments

@lamoreel
Copy link
Contributor

lamoreel commented Oct 4, 2024

@ilateur : by making stupidly small duration steps

@lamoreel
Copy link
Contributor Author

lamoreel commented Oct 4, 2024

What's this about? solve() assures a sensible timestep at the beginning of the first run().

@lamoreel lamoreel self-assigned this Oct 4, 2024
@ilateur
Copy link
Collaborator

ilateur commented Oct 4, 2024

Sometimes you can call solve twice for a single system, for example from t=0 to t=t1, then from t=t1 to t=t2. (I think) after the first solve, time is not exactly at t1, so then it tries to reach t1, but the timesolver thinks it's already good enough, and it gets stuck in an infinite while loop.
I should have made an example, because sometimes it's completely fine too and it might be hard to recreate.

@lamoreel
Copy link
Contributor Author

lamoreel commented Oct 4, 2024

For future reference, this minimal working example reproduces this getting stuck:

from mumaxplus import Ferromagnet, Grid, World
import numpy as np


w = World(cellsize=(1e-9, 1e-9, 1e-9))
magnet = Ferromagnet(w, Grid((5, 5, 5)), "fm")

eps = 1e-17
tp1 = np.linspace(0, 5e-10, 5)
tp2 = np.linspace(5e-10 + eps, 10e-10, 5)

outputquantities = {"m": lambda: magnet.magnetization.average()}

output1 = w.timesolver.solve(tp1, outputquantities)
output2 = w.timesolver.solve(tp2, outputquantities) # fails to compute

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants