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

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
exercises:2015_cecam_tutorial:geometry_and_cell_optimization [2015/08/31 21:16] – [Cell optimization of NaCl] mwatkinsexercises:2015_cecam_tutorial:geometry_and_cell_optimization [2015/08/31 21:38] – [Geometry optimization of NaCl clusters] mwatkins
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). 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.
 +
 +How does the conjugate gradients optimizer compare to LBFGS in efficiency?
 ====== Cell optimization of NaCl ====== ====== Cell optimization of NaCl ======
  
exercises/2015_cecam_tutorial/geometry_and_cell_optimization.txt · Last modified: 2020/08/21 10:15 by 127.0.0.1