|
Last change
on this file since 3f0c46 was 41c2f1, checked in by Frederik Heber <heber@…>, 17 years ago |
|
Two new shell scripts to calculate mass (with elements.db) and the resulting density (with volume out of BoxLength)
|
-
Property mode
set to
100755
|
|
File size:
783 bytes
|
| Line | |
|---|
| 1 | #!/bin/sh
|
|---|
| 2 | #
|
|---|
| 3 | # calculates the density of a molecule contained in a espack config file
|
|---|
| 4 |
|
|---|
| 5 | if [ -z $1 ]; then
|
|---|
| 6 | echo "Usage: $0 <config file>"
|
|---|
| 7 | echo "We assume, that there is also an xyz file to the config file."
|
|---|
| 8 | exit 1
|
|---|
| 9 | else
|
|---|
| 10 | config=$1
|
|---|
| 11 | fi
|
|---|
| 12 |
|
|---|
| 13 | mass=`/home/heber/workspace/ESPACK/bin/CalculateMass.sh ${config}.xyz | awk -F" " {'print $3'}`
|
|---|
| 14 | echo "Mass is $mass atomicmassunit"
|
|---|
| 15 | boxlengths=`grep ^Box --after-context=3 ${config} | tail -n 3`
|
|---|
| 16 | volume=`echo $boxlengths | awk -F" " {'print $1*$3*$6'}`
|
|---|
| 17 | if [ `grep IsAngstroem ${config} | awk -F" " {'print $2'}` == "1" ]; then
|
|---|
| 18 | unit="angstrom^3"
|
|---|
| 19 | else
|
|---|
| 20 | unit="atomiclength^3"
|
|---|
| 21 | fi
|
|---|
| 22 | echo "Volume is $volume $unit"
|
|---|
| 23 | density=`units "$mass atomicmassunit / $volume $unit" "g/cm^3" | grep \* | awk -F" " {'print $2'}`
|
|---|
| 24 | echo "Density is $density g/cm^3"
|
|---|
| 25 |
|
|---|
| 26 | exit 0
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.