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_LiebLin_DSF_over_Ensemble.cc 3.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /**********************************************************
  2. This software is part of J.-S. Caux's ABACUS library.
  3. Copyright (c) J.-S. Caux.
  4. -----------------------------------------------------------
  5. File: Smoothen_LiebLin_DSF_over_Ensemble.cc
  6. Purpose: produces .dsf and .ssf files from an ensemble of .raw files
  7. ***********************************************************/
  8. #include "ABACUS.h"
  9. using namespace std;
  10. using namespace ABACUS;
  11. int main(int argc, char* argv[])
  12. {
  13. if (argc != 13) { // Print out instructions
  14. cout << endl << "Welcome to ABACUS\t(copyright J.-S. Caux)." << endl;
  15. cout << endl << "Usage of Smoothen_LiebLin_DSF_over_Ensemble executable: " << endl;
  16. cout << endl << "Provide the following arguments:" << endl << endl;
  17. cout << "char whichDSF \t\t Which structure factor should be calculated ? Options are: "
  18. "d for rho rho, g for psi psi{dagger}, o for psi{dagger} psi" << endl;
  19. cout << "DP c_int \t\t Value of the interaction parameter" << endl;
  20. cout << "DP L \t\t\t Length of the system" << endl;
  21. cout << "int N \t\t\t Number of particles" << endl;
  22. cout << "int iKmin" << endl << "int iKmax \t\t Min and max momentum integers" << endl;
  23. cout << "DP kBT \t\t Temperature" << endl;
  24. cout << "int DiK \t\t\t Window of iK over which DSF is averaged (DiK == 0 means a single iK is used; "
  25. "DiK == 1 means 3 are used (iK-1, iK, iK+1), etc.)" << endl;
  26. cout << "DP ommin" << endl << "DP ommax \t\t Min and max frequencies to cover in smoothened DSF" << endl;
  27. cout << "Nom \t\t\t Number of frequency points used for discretization" << endl;
  28. cout << "DP width \t\t Gaussian width used in smoothing, in units of two-particle level spacing" << endl;
  29. cout << endl << "EXAMPLE: " << endl << endl;
  30. cout << "Smoothen_LiebLin_DSF_over_Ensemble d 1.0 100.0 100 0 200 5.0 1 0.0 10.0 500 2.0" << endl << endl;
  31. }
  32. else if (argc == 13) {
  33. char whichDSF = *argv[1];
  34. DP c_int = atof(argv[2]);
  35. DP L = atof(argv[3]);
  36. int N = atoi(argv[4]);
  37. int iKmin = atoi(argv[5]);
  38. int iKmax = atoi(argv[6]);
  39. DP kBT = atof(argv[7]);
  40. int DiK = atoi(argv[8]);
  41. DP ommin = atof(argv[9]);
  42. DP ommax = atof(argv[10]);
  43. int Nom = atoi(argv[11]);
  44. DP width = atof(argv[12]);
  45. stringstream filenameprefix;
  46. Data_File_Name (filenameprefix, whichDSF, c_int, L, N, iKmin, iKmax, kBT, 0.0, "");
  47. string prefix = filenameprefix.str();
  48. DP normalization = twoPI * L;
  49. DP denom_sum_K = L;
  50. Write_K_File (L, iKmin, iKmax);
  51. Write_Omega_File (Nom, ommin, ommax);
  52. // Read the weights from the ensembles file:
  53. LiebLin_Diagonal_State_Ensemble ensemble;
  54. stringstream ensfilestrstream;
  55. ensfilestrstream << "LiebLin_c_int_" << c_int << "_L_" << L << "_N_" << N << "_kBT_" << kBT << ".ens";
  56. string ensfilestr = ensfilestrstream.str();
  57. const char* ensfile_Cstr = ensfilestr.c_str();
  58. ensemble.Load(c_int, L, N, ensfile_Cstr);
  59. // Define the raw file names
  60. Vect<string> rawfilename(ensemble.nstates);
  61. for (int ns = 0; ns < ensemble.nstates; ++ns) {
  62. // Define the raw input file name:
  63. stringstream filenameprefix;
  64. Data_File_Name (filenameprefix, whichDSF, iKmin, iKmax, 0.0, ensemble.state[ns], ensemble.state[ns], ensemble.state[ns].label);
  65. string prefix = filenameprefix.str();
  66. stringstream RAW_stringstream; string RAW_string;
  67. RAW_stringstream << prefix << ".raw";
  68. rawfilename[ns] = RAW_stringstream.str();
  69. }
  70. Smoothen_RAW_into_SF (prefix, rawfilename, ensemble.weight, iKmin, iKmax, DiK, 0.0,
  71. ommin, ommax, Nom, width, normalization, denom_sum_K);
  72. }
  73. return(0);
  74. }