1 | #!/bin/sh
|
---|
2 | #
|
---|
3 | # uses gather_results with known files
|
---|
4 |
|
---|
5 | . suffix
|
---|
6 |
|
---|
7 | if [ -z "$1" ];then
|
---|
8 | echo "Usage: $0 <mol>"
|
---|
9 | echo "where <mol> is one directory in the defaults-dir, containing pcp.*${suf} files."
|
---|
10 | exit 1
|
---|
11 | fi
|
---|
12 |
|
---|
13 | for mol in $@; do
|
---|
14 | DDir="${configdir}/$mol"
|
---|
15 | SDir=$PWD
|
---|
16 | TEX="$mol.tex"
|
---|
17 | DVI="$mol.dvi"
|
---|
18 | PS="$mol.ps"
|
---|
19 | . suffix
|
---|
20 |
|
---|
21 | # start TeX-File
|
---|
22 | echo "\documentclass[11pt, a4paper]{article}" >${DDir}/$TEX
|
---|
23 | echo "\usepackage{rotating}" >>${DDir}/$TEX
|
---|
24 | echo "\usepackage{graphicx}" >>${DDir}/$TEX
|
---|
25 | echo "\usepackage{latexsym}" >>${DDir}/$TEX
|
---|
26 | echo "\usepackage{amsfonts}" >>${DDir}/$TEX
|
---|
27 | echo "\usepackage{amssymb}" >>${DDir}/$TEX
|
---|
28 | echo "\begin{document}" >>${DDir}/$TEX
|
---|
29 |
|
---|
30 | # gather susceptibility, copy plot file, call gnuplot
|
---|
31 | echo "Gathering susceptibility ..."
|
---|
32 | ./gather_result ${DDir}/ chi
|
---|
33 | ./average_result ${DDir}/ chi 9 "${DDir}/results-chi_avg${suf}"
|
---|
34 | ./average_result ${DDir}/ chi 1 "${DDir}/results-chi_iso_avg${suf}" _iso
|
---|
35 | echo "\include{results-chi}" >>${DDir}/$TEX
|
---|
36 | echo "\include{results-chi_iso}" >>${DDir}/$TEX
|
---|
37 | sed -e "s#results#results-chi#g" ${pcpdir}/util/plot-chi.plt >${DDir}/plot-chi.plt
|
---|
38 | cd ${DDir}
|
---|
39 | gnuplot plot-chi.plt
|
---|
40 | sed -i -e "s#figure#sidewayfigure#g" results-chi.tex
|
---|
41 | cd ${SDir}
|
---|
42 |
|
---|
43 | # go through all different sigmas
|
---|
44 | elementliste="H C O Si"
|
---|
45 |
|
---|
46 | for type in $elementliste; do
|
---|
47 | ion=0
|
---|
48 | while [ -e "$DDir/2Ht/pcp.sigma_i${ion}_${type}${suf}" ]; do
|
---|
49 | echo "Gathering shielding tensor for ion ${ion} of type ${type} ..."
|
---|
50 | ./gather_result ${DDir}/ "sigma_i${ion}_${type}"
|
---|
51 | sed -e "s#sigma#sigma-i${ion}-${type}#g" -e "s#results#results-sigma_i${ion}_${type}#" ${pcpdir}/util/plot-sigma.plt >${DDir}/plot-sigma_i${ion}_${type}.plt
|
---|
52 | cd ${DDir}
|
---|
53 | gnuplot "plot-sigma_i${ion}_${type}.plt"
|
---|
54 | sed -i -e "s#figure#sidewayfigure#g" results-sigma_i${ion}_${type}.tex
|
---|
55 | cd ${SDir}
|
---|
56 | echo "\include{results-sigma_i${ion}_${type}}" >>${DDir}/$TEX
|
---|
57 | echo "\include{results-sigma_i${ion}_${type}_iso}" >>${DDir}/$TEX
|
---|
58 | # step on to next ion, if exists. If not, go to next type and zeroth ion
|
---|
59 | let ion=$ion+1
|
---|
60 | done
|
---|
61 | if [ -e "$DDir/2Ht/pcp.sigma_i0_${type}${suf}" ]; then
|
---|
62 | echo "Collecting shielding tensor, averaging and error estimation ..."
|
---|
63 | ./average_result ${DDir}/ "sigma" ${type} 9 "${DDir}/results-sigma_${type}_avg${suf}"
|
---|
64 | ./average_result ${DDir}/ "sigma" ${type} 1 "${DDir}/results-sigma_${type}_iso_avg${suf}" _iso
|
---|
65 | fi
|
---|
66 |
|
---|
67 | ion=0
|
---|
68 | while [ -e "$DDir/2Ht/pcp.sigma_i${ion}_${type}_rezi${suf}" ]; do
|
---|
69 | echo "Gathering reciprocal shielding tensor for ion ${ion} of type ${type} ..."
|
---|
70 | ./gather_result ${DDir}/ "sigma_i${ion}_${type}_rezi"
|
---|
71 | sed -e "s#sigma#sigma-i${ion}-${type}_rezi#g" -e "s#results#results-sigma_i${ion}_${type}_rezi#" ${pcpdir}/util/plot-sigma.plt >${DDir}/plot-sigma_i${ion}_${type}_rezi.plt
|
---|
72 | cd ${DDir}
|
---|
73 | gnuplot "plot-sigma_i${ion}_${type}_rezi.plt"
|
---|
74 | sed -i -e "s#figure#sidewayfigure#g" results-sigma_i${ion}_${type}_rezi.tex
|
---|
75 | cd ${SDir}
|
---|
76 | echo "\include{results-sigma_i${ion}_${type}_rezi}" >>${DDir}/$TEX
|
---|
77 | echo "\include{results-sigma_i${ion}_${type}_rezi_iso}" >>${DDir}/$TEX
|
---|
78 | # step on to next ion, if exists. If not, go to next type and zeroth ion
|
---|
79 | let ion=$ion+1
|
---|
80 | done
|
---|
81 | if [ -e "$DDir/2Ht/pcp.sigma_i0_${type}_rezi${suf}" ]; then
|
---|
82 | echo "Collecting reciprocal shielding tensor, averaging and error estimation ..."
|
---|
83 | ./average_result ${DDir}/ "sigma" ${type} 9 "${DDir}/results-sigma_${type}_rezi_avg${suf}" "_rezi"
|
---|
84 | ./average_result ${DDir}/ "sigma" ${type} 1 "${DDir}/results-sigma_${type}_rezi_iso_avg${suf}" "_rezi_iso"
|
---|
85 | fi
|
---|
86 |
|
---|
87 | done
|
---|
88 |
|
---|
89 | # End TeX-File and call with latex
|
---|
90 | echo "\end{document}" >>${DDir}/$TEX
|
---|
91 | cd ${DDir}
|
---|
92 | latex $TEX
|
---|
93 | dvips -o $PS $DVI
|
---|
94 | cd ${SDir}
|
---|
95 | done
|
---|
96 |
|
---|
97 | echo "all done."
|
---|
98 |
|
---|
99 | exit 0
|
---|