-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [update] bump version; add link to discourse.group (#930) * [refactor] get rid of template in radial_integrals_sum_L3() (#932) * apply @simonpintarelli proposed code change * get rid of one more tempale * default: -> throw, whitespace * fix * apply format --------- Co-authored-by: Simon Pintarelli <simon.pintarelli@cscs.ch> * [fix] subspace initialization in test_lr_solver (#934) * [cmake] remove std::filesystem target (#936) std::filesystem is part of C++17 which is required via CXX_STANDARD, there is no need to check for it explicitly * [fix] compilation error for ~memory_pool+tests (#939) * Ci/rebuild base image (#942) * CI: rebuild base images / pin spack to v0.21 * CI: use anonymous environments instead of dev-build with SPEC * avoid creating partitions with empty intervals in COSTA `custom_layout` --------- Co-authored-by: Anton Kozhevnikov <toxa81@gmail.com> * [fix] truncate very small occupation numbers to 0 (#943) * [refactor] minor cleaups (#938) * minor cleaups * apply format * [cmake] add missing REQUIRED (#945) * [fix] scalar-relativistic radial solver (#941) Introduce a few fixes for the scalar-relativistic radial solver. * [feature] port lr_addusdens to sirius (#937) Use a different sequence of operations to compute G+q augmentation charge. --------- Co-authored-by: Simon Pintarelli <simon.pintarelli@cscs.ch> Co-authored-by: Simon Pintarelli <1237199+simonpintarelli@users.noreply.github.com>
- Loading branch information
1 parent
8166bae
commit 62d3e0a
Showing
38 changed files
with
5,284 additions
and
541 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,61 @@ | ||
#include <sirius.hpp> | ||
#include "sirius.hpp" | ||
#include "testing.hpp" | ||
|
||
using namespace sirius; | ||
|
||
void | ||
test_enu(int zn__, int n__, int l__, double R__) | ||
int | ||
test_enu(cmd_args const& args__) | ||
{ | ||
auto rgrid = Radial_grid_factory<double>(radial_grid_t::lin_exp, 1500, 1e-7, R__, 6.0); | ||
auto rel = get_relativity_t(args__.value<std::string>("rel", "none")); | ||
auto zn = args__.value<int>("zn", 1); | ||
auto l = args__.value<int>("l", 0); | ||
auto n = args__.value<int>("n", 1); | ||
auto R = args__.value<double>("R", 2.2); | ||
|
||
auto rgrid = Radial_grid_factory<double>(radial_grid_t::lin_exp, 1500, 1e-7, R, 6.0); | ||
std::vector<double> v(rgrid.num_points()); | ||
for (int ir = 0; ir < rgrid.num_points(); ir++) { | ||
v[ir] = -double(zn__) / rgrid[ir]; | ||
v[ir] = -double(zn) / rgrid[ir]; | ||
} | ||
|
||
Enu_finder e(relativity_t::none, zn__, n__, l__, rgrid, v, -0.1); | ||
Enu_finder e(rel, zn, n, l, rgrid, v, -0.1); | ||
|
||
printf("Z: %i n: %i l: %i band energies (bottom, top, enu): %12.6f %12.6f %12.6f\n", zn__, n__, l__, e.ebot(), | ||
e.etop(), e.enu()); | ||
printf("Z: %i n: %i l: %i band energies (bottom, top, enu): %12.6f %12.6f %12.6f\n", zn, n, l, e.ebot(), e.etop(), | ||
e.enu()); | ||
|
||
Radial_solver solver(zn__, v, rgrid); | ||
Radial_solver solver(zn, v, rgrid); | ||
|
||
std::vector<double> p1, p2, p3, rdudr; | ||
std::array<double, 2> uderiv; | ||
|
||
solver.solve(relativity_t::none, 0, l__, e.ebot(), p1, rdudr, uderiv); | ||
solver.solve(relativity_t::none, 0, l__, e.etop(), p2, rdudr, uderiv); | ||
solver.solve(relativity_t::none, 0, l__, e.enu(), p3, rdudr, uderiv); | ||
int dme{0}; | ||
|
||
solver.solve(rel, dme, l, e.ebot(), p1, rdudr, uderiv); | ||
solver.solve(rel, dme, l, e.etop(), p2, rdudr, uderiv); | ||
solver.solve(rel, dme, l, e.enu(), p3, rdudr, uderiv); | ||
|
||
// printf("uderiv: %12.6f %12.6f\n", uderiv[0], uderiv[1]); | ||
printf("uderiv: %12.6f %12.6f\n", uderiv[0], uderiv[1]); | ||
|
||
// FILE* fout = fopen("radial_solution.dat", "w"); | ||
// for (int i = 0; i < rgrid.num_points(); i++) | ||
//{ | ||
// double x = rgrid[i]; | ||
// fprintf(fout, "%18.12f %18.12f %18.12f %18.12f\n", x, p1[i] / x, p2[i] / x, p3[i] / x); | ||
// } | ||
// fclose(fout); | ||
FILE* fout = fopen("radial_solution.dat", "w"); | ||
for (int i = 0; i < rgrid.num_points(); i++) { | ||
double x = rgrid[i]; | ||
fprintf(fout, "%18.12f %18.12f %18.12f %18.12f\n", x, p1[i] / x, p2[i] / x, p3[i] / x); | ||
} | ||
fclose(fout); | ||
return 0; | ||
} | ||
|
||
int | ||
main(int argn, char** argv) | ||
{ | ||
cmd_args args(argn, argv, | ||
{{"rel=", "(string) type of scalar-relativistic equation"}, | ||
{"zn=", "(int) nuclear charge"}, | ||
{"l=", "(int) orbital quantum number"}, | ||
{"n=", "(int) principal quantum number"}, | ||
{"R=", "(double) muffin-tin radius"}}); | ||
|
||
sirius::initialize(1); | ||
for (int zn = 1; zn < 100; zn++) { | ||
#pragma omp parallel for | ||
for (int n = 1; n < 7; n++) { | ||
for (int l = 0; l < n; l++) { | ||
test_enu(zn, n, l, 1.5); | ||
} | ||
} | ||
} | ||
call_test("test_enu", test_enu, args); | ||
sirius::finalize(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,17 @@ | ||
ARG BASE_IMAGE | ||
FROM $BASE_IMAGE | ||
|
||
ARG SPECDEV | ||
|
||
# show the spack's spec | ||
RUN spack spec -I $SPECDEV | ||
|
||
RUN spack env create --with-view /opt/sirius sirius-env | ||
RUN spack -e sirius-env add $SPECDEV | ||
ARG ENVPATH | ||
|
||
# copy source files of the pull request into container | ||
COPY . /sirius-src | ||
|
||
# build SIRIUS | ||
RUN spack --color always -e sirius-env dev-build --source-path /sirius-src $SPECDEV | ||
RUN spack -e $ENVPATH install | ||
|
||
# # show the spack's spec | ||
RUN spack -e $ENVPATH find -lcdv sirius | ||
|
||
# we need a fixed name for the build directory | ||
# here is a hacky workaround to link ./spack-build-{hash} to ./spack-build | ||
RUN cd /sirius-src && ln -s $(find . -name "spack-build-*" -type d) spack-build | ||
RUN cd /sirius-src && ln -s $(spack -e $ENVPATH location -b sirius) spack-build |
Oops, something went wrong.