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.

build_LiebLin_catalogue_k_range_dsfs_plots.sh 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. #! /bin/zsh
  2. # We use zsh here to support floats (not supported in bash)
  3. # This script produces the plots for the runs from `build_LiebLin_catalogue_k_range`
  4. # runs which achieved the required sumrule saturation.
  5. if [[ $# -ne 5 ]]; then
  6. echo "Arguments needed: whichDSF, kBT, target_sumrule, nkmax (max momentum in units of kF/4), width."
  7. exit 1
  8. fi
  9. if [[ $1 != 'd' && $1 != 'g' && $1 != 'o' ]]; then
  10. echo "Only the d, g and o scanning options are implemented."
  11. exit 1
  12. fi
  13. if [[ $2 -lt 0 ]]; then
  14. echo "Temperature kBT must be > 0."
  15. exit 1
  16. fi
  17. if [[ $3 -lt 0 || $3 -gt 1 ]]; then
  18. echo "Requirement: 0 < target_sumrule < 1."
  19. exit 1
  20. fi
  21. if [[ $4 -lt 0 ]]; then
  22. echo "nkmax must be > 0."
  23. exit 1
  24. fi
  25. if [[ $5 -lt 0 ]]; then
  26. echo "width must be > 0."
  27. exit 1
  28. fi
  29. whichDSF=$1
  30. kBT=$2
  31. target_sumrule=$3
  32. nkmax=$4
  33. width=$5
  34. correlator='rho-rho'
  35. if [[ $whichDSF == 'o' ]]; then
  36. correlator='psidag-psi'
  37. elif [[ $whichDSF == 'g' ]]; then
  38. correlator='psi-psidag'
  39. fi
  40. clist=(1024 512 256 128 64 32 16 8 4 2 1 0.5 0.25 0.125 0.0625 0.03125 0.015625)
  41. basedir="$(pwd)"
  42. for c in $clist
  43. do
  44. echo '** Starting plotting of DSFs for c =' $c
  45. dir='Lieb-Liniger/'$correlator'/T_'$kBT'/c_fixed/c_'$c'/k_range/k_0_to_'${(l:2::0:)nkmax}'kFo4/sr_'$target_sumrule'/store/plots'
  46. mkdir -p $dir
  47. cd $dir
  48. for datadir in ../data/*
  49. do
  50. N=${datadir#"../data/N_"}
  51. mkdir -p 'N_'$N
  52. cd 'N_'$N
  53. # Move all K_, Omega_ and .dsfs files here
  54. mv ../../data/N_$N/K_* .
  55. mv ../../data/N_$N/Omega_* .
  56. mv ../../data/N_$N/*dsfs .
  57. # Find the K and Omega file
  58. for file in *
  59. do
  60. if [[ $file = Omega* ]]; then
  61. omegafile=$file
  62. elif [[ $file = K_* ]]; then
  63. kfile=$file
  64. fi
  65. done
  66. # For each .dsfs file, plot
  67. for file in *.dsfs
  68. do
  69. echo 'Found file ' $file
  70. # invoke the python script
  71. plot_dsf_k_range.py $kfile $omegafile $file
  72. done
  73. cd ..
  74. done
  75. cd $basedir
  76. echo '** Successfully plotted DSFs for c =' $c'.\n'
  77. done