implement tests for harmonic/shift

This commit is contained in:
Axel Kohlmeyer
2013-11-23 19:32:50 +01:00
parent fe02d652b5
commit 4d43e30b42
5 changed files with 49 additions and 37 deletions

View File

@ -1,11 +0,0 @@
Step Temp E_pair E_mol TotEng Press
0 0 0 0.040304848 0.040304848 183.5375
1 0.22393239 0 0.036893575 0.040231075 175.82761
--
Step Temp E_pair E_mol TotEng Press
0 0.22393239 0 0.036893575 0.040231075 175.82761
1 0.81991975 0 0.027814603 0.040034728 153.28706
--
Step Temp E_pair E_mol TotEng Press
1 0.22393239 0 0.036893575 0.040231075 175.82761
2 0.81991975 0 0.027814603 0.040034728 153.28706

View File

@ -1,11 +0,0 @@
Step Temp E_pair E_mol TotEng Press
0 0 0 0.040304848 0.040304848 183.5375
1 0.22393239 0 0.036893575 0.040231075 175.82761
--
Step Temp E_pair E_mol TotEng Press
0 0.22393239 0 0.036893575 0.040231075 175.82761
1 0.81991975 0 0.027814603 0.040034728 153.28706
--
Step Temp E_pair E_mol TotEng Press
1 0.22393239 0 0.036893575 0.040231075 175.82761
2 0.81991975 0 0.027814603 0.040034728 153.28706

View File

@ -0,0 +1,11 @@
Step Temp E_pair E_mol TotEng Press
0 0 0 -399.98185 -399.98185 82.670827
1 0.046543578 0 -399.98255 -399.98185 81.107729
--
Step Temp E_pair E_mol TotEng Press
0 0.046543578 0 -180.16414 -180.16344 36.550781
1 0.095879348 0 -180.16488 -180.16345 34.84325
--
Step Temp E_pair E_mol TotEng Press
1 0.046543578 0 -399.98255 -399.98185 81.107729
2 0.17899078 0 -399.98454 -399.98187 76.471982

View File

@ -0,0 +1,11 @@
Step Temp E_pair E_mol TotEng Press
0 0 0 -399.98185 -399.98185 82.670827
1 0.046543578 0 -399.98255 -399.98185 81.107729
--
Step Temp E_pair E_mol TotEng Press
0 0.046543578 0 -180.16414 -180.16344 36.550781
1 0.095879348 0 -180.16488 -180.16345 34.84325
--
Step Temp E_pair E_mol TotEng Press
1 0.046543578 0 -399.98255 -399.98185 81.107729
2 0.17899078 0 -399.98454 -399.98187 76.471982

View File

