ABINIT/m_fit_polynomial_coeff [ Modules ]

Copyright (C) 2010-2018 ABINIT group (AM)
This file is distributed under the terms of the
GNU General Public Licence, see ~abinit/COPYING
or http://www.gnu.org/copyleft/gpl.txt .
For the initials of contributors, see ~abinit/doc/developers/contributors.txt .

coefficients(ncoeff) = type(polynomial_coeff_type)
energy_coeffs(ncoeff,ntime) = value of the energy for each coefficient (Ha)
energy_diff(ntime) = Difference of energ ybetween DFT calculation and fixed part
of the model (more often harmonic part)
fixed part of the model (more often harmonic part)
fcart_coeffs(ncoeff,3,natom,ntime) = value of the forces for each coefficient
(-1 factor is taking into acount) (Ha/Bohr)
fcart_diff(3,natom,ntime) = Difference of cartesian forces between DFT calculation and
fixed part of the model (more often harmonic part)
list_coeffs(ncoeff_fit) = List with the indexes of the coefficients used for this model
natom = Number of atoms
ncoeff_fit = Number of coefficients fitted
ncoeff_max = Maximum number of coeff in the list
ntime = Number of time in the history
strten_coeffs(ncoeff,3,natom,ntime)= value of the stresses for each coefficient
(1/ucvol factor is taking into acount) (Ha/Bohr^3)
strten_diff(6,natom) = Difference of stress tensor between DFT calculation and
fixed part of the model (more often harmonic part)
sqomega = Sheppard and al Factors \Omega^{2} see J.Chem Phys 136, 074103 (2012) [[cite:Sheppard2012]]

m_fit_polynomial_coeff/fit_polynomial_coeff_computeMSD [ Functions ]

eff_pot<type(effective_potential)> = effective potential
hist<type(abihist)> = The history of the MD
natom = number of atom
ntime = number of time in the hist
sqomega = Sheppard and al Factors \Omega^{2} see J.Chem Phys 136, 074103 (2012) [[cite:Sheppard2012]]
compute_anharmonic = TRUE if the anharmonic part of the effective potential
has to be taking into acount
print_file = if True, a ASCII file with the difference in energy will be print

m_fit_polynomial_coeff/fit_polynomial_coeff_fit [ Functions ]

Fit the list of coefficients included in eff_pot,
if the coefficients are not set in eff_pot, this routine will genenerate
a list of coefficients by taking into acount the symmetries of the system
and the cutoff

INPUTS

eff_pot<type(effective_potential)> = effective potential
bancoeff(nbancoeff) = list of bannned coeffcients, these coefficients will NOT be
used during the fit process
fixcoeff(nfixcoeff) = list of fixed coefficient, these coefficients will be
imposed during the fit process
hist<type(abihist)> = The history of the MD (or snapshot of DFT)
generateterm = term to activate the generation of the term set
power_disps(2) = array with the minimal and maximal power_disp to be computed
nbancoeff = number of banned coeffcients
ncycle_in = number of maximum cycle (maximum coefficient to be fitted)
nfixcoeff = Number of coefficients imposed during the fit process
option = option of the fit process : 1 - selection of the coefficient one by one
2 - selection of the coefficients with Monte Carlo(testversion)
comm = MPI communicator
cutoff_in = optional,cut off to apply to the range of interation if
the coefficient are genereted in this routine
max_power_strain = maximum order of the strain of the strain phonon coupling
fit_initializeData = optional, logical !If true, we store all the informations for the fit,
it will reduce the computation time but increase a lot the memory...
fit_tolMSDF = optional, tolerance in eV^2/A^2 on the Forces for the fit process
fit_tolMSDS = optional, tolerance in eV^2/A^2 on the Stresses for the fit process
fit_tolMSDE = optional, tolerance in meV^2/A^2 on the Energy for the fit process
fit_tolMSDFS= optional, tolerance in eV^2/A^2 on the Forces+stresses for the fit process
positive = optional, TRUE will return only positive coefficients
FALSE, default
verbose = optional, flag for the verbose mode
anhstr = logical, optional : TRUE, the anharmonic strain are computed
FALSE, (default) the anharmonic strain are not computed
only_odd_power = logical, optional : if TRUE generate only odd power
only_even_power= logical, optional : if TRUE generate only even power

