Skip to content

Commit

Permalink
Completed the GcmcTutorial. Modified grompy.__init__ to accomodate for
Browse files Browse the repository at this point in the history
non-standard locations of libc.s0.6.

Change-Id: Ib15844de40d89cd6b807e82673a8e983f5d9903b
  • Loading branch information
rpool committed Dec 16, 2011
1 parent 946b164 commit c125e3a
Show file tree
Hide file tree
Showing 17 changed files with 1,763 additions and 11 deletions.
42 changes: 42 additions & 0 deletions GcmcTutorial/GcmcLj/DoBlockAveraging.sh
@@ -0,0 +1,42 @@
#! /bin/bash

MCReportFiles=`find -type f -name MCReport.prod.dat`

echo "# mu [kJ/mol] Rho [1/(nm^3)] Err Rho [1/(nm^3)]" > rho_of_mu.dat
for MCReportFile in $MCReportFiles
do
grep -v \# $MCReportFile | awk '{print $1,$4}' > Rho.xvg
g_analyze -f Rho.xvg -ee Err.xvg > /dev/null 2>&1
rm -f \#*
Mu=`echo $MCReportFile | sed -e s/"\/"/\ /g | awk '{print $2}' | sed -e s/mu//`
AvRho=`grep \"av Err.xvg | sed -e s/\"//g | awk '{print $(NF)}'`
SdRho=`grep \"ee Err.xvg | sed -e s/\"//g | awk '{print $(NF)}'`
echo $Mu $AvRho $SdRho
done | sort -n >> rho_of_mu.dat
rm Rho.xvg Err.xvg

NA="6.0221415e23"
MCReportFile=`echo $MCReportFiles | awk '{print $(NF)}'`
Lambda3=`grep "\# De Broglie Wavelength\^3 \[l\/mol\]" $MCReportFile | awk '{print $(NF-4)}'` #l/mol
DmPerM=10.0
NmPerM=1.0e9
Kilo=1000.0
R=8.314472 #J/mol/K
T=`grep "\# De Broglie Wavelength\^3 \[l\/mol\]" $MCReportFile | awk '{print $(NF-1)}'` #K

echo "# mu [kJ/mol] Rho [mol/l] Err Rho [mol/l]" > rho_of_mu_in_mol_p_l.dat
grep -v \# rho_of_mu.dat | awk '{f='$NmPerM'^3/'$Kilo'/'$NA';print $1,f*$2,f*$3}' >> rho_of_mu_in_mol_p_l.dat

echo "# rho [mol/l] sdrho [mol/l] mu [kJ/mol] muid[kJ/mol] muex [kJ/mol] sdmuex [kJ/mol]" > mu_of_rho_in_mol_p_l.dat
grep -v \# rho_of_mu_in_mol_p_l.dat | awk '
{
rho=$2;
sdrho=$3;
mu=$1;
muid='$R'*'$T'*log(rho*'$Lambda3')/'$Kilo';
muex=mu-muid;
sdmuex='$R'*'$T'/rho*sdrho/'$Kilo';
print rho, sdrho, mu, muid, muex, sdmuex;
}' >> mu_of_rho_in_mol_p_l.dat

exit
29 changes: 29 additions & 0 deletions GcmcTutorial/GcmcLj/RunEos.sh
@@ -0,0 +1,29 @@
#! /bin/bash

GMXINSTALLDIR="../../gromacs/gromacs-4.0.7/gromacs-4.0.7-git/install/"
source ../SourceGromPyEnv.sh

InputParFile="start.dat"
MuList=`grep -v \# $InputParFile | awk '{print $3}' | sort -n`
TprDir=$PWD"/tpr"
PyLogFile="py.log"
NMin=0
NMax=426
GCMCMol="W"
GcmcPy=testHybrid.py

for i in $MuList
do
Mu=$i
NStart=`grep "mu"$i $InputParFile| awk '{print $2}'`
echo "Performing MuVT simulation @ Mu=$Mu ..."
cd "mu$i"
time ../../../$GcmcPy $TprDir $Mu $NStart $GCMCMol $NMin $NMax 2> /dev/null > $PyLogFile
rm -f \#*
gzip -f md.log
gzip -f py.log
echo
cd ../
done

exit
44 changes: 44 additions & 0 deletions GcmcTutorial/GcmcLj/gro/GenerateStartingStructures.sh
@@ -0,0 +1,44 @@
#! /bin/bash

EXPECTED_N_ARGS=3
if [ $# -ne $EXPECTED_N_ARGS ]; then
echo "Input the correct amount of arguments!"
echo "Usage:"
echo "------"
echo "./GenerateStartingStructures.sh \"StartOfNRange\" \"EndOfNRange\" \"WInputN.gro\""
echo "Example: ./GenerateStartingStructures.sh 1 430 W400.gro"
echo "EXITING..."
exit 1
fi

NStart=$1
NEnd=$2
NInputFile=$3
NInput=`echo $NInputFile | cut -d. -f1 | sed -e s/W//`

declare -i N=$NStart
while [ $N -lt $NInput ]
do
head -1 $NInputFile > tmp.gro
echo $N >> tmp.gro
head -$(($N+2)) $NInputFile | tail -$N >> tmp.gro
tail -1 $NInputFile >> tmp.gro
mv tmp.gro W$N.gro
N=$N+1
done
declare -i N=$(($NInput+1))
while [ $N -le $NEnd ]
do
PrevN=$(($N-1))
head -1 $NInputFile > tmp.gro
echo $N >> tmp.gro
head -$(($PrevN+2)) W$PrevN.gro | tail -$PrevN >> tmp.gro
tail -2 W$PrevN.gro | head -1 | sed -e s/"$PrevN"W/"$N"W/ >> tmp.gro
tail -1 $NInputFile >> tmp.gro
editconf -f tmp.gro -o W$N.gro
rm -f tmp.gro
rm -f \#*
N=$N+1
done

exit
403 changes: 403 additions & 0 deletions GcmcTutorial/GcmcLj/initstructure/water.gro

Large diffs are not rendered by default.

0 comments on commit c125e3a

Please sign in to comment.