Shortest paths PBC calculation

From Micro and Nano Mechanics Group
Revision as of 23:14, 16 October 2016 by Nbertin (talk | contribs) (Created page with "= Shortest paths calculation in periodic CGSD simulation = == Introduction == This example shows how to compute the shortest path between a bead in a CGSD simulation and its ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Shortest paths calculation in periodic CGSD simulation

Introduction

This example shows how to compute the shortest path between a bead in a CGSD simulation and its periodic image using the NetworCh library. The scripts and data files corresponding to this tutorial can be found in directory <NetworChDir>/tests/shortest_path_pbc/.

Loading and replicating the structure

% Load CGSD structure
filename = '0_percent_strain_x500';
[cn,bnds,vol] = read_cgsd(filename);

cn(:,end+1) = [1:size(cn,1)]';

% Merge cross-linked nodes
[cn,bnds] = merge_cross_links(cn,bnds);
% Calculate bonds physical lengths
bnds(:,end+1) = all_segments_length(cn,bnds,vol);

ndir = 2; % replicate in the y-direction
[cn1,bnds1,vol1] = replicate_volume(cn,bnds,vol,ndir);

bond_weight = bnds1(:,4); %use chain length as bond weight
bond_weight = bnds1(:,end); %use physical distance as bond weight

plot_structure(cn1,bnds1,vol1,'r');

Computing the shortest path between a bead and its periodic replica

Computing the periodic image shortest path distribution

n = size(cn,1);

Final script