GithubHelp home page GithubHelp logo

dormrod / triangle_raft Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 3.14 MB

Modern interpretation of the triangle raft algorithm to construct 2D atomic networks.

License: MIT License

CMake 0.08% C++ 93.56% Python 6.36%

triangle_raft's Introduction

Triangle Raft

The triangle raft algorithm was originally developed to make hand-built models of 2D glasses [1]. As part of my PhD I have modified this algorithm into a flexible computational version, to generate networks with tuneable properties [2].

The C++ code to generate these structures is included here, along with some python visualisation tools.

For some example outputs please check out the gallery!

Alt text

Compilation

Compilation is easiest using CMake. To compile the code execute the following in terminal:

cd src/
cmake .
make

As the code is relatively computationally intensive, it is recommended that in the CMakeCache.txt you set CMAKE_BUILD_TYPE:STRING=Release before making.

The generated executable is called mx2.x (this is for chemistry reasons, the network in a chemical sense has this formula).

Input

The parameters for the calculation can be found in mx2.inpt which are read at runtime. I would like to say that it is self-explanatory, but as a wise person once said you learn more about a code if I don't tell you what all the numbers mean...

However, the key parts are as follows:

1:   /path/to/starting/seed  

the algorithm needs a seed to start the calculation, this can be a previous output or can be generated with the python scriptpython python_scripts/make_poly_seed.py 6.

7:   4 10    ring size limits

This pair of numbers determines the size of rings that can be built. The lower should be set to 4, the upper can be anything you like >6, but this will slow the code down!

8:   2DC/2DS    geometry code

If set to 2DC output will be circular, 2DS will be square.


12:   <temperature>

This controls the width of the ring size distribution, the suitable range for which will depend on the potential model. If this remains unchanged T~10-5 to 10-2 should be about right.

Runtime

Running mx2.x will read the input file and start the code. A log file, mx2.log, will also be produced which is quite verbose. Some things to note:

  • The code is not wickedly fast and increasing the ring size limits in particular will slow it down.
  • As is the nature of Monte Carlo codes, rarely it will run into irreconcilable cases where the algorithm cannot continue. In this case the final structure is written. If the temperature is set too high this will happen more often.

Output and Visualisation

After the code has finished there should be six .out files, prefixed with your output prefix. Of these two are probably of the most interest: prefix_atoms.out gives the atomic number (O or Si), coordination and coordinates of the final configuration; prefix_analysis.out contains analysis information on the ring statistics and bond lengths and angles.

The remaining files specify connectivities. These are needed for visualisation, which can be achieved with:

python python_scripts/visualise_network.py prefix <flags>

where the choice of flags is as follows:

  • -r show rings
  • -t show triangles
  • -tmx show triangles and atoms
  • -s or -S save as .pdf or .png

Summary

This is a very brief overview of the code, designed to get some output. Please let me know if you want to use it for research purposes and I will help you get to grips with it.

triangle_raft's People

Stargazers

zhetao avatar

Watchers

James Cloos avatar  avatar

triangle_raft's Issues

Generating equilateral triangles

Hi @dormrod ,

Thanks for this wonderful package! I plan to use it to generate equilateral triangle raft and I was wondering if it is possible to make all edges of equal length by tuning the potential? I tried the example and modifiying a potential parameters but it is not clear to me how the potential works and the edge lengths always have some variance.

Regards,
EJ

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.