exercises:2016_uzh_cmest:calculation_pbc
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
Last revision | |||
— | exercises:2016_uzh_cmest:calculation_pbc [2016/10/24 07:48] – created tmueller | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ======= Calculations with Periodic Boundary Conditions ======= | ||
+ | This exercise illustrates the property of periodic boundary conditions and gives you some ideas/ | ||
+ | |||
+ | A geometry file for a H2O molecule: | ||
+ | <code - h2o.xyz> | ||
+ | 3 | ||
+ | Atom X | ||
+ | O | ||
+ | H | ||
+ | H | ||
+ | </ | ||
+ | |||
+ | An input file to run a calculation with it: | ||
+ | <code - h2o_pbc.inp> | ||
+ | &GLOBAL | ||
+ | PROJECT h2o_pbc | ||
+ | RUN_TYPE ENERGY | ||
+ | PRINT_LEVEL MEDIUM | ||
+ | &END GLOBAL | ||
+ | |||
+ | & | ||
+ | METHOD Quickstep | ||
+ | &DFT | ||
+ | BASIS_SET_FILE_NAME | ||
+ | POTENTIAL_FILE_NAME | ||
+ | |||
+ | & | ||
+ | PERIODIC XYZ | ||
+ | &END POISSON | ||
+ | & | ||
+ | SCF_GUESS ATOMIC | ||
+ | EPS_SCF 1.0E-6 | ||
+ | MAX_SCF 300 | ||
+ | &END SCF | ||
+ | & | ||
+ | & | ||
+ | &END XC_FUNCTIONAL | ||
+ | &END XC | ||
+ | &END DFT | ||
+ | |||
+ | &SUBSYS | ||
+ | &CELL | ||
+ | ABC 10. 10. 10. | ||
+ | PERIODIC XYZ | ||
+ | &END CELL | ||
+ | & | ||
+ | COORD_FILE_FORMAT xyz | ||
+ | COORD_FILE_NAME | ||
+ | & | ||
+ | CENTER_POINT 5. 5. 5. | ||
+ | &END | ||
+ | &END | ||
+ | &KIND H | ||
+ | ELEMENT H | ||
+ | BASIS_SET TZVP-MOLOPT-GTH | ||
+ | POTENTIAL GTH-PBE-q1 | ||
+ | &END KIND | ||
+ | &KIND O | ||
+ | ELEMENT O | ||
+ | BASIS_SET TZVP-MOLOPT-GTH | ||
+ | POTENTIAL GTH-PBE-q6 | ||
+ | &END KIND | ||
+ | &END SUBSYS | ||
+ | &END FORCE_EVAL | ||
+ | </ | ||
+ | |||
+ | And a script to run it: | ||
+ | |||
+ | <code - run.sh> | ||
+ | #!/bin/bash | ||
+ | |||
+ | set -o errexit | ||
+ | set -o nounset | ||
+ | set -o pipefail | ||
+ | |||
+ | xseq=$(seq 5 0.1 6) | ||
+ | |||
+ | for x in $xseq; do | ||
+ | rm -f " | ||
+ | |||
+ | sed \ | ||
+ | -e " | ||
+ | -e " | ||
+ | h2o_pbc.inp > " | ||
+ | |||
+ | cp2k.sopt -i " | ||
+ | done | ||
+ | |||
+ | for job in $(jobs -p) ; do | ||
+ | wait $job | ||
+ | done | ||
+ | |||
+ | >| energies | ||
+ | |||
+ | for x in $xseq; do | ||
+ | energy=$(awk '/ | ||
+ | echo "$x $energy" | ||
+ | done | ||
+ | </ | ||
+ | |||
+ | You have to mark the script as an executable after creating it, using: | ||
+ | |||
+ | < | ||
+ | $ chmod +x run.sh | ||
+ | </ | ||
+ | |||
+ | ====== Create a plot ====== | ||
+ | |||
+ | Run the script after loading the CP2K module: | ||
+ | |||
+ | < | ||
+ | $ ./run.sh | ||
+ | </ | ||
+ | |||
+ | Besides various input and output files, you should get a file named '' | ||
+ | |||
+ | * Plot it, including meaningful axis labels. To that end, try to understand the provided script. Looking at the difference between the initially provided input file '' | ||
+ | * What would you expect from such a plot and why? What order is the deviation from what you would expect? What could be the source for this deviation? | ||
+ | |||
+ | ====== Make the script your own ====== | ||
+ | |||
+ | * Read the script and try to understand the commands. Look them up using your favorite search engine, the man pages on the system ('' | ||
+ | * Try to document the script in such a way that you will still understand it when looking at it again in a year or two (so, not every detail, but make sure to cover the obscure stuff and the big blocks) | ||
+ | * Change the script to calculate energies for '' |
exercises/2016_uzh_cmest/calculation_pbc.txt · Last modified: 2020/08/21 10:15 by 127.0.0.1