ABACUS/src/EXECS/Smoothen_Heis_DSF.cc

89 lines
2.6 KiB
C++

/**********************************************************
This software is part of J.-S. Caux's ABACUS library.
Copyright (c) J.-S. Caux.
-----------------------------------------------------------
File: Smoothen_Heis_DSF.cc
Purpose: produces .dsf and .ssf files from a .raw file
***********************************************************/
#include "ABACUS.h"
using namespace std;
using namespace ABACUS;
int main(int argc, char* argv[])
{
if (argc != 13 && argc != 14) { // Print out 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 devmax kBT ommin ommax Nom gwidth" << endl << endl;
cout << "2) (for fixed momentum) whichDSF Delta N M iKneeded devmax ommin ommax Nom gwidth" << endl << endl;
}
else if (argc == 14) { // !fixed_iK
int index = 1;
char whichDSF = *argv[index++];
DP Delta = atof(argv[index++]);
int N = atoi(argv[index++]);
int M = atoi(argv[index++]);
int iKmin = atoi(argv[index++]);
int iKmax = atoi(argv[index++]);
int DiK = atoi(argv[index++]);
DP devmax = atof(argv[index++]);
DP kBT = atof(argv[index++]);
DP ommin = atof(argv[index++]);
DP ommax = atof(argv[index++]);
int Nom = atoi(argv[index++]);
DP gwidth = atof(argv[index++]);
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, devmax, 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;
}
*/
return(0);
}