91 lignes
2.7 KiB
C++
91 lignes
2.7 KiB
C++
/**********************************************************
|
|
|
|
This software is part of J.-S. Caux's ABACUS++ library.
|
|
|
|
Copyright (c)
|
|
|
|
-----------------------------------------------------------
|
|
|
|
File: Smoothen_Heis_DSF.cc
|
|
|
|
Purpose: produces .dsf and .ssf files from a .raw file
|
|
|
|
***********************************************************/
|
|
|
|
#include "JSC.h"
|
|
|
|
using namespace std;
|
|
using namespace JSC;
|
|
|
|
|
|
int main(int argc, char* argv[])
|
|
{
|
|
if (argc != 13 && argc != 14) { // Print out instructions
|
|
//if (strcmp(argv[1],"help") == 0) { // Output some instructions
|
|
cout << "Usage of Smoothen_Heis_DSF executable: " << endl << endl;
|
|
cout << "Provide arguments using one of the following options:" << endl << endl;
|
|
cout << "1) (for general momenta) whichDSF Delta N M iKmin iKmax DiK kBT ommin ommax Nom gwidth" << endl << endl;
|
|
cout << "2) (for fixed momentum) whichDSF Delta N M iKneeded ommin ommax Nom gwidth" << endl << endl;
|
|
//else JSCerror("Incomprehensible arguments in Smoothen_Heis_DSF executable.");
|
|
}
|
|
|
|
else if (argc == 13) { // !fixed_iK
|
|
char whichDSF = *argv[1];
|
|
DP Delta = atof(argv[2]);
|
|
int N = atoi(argv[3]);
|
|
int M = atoi(argv[4]);
|
|
int iKmin = atoi(argv[5]);
|
|
int iKmax = atoi(argv[6]);
|
|
int DiK = atoi(argv[7]);
|
|
DP kBT = atof(argv[8]);
|
|
DP ommin = atof(argv[9]);
|
|
DP ommax = atof(argv[10]);
|
|
int Nom = atoi(argv[11]);
|
|
DP gwidth = atof(argv[12]);
|
|
|
|
stringstream filenameprefix;
|
|
Data_File_Name (filenameprefix, whichDSF, Delta, N, M, iKmin, iKmax, kBT, 0, "");
|
|
string prefix = filenameprefix.str();
|
|
|
|
DP normalization = twoPI;
|
|
DP denom_sum_K = 1.0/N;
|
|
|
|
Write_K_File (N, iKmin, iKmax);
|
|
Write_Omega_File (Nom, ommin, ommax);
|
|
|
|
DP sumcheck;
|
|
sumcheck = Smoothen_RAW_into_SF (prefix, iKmin, iKmax, DiK, ommin, ommax, Nom, gwidth, normalization, denom_sum_K);
|
|
|
|
}
|
|
|
|
/*
|
|
else if (argc == 10) { // fixed_iK
|
|
char whichDSF = *argv[1];
|
|
DP Delta = atof(argv[2]);
|
|
int N = atoi(argv[3]);
|
|
int M = atoi(argv[4]);
|
|
int iKneeded = atoi(argv[5]);
|
|
DP ommin = atof(argv[6]);
|
|
DP ommax = atof(argv[7]);
|
|
int Nom = atoi(argv[8]);
|
|
DP gwidth = atof(argv[9]);
|
|
|
|
bool fixed_iK = true;
|
|
|
|
stringstream filenameprefix;
|
|
Data_File_Name (filenameprefix, whichDSF, Delta, N, M, fixed_iK, iKneeded, 0.0, 0, "");
|
|
string prefix = filenameprefix.str();
|
|
|
|
DP normalization = twoPI;
|
|
int iKmin = iKneeded;
|
|
int iKmax = iKneeded;
|
|
|
|
cout << "Smoothing: sumcheck = " << Smoothen_RAW_into_SF (prefix, iKmin, iKmax, ommin, ommax, Nom, gwidth, normalization) << endl;
|
|
}
|
|
*/
|
|
|
|
//else JSCerror("Wrong number of arguments to Smoothen_Heis_DSF executable.");
|
|
|
|
return(0);
|
|
}
|