Skip to content

PPAFM GUI

NikoOinonen edited this page Jun 14, 2023 · 7 revisions

The GPU version of PPM comes with a graphical user interface (GUI) application. It is requires some optional dependencies that can be installed according to the installation instructions in the README. After the installation you can launch the GUI from the command line with

ppafm-gui

After running the command, you should see window like this appear: ppafm-gui

Usage

  • Open a file by clicking Open File... at the bottom or provide an input file as a command line argument. The input file can be a .xyz geometry file (possibly with point charges*), a VASP POSCAR or CONTCAR file, an FHI-aims .in file, or a .xsf or .cube Hartree potential file. Loading large files may take some time.
  • Changing any number in any input box will automatically update the image. There are also presets for some commonly used tip configurations. Hover the mouse cursor over any parameter for a tooltip explaining the meaning of the parameter.
  • Click anywhere on the image to bring up a plot of the df approach curve for that point in the image.
  • Scroll anywhere on the image to zoom the scan window in/out of that spot.
  • Click on the View Geometry button to show the system geometry in ASE GUI.
  • Click on the Edit Geometry button to edit the positions, types, and charges of the atoms in the system. Note that for Hartree potential inputs, editing charges is disabled and editing the geometry only affects the Lennard-Jones force field.
  • Click on the View Forcefield button to view different components of the force field. Note that the forcefield box size is inferred automatically from the scan size and is bigger than the scan size. Take into account the probe particle equilibrium distance when comparing the reported z-coordinates between the forcefield and the df image.
  • Click on the Edit Forcefield button to edit the per-species parameters of the Lennard-Jones forcefield.
  • Save the current image or df data by clicking the Save Image... or Save df... buttons at the bottom.
  • In case there are multiple OpenCL devices installed on the system, use the -l or --list-devices option to list available devices and choose the device using the -d or --device option with the device platform number as the argument.

*Note that while input files without charges work, depending on the system, the resulting image may be significantly different from an image with electrostatics, and therefore may not be representative of reality. If no electrostatics are included, this is indicated in the title of the image.

Launching from the desktop

Launching GUI applications from the command line is no fun, so you may want to create a desktop icon for ppafm-gui.

Linux

On Linux desktops, you can create a desktop entry by creating a .desktop file. Create a file named ppafm-gui.desktop inside ~/.local/share/applications/ with the following contents

[Desktop Entry]
Type=Application
Name=PPAFM-GUI
Comment=Simulate high-resolution atomic force microscopy images
Exec=ppafm-gui %f
Terminal=false

A new application named PPAFM-GUI should appear in your list of applications (may require a re-login) and you should be able to open files with this application in your file manager with right-click->"Open with..." dialog. You may want to modify the Exec line with additional options to, for example, choose the OpenCL device with the -d option.

Windows

Go to the desktop and create a new shortcut with right-click->New->Shortcut. In item location field, type ppafm-gui. Click Next, and type any name you want for the shortcut. Double-clicking the shortcut should now open the GUI. It should also be searchable in the Start menu, and you can associate file types to the shortcut with right-click->"Open With". You can modify command-line arguments to the application by right-click->Properties on the shortcut and modify the Target field.

MacOS support

Apple has officially deprecated OpenCL in favor of their Metal platform since MacOS 10.14, so support is not guaranteed into the future. We haven't tested the GUI on MacOS, but you could try anyway. Running with pocl according to the pyopencl documentation should work.