You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Smoothen_ODSLF_DSF.cc 2.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /**********************************************************
  2. This software is part of J.-S. Caux's ABACUS library.
  3. Copyright (c) J.-S. Caux.
  4. -----------------------------------------------------------
  5. File: Smoothen_ODSLF_DSF.cc
  6. Purpose: produces .dsf and .ssf files from a .raw file
  7. ***********************************************************/
  8. #include "ABACUS.h"
  9. using namespace std;
  10. using namespace ABACUS;
  11. int main(int argc, char* argv[])
  12. {
  13. if (argc != 10 && argc != 11) { // Print out instructions
  14. //if (strcmp(argv[1],"help") == 0) { // Output some instructions
  15. cout << "Usage of Smoothen_ODSLF_DSF executable: " << endl << endl;
  16. cout << "Provide arguments using one of the following options:" << endl << endl;
  17. cout << "1) (for general momenta) whichDSF Delta N M iKmin iKmax ommin ommax Nom gwidth" << endl << endl;
  18. cout << "2) (for fixed momentum) whichDSF Delta N M iKneeded ommin ommax Nom gwidth" << endl << endl;
  19. //else ABACUSerror("Incomprehensible arguments in Smoothen_ODSLF_DSF executable.");
  20. }
  21. else if (argc == 11) { // !fixed_iK
  22. char whichDSF = *argv[1];
  23. DP Delta = atof(argv[2]);
  24. int N = atoi(argv[3]);
  25. int M = atoi(argv[4]);
  26. int iKmin = atoi(argv[5]);
  27. int iKmax = atoi(argv[6]);
  28. DP ommin = atof(argv[7]);
  29. DP ommax = atof(argv[8]);
  30. int Nom = atoi(argv[9]);
  31. DP gwidth = atof(argv[10]);
  32. stringstream filenameprefix;
  33. ODSLF_Data_File_Name (filenameprefix, whichDSF, Delta, N, M, iKmin, iKmax, 0.0, 0);
  34. string prefix = filenameprefix.str();
  35. DP normalization = twoPI;
  36. cout << "Smoothing: sumcheck = " << Smoothen_RAW_into_SF (prefix, iKmin, iKmax, ommin, ommax, Nom, gwidth, normalization) << endl;
  37. Write_K_File (N, iKmin, iKmax);
  38. Write_Omega_File (Nom, ommin, ommax);
  39. }
  40. else if (argc == 10) { // fixed_iK
  41. char whichDSF = *argv[1];
  42. DP Delta = atof(argv[2]);
  43. int N = atoi(argv[3]);
  44. int M = atoi(argv[4]);
  45. int iKneeded = atoi(argv[5]);
  46. DP ommin = atof(argv[6]);
  47. DP ommax = atof(argv[7]);
  48. int Nom = atoi(argv[8]);
  49. DP gwidth = atof(argv[9]);
  50. bool fixed_iK = true;
  51. stringstream filenameprefix;
  52. Data_File_Name (filenameprefix, whichDSF, Delta, N, M, fixed_iK, iKneeded, 0.0, 0);
  53. string prefix = filenameprefix.str();
  54. DP normalization = twoPI;
  55. int iKmin = iKneeded;
  56. int iKmax = iKneeded;
  57. cout << "Smoothing: sumcheck = " << Smoothen_RAW_into_SF (prefix, iKmin, iKmax, ommin, ommax, Nom, gwidth, normalization) << endl;
  58. }
  59. else ABACUSerror("Wrong number of arguments to Smoothen_Heis_DSF executable.");
  60. }