Neighborlist building routine for molecular dynamics
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
Platform Compatibility
Windows macOS LinuxCategories
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.0.0.0 |