exercises:2017_ethz_mmm:replica_2017
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
exercises:2017_ethz_mmm:replica_2017 [2017/05/10 14:13] – dpasserone | exercises:2017_ethz_mmm:replica_2017 [2017/05/11 08:05] – dpasserone | ||
---|---|---|---|
Line 32: | Line 32: | ||
7) Change your password as in point 4) using TMP-PASSW2 as old password and set EMPA-PASSW | 7) Change your password as in point 4) using TMP-PASSW2 as old password and set EMPA-PASSW | ||
+ | </ | ||
============================================ | ============================================ | ||
Line 90: | Line 91: | ||
The last line is the command to run a parallel lammps job with the input file '' | The last line is the command to run a parallel lammps job with the input file '' | ||
+ | ===== The input file for lammps ===== | ||
+ | |||
+ | |||
+ | The file input contains information for the program **lammps**. Details on the documentation can be found [[http:// | ||
+ | |||
+ | There is an initialization section, showing the kind of units (see [[http:// | ||
+ | |||
+ | < | ||
+ | # Initialization | ||
+ | units metal | ||
+ | dimension | ||
+ | boundary | ||
+ | atom_style | ||
+ | </ | ||
+ | |||
+ | In the second part of the input file a spherical region is defined (to confine the cluster). Then the atoms are read from '' | ||
+ | |||
+ | |||
+ | < | ||
+ | region rs sphere 0 0 0 12.66 | ||
+ | read_data | ||
+ | mass 1 39.948 | ||
+ | </ | ||
+ | |||
+ | Then, we define the parameters for the Lennard-Jones potential. The units are **eV** for epsilon, and angstrom for **sigma**. | ||
+ | The last number is the cutoff, in Angstrom. | ||
+ | |||
+ | < | ||
+ | pair_style lj/cut 8.5 | ||
+ | pair_coeff 1 1 0.01042 3.405 8.5 | ||
+ | </ | ||
+ | |||
+ | Then, we initialize the '' | ||
+ | |||
+ | < | ||
+ | variable i equal part | ||
+ | variable t world 2.00 2.44 2.98 3.64 4.45 5.43 6.63 8.09 9.88 | ||
+ | velocity | ||
+ | velocity all zero linear | ||
+ | velocity all zero angular | ||
+ | fix 1 all nvt temp $t $t 0.1 | ||
+ | fix 2 all wall/region rs harmonic 2.0 0.0 0.4 | ||
+ | </ | ||
+ | |||
+ | The next section is about writing out each 1000 steps the relecant information about temperature and energy. We also dump a restart file at the end, and every 10000 steps a structure in xyz format. | ||
+ | |||
+ | < | ||
+ | thermo | ||
+ | thermo_style | ||
+ | thermo_modify | ||
+ | restart 5000000 restart.* | ||
+ | dump 2 all xyz 10000 structure_$i.xyz | ||
+ | dump_modify | ||
+ | </ | ||
+ | |||
+ | Finally, this is the command to run the tempering, with an exchange move attempted every 1000 step of molecular dynamics and an initial temperature $t that is different from replica to replica. The last numbers are random seeds that are used for choosing which replica to exchange and for the Metropolis criterion. | ||
+ | |||
+ | < | ||
+ | temper 5000000 1000 $t 1 3678 3490 | ||
+ | </ | ||
+ | |||
+ | ===== Adapting the output files ===== | ||
+ | |||
+ | We must now make some postprocessing on the output files. The goal is to performs averages at different temperatures. These averages are enhanced by the exchanges that were performed between different molecular dynamics replica. Note that temperature is set by a thermostat. | ||
+ | |||
+ | <note tip> | ||
+ | **Example**. Processor 0 starts with temperature T0=2 K, processor 1 with temperature T1=2.44 K. | ||
+ | After 1000 steps, an exchange step is attempted and accepted with some probability (see theory slides, and also the paper | ||
+ | [[doi> | ||
+ | But you can see it also as the **configurations** of T0=2 K and the one of T1=2.44 K are changing, thus improving the sampling at both temperature. | ||
+ | </ | ||
+ | |||
+ | The script '' | ||
+ | |||
+ | <note tip> | ||
+ | - prunes the '' | ||
+ | - For all the '' | ||
+ | - Compute the **q4** order parameter for all structure files and create '' | ||
+ | - now paste the '' | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== Reordering the replica: one temperature, | ||
+ | |||
+ | At this point, we have a set of '' | ||
+ | |||
+ | <note tip> | ||
+ | * Consider each file t_epot_q4_etot.*.out (processor by processor). Say you consider the number 5 (6th replica): '' | ||
+ | * At the step 50000, the file shows the following line: | ||
+ | '' | ||
+ | |||
+ | indicating a temperature of 6.7133746. | ||
+ | * The file '' | ||
+ | '' | ||
+ | |||
+ | indicating that at the 6th replica (column **7**), we have the temperature **6**, which is (see input file) T=6.63 K. Meaning that at step 50000, the thermostat is keeping replica 5 around the temperature T=6.63 K. | ||
+ | * This means that this line has to be stored in the temperature file number **6**. | ||
+ | </ | ||
+ | |||
+ | At the end of the procedure performed by the small script section: | ||
+ | <code bash> | ||
+ | NP=16 | ||
+ | NP1=$[NP-1] | ||
+ | rm torder* | ||
+ | for repl in `seq 0 $NP1` | ||
+ | do | ||
+ | echo $repl | ||
+ | awk -v rep=$repl ' | ||
+ | i=0 | ||
+ | for a in `cat rep_$repl` | ||
+ | do | ||
+ | i=$[i+1] | ||
+ | head -$i t_epot_q4_etot.$repl.out | tail -1 >> torder.$a | ||
+ | done | ||
+ | done | ||
+ | </ | ||
exercises/2017_ethz_mmm/replica_2017.txt · Last modified: 2020/08/21 10:15 by 127.0.0.1