GithubHelp home page GithubHelp logo

chgcar_pbc's Introduction

CHGCAR_pbc

This script converts an n x n size CHGCAR to a 2n x 2n CHGCAR for display purposes in VMD. This is useful to view with atoms given periodic boundary conditions (CONTCAR, POSCAR), since pbcs cannot be applied to CHGCAR files in VMD. It does this by duplicating the original supercell on each positive edge to make the larger cell.

The script reads in the supercell size line by line and multiplies it by 2.

The number of each type of atom is multiplied by 8, and then original atom coordinates are shifted in x, y, z, xy, yz, zx directions for each of the new atoms. The total number of coordinates in the modified CHGCAR will by i*8, if i = total number of atoms regardless of element.

The CHGCAR file then gives number of points with a defined charge density in each direction (x, y, z respectively). These are each multiplied by 2 for the modified CHGCAR.

Each following number in the original CHGCAR is a charge density defined at a point in the supercell grid. This grid is printed to the CHGCAR with the x axis as the inner loop, and the z axis as the outer loop. This means the points are defined along the x axis, increasing in y until all are defined, and then increase one in z and continue defining points in this pattern.

Using the number of defined x,y,z points this script takes the first x number of points and repeats this block of numbers immediately after itself. Then the next x numbers of point is copied and repeated. This continues for the length of defined points until the loop reaches the augmentation values. The same is then done with y*2 length blocks of points, and then the entire new list of defined points is repeated once. This gives a replica of defined charge densities for the new 2n x 2n cube size.

chgcar_pbc's People

Watchers

 avatar  avatar

Forkers

kcantosh

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.