Skip to content

Fix broken tip displacement calculation#388

Merged
mondracek merged 1 commit into
mainfrom
reverse
Apr 28, 2026
Merged

Fix broken tip displacement calculation#388
mondracek merged 1 commit into
mainfrom
reverse

Conversation

@mondracek
Copy link
Copy Markdown
Collaborator

Fixes #387.

  • The crucial line to be fixed was in ppafm.HighLevel.perform_relaxation().
  • I have added the --dist option to examples/FFPB_KPFM/run.sh so that we have some example that checks the --dist functionality in the future.
  • The change I have made in the relaxTipStrokes_omp function in ppafm/cpp/ProbeParticle.cpp is optional. The old definition of ioff values combined with the new definition of index order resulted in an erratic scanning of tip position in the x,y directions. The code still worked because all points would be eventually visited, although in a nonsensical order, but I thought it would still be better to make it consistent with the new index order.
  • Finally, I have removed the meshgrid3d function from ppafm/HighLevel.py. It did nothing and could not do anything as it lacked any command for output: neither it had a return command nor did it any argument reassignment. It caught my attention when I was checking how the np.meshgrid function works in the line I had to fix.

@mondracek mondracek self-assigned this Apr 22, 2026
@mondracek mondracek added the bug label Apr 22, 2026
@mondracek
Copy link
Copy Markdown
Collaborator Author

By the way, I had to commit this with git commit --no-verify, otherwise, I was getting
ERROR: Package 'isort' requires a different Python: 3.9.12 not in '>=3.10.0'.
As I understand it, it is because my git commit calls an old version of Python for the pre-commit checks. Sorry for that, I do not have a full control over the software versions used on our computer grid. I suppose I could move my ppafm installation to some virtual environment where I would install my own pip and git, but it seemed to be too much hassle to do it at this moment (especially as I am not completely sure whether it would helped or not).

Copy link
Copy Markdown
Collaborator

@NikoOinonen NikoOinonen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see ioff was in the wrong order. I don't understand transpose order in the meshgrid, but I trust you tested that it works.

@mondracek mondracek merged commit 40f309b into main Apr 28, 2026
15 checks passed
@mondracek mondracek deleted the reverse branch April 28, 2026 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tip displacement output broken (--dist option)

2 participants