Skip to content

Commit 2a49322

Browse files
authored
Add files via upload
1 parent b2aca3c commit 2a49322

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+74818
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
add_library(
2+
xc_
3+
OBJECT
4+
xc_functional.cpp
5+
xc_functional_vxc.cpp
6+
xc_functional_gradcorr.cpp
7+
xc_functional_wrapper_xc.cpp
8+
xc_functional_wrapper_gcxc.cpp
9+
xc_funct_exch_lda.cpp
10+
xc_funct_corr_lda.cpp
11+
xc_funct_exch_gga.cpp
12+
xc_funct_corr_gga.cpp
13+
xc_funct_hcth.cpp
14+
xc_functional_libxc.cpp
15+
xc_functional_libxc_tools.cpp
16+
xc_functional_libxc_vxc.cpp
17+
xc_functional_libxc_wrapper_xc.cpp
18+
xc_functional_libxc_wrapper_gcxc.cpp
19+
xc_functional_libxc_wrapper_tauxc.cpp
20+
NCLibxc/NCLibxc.cpp
21+
NCLibxc/NCLibxc.h
22+
NCLibxc/interface_to_libxc.cpp
23+
NCLibxc/interface_to_libxc.h
24+
NCLibxc/LebedevGrid.cpp
25+
NCLibxc/FibonacciGrid.cpp
26+
NCLibxc/FibonacciGrid.h
27+
NCLibxc/benchmark_tests.cpp
28+
NCLibxc/gga.cpp
29+
NCLibxc/lda.cpp
30+
NCLibxc/mgga.cpp
31+
NCLibxc/math.cpp
32+
NCLibxc/print.cpp
33+
NCLibxc/torque.cpp
34+
)
35+
36+
if(ENABLE_COVERAGE)
37+
add_coverage(xc_)
38+
endif()
39+
40+
if(BUILD_TESTING)
41+
if(ENABLE_MPI)
42+
if(ENABLE_LIBXC)
43+
add_subdirectory(test)
44+
add_subdirectory(kernels/test)
45+
endif()
46+
endif()
47+
endif()
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#include <iostream>
2+
#include <vector>
3+
#include <cmath>
4+
5+
struct Point {
6+
double x, y, z, w;
7+
};
8+
9+
std::vector<Point> fibonacci_sphere(int samples) {
10+
std::vector<Point> points;
11+
double phi = M_PI * (std::sqrt(5.0) - 1.0); // golden angle in radians
12+
13+
for (int i = 0; i < samples; ++i) {
14+
double y = 1.0 - (i / double(samples - 1)) * 2.0; // y goes from 1 to -1
15+
double radius = std::sqrt(1.0 - y * y); // radius at y
16+
17+
double theta = phi * i; // golden angle increment
18+
19+
double x = std::cos(theta) * radius;
20+
double z = std::sin(theta) * radius;
21+
22+
double w = 1.0 / samples;
23+
24+
points.push_back({x, y, z, w});
25+
}
26+
27+
return points;
28+
}
29+
/*
30+
int main() {
31+
int samples = 10;
32+
auto points = fibonacci_sphere(samples);
33+
34+
double sum_weights = 0.0;
35+
for (const auto& p : points) {
36+
std::cout << "x: " << p.x << ", y: " << p.y
37+
<< ", z: " << p.z << ", w: " << p.w << std::endl;
38+
sum_weights += p.w;
39+
}
40+
41+
std::cout << "Sum of weights: " << sum_weights << std::endl;
42+
43+
return 0;
44+
}
45+
*/
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// FibonacciGrid.h
2+
#ifndef FIBONACCIGRID_H
3+
#define FIBONACCIGRID_H
4+
5+
#include <vector>
6+
7+
struct Point {
8+
double x, y, z, w;
9+
};
10+
11+
std::vector<Point> fibonacci_sphere(int samples);
12+
13+
#endif // FIBONACCIGRID_H

0 commit comments

Comments
 (0)