|
@@ -34,11 +34,11 @@ namespace ABACUS {
|
34
|
34
|
|
35
|
35
|
// Types of descendents:
|
36
|
36
|
// 14 == iK stepped up, leading exc one step further (can lead to ph recombination)
|
37
|
|
- // 13 == iK stepped up, next exc (nr of ph preserved, not taking possible ph recombination into account)
|
38
|
|
- // 12 == iK stepped up, next ext (nr ph increased, not taking possible ph recombination into account)
|
39
|
|
- // 11 == iK stepped down, leading exc one step further (can lead to ph recombination)
|
40
|
|
- // 10 == iK stepped down, next exc (nr of ph preserved, not taking possible ph recombination into account)
|
41
|
|
- // 9 == iK stepped down, next exc (nr ph increased, not taking possible ph recombination into account)
|
|
37
|
+ // 13 == iK up, next exc (nr of ph preserved, not taking possible ph recombination into account)
|
|
38
|
+ // 12 == iK up, next ext (nr ph increased, not taking possible ph recombination into account)
|
|
39
|
+ // 11 == iK down, leading exc one step further (can lead to ph recombination)
|
|
40
|
+ // 10 == iK down, next exc (nr of ph preserved, not taking possible ph recombination into account)
|
|
41
|
+ // 9 == iK down, next exc (nr ph increased, not taking possible ph recombination into account)
|
42
|
42
|
// 8 == iK preserved, 14 and 11 (up to 2 ph recombinations)
|
43
|
43
|
// 7 == iK preserved, 14 and 10
|
44
|
44
|
// 6 == iK preserved, 14 and 9
|
|
@@ -50,8 +50,10 @@ namespace ABACUS {
|
50
|
50
|
// 0 == iK preserved, 12 and 9
|
51
|
51
|
|
52
|
52
|
// For scanning over symmetric states, the interpretation is slightly different.
|
53
|
|
- // Types 14, 13 and 12 step iK up using the Ix2 on the right only, and mirrors the change on the left Ix2.
|
54
|
|
- // Types 11, 10 and 9 step iK down using the Ix2 on the right only, and mirrors the change on the left Ix2.
|
|
53
|
+ // Types 14, 13 and 12 step iK up using the Ix2 on the right only,
|
|
54
|
+ // and mirrors the change on the left Ix2.
|
|
55
|
+ // Types 11, 10 and 9 step iK down using the Ix2 on the right only,
|
|
56
|
+ // and mirrors the change on the left Ix2.
|
55
|
57
|
// There is then no need of scanning over types 0 - 8.
|
56
|
58
|
// By convention, types 9, 10 and 11 can call types 9 - 14; types 12-14 can only call types 12-14.
|
57
|
59
|
|
|
@@ -61,7 +63,8 @@ namespace ABACUS {
|
61
|
63
|
// This function returns true if descending further can lead to a particle-hole recombination.
|
62
|
64
|
// The criteria which are used are:
|
63
|
65
|
// - the active excitation has moved at least one step (so it has already created its p-h pair)
|
64
|
|
- // - there exists an OriginIx2 between the active Ix2 and the next Ix2 (to right or left depending on type of descendent)
|
|
66
|
+ // - there exists an OriginIx2 between the active Ix2 and the next Ix2
|
|
67
|
+ // (to right or left depending on type of descendent)
|
65
|
68
|
|
66
|
69
|
Vect<Vect<int> > ScanIx2 = Return_Ix2_from_Label (ScanIx2_label, OriginIx2);
|
67
|
70
|
|
|
@@ -71,7 +74,7 @@ namespace ABACUS {
|
71
|
74
|
bool excfound = false;
|
72
|
75
|
do {
|
73
|
76
|
exclevel++;
|
74
|
|
- if (exclevel == ScanIx2.size()) { // there isn't a single right-moving quantum number in ScanIx2
|
|
77
|
+ if (exclevel == ScanIx2.size()) { // there is no right-moving quantum number in ScanIx2
|
75
|
78
|
break;
|
76
|
79
|
}
|
77
|
80
|
for (int alpha = 0; alpha < ScanIx2[exclevel].size(); ++alpha)
|
|
@@ -125,7 +128,8 @@ namespace ABACUS {
|
125
|
128
|
// This function returns true if descending further can lead to a particle-hole recombination.
|
126
|
129
|
// The criteria which are used are:
|
127
|
130
|
// - the active excitation has moved at least one step (so it has already created its p-h pair)
|
128
|
|
- // - there exists an OriginIx2 between the active Ix2 and the next Ix2 (to right or left depending on type of descendent)
|
|
131
|
+ // - there exists an OriginIx2 between the active Ix2 and the next Ix2
|
|
132
|
+ // (to right or left depending on type of descendent)
|
129
|
133
|
|
130
|
134
|
Vect<Vect<int> > ScanIx2 = Return_Ix2_from_Label (ScanIx2_label, OriginIx2);
|
131
|
135
|
|
|
@@ -153,7 +157,8 @@ namespace ABACUS {
|
153
|
157
|
if (excfound && !BaseScanIx2[exclevel].includes(ScanIx2[exclevel][excindex])) {
|
154
|
158
|
// there exists an already dispersing excitation which isn't in Origin
|
155
|
159
|
// Is there a possible recombination?
|
156
|
|
- if (excindex > 0) { // a particle to the left of excitation has already moved left, so there is a hole
|
|
160
|
+ if (excindex > 0) {
|
|
161
|
+ // a particle to the left of excitation has already moved left, so there is a hole
|
157
|
162
|
// check that there exists an occupied Ix2 in Origin sitting between the excitation
|
158
|
163
|
// and the next Ix2 to its left in ScanIx2
|
159
|
164
|
for (int alpha = 0; alpha < BaseScanIx2[exclevel].size(); ++alpha)
|
|
@@ -227,13 +232,18 @@ namespace ABACUS {
|
227
|
232
|
int Max_Secs_alert = int(0.95 * Max_Secs); // we break any ongoing ithread loop beyond this point
|
228
|
233
|
|
229
|
234
|
stringstream filenameprefix;
|
230
|
|
- Data_File_Name (filenameprefix, whichDSF, iKmin, iKmax, kBT, AveragingState, SeedScanState, defaultScanStatename);
|
|
235
|
+ Data_File_Name (filenameprefix, whichDSF, iKmin, iKmax, kBT,
|
|
236
|
+ AveragingState, SeedScanState, defaultScanStatename);
|
231
|
237
|
|
232
|
|
- if (in_parallel) for (int r = 0; r < paralevel; ++r) filenameprefix << "_" << rank[r] << "_" << nr_processors[r];
|
|
238
|
+ if (in_parallel)
|
|
239
|
+ for (int r = 0; r < paralevel; ++r)
|
|
240
|
+ filenameprefix << "_" << rank[r] << "_" << nr_processors[r];
|
233
|
241
|
|
234
|
242
|
string prefix = filenameprefix.str();
|
235
|
243
|
|
236
|
|
- stringstream filenameprefix_prevparalevel; // without the rank and nr_processors of the highest paralevel
|
|
244
|
+ stringstream filenameprefix_prevparalevel;
|
|
245
|
+ // without the rank and nr_processors of the highest paralevel
|
|
246
|
+
|
237
|
247
|
Data_File_Name (filenameprefix_prevparalevel, whichDSF, iKmin, iKmax, kBT,
|
238
|
248
|
AveragingState, SeedScanState, defaultScanStatename);
|
239
|
249
|
if (in_parallel) for (int r = 0; r < paralevel - 1; ++r)
|
|
@@ -330,7 +340,7 @@ namespace ABACUS {
|
330
|
340
|
ScanStateList.Populate_List(whichDSF, SeedScanState);
|
331
|
341
|
|
332
|
342
|
if (refine && !in_parallel) ScanStateList.Load_Info (SUM_Cstr);
|
333
|
|
- else if (in_parallel && rank.sum() == 0) {}; // do nothing, keep the info in the higher .sum file!
|
|
343
|
+ else if (in_parallel && rank.sum() == 0) {}; // do nothing, keep info in the higher .sum file!
|
334
|
344
|
|
335
|
345
|
DP Chem_Pot = Chemical_Potential (AveragingState);
|
336
|
346
|
DP sumrule_factor = Sumrule_Factor (whichDSF, AveragingState, Chem_Pot, iKmin, iKmax);
|
|
@@ -342,8 +352,8 @@ namespace ABACUS {
|
342
|
352
|
|
343
|
353
|
int Ndata_previous_cycle = 0;
|
344
|
354
|
|
345
|
|
- int ninadm = 0; // number of inadmissible states for which we save some info in .inadm file. Save first 1000.
|
346
|
|
- int nconv0 = 0; // number of unconverged states for which we save some info in .conv0 file. Save first 1000.
|
|
355
|
+ int ninadm = 0; // nr of inadm states for which we save info in .inadm file. Save first 1000.
|
|
356
|
+ int nconv0 = 0; // nr of unconv states for which we save info in .conv0 file. Save first 1000.
|
347
|
357
|
|
348
|
358
|
double start_time_omp = omp_get_wtime();
|
349
|
359
|
double current_time_omp = omp_get_wtime();
|
|
@@ -373,12 +383,14 @@ namespace ABACUS {
|
373
|
383
|
double start_time_flags = omp_get_wtime();
|
374
|
384
|
|
375
|
385
|
// First flag the new base/type 's that we need to include:
|
376
|
|
- ScanStateList.Raise_Scanning_Flags (exp(-paused_thread_data.logscale * paused_thread_data.lowest_il_with_nthreads_neq_0));
|
|
386
|
+ ScanStateList.Raise_Scanning_Flags
|
|
387
|
+ (exp(-paused_thread_data.logscale * paused_thread_data.lowest_il_with_nthreads_neq_0));
|
377
|
388
|
|
378
|
389
|
|
379
|
390
|
// Get these base/type started:
|
380
|
391
|
for (int i = 0; i < ScanStateList.ndef; ++i) {
|
381
|
|
- if (ScanStateList.flag_for_scan[i] && ScanStateList.info[i].Ndata == 0 && !ScanStateList.scan_attempted[i]) {
|
|
392
|
+ if (ScanStateList.flag_for_scan[i] && ScanStateList.info[i].Ndata == 0
|
|
393
|
+ && !ScanStateList.scan_attempted[i]) {
|
382
|
394
|
|
383
|
395
|
Scan_Info scan_info_flags;
|
384
|
396
|
|