fix addforce/magnetic command

Warning

GPU support for this command has not been tested and may not work as expected.

Syntax

fix ID group-ID addforce/weighted keywords values
  • ID, is documented in fix command.

  • addforce/weighted = style name of this fix command

  • zero or more keyword/value pairs may be appended

  • keyword = region or binsize or file or file_coords or c_calibration or dipole_init

region value = region-ID
  region-ID = ID of region atoms must be in to have added force
binsize value = bsize
  bsize = size of bins for structured grid used (length units)
file value = filename
  filename = filename for reading magnetic field data (string)
file_coords value = filename_coords
  filename_coords = filename to write coordinate data of grid cells (string)
c_calibration value = cc
  cc = calibration constant for imperfection of real-world systems (dimensionless)
dipole_init value = dx dy dz
  dx dy dz = initial values dipole  (length units)
dipole_lookup values = n_lookup nl H_lookup H1 H2 ... B_lookup B1 B2 ...
  n_lookup = obligatory keyword
  nl = number of H/B tuples for lookup table
  H_lookup = obligatory keyword
  H1, H2, ... = values for magnetic field strength used for lookup-table (A/m)
  B_lookup = obligatory keyword
  B1, B2, ... = values for magnetic flux density used for lookup-table (T)

Examples

region magreg block -1. 1. -1. 1.  0. 1. units box
fix mag all addforce/magnetic region magreg binsize 1.0  dipole_init 0.001 0. 0. file data/mag.file file_coords data/file.coords
fix mag all addforce/magnetic region magreg binsize 1.0  dipole_init 0.001 0. 0. file data/mag.file file_coords data/file.coords dipole_lookup n_lookup 3 H_lookup -200 0 200 B_lookup -1.7 0 1.7

Description

This fix adds a magnetic forces and torque to dipole particles as defined by the atom_vec dipole command in the fix group. The calculation is based upon field values of magnetic field (H) and spatial gradient of magnetic field (gradHx, gradHy, gradHz). The magnetic force for dimensions d=x,y,z is

force_d = cc * Vp * (dipole_x*gradHx_d + dipole_y*gradHy_d + dipole_z*gradHz_d)

where dipole is the magnetic dipole vector and Vp the particle volume. cc is a calibration constant with default 1.0, which can be defined via the c_calibration keyword. It can be used to calibrate imperfections of real-world systems.

Likewise, the magnetic torque is calculated from the cross-product of magnetic dipole and magnetic field:

torque = cc* Vp * dipole x H

The mandatory keyword dipole_init must be used to define the dipole vector of each particle when it is inserted / added to the simulation domain. The initialization is only performed for particles where the dipole moment is equal 0/0/0

If the region keyword is used, the atom must also be in the specified geometric region in order to have the force added to it.

The bounding box of the region defined is used as a basis for the structured grid. Keyword binsize, which is mandatory, is used to define the grid size for this structured grid storing the field information.

With the optional keyword file_coords, you can have the code write the coordinates of each bin / grid cell to a file. An example for a grid just containing 4 cells is shown below:

x y z
-0.500000 -0.500000 0.500000
-0.500000 0.500000 0.500000
0.500000 -0.500000 0.500000
0.500000 0.500000 0.500000

The mandatory keyword file is used to specify the location of the file containing the field values for the magnetic field data. It contains of a header line and data lines. The first 3 columns must contain the coordinate of the bin / grid cell, followed by data for the fields H, gradHx, gradHy, and gradHz. The header line starts with “x y z”, followed by the name of each field component (e.g., H_x for the x component of the H field).

An example for the file format required for this fix is shown here:

x y z                           H_x H_y H_z  gradHx_x gradHx_y gradHx_z  gradHy_x gradHy_y gradHy_z  gradHz_x gradHz_y gradHz_z
-0.500000 -0.500000 0.500000    100. 0. 0.   150. 0. 0.                  0. 0. 0.                    0. 0. 0.
-0.500000  0.500000 0.500000    100. 0. 0.   150. 0. 0.                  0. 0. 0.                    0. 0. 0.
 0.500000 -0.500000 0.500000      0. 0. 0.    50. 0. 0.                  0. 0. 0.                    0. 0. 0.
 0.500000  0.500000 0.500000      0. 0. 0.    50. 0. 0.                  0. 0. 0.                    0. 0. 0.

With the optional dipole_lookup, the value for the magnetization is set via a look-up from the provided tuples of H/B values, which are linearly connected. If the value is out of range, then a zero-order-hold is applied. If dipole_lookup is used, then the magnetization is set as M(H) = B(H) / H * eM., where eM is the unit vector of M(H) before applying the lookup.

Restart, fix_modify, output, run start/stop

This fix does not need to write data to binary restart files. None of the fix_modify options are relevant to this fix.A global vector is stored by this fix for access by various output commands. It contains the x,y,and z component of the force that was actually applied No parameter of this fix can be used with the start/stop keywords of the run command.

Restrictions

This command cannot applied to nonspherical particles.

This fix is only applicable to dipole particles, as defined via atom_vec dipole

Coarse-graining information:

Using coarsegraining in combination with this command might lead to different dynamics or system state and thus to inconsistencies. However, the influence of this model on the global dynamics or system state might be small so in some cases the results may be valid. This has to be reviewed by a specialist on a case-by-case basis.

Default

region = whole simulation box c_calibration = 1.0