LCC  1. 0. 0.
Crystal cutting code
Functions/Subroutines
lcc_lattice_mod Module Reference

Module to hold routines for handling the lattice and lattice base. More...

Functions/Subroutines

subroutine, public lcc_make_lattice (bld, ltt, check, sy)
 Make a lattice depending on the input parameter. More...
 
subroutine lcc_read_base (bld, ltt, check, verbose)
 Reading the basis from an input file. More...
 
subroutine lcc_check_basis (base_format, r_base, lattice_vectors, verbose)
 Routine to check for atom repetitions in basis \bnrief It will do all possible translations searching for atoms that could be repeated. More...
 
subroutine lcc_add_base_to_cluster (ltt, sy, verbose)
 Add a basis to the lattice. More...
 
subroutine lcc_sc (Nx1, Nx2, Ny1, Ny2, Nz1, Nz2, h_lattice_a, supra_lattice_vectors, r_sy)
 Simple cubic (SC) lattice construction. More...
 
subroutine lcc_fcc (Nx1, Nx2, Ny1, Ny2, Nz1, Nz2, h_lattice_a, supra_lattice_vectors, r_sy, verbose)
 Face center cubic (FCC) lattice construction. More...
 
subroutine lcc_triclinic (Nx1, Nx2, Ny1, Ny2, Nz1, Nz2, lattice_vectors, supra_lattice_vectors, r_sy, verbose)
 Triclinic lattice construction. More...
 
subroutine, public lcc_set_atom_type (a_type, atom_symbol, atom_name, nats)
 Sets the atom type. More...
 
subroutine lcc_add_randomness (r_inout, lattice_vectors, seed, rcoeff)
 Will add randomness to the system. More...
 
subroutine lcc_minimize_from (xVar, i, ai, nats, trs, verbose)
 To get the best translation that minimizes the distance to any previous fragment. More...
 
subroutine lcc_get_besttranslations (nop, nats, r_inout, verbose)
 To get the best translation that minimizes the distance to any previous fragment. More...
 

Detailed Description

Module to hold routines for handling the lattice and lattice base.

Function/Subroutine Documentation

◆ lcc_add_base_to_cluster()