m_fit_polynomial_coeff/fit_polynomial_coeff_getFS [ Functions ]

Compute all the matrix elements of eq.11 and 12 in PRB95,094115 (2017) [[cite:Escorihuela-Sayalero2017]]

INPUTS

coefficients(ncoeff) = type(polynomial_coeff_type)
du_delta(6,3,natom_sc,ntime) = Variation to displacements wrt to the strain (Bohr)
displacement(3,natom_sc,ntime)= Atomic displacement wrt to the reference (Bohr)
natom_sc = Number of atoms in the supercell
natom_uc = Number of atoms in the unit cell
ncoeff = Number of coefficients
ntime = Number of time in the history
sc_size(3) = Size of the supercell
strain(6,ntime) = Strain
ucvol(ntime) = Volume of the supercell for each time (Bohr^3)
cells(ncell) = Indexes of the cell treat by this CPU
ncell = Number of cell treat by this CPU
index_cells(ncell,3) = Indexes of the cells (1 1 1, 0 0 0 for instance) treat by this CPU
comm = MPI communicator

OUTPUT

fcart_out(ncoeff,3,natom,ntime) = value of the forces for each coefficient
(-1 factor is taking into acount) (Ha/Bohr)
strten_out(ncoeff,3,natom,ntime)= value of the stresses for each coefficient
(-1/ucvol factor is taking into acount) (Ha/Bohr^3)
energy_out(ncoeff,ntime) = value of the energy for each coefficient (Ha)

m_fit_polynomial_coeff/fit_polynomial_coeff_getPositive [ Functions ]

This routine fit a list of possible model.
Return in the isPositive array:
0 if the model ii does not contain possive coefficients
1 if the model ii contain possive coefficients

INPUTS

eff_pot<type(effective_potential)> = effective potential
hist<type(abihist)> = The history of the MD (or snapshot of DFT
coeff_values(nmodel,ncoeff) = values of the coefficients for each model
isPositive(nmodel) = see description below
list_coeff(nmodel,ncoeff) = list of the models
ncoeff = number of coeff per model
nfixcoeff = will not test the nfixcoeff first coeffcients
nmodel = number of model
comm = MPI communicator
verbose = optional, flag for the verbose mode

m_fit_polynomial_coeff/fit_polynomial_coeff_solve [ Functions ]

Build and the solve the system to get the values of the coefficients
This routine solves the linear system proposed by
C.Escorihuela-Sayalero see PRB95,094115(2017) [[cite:Escorihuela-Sayalero2017]]

INPUTS

fcart_coeffs(3,natom_sc,ncoeff_max,ntime) = List of the values of the contribution to the
cartesian forces for all coefficients
for each direction and each time
fcart_diff(3,natom,ntime) = Difference of cartesian forces between DFT calculation and
fixed part of the model (more often harmonic part)
energy_coeffs(ncoeff,ntime) = value of the energy for each coefficient (Ha)
energy_diff(ntime) = Difference of energ ybetween DFT calculation and fixed part
of the model (more often harmonic part)
list_coeffs(ncoeff_fit) = List with the index of the coefficients used for this model
natom = Number of atoms
ncoeff_fit = Number of coeff for the fit (dimension of the system)
ncoeff_max = Maximum number of coeff in the list
ntime = Number of time (number of snapshot, number of md step...)
strten_coeffs(6,ntime,ncoeff_max) = List of the values of the contribution to the stress tensor
of the coefficients for each direction,time
strten_diff(6,natom) = Difference of stress tensor between DFT calculation and
fixed part of the model (more often harmonic part)
sqomega(ntime) = Sheppard and al Factors \Omega^{2} see J.Chem Phys 136, 074103 (2012) [[cite:Sheppard2012]]

OUTPUT

coefficients(ncoeff_fit) = Values of the coefficients
info_out = 0: successful exit
< 0: if INFO = -i, the i-th argument had an illegal value
> 0: if INFO = i, U(i,i) computed in DOUBLE PRECISION is
exactly zero. The factorization has been completed,
but the factor U is exactly singular, so the solution
could not be computed. = 0: successful exit
information from the subroutine dsgesv in LAPACK