Calculator of polarization displacements and polarization of ferroelectrics in molecular dynamics simulations.
This code is designed for:
- build neighbor list for ferrorelectrics (ABO3 perovskite)
- calculate the polarization and displacement from a LAMMPS dump file.
For better performence, the main part of code is written in C++.
.
├── example //example of how to use code, in todo list
├── ferrodispcalc // python library
│ ├── build_neighbor_list.py //Build neighbor list for ABO3 perovskite
│ ├── PolarPolter.py
│ └── type_map.py //store the common type map
├── install.sh //installation script
├── LICENSE
├── README.md
├── src //c++ source code
│ ├── basic.hpp //This file contains basic functions to read lammps dump files.
│ ├── get_averaged_structure.cpp //Calculate the average structure from LAMMPS dump file
│ ├── get_polarization.cpp //Calculate the polarization of each perovskite unit call using LAMMPS dump file
│ └── get_polarization_displacement.cpp //Calculate the polarization displacement from LAMMPS dump file
└── test //files related to testing
├── BaTiO3
├── compare.py
├── com_sys.py
├── PIN-PMN-PT
├── PIN-PMN-PT_multi_domain
├── PSZO
├── PZO
├── README.md
└── run_test.sh
- Get source code:
git clone https://github.com/MoseyQAQ/FerroDispCalc.git
-
Prerequisites:
- C++ compiler
- Eigen (For matrix operation)
- numpy, pymatgen (can be easily installed through: pip3 install pymatgen)
-
Edit the following variables in install.sh:
####### general seeting #######
EIGEN=/home/liulab/eigen-3.4.0 # path to your eigen header
CXX=g++ # your c++ compiler
CXXFLAGS="-O3" # or "-O3 -march=native" for example
INSTALL_DIR=$(pwd)
###############################
- Run the install.sh:
chmod +x install.sh
./install.sh make # compile the source code
./install.sh clean # clean the compiled code
./install.sh test # test the executable
./install.sh install # installation
-
get_averaged_structure / get_a : calculate averaged structure from a LAMMPS dump file.
Options:- input_file: LAMMPS dump file
- output_file: output file in .xsf format
- type_map_file: a file containing the atom types.
- ratio: If < 1, the last "ratio"% of frame will be read. If >= 1, the last "ratio" frames will be read.
-
get_polarization_displacement / get_d : calculate displacement from: LAMMPS dump / .xsf file.
Options:- traj_file: LAMMPS dump or .xsf file
- output_file: output file, each line contains the original coordinates and displacements of a cation.
- nl_file: neighbor list file, it can be generated using build_neighbor_list.py
- ratio/last_frame: If < 1, the last "ratio"% of frame will be read. If >= 1, the last "ratio" frames will be read. (only work when reading LAMMPS dump)
-
get_polarization / get_p : calculate polarization from: LAMMPS dump / .xsf file.
Options:- traj_file: LAMMPS dump or .xsf file
- output_file: output file, each line contains the original coordinates and displacements of a cation.
- a_nl_file: neighbor list file for A site cations
- x_nl_file: neighbor list file for X site anions
- type_map_file: file contains the type map of atom types
- bec_file: file contains the Born effective charge of each atom type
- ratio/last_frame: If < 1, the last "ratio"% of frame will be read. If >= 1, the last "ratio" frames will be read. (only work when reading LAMMPS dump)
The example is still under developed. You can find examples in "test" folder.
imporved IO, doc