subroutine lcc_lattice_mod::lcc_add_base_to_cluster ( type(lattice_type ltt,
type(system_type), intent(inout)  sy,
integer, intent(in)  verbose 
)

Add a basis to the lattice.

This routine will add the basis to the system points previously cut from the lattice. This is the last step of the solid/shape/slab creation.

Parameters
lttlattice_type See lcc_structs_mod
sysystem_type See progress library

◆ lcc_add_randomness()

subroutine lcc_lattice_mod::lcc_add_randomness ( real(dp), dimension(:,:), intent(inout), allocatable  r_inout,
real(dp), dimension(:,:), intent(in), allocatable  lattice_vectors,
integer, intent(in)  seed,
real(dp), intent(in)  rcoeff 
)

Will add randomness to the system.

Parameters
r_inoutSystem coordinates.
lattice_vectorsLattice vectors.
seedRandom seed. rcoeff Coefficient for randomness.

◆ lcc_check_basis()

subroutine lcc_lattice_mod::lcc_check_basis ( character(len=*), intent(in)  base_format,
real(dp), dimension(:,:), intent(in), allocatable  r_base,
real(dp), dimension(:,:), intent(in), allocatable  lattice_vectors,
integer, intent(in)  verbose 
)

Routine to check for atom repetitions in basis \bnrief It will do all possible translations searching for atoms that could be repeated.

Parameters
base_formatBasis format, if xyz of abc
r_baseCoordinates of the basis. r_base(1,7) means coordinate x of atom 7
lattice_vectorsLattice vectors. WARNING, in this case lattice_vector(1,3) means the coordinate 3=z of vector 1.

◆ lcc_fcc()

subroutine lcc_lattice_mod::lcc_fcc ( integer, intent(in)  Nx1,
integer, intent(in)  Nx2,
integer, intent(in)  Ny1,
integer, intent(in)  Ny2,
integer, intent(in)  Nz1,
integer, intent(in)  Nz2,
real(dp), intent(in)  h_lattice_a,
real(dp), dimension(:,:), intent(inout), allocatable  supra_lattice_vectors,
real(dp), dimension(:,:), intent(inout), allocatable  r_sy,
integer, intent(in)  verbose 
)

Face center cubic (FCC) lattice construction.

Constructs a "bulk" of Face center cubic lattice.

Parameters
Nx1Initial x lattice point.
Nx2Final x lattice point.
Ny1Initial y lattice point.
Ny2Final y lattice point.
Nz1Initial z lattice point.
Nz2Final z lattice point.
h_lattice_aLattice parameter.
supra_lattice_vectorsLattice unit vectors of the resulting slab.
r_syOutput system coordinates.

◆ lcc_get_besttranslations()

subroutine lcc_lattice_mod::lcc_get_besttranslations ( integer, intent(in)  nop,
integer, intent(in)  nats,
real(dp), dimension(:,:), intent(inout), allocatable  r_inout,
integer, intent(in)  verbose 
)

To get the best translation that minimizes the distance to any previous fragment.

Parameters
nopNumber of symmetry operations
natsNumber of atoms in each fragment
r_inoutCoordinates for the fragment
verboseVerbosity level

◆ lcc_make_lattice()

subroutine, public lcc_lattice_mod::lcc_make_lattice ( type(build_type), intent(inout)  bld,
type(lattice_type), intent(inout)  ltt,
logical, intent(in)  check,
type(system_type), intent(inout)  sy 
)

Make a lattice depending on the input parameter.

This will make one of the following latices: SC: Simple cubic, FCC: Face center cubic, or Triclinic.

Parameters
bldBuilding structure (see lcc_structures_mod)
lttLattice structure (see lcc_scturctures_mod)
checkIf we want to check the basis for atom repetition. Note that checks can be expensive.

◆ lcc_minimize_from()

subroutine lcc_lattice_mod::lcc_minimize_from ( real(dp), dimension(:,:), intent(in)  xVar,
integer, intent(in)  i,
integer, intent(in)  ai,
integer, intent(in)  nats,
real(dp), dimension(3), intent(inout)  trs,
integer, intent(in)  verbose 
)

To get the best translation that minimizes the distance to any previous fragment.

Parameters
xVarCoordinates of the full basis (including symmetry operations).
iFragmet being added at the "i" operation.
aiAtom index to translate and get the optimal translation.
natsNumber of atoms in the fragment.
trsOptimal translation.

◆ lcc_read_base()

subroutine lcc_lattice_mod::lcc_read_base ( type(build_type), intent(inout)  bld,
type(lattice_type), intent(inout)  ltt,
logical, intent(in)  check,
integer, intent(in)  verbose 
)

Reading the basis from an input file.

This will read the coordinates for the basis from an input file If information about the lattice is contained, it will also be read.

Parameters
bldBuilding structure (see lcc_structures_mod).
lttLattice structure (see lcc_scturctures_mod).
checkIf we want to check the basis for atom repetition.
verboseVerbose level. Note that checks can be expensive.

◆ lcc_sc()

subroutine lcc_lattice_mod::lcc_sc ( integer, intent(in)  Nx1,
integer, intent(in)  Nx2,
integer, intent(in)  Ny1,
integer, intent(in)  Ny2,
integer, intent(in)  Nz1,
integer, intent(in)  Nz2,
real(dp), intent(in)  h_lattice_a,
real(dp), dimension(:,:), intent(inout), allocatable  supra_lattice_vectors,
real(dp), dimension(:,:), intent(inout), allocatable  r_sy 
)

Simple cubic (SC) lattice construction.

Constructs a "bulk" of Simple Cubic lattice.

Parameters
Nx1Initial x lattice point.
Nx2Final x lattice point.
Ny1Initial y lattice point.
Ny2Final y lattice point.
Nz1Initial z lattice point.
Nz2Final z lattice point.
h_lattice_aLattice parameter.
supra_lattice_vectorsLattice unit vectors of the resulting slab.
r_syOutput system coordinates.

◆ lcc_set_atom_type()

subroutine, public lcc_lattice_mod::lcc_set_atom_type ( character(len=2), intent(in)  a_type,
character(len=2), dimension(:), intent(inout), allocatable  atom_symbol,
character(len=3), dimension(:), intent(inout), allocatable  atom_name,
integer, intent(in)  nats 
)

Sets the atom type.

Sets the atom "symbol/type/name."

Parameters
a_typeAtom symbol character.
atom_symbolAtom symbols.
atom_nameAtom name. Note: Atom name is a tag that can distinguish atoms with same symbol.

◆ lcc_triclinic()

subroutine lcc_lattice_mod::lcc_triclinic ( integer, intent(in)  Nx1,
integer, intent(in)  Nx2,
integer, intent(in)  Ny1,
integer, intent(in)  Ny2,
integer, intent(in)  Nz1,
integer, intent(in)  Nz2,
real(dp), dimension(:,:), intent(in), allocatable  lattice_vectors,
real(dp), dimension(:,:), intent(inout), allocatable  supra_lattice_vectors,
real(dp), dimension(:,:), intent(inout), allocatable  r_sy,
integer, intent(in)  verbose 
)

Triclinic lattice construction.

Constructs a "bulk" of triclinic lattice.

Parameters
Nx1Initial x lattice point.
Nx2Final x lattice point.
Ny1Initial y lattice point.
Ny2Final y lattice point.
Nz1Initial z lattice point.
Nz2Final z lattice point.
lattice_vectorsLattice vectors.
supra_lattice_vectorsLattice unit vectors of the resulting slab.
r_syOutput system coordinates. Note: Unit cell representation has to be transformed from edges and angles to vetors before calling this routine.
Todo:
A angles_to_vectors transformation will be available.