forked from dftfeDevelopers/dftfe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eshelbyTensor.h
134 lines (116 loc) · 6.3 KB
/
eshelbyTensor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
// ---------------------------------------------------------------------
//
// Copyright (c) 2017-2022 The Regents of the University of Michigan and DFT-FE
// authors.
//
// This file is part of the DFT-FE code.
//
// The DFT-FE code is free software; you can use it, redistribute
// it, and/or modify it under the terms of the GNU Lesser General
// Public License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
// The full text of the license can be found in the file LICENSE at
// the top level of the DFT-FE distribution.
//
// ---------------------------------------------------------------------
#ifndef eshelby_H_
#define eshelby_H_
#include "constants.h"
#include "headers.h"
namespace dftfe
{
/**
* @brief The functions in this namespace contain the expressions for the various terms of the configurational force (https://link.aps.org/doi/10.1103/PhysRevB.97.165132)
* for both periodic (see Eq. 38) and non-periodic (see Eqs. 28-29) case.
*
* Basically, the configurational force is the Gateaux derivative
* of the Kohn-Sham saddle point problem with respect to perturbations of the
* underlying space due to generic generator (which can be affine perturbation
* in case of stress computation or an atom centered generator with a compact
* support for computing the forces). The terms in the configurational force
* can be grouped into two types: one type can be written as contraction of
* Eshelby tensors (second order tensor) with the gradient of the Generator.
* Another type involves contraction of first order tensors with the
* Generator. The functions in this class provide expressions for the left
* side of the contraction operation- the second order Eshelby tensors
* (denoted by E*) and the first order force tensors (denoted by F*). General
* nomenclature of the input arguments: a) phiTot- total electrostatic
* potential b) phiExt- sum of electrostatic potential from all nuclear
* charges c) rho- electron density d) gradRho- gradient of electron density
* e) exc- exchange correlation energy
* f) derExcGradRho- derivative of exc with gradient of rho
* g) psiBegin- begin iterator to vector eigenvectors stored as a flattened
* array over k points and number of eigenvectors for each k point (periodic
* case has complex valued eigenvectors which is why
* dealii::Tensor<1,2,dealii::VectorizedArray<double> is used in functions for
* periodic case) h) gradPsiBegin- gradient of eigenvectors i) eigenValues-
* Kohn sham grounstate eigenvalues stored in a vector. For periodic problems
* with multiple k points the outer vector should be over k points j) tVal-
* smearing temperature in K k) pseudoVLoc- local part of the pseudopotential
* l) gradPseudoVLoc- gradient of local part of pseudopotential m) ZetaDeltaV-
* nonlocal pseudowavefunctions times deltaV (see Eq. 11 in
* https://link.aps.org/doi/10.1103/PhysRevB.97.165132) n) gradZetaDeltaV-
* gradient of ZetaDeltaV o) projectorKetTimesPsiTimesV- nonlocal
* pseudopotential projector ket times eigenvectors which are precomputed. The
* nonlocal pseudopotential constants are also multiplied to this quantity.
* (see Eq. 11 in https://link.aps.org/doi/10.1103/PhysRevB.97.165132)
*
* @author Sambit Das
*/
namespace eshelbyTensor
{
/// Eshelby tensor from sum of electrostatic potential from all nuclear
/// charges (only used for testing purpose)
dealii::Tensor<2, 3, dealii::VectorizedArray<double>>
getPhiExtEshelbyTensor(
const dealii::VectorizedArray<double> & phiExt,
const dealii::Tensor<1, 3, dealii::VectorizedArray<double>> &gradPhiExt);
/// Eshelby tensor corresponding to nuclear self energy (only used for
/// testing purpose)
dealii::Tensor<2, 3, dealii::VectorizedArray<double>>
getVselfBallEshelbyTensor(
const dealii::Tensor<1, 3, dealii::VectorizedArray<double>> &gradVself);
/// Eshelby tensor corresponding to nuclear self energy
dealii::Tensor<2, 3, double>
getVselfBallEshelbyTensor(const dealii::Tensor<1, 3, double> &gradVself);
/// All-electron electrostatic part of the Eshelby tensor
dealii::Tensor<2, 3, dealii::VectorizedArray<double>>
getEElectroEshelbyTensor(
const dealii::VectorizedArray<double> & phiTot,
const dealii::Tensor<1, 3, dealii::VectorizedArray<double>> &gradPhiTot,
const dealii::VectorizedArray<double> & rho);
/// exchange-correlation part of the ELoc Eshelby tensor
dealii::Tensor<2, 3, dealii::VectorizedArray<double>>
getELocXcEshelbyTensor(
const dealii::VectorizedArray<double> & rho,
const dealii::Tensor<1, 3, dealii::VectorizedArray<double>> &gradRho,
const dealii::VectorizedArray<double> & exc,
const dealii::Tensor<1, 3, dealii::VectorizedArray<double>>
&derExcGradRho);
/// psp part of the ELoc Eshelby tensor
dealii::Tensor<2, 3, dealii::VectorizedArray<double>>
getELocPspEshelbyTensor(const dealii::VectorizedArray<double> &rho,
const dealii::VectorizedArray<double> &pseudoVLoc,
const dealii::VectorizedArray<double> &phiExt);
/// Local pseudopotential force contribution
dealii::Tensor<1, 3, dealii::VectorizedArray<double>>
getFPSPLocal(
const dealii::VectorizedArray<double> rho,
const dealii::Tensor<1, 3, dealii::VectorizedArray<double>>
&gradPseudoVLoc,
const dealii::Tensor<1, 3, dealii::VectorizedArray<double>> &gradPhiExt);
/// Nonlocal core correction pseudopotential force contribution
dealii::Tensor<1, 3, dealii::VectorizedArray<double>>
getFNonlinearCoreCorrection(
const dealii::VectorizedArray<double> & vxc,
const dealii::Tensor<1, 3, dealii::VectorizedArray<double>> &gradRhoCore);
/// Nonlocal core correction pseudopotential force contribution
dealii::Tensor<1, 3, dealii::VectorizedArray<double>>
getFNonlinearCoreCorrection(
const dealii::Tensor<1, 3, dealii::VectorizedArray<double>>
&derExcGradRho,
const dealii::Tensor<2, 3, dealii::VectorizedArray<double>>
&hessianRhoCore);
}; // namespace eshelbyTensor
} // namespace dftfe
#endif