|
Last change
on this file since 0ab37b was 0779a9, checked in by Frederik Heber <heber@…>, 17 years ago |
|
some mor changes to fine-tune the cluster generation.
Sadly, VolumeOfConvexEnvelope() is not robust/stable, with Ratio1.4-1/1800K/compundH.*.xyz no usable convex envelope was found but points were connected right through the cluster.
|
-
Property mode
set to
100755
|
|
File size:
780 bytes
|
| Rev | Line | |
|---|
| [41c2f1] | 1 | #!/bin/sh
|
|---|
| 2 | #
|
|---|
| 3 | # calculates mass of a molecule in a XYZ file
|
|---|
| 4 |
|
|---|
| 5 | ELEMENTSDB="/home/heber/workspace/ESPACK/bin/elements.db"
|
|---|
| 6 |
|
|---|
| 7 | if [ -z "$1" ]; then
|
|---|
| 8 | echo "Usage $0 <XYZ file>"
|
|---|
| 9 | exit 1
|
|---|
| 10 | else
|
|---|
| 11 | XYZ="$1"
|
|---|
| [0779a9] | 12 | if [ ! -e $XYZ ]; then
|
|---|
| 13 | echo "The xyz file $XYZ does not exist!"
|
|---|
| 14 | exit 1
|
|---|
| 15 | fi
|
|---|
| [41c2f1] | 16 | fi
|
|---|
| 17 |
|
|---|
| [0779a9] | 18 | # check for db presence
|
|---|
| 19 | if [ ! -e $ELEMENTSDB ]; then
|
|---|
| 20 | echo "The database file $ELEMENTSDB does not exist!"
|
|---|
| 21 | exit 1
|
|---|
| 22 | fi
|
|---|
| 23 |
|
|---|
| [41c2f1] | 24 | elements=(`grep -v ^# ${ELEMENTSDB} | awk -F" " {'print $2'}`)
|
|---|
| 25 | masses=(`grep -v ^# ${ELEMENTSDB} | awk -F" " {'print $7'}`)
|
|---|
| 26 |
|
|---|
| 27 | i=0
|
|---|
| 28 | totalmass=0
|
|---|
| 29 | while [ $i -lt ${#elements[*]} ]; do
|
|---|
| 30 | nr=`grep -E "^${elements[$i]}[[:space:]]+" $XYZ | wc -l`
|
|---|
| 31 | totalmass=`echo "$totalmass $nr ${masses[$i]}" | awk -F" " {'print $1+$2*$3'}`
|
|---|
| 32 | let i=$i+1
|
|---|
| 33 | done
|
|---|
| 34 |
|
|---|
| 35 | echo "Totalmass is $totalmass atomicunits"
|
|---|
| 36 | exit 0
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.