# Open SourceMolecular Dynamics

### Site Tools

exercises:2016_summer_school:geometry_and_cell_optimization

# Differences

This shows you the differences between two versions of the page.

 exercises:2016_summer_school:geometry_and_cell_optimization [2016/08/22 21:12]ibethune created exercises:2016_summer_school:geometry_and_cell_optimization [2016/08/23 19:18] (current)ibethune 2016/08/23 19:18 ibethune 2016/08/23 06:57 ibethune 2016/08/22 21:29 ibethune 2016/08/22 21:20 ibethune 2016/08/22 21:18 ibethune 2016/08/22 21:16 ibethune 2016/08/22 21:12 ibethune created Next revision Previous revision 2016/08/23 19:18 ibethune 2016/08/23 06:57 ibethune 2016/08/22 21:29 ibethune 2016/08/22 21:20 ibethune 2016/08/22 21:18 ibethune 2016/08/22 21:16 ibethune 2016/08/22 21:12 ibethune created Line 4: Line 4: <​code>​ <​code>​ - #​!/​bin/​bash + #​!/​bin/​bash ​--login - # + #PBS -N cp2k + #PBS -l select=1 + #PBS -l walltime=0:​20:​0 + #PBS -A y14 + + cd $PBS_O_WORKDIR + module load cp2k for ii in 2 4 6 8 10 12 for ii in 2 4 6 8 10 12 do do sed -e "​s/​MY_SUPERCELL/​${ii}/​g"​ template.inp > input_${ii}.inp sed -e "​s/​MY_SUPERCELL/​${ii}/​g"​ template.inp > input_${ii}.inp - ​cp2k.popt input_${ii}.inp > NaCl_supercell_${ii}.out + aprun -n 2 cp2k.popt input_${ii}.inp > NaCl_supercell_${ii}.out done done ​ - where the template input is this geometry optimization using the classical forcefield FIST module of CP2K. + where the template input ''​template.inp'' ​is this geometry optimization using the classical forcefield FIST module of CP2K. <​code>​ <​code>​ Line 85: Line 91: &END MOTION &END MOTION + ​ + + You will also need to initial geometry file ''​NaCl.pdb'':​ + <​code>​ + REMARK ​ 4 NaCl COMPLIES WITH FORMAT V. 2.0 + CRYST1 ​ 5.620 5.620 5.620 90.00 90.00 90.00 P 1 + HETATM ​ 1 Na ​NMO ​ ​0 ​ ​0.000 ​ ​0.000 ​ ​0.000 ​ 1.00 0.00 NMO Na + HETATM ​ 2 Cl ​CMO ​ ​0 ​ ​2.810 ​ ​2.810 ​ ​2.810 ​ 1.00 0.00 CMO Cl + HETATM ​ 3 Na ​NMO ​ ​0 ​ ​0.000 ​ ​2.810 ​ ​2.810 ​ 1.00 0.00 NMO Na + HETATM ​ 4 Cl ​CMO ​ ​0 ​ ​2.810 ​ ​0.000 ​ ​0.000 ​ 1.00 0.00 CMO Cl + HETATM ​ 5 Na ​NMO ​ ​0 ​ ​2.810 ​ ​0.000 ​ ​2.810 ​ 1.00 0.00 NMO Na + HETATM ​ 6 Cl ​CMO ​ ​0 ​ ​0.000 ​ ​2.810 ​ ​0.000 ​ 1.00 0.00 CMO Cl + HETATM ​ 7 Na ​NMO ​ ​0 ​ ​2.810 ​ ​2.810 ​ ​0.000 ​ 1.00 0.00 NMO Na + HETATM ​ 8 Cl ​CMO ​ ​0 ​ ​0.000 ​ ​0.000 ​ ​2.810 ​ 1.00 0.00 CMO Cl + TER ​9 ​ UNK ​0 ​ + END ​ Line 90: Line 112: How does the conjugate gradients optimizer compare to LBFGS in efficiency for this system? How does the conjugate gradients optimizer compare to LBFGS in efficiency for this system? + ====== Cell optimization of NaCl ====== ====== Cell optimization of NaCl ====== - For studying many properties of solid materials it is important that the lattice parameters used in a simulation are close to equilibrium for the model chemistry (Hamiltonian) used. Otherwise, large stresses can be present that complicate comparison to experiment. Successful cell optimization requires that the energy changes smoothly with cell volume - and for this the energy cutoff is the most important parameter. The input file template below can be used with driver script to examine how the energy volume curve of NaCl changes with the PW cutoff. + For studying many properties of solid materials it is important that the lattice parameters used in a simulation are close to equilibrium for the model chemistry (Hamiltonian) used. Otherwise, large stresses can be present that complicate comparison to experiment. Successful cell optimization requires that the energy changes smoothly with cell volume - and for this the energy cutoff is the most important parameter. The input file template below ''​template.inp'' ​can be used with driver script to examine how the energy volume curve of NaCl changes with the PW cutoff. <​code>​ <​code>​ Line 175: Line 198: <​code>​ <​code>​ - #​!/​bin/​bash + #​!/​bin/​bash ​--login - # + #PBS -N cp2k + #PBS -l select=1 + #PBS -l walltime=0:​20:​0 + #PBS -A y14 + + cd$PBS_O_WORKDIR + module load cp2k CUTOFF="​280"​ CUTOFF="​280"​ Line 187: Line 216: #this line should changed to point to your cp2k executable #this line should changed to point to your cp2k executable - mpirun ​-np 2 cp2k.popt input_${ii}.inp > NaCl_${CUTOFF}_${ii}.out + aprun -n 2 cp2k.popt input_${ii}.inp > NaCl_${CUTOFF}_${ii}.out done done Line 199: Line 228: and you can plot the results in your favourite graphing software. and you can plot the results in your favourite graphing software. - What is happening here? Try changing the PW cutoff (defined in the driver script) and using the CELL_REF variable. + What is happening here? Try changing the PW cutoff (defined in the driver script) and using the ''​CELL_REF'' ​variable. - Copy the input template to a new file and change the RUN_TYPE to CELL_OPT. You'll also need to ask the code to calculate the stress tensor (in FORCE_EVAL section) ​ANALYTICALLY! Also define the CUTOFF and SCALING_FACTOR. Start the cell optimization from small cells (SCALING_FACTOR 0.85) or large cells (SCALING_FACTOR 1.10) - do you get the same results? ​ + Copy the input template to a new file and change the ''​RUN_TYPE'' ​to ''​CELL_OPT''​. You'll also need to ask the code to calculate the stress tensor (in ''​FORCE_EVAL'' ​section) ​''​ANALYTICAL''​ly! Also define the ''​CUTOFF'' ​and ''​SCALING_FACTOR''​. Start the cell optimization from small cells (''​SCALING_FACTOR 0.85''​) or large cells (''​SCALING_FACTOR 1.10''​) - do you get the same results? ​ - If you have access a machine with several cores (16 or so ideally) ​check whether increasing the supercell size (NREP variable) affects the results. + If you are running on ARCHER, use some larger parallel jobs to check whether increasing the supercell size (''​NREP'' ​variable) affects the results.