@ -2,8 +2,21 @@
export OMP_NUM_THREADS=2
if [ $# -lt 1 ]
then
cat <<EOF
usage: $0 <LAMMPS MPI binary>
EOF
exit 0
fi
exe="$1"
runcheck () {
exe=$1
lmp=$1
sty=$2
coe=$3
arg=$4
@ -11,10 +24,10 @@ log=$5
for n in 1 2 4 8
do \
mpirun -np $n ${exe} -i in.bond_angle ${sty} ${coe} "${arg}" -log ${log}-${n} -echo none -screen none
mpirun -x OMP_NUM_THREADS -np $n ${lmp} -i in.bond_angle ${sty} ${coe} "${arg}" -log ${log}-${n} -echo none -screen none
grep -A2 ^Step ${log}-${n} > out
diff -u ref/${log} out && rm out ${log}-${n} && echo OK ${log} ${n} || echo ERROR ${log} ${n}
mpirun -np $n ${exe} -i in.bond_angle ${sty} ${coe} "${arg}" -log ${log}-omp-${n} -echo none -screen none -suffix omp
mpirun -x OMP_NUM_THREADS -np $n ${lmp} -i in.bond_angle ${sty} ${coe} "${arg}" -log ${log}-omp-${n} -echo none -screen none -suffix omp
grep -A2 ^Step ${log}-omp-${n} > omp
diff -u ref/${log} omp && rm omp ${log}-omp-${n} && echo OK ${log} omp ${n} || echo ERROR ${log} omp ${n}
done
@ -22,27 +35,26 @@ done
rm -f *.data *.restart log.*
runcheck lmp_g++ '-v bstyle harmonic' '-v bcoeff' '1 100.0 1.01' log.harmonic-none
runcheck lmp_g++ '-v bstyle morse' '-v bcoeff' '1 100.0 2.0 1.01' log.morse-none
runcheck lmp_g++ '-v bstyle nonlinear' '-v bcoeff' '1 100.0 1.01 2.0' log.nonlinear-none
runcheck ${exe} '-v bstyle harmonic' '-v bcoeff' '1 100.0 1.01' log.harmonic-none
runcheck ${exe} '-v bstyle morse' '-v bcoeff' '1 100.0 2.0 1.01' log.morse-none
runcheck ${exe} '-v bstyle nonlinear' '-v bcoeff' '1 100.0 1.01 2.0' log.nonlinear-none
# first term of class2 is harmonic
runcheck lmp_g++ '-v bstyle class2' '-v bcoeff' '1 1.01 100.0 0.0 0.0' log.class2a-none
runcheck lmp_g++ '-v bstyle class2' '-v bcoeff' '1 1.01 100.0 80.0 80.0' log.class2b-none
runcheck ${exe} '-v bstyle class2' '-v bcoeff' '1 1.01 100.0 0.0 0.0' log.class2a-none
runcheck ${exe} '-v bstyle class2' '-v bcoeff' '1 1.01 100.0 80.0 80.0' log.class2b-none
runcheck lmp_g++ '-v bstyle fene' '-v bcoeff' '1 50.0 1.01 0.5 0.9' log.fene-none
runcheck ${exe} '-v bstyle fene' '-v bcoeff' '1 50.0 1.01 0.5 0.9' log.fene-none
# hack to handle styles with a '/'
mkdir -p fene
runcheck lmp_g++ '-v bstyle fene/expand' '-v bcoeff' '1 50.0 1.01 0.5 0.9 0.0' log.fene-expand-a-none
runcheck lmp_g++ '-v bstyle fene/expand' '-v bcoeff' '1 50.0 1.01 0.5 0.9 0.1' log.fene-expand-b-none
runcheck ${exe} '-v bstyle fene/expand' '-v bcoeff' '1 50.0 1.01 0.5 0.9 0.0' log.fene-expand-a-none
runcheck ${exe} '-v bstyle fene/expand' '-v bcoeff' '1 50.0 1.01 0.5 0.9 0.1' log.fene-expand-b-none
rm -r fene
mkdir -p harmonic/shift
#runcheck lmp_g++ '-v bstyle harmonic/shift' '-v bcoeff' '1 100.0 1.01 1.01' log.harmonic-shift-a-none
#runcheck lmp_g++ '-v bstyle harmonic/shift' '-v bcoeff' '1 100.0 1.01 2.0' log.harmonic-shift-b-none
#runcheck lmp_g++ '-v bstyle harmonic/shift/cut' '-v bcoeff' '1 100.0 1.01 1.01' log.harmonic-shift-cut-a-none
#runcheck lmp_g++ '-v bstyle harmonic/shift/cut' '-v bcoeff' '1 100.0 1.01 2.0' log.harmonic-shift-cut-b-none
runcheck ${exe} '-v bstyle harmonic/shift' '-v bcoeff' '1 100.0 1.01 2.5' log.harmonic-shift-none
runcheck ${exe} '-v bstyle harmonic/shift/cut' '-v bcoeff' '1 100.0 1.01 2.5' log.harmonic-shift-cut-none
rm -r harmonic
# XXX: need special case inputs for bond style quartic and table.