GithubHelp home page GithubHelp logo

fachengg / xyz_to_poscar Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 2.0 6 KB

Transfer XYZ file into POSCAR/CONTCAR file with re-center feature. Useful for single molecule calculation in VASP.

License: MIT License

Python 100.00%
vasp vasp-processing vasp-poscar xyz xyz-files vasp-files

xyz_to_poscar's Introduction

Purpose

This script is designed for the purpose: transfer a molecule from xyz into POSCAR. Please put the box information in the second line of xyz file (learn more at "input xyz file example" section). If the box is not defined, a default 100x100x100 box will be used. When using it trnasfer 3D/2D material from xyz to POSCAR, be careful.

Feature

  1. The molecule recentered at the box's center.
  2. Transfer multi xyz files to POSCAR files at one time.
  3. Independent: does not require any python library.
  4. Easy to use.

How to use the code:

  1. Put the xyz files in the same folder with this script.
  2. Run:
python3 xyz_to_POSCAR.py

The POSCAR files with Cartesian coordinates will be generated in the folder.

Input xyz file format:

<number of atoms>
[x1,y1,z1,x2,y2,z2,x3,y3,z3] # Define of the box
<element> <X> <Y> <Z>
...

Example:

xyz input:

3
[60,0,0,0,40,0,0,0,50]
C 10 10 10
O 1 1 1
O 21 21 21

POSCAR output:

Input file generated from example.xyz
1.0
 60.0 0.0 0.0
 0.0 40.0 0.0
 0.0 0.0 50.0
 C O
 1 2
Cartesian
  29.333333333333336  19.333333333333336  24.333333333333336
  20.333333333333336  10.333333333333334  15.333333333333334
  40.333333333333336  30.333333333333336  35.333333333333336

xyz_to_poscar's People

Contributors

fachengg avatar

Watchers

 avatar

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.