Neighborlist building routine for molecular dynamics

This routine returns interaction pairs for a given set of atoms in 3D space.
1.1K Downloads
Updated 11 Jun 2009

View License

Linked cell algorithm is used, therefore, the computational cost is linear vs. the number of atoms.

Periodic boundary condition can be activated as an option.

A cubic region should be defined for generating the neighborlist.

Atomic coordinates can be ONLY in 3D format, as row vectors.

% [nebrTab, nebrLen] = md_neighlist_cube( x, nx, rc, srgdat, bctyp, frc) %
% ----------------------------------------------------------------------
% Create neighbor list for atomic system in a cubic %region
% WZ. Shan
%-----------------------------------------------------------------------
% input:
% x : atom coords, [ px, py, pz]
% nx : num. of atoms, = size( x, 1)
% rc : cutoff radius
% srgdat : region data [ srg_o(1:3), W, H, D]
% : [ srg_o(1:3), W, H, D, x, y, z] if bctyp == 2,
% srgdat defines the cubic region, where
% srg_o: coordinates of the lower-left-back corner
% [W, H, D]: dimension of the cube in x,y,z-direction.
%
% bctyp : types of boundary, 1: free, 2: periodic
% frc : cell size factor( optional)
% output:
% nebrTab : interaction pairs, [p1, p2]
% nebrLen : size( nebrTab, 1)
% ncell : global cell coordinates
% id_cell : cell coordinates

Cite As

Wenzhe Shan (2024). Neighborlist building routine for molecular dynamics (https://www.mathworks.com/matlabcentral/fileexchange/24411-neighborlist-building-routine-for-molecular-dynamics), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2008a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Biological Physics in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0.0