Browse Source

Tweak execs

master
J.-S. Caux 4 years ago
parent
commit
8793035aa1

+ 2
- 2
include/ABACUS_Scan.h View File

@@ -150,9 +150,9 @@ namespace ABACUS {
150 150
   void Sort_RAW_File (const char ffsq_file[], char optionchar, char whichDSF);
151 151
 
152 152
   // Functions for data interpretation:
153
-  DP Smoothen_RAW_into_SF (std::string prefix, int iKmin, int iKmax, int DiK,
153
+  DP Smoothen_RAW_into_SF (std::string prefix, int iKmin, int iKmax, int DiK, DP devmax,
154 154
 			   DP ommin, DP ommax, int Nom, DP gwidth, DP normalization, DP denom_sum_K);
155
-  DP Smoothen_RAW_into_SF (std::string prefix, Vect<std::string> rawfilename, Vect<DP> weight, int iKmin, int iKmax, int DiK,
155
+  DP Smoothen_RAW_into_SF (std::string prefix, Vect<std::string> rawfilename, Vect<DP> weight, int iKmin, int iKmax, int DiK, DP devmax,
156 156
 			   DP ommin, DP ommax, int Nom, DP gwidth, DP normalization, DP denom_sum_K);
157 157
   void Write_K_File (DP Length, int iKmin, int iKmax);
158 158
   void Write_Omega_File (int Nout_omega, DP omegamin, DP omegamax);

+ 18
- 16
src/EXECS/Smoothen_Heis_DSF.cc View File

@@ -23,23 +23,25 @@ int main(int argc, char* argv[])
23 23
   if (argc != 13 && argc != 14) { // Print out instructions
24 24
     cout << "Usage of Smoothen_Heis_DSF executable: " << endl << endl;
25 25
     cout << "Provide arguments using one of the following options:" << endl << endl;
26
-    cout << "1) (for general momenta) whichDSF Delta N M iKmin iKmax DiK kBT ommin ommax Nom gwidth" << endl << endl;
27
-    cout << "2) (for fixed momentum) whichDSF Delta N M iKneeded ommin ommax Nom gwidth" << endl << endl;
26
+    cout << "1) (for general momenta) whichDSF Delta N M iKmin iKmax DiK devmax kBT ommin ommax Nom gwidth" << endl << endl;
27
+    cout << "2) (for fixed momentum) whichDSF Delta N M iKneeded devmax ommin ommax Nom gwidth" << endl << endl;
28 28
   }
29 29
 
30
-  else if (argc == 13) { // !fixed_iK
31
-    char whichDSF = *argv[1];
32
-    DP Delta = atof(argv[2]);
33
-    int N = atoi(argv[3]);
34
-    int M = atoi(argv[4]);
35
-    int iKmin = atoi(argv[5]);
36
-    int iKmax = atoi(argv[6]);
37
-    int DiK = atoi(argv[7]);
38
-    DP kBT = atof(argv[8]);
39
-    DP ommin = atof(argv[9]);
40
-    DP ommax = atof(argv[10]);
41
-    int Nom = atoi(argv[11]);
42
-    DP gwidth = atof(argv[12]);
30
+  else if (argc == 14) { // !fixed_iK
31
+    int index = 1;
32
+    char whichDSF = *argv[index++];
33
+    DP Delta = atof(argv[index++]);
34
+    int N = atoi(argv[index++]);
35
+    int M = atoi(argv[index++]);
36
+    int iKmin = atoi(argv[index++]);
37
+    int iKmax = atoi(argv[index++]);
38
+    int DiK = atoi(argv[index++]);
39
+    DP devmax = atof(argv[index++]);
40
+    DP kBT = atof(argv[index++]);
41
+    DP ommin = atof(argv[index++]);
42
+    DP ommax = atof(argv[index++]);
43
+    int Nom = atoi(argv[index++]);
44
+    DP gwidth = atof(argv[index++]);
43 45
 
44 46
     stringstream filenameprefix;
45 47
     Data_File_Name (filenameprefix, whichDSF, Delta, N, M, iKmin, iKmax, kBT, 0, "");
@@ -52,7 +54,7 @@ int main(int argc, char* argv[])
52 54
     Write_Omega_File (Nom, ommin, ommax);
53 55
 
54 56
     DP sumcheck;
55
-    sumcheck = Smoothen_RAW_into_SF (prefix, iKmin, iKmax, DiK, ommin, ommax, Nom, gwidth, normalization, denom_sum_K);
57
+    sumcheck = Smoothen_RAW_into_SF (prefix, iKmin, iKmax, DiK, devmax, ommin, ommax, Nom, gwidth, normalization, denom_sum_K);
56 58
 
57 59
   }
58 60
 

+ 2
- 2
src/EXECS/Smoothen_LiebLin_DSF.cc View File

@@ -69,7 +69,7 @@ int main(int argc, char* argv[])
69 69
 
70 70
     // We use the scaled width function as default:
71 71
     DP sumcheck;
72
-    sumcheck = Smoothen_RAW_into_SF (prefix, iKmin, iKmax, DiK, ommin, ommax, Nom, width, normalization, denom_sum_K);
72
+    sumcheck = Smoothen_RAW_into_SF (prefix, iKmin, iKmax, DiK, 0.0, ommin, ommax, Nom, width, normalization, denom_sum_K);
73 73
   }
74 74
 
75 75
   /*
@@ -97,7 +97,7 @@ int main(int argc, char* argv[])
97 97
     int iKmin = iKneeded;
98 98
     int iKmax = iKneeded;
99 99
 
100
-    cout << "Smoothing:  sumcheck = " << Smoothen_RAW_into_SF (prefix, iKmin, iKmax, ommin, ommax, Nom, gwidth, normalization) << endl;
100
+    cout << "Smoothing:  sumcheck = " << Smoothen_RAW_into_SF (prefix, iKmin, iKmax, 0.0, ommin, ommax, Nom, gwidth, normalization) << endl;
101 101
   }
102 102
   */
103 103
 

+ 2
- 2
src/EXECS/Smoothen_LiebLin_DSF_GeneralState.cc View File

@@ -76,7 +76,7 @@ int main(int argc, char* argv[])
76 76
 
77 77
     // We use the scaled width function as default:
78 78
     DP sumcheck;
79
-    sumcheck = Smoothen_RAW_into_SF (prefix, iKmin, iKmax, DiK, ommin, ommax, Nom, width, normalization, denom_sum_K);
79
+    sumcheck = Smoothen_RAW_into_SF (prefix, iKmin, iKmax, DiK, 0.0, ommin, ommax, Nom, width, normalization, denom_sum_K);
80 80
   }
81 81
 
82 82
   /*
@@ -104,7 +104,7 @@ int main(int argc, char* argv[])
104 104
     int iKmin = iKneeded;
105 105
     int iKmax = iKneeded;
106 106
 
107
-    cout << "Smoothing:  sumcheck = " << Smoothen_RAW_into_SF (prefix, iKmin, iKmax, ommin, ommax, Nom, gwidth, normalization) << endl;
107
+    cout << "Smoothing:  sumcheck = " << Smoothen_RAW_into_SF (prefix, iKmin, iKmax, 0.0, ommin, ommax, Nom, gwidth, normalization) << endl;
108 108
   }
109 109
   */
110 110
 

+ 1
- 1
src/EXECS/Smoothen_LiebLin_DSF_MosesState.cc View File

@@ -81,7 +81,7 @@ int main(int argc, char* argv[])
81 81
 
82 82
     // We use the scaled width function as default:
83 83
     DP sumcheck;
84
-    sumcheck = Smoothen_RAW_into_SF (prefix, iKmin, iKmax, DiK, ommin, ommax, Nom, width, normalization, denom_sum_K);
84
+    sumcheck = Smoothen_RAW_into_SF (prefix, iKmin, iKmax, DiK, 0.0, ommin, ommax, Nom, width, normalization, denom_sum_K);
85 85
   }
86 86
 
87 87
   return(0);

+ 1
- 1
src/EXECS/Smoothen_LiebLin_DSF_over_Ensemble.cc View File

@@ -89,7 +89,7 @@ int main(int argc, char* argv[])
89 89
       rawfilename[ns] = RAW_stringstream.str();
90 90
     }
