NetworCh Introduction and examples

From Micro and Nano Mechanics Group
Revision as of 02:49, 13 October 2016 by Nbertin (talk | contribs) (Created page with "NetworCh manuals: Reference = Introduction and examples = == NetworCh basics == === Network representation === A network is a collection of vertices (nodes) joined by edges...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

NetworCh manuals: Reference

Introduction and examples

NetworCh basics

Network representation

A network is a collection of vertices (nodes) joined by edges (links). In NetworCh, each network/structure is represented by a list of nodes position rn and a list of links links. The first three columns of rn are reserved for the (x,y,z) spatial coordinates of each node. The two first columns of links must contain the id of nodes connected by the edges.

For example, a simple network consisting of two nodes A = (xa,ya,za) and B = (xb,yb,zb) joined by a single segment can be initialized as:

% Nodes
rn = zeros(2,3);
rn(1,1:3) = [xa,ya,za];
rn(2,1:3) = [xb,yb,zb];

% Links
links = zeros(1,2);
links(1,1:2) = [1,2];

Network visualization

A network can plotted with function plot_structure:

plot_structure(rn,links);

Note that function plot_structure uses the spatial coordinates rn(:,1:3) to position nodes and does not relie and graph drawing algorithm to generate a planar layout of the network.

In many situations, the nodes of the network are contained in a rectangular box (e.g. the simulation box in DD or MD simulations). In NetworCh, the such volume is defined with array bounds. Array bounds specifies the bounds of the volume in the following manner: bounds = [xmin,xmax;ymin,ymax;zmin,zmax]. For example, if we assume that our structure is contained in a cubic simulation box of edge size L centered in the origin (0,0,0), it can be visualised using:

bounds = L/2*[-1,1;-1,1;-1,1];
plot_structure(rn,links,bounds);

By default, periodic boundary conditions will be applied for the visualization when argument bounds is specified in function plot_structure, such that nodes whose position lie outside the volume defined by bounds will be folded back to the volume.

Importing/Creating networks

NetworCh can generate or import networks from different sources.

Test structures

Several simple test structures are provided within the library to test its functions. Test structures are generated by using the test_structure function:

[rn,links,bounds] = test_structure(id);

where id is the index of the test structure to generate.

DD structures

MD structures

Newtorks generation

Exporting networks