Permalink
Browse files

Add more configuration files

  • Loading branch information...
1 parent 9151670 commit 88acc932271ebb438226876808e8b86e6dca61a3 Xie Qingguang committed Dec 21, 2011
@@ -0,0 +1,109 @@
+function fabs(var) {
+ return var>0?var:-var
+}
+
+function isbound(atom_number, period, rem, current_npoly) {
+ period = Nbeads + Nsolvent
+ rem = (atom_number-1)%(period) # from 0 to period-1
+ current_npoly = int(atom_number/period) + 1
+ return (rem<Nbeads-1) && (atom_number<iatom) && (current_npoly<=Npoly)
+}
+
+BEGIN {
+ inatoms=0
+ lo=1; hi=2
+ x=1; y=2; z=3
+ iatom=0
+ if (Npoly=="full") {
+ Npoly = 1e22
+ }
+}
+
+/LAMMPS/{
+ print
+ next
+}
+
+/xlo xhi/{
+ box[x,lo]=$1
+ box[x,hi]=$1
+}
+
+/ylo yhi/{
+ box[y,lo]=$1
+ box[y,hi]=$2
+}
+
+/zlo zhi/{
+ box[z,lo]=$1
+ box[z,hi]=$2
+}
+
+/atom types/{
+ print
+ print "1 bond types"
+ next
+}
+
+/atoms/{
+ natoms=$1
+ print
+ printf("%s bonds\n", "_NUMBER_OF_BOUNDS_")
+ next
+}
+
+(NF>0)&&($1=="Atoms"){
+ inatoms=1
+ print
+ # skip empty line
+ getline
+ printf "\n"
+ next
+}
+
+inatoms && (NF==0) {
+ inatoms = 0
+ print
+ next
+}
+
+inatoms{
+ # here I get one atom
+ iatom++
+ R[x]=$4; R[y]=$5; R[z]=$6
+ if (iatom>1) {
+ for (idim=1; idim<=3; idim++) {
+ if (fabs(R[idim]- prevR[idim])>cutoff) {
+ if (R[idim]<prevR[idim]) image[idim]++; else image[idim]--
+ }
+ }
+ } else {
+ image[x]=0; image[y]=0; image[z]=0
+ }
+ prevR[x]=R[x]; prevR[y]=R[y]; prevR[z]=R[z]
+ # change image field
+ $(NF-2)=image[x]; $(NF-1)=image[y]; $(NF)=image[z];
+ # add molecule ID
+ # $6=$6 " 0"
+ print $0
+ next
+}
+
+!inatoms {
+ print
+ next
+}
+
+END {
+ printf("\nBonds\n\n")
+ ibond = 0
+ for (q=1; q<iatom; q++) {
+ if (isbound(q)) {
+ ibond++
+ ip = q
+ jp = q+1
+ bondtype=1
+ print ibond, bondtype, ip, jp
+ }
+ }
+}
@@ -0,0 +1,6 @@
+#! /bin/bash
+rm -rf punto.dat
+awk 'fl{print $3, $4,$5, $6, $7, $8} /ITEM: ATOMS/{fl=1}' *.dat > punto.dat
+#for filename in dump*.dat; do echo $filename; sed '1,8d' $filename > ${filename/.dat/.del};done
+#awk 'fl{print $1, $2, $3, $4} /ITEM: ATOMS/{fl=1}' *.del > punto.dat
+
@@ -0,0 +1,17 @@
+#! /bin/bash
+
+
+
+
+../../../../src/lmp_linux -in sdpd-polymer3D-inti.lmp
+../../../../tools/restart2data poly3d.restart poly3d.txt
+
+
+ awk -v cutoff=3.0 -v Nbeads=1 -v Nsolvent=1 -v Npoly=full \
+ -f addpolymer.awk poly3d.txt > poly3.txt
+ nbound=$(tail -n 1 poly3.txt | awk '{print $1}')
+ sed "s/_NUMBER_OF_BOUNDS_/$nbound/1" poly3.txt > poly3d.txt
+
+time /scratch/qingguang/prefix-nana/bin/mpirun -np 1 ../../../../src/lmp_linux -in sdpd-polymer3D-run.lmp
+#mpirun -np 2 ../../../../src/lmp_linux -in sdpd-polymer3D-run.lmp
+#../../../../src/lmp_linux -in sdpd-polymer-run.lmp
@@ -0,0 +1,29 @@
+
+echo both
+dimension 3
+units si
+atom_style hybrid bond meso
+boundary p p p
+
+
+# create simulation box
+#3D box
+variable L equal 2.0e-4
+region box block 0.0 ${L} 0.0 ${L} 0.0 ${L} units box
+create_box 1 box
+
+# create fluid particles
+lattice fcc 0.025e-3
+#lattice sc 0.025e-3
+create_atoms 1 region box
+
+variable sdpd_mass equal 3.90625e-12
+mass 1 ${sdpd_mass}
+
+variable sdpd_temp index 0.0
+
+
+timestep 0.0e-5
+
+write_restart poly3d.restart
+
@@ -0,0 +1,63 @@
+echo both
+dimension 3
+units si
+atom_style hybrid bond meso
+boundary p p p
+# create simulation box
+#3D box
+variable L equal 2.0e-4
+region box block 0.0 ${L} 0.0 ${L} 0.0 ${L} units box
+read_data poly3d.txt
+
+# create fluid particles
+
+#lattice fcc 0.025e-3
+lattice sc 0.025e-3
+create_atoms 1 region box
+
+#special_bonds lj 1 1 1
+#bond_style fene
+#bond_coeff * 3e-2 5e-5 0 0
+
+
+mass 1 3.90625e-12
+set group all meso_rho 1000.0
+
+# smothing length
+variable h equal 6.5e-5
+
+
+# use Tait's EOS in combination with Morris' laminar viscosity.
+# We set rho_0 = 1000 kg/m^3, c = 0.1 m/s, h = 6.5e-5 m.
+# The dynamic viscosity is set to 1.0e-3 Pa s, corresponding to a kinematic viscosity of 1.0e-6 m^2/s
+
+variable sdpd_temp index 1e1
+pair_style hybrid sdpd
+pair_coeff * * sdpd 1000 0.1 5.0e-3 6.5e-5 ${sdpd_temp}
+
+compute rho_peratom all meso_rho/atom
+compute e_peratom all meso_e/atom
+compute ke_peratom all ke/atom
+compute esph all reduce sum c_e_peratom
+compute ke all ke
+compute sdpd_kin all temp
+variable etot equal c_ke+c_esph
+
+#compute sdpd_kin all temp
+#compute rho_peratom all meso_rho/atom
+
+# do full time integration for shear driver and fluid, but keep walls stationary
+fix integrate_fix_full all meso
+
+dump dump_id all custom 10 dump*.dat id type x y z vx vy vy c_rho_peratom
+dump_modify dump_id first yes
+dump_modify dump_id sort id
+dump_modify dump_id pad 8
+thermo_style custom step c_sdpd_kin
+thermo_modify norm no
+thermo 1
+
+
+neighbor 3.0e-6 bin
+timestep 1e-5
+run 40000
@@ -0,0 +1,119 @@
+function fabs(var) {
+ return var>0?var:-var
+}
+
+function isbound(atom_number, period, rem, current_npoly) {
+ period = Nbeads + Nsolvent
+ rem = (atom_number-1)%(period) # from 0 to period-1
+ current_npoly = int(atom_number/period) + 1
+ return (rem<Nbeads-1) && (atom_number<iatom) && (current_npoly<=Npoly)
+}
+
+BEGIN {
+ inatoms=0
+ lo=1; hi=2
+ x=1; y=2; z=3
+ iatom=0
+ if (Npoly=="full") {
+ Npoly = 1e22
+ }
+}
+
+/LAMMPS/{
+ print
+ next
+}
+
+/xlo xhi/{
+ box[x,lo]=$1
+ box[x,hi]=$1
+}
+
+/ylo yhi/{
+ box[y,lo]=$1
+ box[y,hi]=$2
+}
+
+/zlo zhi/{
+ box[z,lo]=$1
+ box[z,hi]=$2
+}
+
+/atom types/{
+ print
+ print "1 bond types"
+ next
+}
+
+/atoms/{
+ natoms=$1
+ print
+ printf("%s bonds\n", "_NUMBER_OF_BOUNDS_")
+ next
+}
+
+(NF>0)&&($1=="Atoms"){
+ inatoms=1
+ print
+ # skip empty line
+ getline
+ printf "\n"
+ next
+}
+
+inatoms && (NF==0) {
+ inatoms = 0
+ print
+ next
+}
+
+inatoms{
+ # here I get one atom
+ iatom++
+ R[x]=$4; R[y]=$5; R[z]=$6
+ if (iatom>1) {
+ for (idim=1; idim<=3; idim++) {
+ if (fabs(R[idim]- prevR[idim])>cutoff) {
+ if (R[idim]<prevR[idim]) image[idim]++; else image[idim]--
+ }
+ }
+ } else {
+ image[x]=0; image[y]=0; image[z]=0
+ }
+ prevR[x]=R[x]; prevR[y]=R[y]; prevR[z]=R[z]
+ # change image field
+ $(NF-2)=image[x]; $(NF-1)=image[y]; $(NF)=image[z];
+ # add molecule ID
+ # $6=$6 " 0"
+ print $0
+ next
+}
+
+!inatoms {
+ print
+ next
+}
+
+END {
+ printf("\nBonds\n\n")
+ ibond = 0
+ipoly=0
+printf("") > "poly.id"
+ for (q=1; q<iatom; q++) {
+ if (isbound(q)) {
+ ibond++
+ ip = q
+ jp = q+1
+ bondtype=1
+ print ibond, bondtype, ip, jp
+if (ip != prev) {
+if (prev>0) {
+print prev, ipoly >> "poly.id"
+}
+ ipoly++
+ }
+ print ip, ipoly >> "poly.id"
+ prev=jp
+}
+ }
+}
@@ -0,0 +1,6 @@
+# gnuplot script to fit autocorrelation data
+f(x) = exp(-x/tau)
+
+tlim=30
+fit [0:tlim] f(x) "corr.dat" via tau
+plot "corr.dat", f(x)
@@ -0,0 +1,8 @@
+#! /bin/bash
+rm -rf punto.dat
+rm -rf pdata
+awk 'fl{print $3, $4, $5, $6} /ITEM: ATOMS/{fl=1}' *.dat > punto.dat
+awk -f extpolymer.awk dump*.dat
+# write auto-correlation to corr.dat
+octave -q --eval relaxtime
+gnuplot fitcorr.gp
Oops, something went wrong.

0 comments on commit 88acc93

Please sign in to comment.