Description
This module provides utilities in order to manipulate a crystal object. Crystal object can be created from POSCAR/CONTCAR VASP files. In all functions and subroutines, angle are given or returned in degrees. If needed they are converted in radian localy.
Quick access
Types: | atom, crystal |
---|---|
Variables: | pi, vtrans, trans |
Routines: | inverse(), cleancrystal(), computeredcoord(), computexyzcoord(), getcomposition(), fromconfig(), toposcar(), fromposcar(), red2cart(), allneighbor(), neighbor(), computelatticevectors(), computelatticeparameters(), fillmatrix(), cart2red(), image(), computevolume(), dist_i(), dist_r(), dist_x() |
Types
atom type object
Type fields: |
|
---|
crystal type object
Type fields: |
|
---|
:f atom atoms(:) [allocatable]: :f real gam: :f character atomtype(:) [allocatable]: :f real mred2cart(3,3): :f real alpha: :f real a: :f real mcart2red(3,3): :f real c: :f real b: :f real beta: :f character cname: :f integer natompertype(:) [allocatable]:
Variables
Subroutines and functions
Clean crystal type :
- deallocate array if allocated
- set default value to all attributes
Parameters: | cell [crystal,inout] |
---|
Compute lattice vectors from lattice parameters. Lattice parameters must be known. By default, lattice vector veca is along x, vecb is in the xOy plane and z is choosen such as [veca, vecb, vecc] is positive.
Parameters: | cell [crystal,inout] :: Crystal structure |
---|---|
Options: | verbose [logical,in,optional] :: manage verbosity |
Compute lattice parameters from lattice vectors. Lattice vectors must be known.
Parameters: | cell [crystal,inout] :: crystal structure |
---|---|
Options: | verbose [logical,in,optional] :: manage verbosity |
Called from: | fromconfig(), fromposcar() |
fill transformation matrix from lattice vectors.
- Mred2cart : reduce -> cartesian
- Mcart2red : cartesian -> reduce
Lattice vectors must be knwon and must be consistent with coordinates.
Parameters: | cell [crystal,inout] :: crystal structure |
---|---|
Options: | verbose [logical,in,optional] :: manage verbosity |
Called from: | fromconfig(), fromposcar() |
Call to: | inverse() |
convert cartesian coordinate into reduce coordinate.
Parameters: |
|
---|---|
Return: | red2cart (3) [real] :: cartesian coordinate |
Called from: | dist_r(), computexyzcoord(), neighbor(), dist_i(), dist_x(), allneighbor() |
convert cartesian coordinate into reduce coordinate.
Parameters: |
|
---|---|
Return: | cart2red (3) [real] :: reduce coordinate |
Called from: | dist_x(), computeredcoord() |
compute cartesian coordinates from reduce coordinates of all atoms into the crystal structure.
Parameters: | cell [crystal,inout] :: Crystal structure |
---|---|
Called from: | fromposcar() |
Call to: | red2cart() |
compute reduce coordinates from cartesian coordinates of all atoms into the crystal structure.
Parameters: | cell [crystal,inout] :: Crystal structure |
---|---|
Called from: | fromconfig(), fromposcar() |
Call to: | cart2red() |
Compute the minimum distance between atoms iat and jat considering periodic boundary conditions. This function needs that reduce coordinates of atoms iat and jat are known.
Parameters: |
|
---|---|
Return: | dist_i [real] |
Called from: | neighbor(), allneighbor() |
Call to: | image(), red2cart() |
Compute the minimum distance between atoms at coordinate ri and rj considering periodic boundary conditions. ri and rj are reduce coordinates.
Parameters: |
|
---|---|
Return: | dist_r [real] |
Call to: | image(), red2cart() |
Compute the minimum distance between atoms at coordinate xi and xj considering periodic boundary conditions. xi and xj are cartesian coordinates.
Parameters: |
|
---|---|
Return: | dist_x [real] |
Call to: | image(), cart2red(), red2cart() |
Returns the shortest vector in reduce coordinate considering the periodic boundary conditions. This function needs that reduce coordinate had been calculated. Use computeRedCoord if needed.
Parameters: |
|
---|---|
Return: | image (3) [real] |
Called from: | dist_r(), image(), dist_i(), dist_x() |
Call to: | image() |
Compute the cell volume
Parameters: | cell [crystal,in] :: Crystal structure |
---|---|
Return: | computevolume [real] |
look for different atom type and number of each atom type.
Parameters: | cell [crystal,inout] |
---|---|
Called from: | toposcar() |
Build a crystal object from a POSCAR/CONTCAR VASP structure file.
Parameters: | cell [crystal,out] :: built structure |
---|---|
Options: |
|
Call to: | computelatticeparameters(), fillmatrix(), computeredcoord(), computexyzcoord() |
print cell into a VASP structure file POSCAR
Parameters: | cell [crystal,inout] :: crystal structure |
---|---|
Options: |
|
Call to: | getcomposition() |
Build a crystal object from a CONFIG/REVCON DLPOLY structure file.
Parameters: | cell [crystal,out] :: built structure |
---|---|
Options: |
|
Call to: | computelatticeparameters(), fillmatrix(), computeredcoord() |
look for neighbors of atoms in the list iatom. If ligand present, only atoms with name ligand are considered. If rcut < cell parameters / 2, the subroutine looks for multiple neighbors by considering all atoms in the 26 adjacent cells around the central the considered cell.
Parameters: |
|
---|---|
Options: | ligand [character,in,optional] :: limit the neighbors list to atoms name ligand (defaut = “#” not any atom is excluded) |
Call to: | red2cart(), dist_i() |
Look for neighbors of all atoms in cell. If rcut > cell parameters/2, the subroutine looks for multiple neighbors by considering all atoms in the 26 adjacent cells around the considered cell.
Parameters: |
|
---|---|
Call to: | red2cart(), dist_i() |
Inverse matrix
Method : | Based on Doolittle LU factorization for Ax=b |
---|---|
Author : | Alex G. December 2009 |
Comments : | the original matrix a(n,n) will be destroyed during the calculation |
Parameters: |
|
Called from: | fillmatrix() |