91 91
 
92
-    Smoothen_RAW_into_SF (prefix, rawfilename, ensemble.weight, iKmin, iKmax, DiK,
92
+    Smoothen_RAW_into_SF (prefix, rawfilename, ensemble.weight, iKmin, iKmax, DiK, 0.0,
93 93
 			  ommin, ommax, Nom, width, normalization, denom_sum_K);
94 94
 
95 95
   }

+ 2
- 2
src/EXECS/Smoothen_ODSLF_DSF.cc View File

@@ -45,7 +45,7 @@ int main(int argc, char* argv[])
45 45
 
46 46
     DP normalization = twoPI;
47 47
 
48
-    cout << "Smoothing:  sumcheck = " << Smoothen_RAW_into_SF (prefix, iKmin, iKmax, ommin, ommax,
48
+    cout << "Smoothing:  sumcheck = " << Smoothen_RAW_into_SF (prefix, iKmin, iKmax, 0.0, ommin, ommax,
49 49
 							       Nom, gwidth, normalization) << endl;
50 50
 
51 51
     Write_K_File (N, iKmin, iKmax);
@@ -74,7 +74,7 @@ int main(int argc, char* argv[])
74 74
     int iKmin = iKneeded;
75 75
     int iKmax = iKneeded;
76 76
 
77
-    cout << "Smoothing:  sumcheck = " << Smoothen_RAW_into_SF (prefix, iKmin, iKmax, ommin, ommax,
77
+    cout << "Smoothing:  sumcheck = " << Smoothen_RAW_into_SF (prefix, iKmin, iKmax, 0.0, ommin, ommax,
78 78
 							       Nom, gwidth, normalization) << endl;
79 79
   }
80 80
 

+ 13
- 13
src/UTILS/Smoothen_RAW_into_SF.cc View File

@@ -19,7 +19,7 @@ using namespace ABACUS;
19 19
 
20 20
 namespace ABACUS {
21 21
 
22
-  DP Smoothen_RAW_into_SF (string prefix, int iKmin, int iKmax, int DiK,
22
+  DP Smoothen_RAW_into_SF (string prefix, int iKmin, int iKmax, int DiK, DP devmax,
23 23
 			   DP ommin, DP ommax, int Nom, DP gwidth, DP normalization, DP denom_sum_K)
24 24
   {
25 25
     // ommax is omega max for .dsf file, Nom is the number of omega slots used.
@@ -69,7 +69,7 @@ namespace ABACUS {
69 69
 
70 70
     while (RAW_infile.peek() != EOF) {
71 71
       RAW_infile >> omega >> iK >> FF >> dev >> label;
72
-      if (iK >= iKmin && iK <= iKmax  && fabs(omega) > 1.0e-8) { // remove connected part of DSF
72
+      if (iK >= iKmin && iK <= iKmax && dev < devmax && fabs(omega) > 1.0e-8) { // remove connected part of DSF
73 73
 	for (int deltaiK = -DiK; deltaiK <= DiK; ++deltaiK)
74 74
 	  if (iK + deltaiK >= iKmin && iK + deltaiK <= iKmax)
75 75
 	    SSF[iK + deltaiK - iKmin] += Kweight[abs(deltaiK)] * FF * FF;
@@ -104,7 +104,7 @@ namespace ABACUS {
104 104
     stringstream DSF_stringstream;    string DSF_string;
105 105
     DSF_stringstream << prefix;
106 106
     if (DiK > 0) DSF_stringstream << "_DiK_" << DiK;
107
-    DSF_stringstream << "_ommin_"<< ommin << "_ommax_" << ommax << "_Nom_" << Nom << "_w_" << gwidth << ".dsf";
107
+    DSF_stringstream << "_devmax_" << devmax << "_ommin_"<< ommin << "_ommax_" << ommax << "_Nom_" << Nom << "_w_" << gwidth << ".dsf";
108 108
     DSF_string = DSF_stringstream.str();    const char* DSF_Cstr = DSF_string.c_str();
109 109
 
110 110
     ofstream DSF_outfile;
@@ -121,7 +121,7 @@ namespace ABACUS {
121 121
     stringstream SSF_stringstream;    string SSF_string;
122 122
     SSF_stringstream << prefix;
123 123
     if (DiK > 0) SSF_stringstream << "_DiK_" << DiK;
124
-    SSF_stringstream << ".ssf";
124
+    SSF_stringstream << "_devmax_" << devmax << ".ssf";
125 125
     SSF_string = SSF_stringstream.str();    const char* SSF_Cstr = SSF_string.c_str();
126 126
 
127 127
     ofstream SSF_outfile;
@@ -136,7 +136,7 @@ namespace ABACUS {
136 136
 
137 137
 
138 138
     stringstream ASF_stringstream;    string ASF_string;
139
-    ASF_stringstream << prefix;
139
+    ASF_stringstream << prefix << "_devmax_" << devmax;
140 140
     ASF_stringstream << "_ommin_"<< ommin << "_ommax_" << ommax << "_Nom_" << Nom << "_w_" << gwidth << ".asf";
141 141
     ASF_string = ASF_stringstream.str();    const char* ASF_Cstr = ASF_string.c_str();
142 142
 
@@ -167,7 +167,7 @@ namespace ABACUS {
167 167
   }
168 168
 
169 169
   // This is the same function as above, but now using data for a diagonal ensemble of states
170
-  DP Smoothen_RAW_into_SF (string prefix, Vect<string> rawfilename, Vect<DP> weight, int iKmin, int iKmax, int DiK,
170
+  DP Smoothen_RAW_into_SF (string prefix, Vect<string> rawfilename, Vect<DP> weight, int iKmin, int iKmax, int DiK, DP devmax,
171 171
 			   DP ommin, DP ommax, int Nom, DP gwidth, DP normalization, DP denom_sum_K)
172 172
   {
173 173
     // ommax is omega max for .dsf file, Nom is the number of omega slots used.
@@ -217,7 +217,7 @@ namespace ABACUS {
217 217
 
218 218
       while (RAW_infile.peek() != EOF) {
219 219
 	RAW_infile >> omega >> iK >> FF >> dev >> label;
220
-	if (iK >= iKmin && iK <= iKmax && fabs(omega) > 1.0e-8) { // remove connected part of DSF)
220
+	if (iK >= iKmin && iK <= iKmax && dev < devmax && fabs(omega) > 1.0e-8) { // remove connected part of DSF)
221 221
 	  SSF[iK - iKmin] += weight[ns] * FF * FF;
222 222
 	  for (int iomega = 0; iomega < Nom; ++iomega)
223 223
 	    if (big_gwidth_used > (d_omega = fabs(omegaout[iomega] - omega))) {
@@ -252,7 +252,7 @@ namespace ABACUS {
252 252
     DSF_stringstream << prefix;
253 253
     DSF_stringstream << "_ns_" << weight.size();
254 254
     if (DiK > 0) DSF_stringstream << "_DiK_" << DiK;
255
-    DSF_stringstream << "_ommin_"<< ommin << "_ommax_" << ommax << "_Nom_" << Nom << "_w_" << gwidth << ".dsf";
255
+    DSF_stringstream << "_devmax_" << devmax << "_ommin_"<< ommin << "_ommax_" << ommax << "_Nom_" << Nom << "_w_" << gwidth << ".dsf";
256 256
     DSF_string = DSF_stringstream.str();    const char* DSF_Cstr = DSF_string.c_str();
257 257
 
258 258
     ofstream DSF_outfile;
@@ -269,7 +269,7 @@ namespace ABACUS {
269 269
     stringstream SSF_stringstream;    string SSF_string;
270 270
     SSF_stringstream << prefix;
271 271
     SSF_stringstream << "_ns_" << weight.size();
272
-    SSF_stringstream << ".ssf";
272
+    SSF_stringstream << "_devmax_" << devmax << ".ssf";
273 273
     SSF_string = SSF_stringstream.str();    const char* SSF_Cstr = SSF_string.c_str();
274 274
 
275 275
     ofstream SSF_outfile;
@@ -286,7 +286,7 @@ namespace ABACUS {
286 286
     stringstream ASF_stringstream;    string ASF_string;
287 287
     ASF_stringstream << prefix;
288 288
     ASF_stringstream << "_ns_" << weight.size();
289
-    ASF_stringstream << "_ommin_"<< ommin << "_ommax_" << ommax << "_Nom_" << Nom << "_w_" << gwidth << ".asf";
289
+    ASF_stringstream << "_devmax_" << devmax << "_ommin_"<< ommin << "_ommax_" << ommax << "_Nom_" << Nom << "_w_" << gwidth << ".asf";
290 290
     ASF_string = ASF_stringstream.str();    const char* ASF_Cstr = ASF_string.c_str();
291 291
 
292 292
     ofstream ASF_outfile;
@@ -317,7 +317,7 @@ namespace ABACUS {
317 317
 
318 318
 
319 319
 
320
-  DP Smoothen_RAW_into_ASF (string prefix, int iKmin, int iKmax, DP ommin, DP ommax, int Nom, DP gwidth,
320
+  DP Smoothen_RAW_into_ASF (string prefix, int iKmin, int iKmax, DP devmax, DP ommin, DP ommax, int Nom, DP gwidth,
321 321
 			    DP normalization, DP denom_sum_K)
322 322
   {
323 323
     // ommax is omega max for .asf file, Nom is the number of omega slots used.
@@ -355,7 +355,7 @@ namespace ABACUS {
355 355
 
356 356
     while (RAW_infile.peek() != EOF) {
357 357
       RAW_infile >> omega >> iK >> FF >> dev >> label;
358
-      if (iK >= iKmin && iK <= iKmax && fabs(omega) > 1.0e-8) { // remove connected part of DSF)
358
+      if (iK >= iKmin && iK <= iKmax && dev < devmax && fabs(omega) > 1.0e-8) { // remove connected part of DSF)
359 359
 	for (int iomega = 0; iomega < Nom; ++iomega)
360 360
 	  if (big_gwidth_used > (d_omega = fabs(omegaout[iomega] - omega)))
361 361
 	    ASF[iomega] += FF * FF * exp(-d_omega*d_omega * oneovertwowidthsq);
@@ -373,7 +373,7 @@ namespace ABACUS {
373 373
     stringstream ASF_stringstream;    string ASF_string;
374 374
     ASF_stringstream << prefix;
375 375
     //if (iKmax != iKmin) DSF_stringstream << "_iKmin_" << iKmin << "_iKmax_" << iKmax;
376
-    ASF_stringstream << "_ommin_"<< ommin << "_ommax_" << ommax << "_Nom_" << Nom << "_w_" << gwidth << ".asf";
376
+    ASF_stringstream << "_devmax_" << devmax << "_ommin_"<< ommin << "_ommax_" << ommax << "_Nom_" << Nom << "_w_" << gwidth << ".asf";
377 377
     ASF_string = ASF_stringstream.str();    const char* ASF_Cstr = ASF_string.c_str();
378 378
 
379 379
     ofstream ASF_outfile;

Loading…
Cancel
Save