Git Product home page Git Product logo

nanowire-fragmentation-code's Introduction

Nanowire Logo
This repository contains simulation code for surface diffusion enhanced nanowire junction break-up. The code is written in CUDA C (GPU accelerated parallel code for Nvidia GPUs). The research article that utilized this code can be found at the provided location: https://doi.org/10.1063/5.0064917. The code is based on the variable mobility Cahn-Hilliard (VMCH) formulation. The details of VMCH algorithm can be found at the following DOI: https://doi.org/10.13140/RG.2.2.29738.13760/4.

Directory contents

The contents of this repository are described below: -

  • inputs: Constains the following files: -
    • comp_data.txt: Contains composition value of inside the nanowires, along with noise in the composition profile.
    • parameters_data.txt: Contains simulation parameters such as mobility, free energy barrier, gradient energy coefficient, and stability factor for the numerical scheme.
    • radius_data.txt: The two nanowire radii values (can be different in case crossing nanowires, and equal in case of single nanowire configuration).
    • system_data.txt: Contains the system size data along with the grid spacing used for the structured mesh.
    • time_data.txt: Contains the simulation time along with the user time-step (intervals at which to print the output) and the numerical scheme time-step.
  • visualize: Contains the following files: -
    • vtkfile.c: Code for converting the binary output time-series data into VTK datasets.
    • visualize.sh: Script for compiling and executing the vtkfile code.
  • src: Contains the source cuda C files. The main code file is nanowire3D.cu. All other code files are function files which nanowire3D.cu file calls for different calculations.
  • mayavi_plots3D: Contains mayavi_visualization.py script for converting the binary output time-series data files into 3D plots directly. The output is stored in the plots3D/ directory in the form of PNG image files. The image files are also combined to form an animated GIF file named animation.gif.
  • output: Contains output binary time-series data files generated from a particular simulation run. Subsequent simulation runs overwrite files into this directory and delete files from the previous run. Hence, users are advised to store the generated simulation data to a different folder for future use.

Dependencies

The code is written for Linux based operating systems with Nvidia CUDA enabled GPUs. The following are list of dependencies which are used in the code: -

Code execution

The compilation and execution of the simulation code is handled by the nanowire_cuda.sh script (to be executed from the nanowireCUDA3D/ directory).

The command format: ./nanowire_cuda.sh ARG1 ARG2

The following command line arguments are to be used for different configurations: -

First command line argument:

  • NEW: For a fresh simulation run.
  • RESTART: For a restarted simulation run.

Second command line argument:

  • DEG90: 90 degree configuration between two crossing nanowires.
  • DEG60: 60 degree configuration between two crossing nanowires.
  • DEG45: 45 degree configuration between two crossing nanowires.
  • DEG30: 30 degree configuration between two crossing nanowires.
  • SINGLE_WIRE: For single nanowire configuration.
  • MULT_JUNC: For nanowire grid consisting of 9 junctions.

A sample command for a new simulation for 90 degree configuration is as follows:

$ ./nanowire_cuda.sh NEW DEG90 

Post-processing

The binary simulation output time-series data in the output/ directory can be used for all sorts of post-processing operations. The binary data converted into VTK datasets in the visualize/vtk_data/ directory can be loaded into Paraview directly and visualized. Paraview also provides a lot of filters for data analysis purposes.

Another option is to make on the fly plots directly from the binary data generated. This can be achieved using the mayavi_visualization.py script in the mayavi_plots3D/ directory. To generate the plots, type the following command after the simulation run has finished:

$ cd mayavi_plots3D/
$ python3 mayavi_visualization.py

Output in the form of PNG snapshots will be stored in mayavi_plots3D/plots3D/ directory. Also, an animated gif of the entire simulation named animation.gif will be stored in the mayavi_plots3D/ directory.

NOTE:

  • For the RESTART simulation type, make sure to keep the binary data in the output/ directory corresponding to the last time-step from which simulation needs to be restarted. Accordingly, updated the start_time in the inputs/time_data.txt file to this last time-step from which to restart the simulation.
  • The code can also be run in windows operating system. In that case the bash script files cannot be used, rather the user has to compile the code manually using the compilation commands provided in the assets/ directory without the -lgsl and -lm flags, and with a suitable random number generator for windows.

nanowire-fragmentation-code's People

Contributors

abhinavroy1999 avatar

Stargazers

 avatar Jitin avatar

Watchers

 avatar

Forkers

rayeloud

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.