-
Notifications
You must be signed in to change notification settings - Fork 19
Technical details
The ppafm code is divided into Python and C++, where performance intensive computations are done in C++ and python is used as convenient scripting interface for doing tasks like file I/O, plotting, memory management. For binding of Python and C++ is used python [ctypes] (https://docs.python.org/2/library/ctypes.html) library.
- Python : python ( >=3.7 ), numpy , matplotlib , ctypes .
- only for development: C++ : g++ ( tested with g++ (Ubuntu 4.8.1-2ubuntu1~12.04) 4.8.1 ) or MS Visual C++
- only for GUI and/or graphic card usage: OpenCL and PyQt5.
-
ProbeParticle.cpp
- implementation of all performance intensive Probe-Particle Model as dynamic library which can be called dynamically from python. -
Vec3.cpp
,Mat3.cpp
math subroutines for operations with 3D vectors and metrices
-
ProbeParticle.py
- Interface between C++ core and python ising C-types. Here are also defined some python rutines like: -
- conversion from Force to frequency shift (
Fz2df
),
- conversion from Force to frequency shift (
-
- evaluation of Lenard-Jones coeffitints (
getAtomsLJ
),
- evaluation of Lenard-Jones coeffitints (
-
- copy sample geometry to simulate periodic boundary condition (
PBCAtoms
),
- copy sample geometry to simulate periodic boundary condition (
-
- automatic setup of imagining area acroding to geometry of nonperiodic sample (
autoGeom
),
- automatic setup of imagining area acroding to geometry of nonperiodic sample (
-
- and default parameters of simulation (
params
) with subroutine to read this parameters from a file (loadParams
)
- and default parameters of simulation (
-
test2.py
,testServer2.py
- two examples of python scripts with run actual computations using ProbeParticle library. The idea is that this files can be modified by user to match particular task. -
basUtils.py
- routines for loading of molecule geometry from xyz-format, (loadAtoms
), finding bonds and other. -
Element.py
andelements.py
contains just parameters of atoms form periodic table ( like effective raidus, color for visualization etc. ). It is used bybasUtils.py
.
There are several non-intuitive hits about definition of coordinete system in the code:
- The code works in coordinate system where the origin of sampling grid is always in point (x,y,z)=(0,0,0). The geometry of sample should be alignet (i.e.) shifted to fit into this grid.
- In reality probe particle (PP) cannot approach to sample than ~3.5-4.0 Angstroem ( because van der Waals radius of most atoms is typically 1.5-2.0 Angstroem ). For this reason we do not want to sample region closer than 1.0-2.0 Angstroem to the molecule where the Pauli repulsion would be extremely high, and where quantum mechanical interactions (chemical force) would be important.
- The region of sanning
scanMax
,scanMin
is defined as a position of metallic tip apex (not the probe particle!!!). This means that probe particle can be outside the sampled forcefield grid. The real position of the {{ (i.e. the point where the force is interpolated from forcefield grid ) is shifted from this position by considerable distance ( ~ 4.0 Angstroem ). E.g. At the beginning of each tip approach the shift isr0Probe
(relaxation is negligible).
Overview of relative position of various points in space is schematically illustrate on following image:
For periodic systems ( PBC=true
) the lateral position of sample is taken as it is provided by user and geometry of supercell ( gridA
, gridB
, gridC
) are defined manually.
However, for non-periodic system it is convenient to use automatic routine PP.autoGeom
. Please note, that this routine is not used in generateLJFF.py by default. This routine will make a bounding box around the sample ( according to min an max coordinates of atoms ), and add some border (by default 3.0 Angstroem ) and than shift the molecule in the center of that box. The result should be aligned like this: