| Bsoft 2.0.5 Bernard's software package

Functions | Variables
bafm.cpp File Reference

Simulation of AFM experiments. More...

`#include "rwimg.h"`
`#include "utilities.h"`
`#include "options.h"`
`#include "timer.h"`

Go to the source code of this file.

## Functions
Bimage * | afm_generate_tip (Vector3< long > size, Vector3< double > sampling, double radius, double angle, double resolution)
| Generates a rounded conical AFM tip. More...
Bplot * | afm_simulate (Bimage *ptip, Bimage *p, double spring, double modulus, double thick)
| Simulates and AFM experiment. More...
Bimage * | afm_force_to_height (Bimage *pf, double force_step)
| Converts an AFM force map into a set of 2D height images at different constant force values. More...
int | main (int argc, char **argv)
int | afm_simulate_at_xy (Bimage *ptip, Bimage *p, long ii, float *force, double spring, double modulus, double thick)

## Variables
int | verbose
const char * | use []

## Detailed Description

Simulation of AFM experiments.

Author
  Bernard Heymann

Date
  Created: 19990124
  Modified: 20170612

Definition in file bafm.cpp.

## Function Documentation

## ◆ afm_force_to_height()

Bimage * afm_force_to_height | ( | Bimage * | pf,
|  | double | force_step
| ) |  |

Converts an AFM force map into a set of 2D height images at different constant force values.

Parameters

  *pf | force map.
  force_step | force intervals for height images

Returns
  *ph height images.

Definition at line 452 of file bafm.cpp.

## ◆ afm_generate_tip()

Bimage * afm_generate_tip | ( | Vector3< long > | size,
|  | Vector3< double > | sampling,
|  | double | radius,
|  | double | angle,
|  | double | resolution
| ) |  |

Generates a rounded conical AFM tip.

Parameters

  size | size of the tip density
  sampling | sampling/spacing (in angstrom/pixel)
  radius | radius of the tip curvature (in angstrom)
  angle | angle of the tip side (in radians)
  resolution | the resolution affects the tip surface softness

Returns
  Bimage* tip 3D map.

      A 2D image of a conical tip is generated, with a 45 degree angle and
      a rounding tip with the desired radius and softness.
      The 2D image is then converted to a 3D surface using the function
      img_to_surface and returned.  The density of beta-silicon nitride
      of 1.925 Da/A3 is used.

Definition at line 204 of file bafm.cpp.

## ◆ afm_simulate()

Bplot * afm_simulate | ( | Bimage * | ptip,
|  | Bimage * | p,
|  | double | spring,
|  | double | modulus,
|  | double | thick
| ) |  |

Simulates and AFM experiment.

Parameters

  *ptip | AFM tip density map - converted to force map.
  *p | specimen density map.
  spring | AFM cantilever spring constant (N/m).
  modulus | bulk modules (N/m2).
  thick | sample thickness (angstrom).

Returns
  Bplot* force curve.

      The elastic force on an AFM tip is calculated as:
          F = kt*dz = kb*dV/d
      where   kt is the cantilever spring constant, typically 0.01 - 0.1 N/m.
              dz is the tip displacement due to specimen interaction.
              kb is the bulk modulus of the specimen, typically 1e9 N/m2.
              dV is the volume of the specimen displaced by the tip. This
                  volume is here approximated as the density overlap volume.
              d is the specimen thickness in angstrom.
      The tip is positioned at each point (x,y,z) in the density map and the
      overlap volume calculated (i.e., a type of convolution).  This tip
      position corresponds to a zero displacement.  The correct tip position
      is found by shifting the tip upwards (in the z-direction) until the
      displacement and elastic forces are approximately equal.  The tip
      displacement is refined by interpolation and the force calculated.
      The force map is returned in place of the original density map.
      Forces are calculated in piconewton.
      The origin of the tip density is taken as nx/2, ny/2, 0.

Definition at line 362 of file bafm.cpp.

## ◆ afm_simulate_at_xy()

int afm_simulate_at_xy | ( | Bimage * | ptip,
|  | Bimage * | p,
|  | long | ii,
|  | float * | force,
|  | double | spring,
|  | double | modulus,
|  | double | thick
| ) |  |

Definition at line 269 of file bafm.cpp.

## ◆ main()

int main | ( | int | argc,
|  | char ** | argv
| ) |  |

Definition at line 62 of file bafm.cpp.

## Variable Documentation

## ◆ use

const char* use[]

Definition at line 25 of file bafm.cpp.

## ◆ verbose

int verbose