User Tools

Site Tools


exercises:2015_cecam_tutorial:geometry_and_cell_optimization

Differences

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

Link to this comparison view

Next revision
Previous revision
exercises:2015_cecam_tutorial:geometry_and_cell_optimization [2015/08/31 21:15] – created mwatkinsexercises:2015_cecam_tutorial:geometry_and_cell_optimization [2020/08/21 10:15] (current) – external edit 127.0.0.1
Line 1: Line 1:
-====== Geometry optimization of NaCl ======+====== Geometry optimization of NaCl clusters ======
  
 +Use this short script to drive CP2K
  
 +<code>
 +#!/bin/bash
 +#
 +
 +for ii in 2 4 6 8 10 12
 +do
 +   sed -e "s/MY_SUPERCELL/${ii}/g" template.inp > input_${ii}.inp
 +   cp2k.popt input_${ii}.inp > NaCl_supercell_${ii}.out
 +done
 +</code>
 +
 +where the template input is this geometry optimization using the classical forcefield FIST module of CP2K.
 +
 +<code>
 +@SET NREP MY_SUPERCELL
 +@SET OPTIMIZER LBFGS # BFGS
 +
 +&FORCE_EVAL
 +  METHOD Fist
 +  &MM
 +    &FORCEFIELD
 +      &CHARGE
 +        ATOM Na
 +        CHARGE +1.000
 +      &END CHARGE
 +      &CHARGE
 +        ATOM Cl
 +        CHARGE -1.000
 +      &END CHARGE
 +      &NONBONDED
 +        &BMHFT
 +          map_atoms NA NA
 +          atoms NA NA
 +          RCUT 10.0
 +        &END BMHFT
 +        &BMHFT
 +          map_atoms NA CL
 +          atoms NA CL
 +          RCUT 10.0
 +        &END BMHFT
 +        &BMHFT
 +          map_atoms CL CL
 +          atoms CL CL
 +          RCUT 10.0
 +        &END BMHFT
 +      &END NONBONDED
 +    &END FORCEFIELD
 +    &POISSON
 +      &EWALD
 +        EWALD_TYPE spme
 +        ALPHA .35
 +        GMAX 12*${NREP}
 +        O_SPLINE 6
 +      &END EWALD
 +    &END POISSON
 +  &END MM
 +  &SUBSYS
 +    &CELL
 +      #ABC 5.620 5.620 5.620
 +      ABC 2*5.620 2*5.620 2*5.620
 +      MULTIPLE_UNIT_CELL ${NREP} ${NREP} ${NREP}
 +    &END CELL
 +    &TOPOLOGY
 +      COORD_FILE_NAME NaCl.pdb
 +      COORDINATE PDB
 +      CONN_FILE_FORMAT OFF
 +      MULTIPLE_UNIT_CELL ${NREP} ${NREP} ${NREP}
 +    &END TOPOLOGY
 +  &END SUBSYS
 +&END FORCE_EVAL
 +
 +&GLOBAL
 +  PROJECT NaCl
 +  RUN_TYPE GEO_OPT
 +&END GLOBAL
 +
 +&MOTION
 +  &GEO_OPT
 +    OPTIMIZER ${OPTIMIZER}
 +  &END
 +&END MOTION
 +
 +</code>
 +
 +The script runs very quickly when the LBFGS optimizer is used. But see what happens if we switch to the BFGS optimizer instead (change the OPTIMIZER variable in the cp2k input file - you might want to reduce the size of the supercells in the driver script - NREP varying from 1 to 6 perhaps). Look at the timings that cp2k prints at the end of a run and see if you can see the culprit. Also look for warnings in your outputs (this is a good habit to get into).
  
 +How does the conjugate gradients optimizer compare to LBFGS in efficiency for this system?
 ====== Cell optimization of NaCl ====== ====== Cell optimization of NaCl ======
  
Line 116: Line 203:
 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) 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? 
  
-If you have access a machine with several cores (16 or so ideally) check whether increasing the supercell size affects the 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.
exercises/2015_cecam_tutorial/geometry_and_cell_optimization.1441055733.txt.gz · Last modified: 2020/08/21 10:14 (external edit)