Skip to content

Commit bdc08e4

Browse files
author
dyzheng
committed
Fix: kpar error with use_k_continuity
1 parent 9263f55 commit bdc08e4

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

source/module_hsolver/hsolver_pw.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -751,10 +751,13 @@ void HSolverPW<T, Device>::build_k_neighbors() {
751751
}
752752

753753
// Sort k-points by distance from origin
754-
std::sort(klist.begin(), klist.end(),
755-
[](const KPoint& a, const KPoint& b) {
756-
return a.norm < b.norm;
757-
});
754+
if(klist.size() > 1)
755+
{
756+
std::sort(klist.begin()+1, klist.end(),
757+
[](const KPoint& a, const KPoint& b) {
758+
return a.norm < b.norm;
759+
});
760+
}
758761

759762
// Build parent-child relationships
760763
k_order.push_back(klist[0].index);

0 commit comments

Comments
 (0)