MCPcopy Create free account
hub / github.com/SZAILAB/MaterialDFT-Demo / entropy_ts_kernel

Function entropy_ts_kernel

cpp_core/src/occupations.cpp:70–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68}
69
70double entropy_ts_kernel(double frac, double x, int ismear) {
71 if (ismear == -1) {
72 const double frac_clamped = std::max(1e-14, std::min(1.0 - 1e-14, frac));
73 return -(
74 frac_clamped * std::log(frac_clamped)
75 + (1.0 - frac_clamped) * std::log(1.0 - frac_clamped)
76 );
77 }
78 if (ismear == 0) {
79 return -methfessel_paxton_w1gauss(x, 0);
80 }
81 if (ismear == 1) {
82 return -methfessel_paxton_w1gauss(x, 1);
83 }
84 throw std::invalid_argument("entropy_ts_kernel: unsupported ISMEAR; expected -1, 0, or 1");
85}
86
87int grid_product(const std::array<int, 3>& grid) {
88 return grid[0] * grid[1] * grid[2];

Callers 1

Calls 2

logFunction · 0.85

Tested by

no test coverage detected