Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions src/Particle/LongRange/KContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@
{
TinyVector<int, DIM + 1> TempActualMax;
TinyVector<int, DIM> kvec;
TinyVector<RealType, DIM> kvec_cart;
RealType modk2;
std::vector<TinyVector<int, DIM>> kpts_tmp;
std::vector<PosType> kpts_cart_tmp;
std::vector<RealType> ksq_tmp;
Expand All @@ -129,9 +127,9 @@
if (i == 0 && j == 0 && k == 0)
continue;
//Convert kvec to Cartesian
kvec_cart = lattice.k_cart(kvec + twist);
auto kvec_cart = lattice.k_cart(kvec + twist);
//Find modk
modk2 = dot(kvec_cart, kvec_cart);
const auto modk2 = dot(kvec_cart, kvec_cart);
if (modk2 > kcut2)
continue; //Inside cutoff?
//This k-point should be added to the list
Expand Down Expand Up @@ -171,8 +169,8 @@
if (kvec[2] > mmax[2])
kvec[2] -= kdimsize;
// get cartesian location and modk2
kvec_cart = lattice.k_cart(kvec);
modk2 = dot(kvec_cart, kvec_cart);
auto kvec_cart = lattice.k_cart(kvec);

Check warning on line 172 in src/Particle/LongRange/KContainer.cpp

View check run for this annotation

Codecov / codecov/patch

src/Particle/LongRange/KContainer.cpp#L172

Added line #L172 was not covered by tests
const auto modk2 = dot(kvec_cart, kvec_cart);
// add k-point to lists
kpts_tmp.push_back(kvec);
kpts_cart_tmp.push_back(kvec_cart);
Expand Down
10 changes: 4 additions & 6 deletions src/Particle/LongRange/tests/test_ewald3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@ TEST_CASE("ewald3d", "[lrhandler]")
handler.initBreakup(ref);
CHECK(handler.Sigma == Approx(std::sqrt(lattice.LR_kc / (2.0 * lattice.LR_rc))));

std::cout << "handler.MaxKshell is " << handler.MaxKshell << std::endl;
CHECK( (std::is_same<OHMMS_PRECISION, OHMMS_PRECISION_FULL>::value ?
handler.MaxKshell == 78 : handler.MaxKshell >= 117 && handler.MaxKshell <= 128 ));
app_log() << "handler.MaxKshell is " << handler.MaxKshell << std::endl;
CHECK(handler.MaxKshell == 78);
CHECK(handler.LR_rc == Approx(2.5));
CHECK(handler.LR_kc == Approx(12));

Expand Down Expand Up @@ -94,9 +93,8 @@ TEST_CASE("ewald3d df", "[lrhandler]")
handler.initBreakup(ref);
CHECK(handler.Sigma == Approx(std::sqrt(lattice.LR_kc / (2.0 * lattice.LR_rc))));

std::cout << "handler.MaxKshell is " << handler.MaxKshell << std::endl;
CHECK( (std::is_same<OHMMS_PRECISION, OHMMS_PRECISION_FULL>::value ?
handler.MaxKshell == 78 : handler.MaxKshell >= 117 && handler.MaxKshell <= 128 ));
app_log() << "handler.MaxKshell is " << handler.MaxKshell << std::endl;
CHECK(handler.MaxKshell == 78);
CHECK(handler.LR_rc == Approx(2.5));
CHECK(handler.LR_kc == Approx(12));

Expand Down
5 changes: 2 additions & 3 deletions src/Particle/LongRange/tests/test_lrhandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@ TEST_CASE("dummy", "[lrhandler]")

handler.initBreakup(ref);

std::cout << "handler.MaxKshell is " << handler.MaxKshell << std::endl;
CHECK( (std::is_same<OHMMS_PRECISION, OHMMS_PRECISION_FULL>::value ?
handler.MaxKshell == 78 : handler.MaxKshell >= 117 && handler.MaxKshell <= 128 ));
app_log() << "handler.MaxKshell is " << handler.MaxKshell << std::endl;
CHECK(handler.MaxKshell == 78);
CHECK(handler.LR_kc == Approx(12));
CHECK(handler.LR_rc == Approx(0));

Expand Down
10 changes: 4 additions & 6 deletions src/Particle/LongRange/tests/test_srcoul.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,8 @@ TEST_CASE("srcoul", "[lrhandler]")

handler.initBreakup(ref);

std::cout << "handler.MaxKshell is " << handler.MaxKshell << std::endl;
CHECK( (std::is_same<OHMMS_PRECISION, OHMMS_PRECISION_FULL>::value ?
handler.MaxKshell == 78 : handler.MaxKshell >= 117 && handler.MaxKshell <= 128 ));
app_log() << "handler.MaxKshell is " << handler.MaxKshell << std::endl;
CHECK(handler.MaxKshell == 78);
CHECK(Approx(handler.LR_rc) == 2.5);
CHECK(Approx(handler.LR_kc) == 12);

Expand Down Expand Up @@ -98,9 +97,8 @@ TEST_CASE("srcoul df", "[lrhandler]")

handler.initBreakup(ref);

std::cout << "handler.MaxKshell is " << handler.MaxKshell << std::endl;
CHECK( (std::is_same<OHMMS_PRECISION, OHMMS_PRECISION_FULL>::value ?
handler.MaxKshell == 78 : handler.MaxKshell >= 117 && handler.MaxKshell <= 128 ));
app_log() << "handler.MaxKshell is " << handler.MaxKshell << std::endl;
CHECK(handler.MaxKshell == 78);
CHECK(Approx(handler.LR_rc) == 2.5);
CHECK(Approx(handler.LR_kc) == 12);

Expand Down
5 changes: 2 additions & 3 deletions src/Particle/LongRange/tests/test_temp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,8 @@ TEST_CASE("temp3d", "[lrhandler]")

handler.initBreakup(ref);

std::cout << "handler.MaxKshell is " << handler.MaxKshell << std::endl;
CHECK( (std::is_same<OHMMS_PRECISION, OHMMS_PRECISION_FULL>::value ?
handler.MaxKshell == 78 : handler.MaxKshell >= 117 && handler.MaxKshell <= 128 ));
app_log() << "handler.MaxKshell is " << handler.MaxKshell << std::endl;
CHECK(handler.MaxKshell == 78);
CHECK(Approx(handler.LR_rc) == 2.5);
CHECK(Approx(handler.LR_kc) == 12);

Expand Down
Loading