diff --git a/examples/ELASTIC_T/in.elastic b/examples/ELASTIC_T/in.elastic index 27213dd40e..f1fcafe6e1 100644 --- a/examples/ELASTIC_T/in.elastic +++ b/examples/ELASTIC_T/in.elastic @@ -52,8 +52,16 @@ include init.mod # Compute initial state +variable thermostat equal 1 include potential.mod run ${nequil} + +if "${adiabatic} == 1" & +then "variable thermostat equal 0" & +else "variable thermostat equal 1" + +print ${thermostat} + include potential.mod run ${nrun} diff --git a/examples/ELASTIC_T/init.mod b/examples/ELASTIC_T/init.mod index 0d190b187e..743b6b17d3 100644 --- a/examples/ELASTIC_T/init.mod +++ b/examples/ELASTIC_T/init.mod @@ -12,17 +12,18 @@ variable cfac equal 1.0e-4 variable cunits string GPa # Define MD parameters -variable nevery equal 10 -variable nrepeat equal 10 -variable nfreq equal ${nevery}*${nrepeat} -variable nthermo equal ${nfreq} -variable nequil equal 10*${nthermo} -variable nrun equal 3*${nthermo} -variable temp equal 2000.0 -variable timestep equal 0.001 -variable mass1 equal 28.06 -variable tdamp equal 0.01 -variable seed equal 123457 +variable nevery equal 10 # sampling interval +variable nrepeat equal 10 # number of samples +variable nfreq equal ${nevery}*${nrepeat} # length of one average +variable nthermo equal ${nfreq} # interval for thermo output +variable nequil equal 10*${nthermo} # length of equilibration run +variable nrun equal 3*${nthermo} # length of equilibrated run +variable temp equal 2000.0 # temperature of initial sample +variable timestep equal 0.001 # timestep +variable mass1 equal 28.06 # mass +variable adiabatic equal 0 # adiabatic (1) or isothermal (2) +variable tdamp equal 0.01 # time constant for thermostat +variable seed equal 123457 # seed for thermostat # generate the box and atom positions using a diamond lattice variable a equal 5.431 @@ -34,4 +35,6 @@ region box prism 0 3.0 0 3.0 0 3.0 0.0 0.0 0.0 create_box 1 box create_atoms 1 box mass 1 ${mass1} +velocity all create ${temp} 87287 + diff --git a/examples/ELASTIC_T/potential.mod b/examples/ELASTIC_T/potential.mod index 9477e7285a..b9ed80d865 100644 --- a/examples/ELASTIC_T/potential.mod +++ b/examples/ELASTIC_T/potential.mod @@ -22,6 +22,7 @@ thermo_modify norm no timestep ${timestep} fix 4 all nve -fix 5 all langevin ${temp} ${temp} ${tdamp} ${seed} +if "${thermostat} == 1" then & + "fix 5 all langevin ${temp} ${temp} ${tdamp} ${seed}"