Last change
on this file since 94ca12 was 94ca12, checked in by Frederik Heber <heber@…>, 17 years ago |
replaced absolute paths by @prefix@ and so on
|
-
Property mode
set to
100755
|
File size:
1.1 KB
|
Rev | Line | |
---|
[bad406] | 1 | #!@SHELL@
|
---|
[41c2f1] | 2 | #
|
---|
| 3 | # calculates the density of a molecule contained in a espack config file
|
---|
| 4 |
|
---|
[94ca12] | 5 | MOLECUILDER="@bindir@/molecuilder"
|
---|
[0779a9] | 6 |
|
---|
[41c2f1] | 7 | if [ -z $1 ]; then
|
---|
| 8 | echo "Usage: $0 <config file>"
|
---|
| 9 | echo "We assume, that there is also an xyz file to the config file."
|
---|
| 10 | exit 1
|
---|
| 11 | else
|
---|
| 12 | config=$1
|
---|
[0779a9] | 13 | if [ ! -e $config ]; then
|
---|
| 14 | echo "Config file $config does not exist!"
|
---|
| 15 | exit 1
|
---|
| 16 | fi
|
---|
| 17 | fi
|
---|
| 18 |
|
---|
| 19 | # if xyz is missing, call molecuilder to create it
|
---|
| 20 | if [ ! -e ${config}.xyz ]; then
|
---|
| 21 | echo "Config xyz file ${config}.xyz does not exist, creating it"
|
---|
| 22 | $MOLECUILDER ${config} -t 0. 0. 0.
|
---|
[41c2f1] | 23 | fi
|
---|
| 24 |
|
---|
| 25 | mass=`/home/heber/workspace/ESPACK/bin/CalculateMass.sh ${config}.xyz | awk -F" " {'print $3'}`
|
---|
| 26 | echo "Mass is $mass atomicmassunit"
|
---|
| 27 | boxlengths=`grep ^Box --after-context=3 ${config} | tail -n 3`
|
---|
| 28 | volume=`echo $boxlengths | awk -F" " {'print $1*$3*$6'}`
|
---|
| 29 | if [ `grep IsAngstroem ${config} | awk -F" " {'print $2'}` == "1" ]; then
|
---|
| 30 | unit="angstrom^3"
|
---|
| 31 | else
|
---|
| 32 | unit="atomiclength^3"
|
---|
| 33 | fi
|
---|
| 34 | echo "Volume is $volume $unit"
|
---|
| 35 | density=`units "$mass atomicmassunit / $volume $unit" "g/cm^3" | grep \* | awk -F" " {'print $2'}`
|
---|
| 36 | echo "Density is $density g/cm^3"
|
---|
| 37 |
|
---|
| 38 | exit 0
|
---|
Note:
See
TracBrowser
for help on using the repository browser.