excgrid
0.1.0
Grid + XC-kernel + D3 library
Toggle main menu visibility
Loading...
Searching...
No Matches
kernel.hpp
1
#pragma once
2
3
#include <span>
4
#include <string_view>
5
6
namespace
excgrid {
7
16
24
struct
XcKernelValue
{
25
double
exc
= 0.0;
26
double
vrhoA
= 0.0;
27
double
vrhoB
= 0.0;
28
double
vsigmaAa
= 0.0;
29
double
vsigmaAb
= 0.0;
30
double
vsigmaBb
= 0.0;
31
double
vtauA
= 0.0;
32
double
vtauB
= 0.0;
33
};
34
40
constexpr
XcKernelValue
operator+
(
const
XcKernelValue
& a,
const
XcKernelValue
& b)
noexcept
{
41
return
{a.exc + b.exc,
42
a.vrhoA + b.vrhoA,
43
a.vrhoB + b.vrhoB,
44
a.vsigmaAa + b.vsigmaAa,
45
a.vsigmaAb + b.vsigmaAb,
46
a.vsigmaBb + b.vsigmaBb,
47
a.vtauA + b.vtauA,
48
a.vtauB + b.vtauB};
49
}
50
56
constexpr
XcKernelValue
&
operator+=
(
XcKernelValue
& a,
const
XcKernelValue
& b)
noexcept
{
57
a = a + b;
58
59
return
a;
60
}
61
67
constexpr
XcKernelValue
operator*
(
double
weight,
const
XcKernelValue
& v)
noexcept
{
68
return
{weight * v.exc,
69
weight * v.vrhoA,
70
weight * v.vrhoB,
71
weight * v.vsigmaAa,
72
weight * v.vsigmaAb,
73
weight * v.vsigmaBb,
74
weight * v.vtauA,
75
weight * v.vtauB};
76
}
77
83
constexpr
XcKernelValue
operator*
(
const
XcKernelValue
& v,
double
weight)
noexcept
{
84
return
weight * v;
85
}
86
89
using
LdaKernel
=
XcKernelValue
(*)(
double
rhoA,
double
rhoB);
90
94
using
GgaKernel
=
95
XcKernelValue
(*)(
double
rhoA,
double
rhoB,
double
sigmaAa,
double
sigmaAb,
double
sigmaBb);
96
102
class
XcFunctional
{
103
public
:
104
virtual
~XcFunctional
() =
default
;
105
108
[[nodiscard]]
virtual
bool
UsesGradient
()
const
= 0;
109
113
[[nodiscard]]
virtual
double
ExchangeFraction
()
const
= 0;
114
122
virtual
XcKernelValue
Evaluate
(
123
double
rhoA,
double
rhoB,
double
sigmaAa,
double
sigmaAb,
double
sigmaBb)
const
= 0;
124
};
125
132
const
XcFunctional
*
FindFunctional
(std::string_view name)
noexcept
;
133
137
std::span<const std::string_view>
FunctionalNames
() noexcept;
138
139
}
// namespace excgrid
excgrid::XcFunctional
Definition
kernel.hpp:102
excgrid::XcFunctional::ExchangeFraction
virtual double ExchangeFraction() const =0
excgrid::XcFunctional::UsesGradient
virtual bool UsesGradient() const =0
excgrid::XcFunctional::Evaluate
virtual XcKernelValue Evaluate(double rhoA, double rhoB, double sigmaAa, double sigmaAb, double sigmaBb) const =0
excgrid::GgaKernel
XcKernelValue(*)(double rhoA, double rhoB, double sigmaAa, double sigmaAb, double sigmaBb) GgaKernel
Definition
kernel.hpp:94
excgrid::operator+
constexpr XcKernelValue operator+(const XcKernelValue &a, const XcKernelValue &b) noexcept
Definition
kernel.hpp:40
excgrid::operator*
constexpr XcKernelValue operator*(double weight, const XcKernelValue &v) noexcept
Definition
kernel.hpp:67
excgrid::LdaKernel
XcKernelValue(*)(double rhoA, double rhoB) LdaKernel
Definition
kernel.hpp:89
excgrid::FunctionalNames
std::span< const std::string_view > FunctionalNames() noexcept
excgrid::operator+=
constexpr XcKernelValue & operator+=(XcKernelValue &a, const XcKernelValue &b) noexcept
Definition
kernel.hpp:56
excgrid::FindFunctional
const XcFunctional * FindFunctional(std::string_view name) noexcept
excgrid::XcKernelValue
Definition
kernel.hpp:24
excgrid::XcKernelValue::vsigmaBb
double vsigmaBb
de/d sigmaBb.
Definition
kernel.hpp:30
excgrid::XcKernelValue::vrhoB
double vrhoB
de/d rhoB.
Definition
kernel.hpp:27
excgrid::XcKernelValue::vsigmaAb
double vsigmaAb
de/d sigmaAb.
Definition
kernel.hpp:29
excgrid::XcKernelValue::exc
double exc
Energy density e(r).
Definition
kernel.hpp:25
excgrid::XcKernelValue::vtauB
double vtauB
de/d tauB (reserved - zero from LDA/GGA).
Definition
kernel.hpp:32
excgrid::XcKernelValue::vtauA
double vtauA
de/d tauA (reserved - zero from LDA/GGA).
Definition
kernel.hpp:31
excgrid::XcKernelValue::vsigmaAa
double vsigmaAa
de/d sigmaAa.
Definition
kernel.hpp:28
excgrid::XcKernelValue::vrhoA
double vrhoA
de/d rhoA.
Definition
kernel.hpp:26
include
excgrid
kernel.hpp
Generated by
1.18.0