ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
xc_ncgga_radial.h
Go to the documentation of this file.
1#ifndef XC_NCGGA_RADIAL_H
2#define XC_NCGGA_RADIAL_H
3
4#include <array>
5
6namespace ModuleXC
7{
8
10{
11 // Value, gradient, and Hessian of the same radial scalar map. At zero,
12 // direction is represented by the zero vector because the scalar map has
13 // a unique zero gradient and zero Hessian there.
14 double value = 0.0;
15 std::array<double, 3> direction = {{0.0, 0.0, 0.0}};
16 std::array<double, 3> gradient = {{0.0, 0.0, 0.0}};
17 double transverse_hessian = 0.0;
18 double radial_hessian = 0.0;
19
20 double jacobian(const int row, const int column) const;
21};
22
23// For r = |magnetization| and x = r / eta, the returned scalar is
24// eta * x^3 * (3 x^2 - 8 x + 6), r < eta,
25// r, r >= eta.
26// The splice is C2 at both r = 0 and r = eta. Eta is explicit so this
27// mathematical primitive does not choose policy for any XC mode.
28NcggaRadialPoint make_ncgga_radial_point(const std::array<double, 3> &magnetization, const double eta);
29
30// The C2 regularization scale is part of the gga_grad=2 LCA functional, not a
31// divide-by-zero guard. Other noncollinear modes do not inherit this policy.
33
35{
37 double absolute_density = 0.0;
38 double clipped_magnitude = 0.0;
39 std::array<double, 2> spin_density = {{0.0, 0.0}};
40 double density_sign = 0.0;
41 bool saturated = true;
42
43 // spin is 0/1 for up/down; channel is 0 for the raw total density and
44 // 1..3 for mx,my,mz.
45 double jacobian(const int spin, const int channel) const;
46};
47
48// Compose a raw total density t=n+rho_core with one radial magnetization map:
49// a = |t|,
50// c = min(radial.value, a),
51// rho_up = (a+c)/2,
52// rho_down= (a-c)/2.
53// The Jacobian follows that exact graph. At the abs kink t=0 it selects zero;
54// at the clipping kink radial.value=a it selects the saturated branch. Eta and
55// the radial policy remain explicit in make_ncgga_radial_point.
56NcggaSpinMapPoint make_ncgga_spin_map_point(const double total_density, const NcggaRadialPoint &radial);
57
58} // namespace ModuleXC
59
60#endif
Definition xc_functional_ncgga_sf.cpp:16
NcggaRadialPoint make_ncgga_radial_point(const std::array< double, 3 > &magnetization, const double eta)
Definition xc_ncgga_radial.cpp:16
NcggaSpinMapPoint make_ncgga_spin_map_point(const double total_density, const NcggaRadialPoint &radial)
Definition xc_ncgga_radial.cpp:80
double ncgga_lca_radial_eta()
Definition xc_ncgga_radial.cpp:60
Definition xc_ncgga_radial.h:10
double jacobian(const int row, const int column) const
Definition xc_ncgga_radial.cpp:10
double radial_hessian
Definition xc_ncgga_radial.h:18
std::array< double, 3 > direction
Definition xc_ncgga_radial.h:15
double transverse_hessian
Definition xc_ncgga_radial.h:17
std::array< double, 3 > gradient
Definition xc_ncgga_radial.h:16
double value
Definition xc_ncgga_radial.h:14
Definition xc_ncgga_radial.h:35
bool saturated
Definition xc_ncgga_radial.h:41
double clipped_magnitude
Definition xc_ncgga_radial.h:38
NcggaRadialPoint radial
Definition xc_ncgga_radial.h:36
double jacobian(const int spin, const int channel) const
Definition xc_ncgga_radial.cpp:62
double density_sign
Definition xc_ncgga_radial.h:40
double absolute_density
Definition xc_ncgga_radial.h:37
std::array< double, 2 > spin_density
Definition xc_ncgga_radial.h:39