Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds cp2k script #38

Merged
merged 30 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
43bc813
adds an example how to run batched cp2k calculations
bananenpampe Feb 29, 2024
feec831
updates setup and parameters
bananenpampe Feb 29, 2024
b8cb0f3
adds ase calculator
bananenpampe Feb 29, 2024
cb44afe
adds doc and changes to bash script
bananenpampe Mar 1, 2024
d2c413c
add reference for input and warning
bananenpampe Mar 1, 2024
06a9309
lint
bananenpampe Mar 1, 2024
216e0d5
lint
bananenpampe Mar 1, 2024
b3b58b6
adds correct index
bananenpampe Mar 1, 2024
11b90ca
Adds fixes to files for tox
bananenpampe Mar 1, 2024
872a1e7
findout which cp2k gets installed
bananenpampe Mar 1, 2024
351d444
fixes format
bananenpampe Mar 1, 2024
cbdc2f9
check for sopt
bananenpampe Mar 4, 2024
8ba00bb
change cp2k env
bananenpampe Mar 4, 2024
789faac
more text + debug
PicoCentauri Mar 5, 2024
e66b8d2
more debug
PicoCentauri Mar 5, 2024
46a236d
more debug
PicoCentauri Mar 5, 2024
70c24b5
DEEEEBUGGG
PicoCentauri Mar 5, 2024
aeda5a9
more tries to debug this wonderful project
PicoCentauri Mar 5, 2024
e4618d4
asfdew
PicoCentauri Mar 5, 2024
3430c73
install cp2k directly
PicoCentauri Mar 5, 2024
bc6f1bd
use bare cp2k command
PicoCentauri Mar 5, 2024
21b3751
update cp2k chare path
PicoCentauri Mar 5, 2024
ae20f51
remove data path
PicoCentauri Mar 5, 2024
0c3eb17
cleanup
PicoCentauri Mar 5, 2024
c4002fe
typos
PicoCentauri Mar 5, 2024
83c2a99
Apply suggestions from code review
PicoCentauri Mar 5, 2024
805cbf9
more typos
PicoCentauri Mar 5, 2024
80baaf3
typos my typos, I fix you
PicoCentauri Mar 5, 2024
10b80f7
Update examples/cp2k_run_batch/setup_reftraj.py
DavideTisi Mar 5, 2024
0a70eb9
Update examples/cp2k_run_batch/setup_reftraj.py
DavideTisi Mar 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
python-version: "3.10"
- name: install dependencies
run: |
sudo apt-get install -y cp2k
python -m pip install tox
- name: build documentation
run: tox -e docs
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ docs/src/examples/

*build*
*egg-info/
sg_execution_times.rst
12 changes: 12 additions & 0 deletions docs/src/conf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Add any Sphinx extension module names here, as strings.
extensions = [
"sphinx.ext.viewcode",
"sphinx.ext.intersphinx",
"sphinx_gallery.load_style",
]

Expand All @@ -12,3 +13,14 @@

htmlhelp_basename = "COSMO software-cookbook"
html_theme = "furo"


intersphinx_mapping = {
"ase": ("https://wiki.fysik.dtu.dk/ase/", None),
"metatensor": ("https://lab-cosmo.github.io/metatensor/latest/", None),
"numpy": ("https://numpy.org/doc/stable/", None),
"matplotlib": ("https://matplotlib.org/stable/", None),
"python": ("https://docs.python.org/3", None),
"rascaline": ("https://luthaf.fr/rascaline/latest/", None),
"scipy": ("https://docs.scipy.org/doc/scipy/", None),
}
1 change: 1 addition & 0 deletions docs/src/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ COSMO Software Cookbook
examples/lode_linear/lode_tutorial
examples/sample_selection/sample_selection
examples/gaas_map/gaas_map
examples/cp2k_run_batch/setup_reftraj
5 changes: 5 additions & 0 deletions examples/cp2k_run_batch/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
production/

cp2k.out
cp2k.inp
cp2k_shell.ssmp
7 changes: 7 additions & 0 deletions examples/cp2k_run_batch/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CP2K bash computation
============================

This is an example of a batch calculation using CP2K.
The inputs are a set of structures in `example.xyz`
using the parameters defined in `./data/reftraj_template.cp2k`
importing basisset and pseudopotentials from the local CP2K install.
6 changes: 6 additions & 0 deletions examples/cp2k_run_batch/environement.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: cp2k_run_batch
dependencies:
- python=3.11
- pip
- pip:
- ase
8 changes: 8 additions & 0 deletions examples/cp2k_run_batch/example.xyz
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
6
Lattice="3.9111732301689224 0.0 0.0 0.0 3.9111732301689224 0.0 0.0 0.0 3.9111732301689224" Properties=species:S:1:pos:R:3 #=T CELL(abcABC):=T 3.91117=T 90.00000=T Step:=T 1975600=T Bead:=T 0=T x_centroidangstrom=T cellangstrom=T count=0 pbc="T T T"
H 2.55799292 0.30476323 0.67883354
H 1.46739292 0.53584100 3.59015677
O 1.78619292 3.82685646 0.31171354
H 3.52058031 2.55936677 2.71091323
H 0.84863385 2.05009677 1.85452646
O 0.09813385 1.75660677 2.33837646
144 changes: 144 additions & 0 deletions examples/cp2k_run_batch/reftraj_template.cp2k
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
@SET PREP 0

@SET SCF_GUESS RESTART
@SET SCREEN_ON_INITIAL_P TRUE

@IF ${PREP}
@SET SCF_GUESS ATOMIC
@SET SCREEN_ON_INITIAL_P FALSE
@ENDIF

&GLOBAL
PROJECT //PROJECT//
PREFERRED_FFT_LIBRARY FFTW
FFTW_PLAN_TYPE MEASURE
RUN_TYPE MD
PRINT_LEVEL LOW
&END GLOBAL

&MOTION
&PRINT
&CELL
&EACH
MD 1
&END EACH
&END CELL
&FORCES
&EACH
MD 1
&END EACH
&END FORCES
&END PRINT
&MD
ENSEMBLE REFTRAJ
&REFTRAJ ! Loads an external trajectory file and performs analysis on the loaded snapshots.
EVAL_ENERGY_FORCES TRUE
EVAL_FORCES TRUE
CELL_FILE_NAME reftraj.cell
TRAJ_FILE_NAME reftraj.xyz
FIRST_SNAPSHOT 1
VARIABLE_VOLUME TRUE
LAST_SNAPSHOT //LAST_SNAPSHOT//
&END REFTRAJ
&END MD
&END MOTION

&FORCE_EVAL
&PRINT
&FORCES
&EACH
MD 1
&END EACH
&END FORCES
&END PRINT
&DFT
BASIS_SET_FILE_NAME GTH_BASIS_SETS
BASIS_SET_FILE_NAME BASIS_ADMM
POTENTIAL_FILE_NAME POTENTIAL
&MGRID
CUTOFF 400
&END MGRID
&SCF
SCF_GUESS ${SCF_GUESS}
MAX_SCF 20
EPS_SCF 5.0E-7
&OT
MINIMIZER DIIS
PRECONDITIONER FULL_ALL
&END OT
&OUTER_SCF
MAX_SCF 20
EPS_SCF 5.0E-7
&END OUTER_SCF
&END SCF
&QS
EPS_DEFAULT 1.0E-12
EPS_PGF_ORB 1.0E-16
EXTRAPOLATION_ORDER 5
&END QS
&XC # revPBE0-TC-D3
&XC_FUNCTIONAL
&PBE
PARAMETRIZATION REVPBE
SCALE_X 0.75
SCALE_C 1.0
&END
&END XC_FUNCTIONAL
&HF
FRACTION 0.25
&SCREENING
EPS_SCHWARZ 1.0E-6
SCREEN_ON_INITIAL_P ${SCREEN_ON_INITIAL_P}
&END
&MEMORY
MAX_MEMORY 37000
EPS_STORAGE_SCALING 0.1
&END
&INTERACTION_POTENTIAL
POTENTIAL_TYPE TRUNCATED
CUTOFF_RADIUS 3.0
T_C_G_DATA t_c_g.dat
&END
&HF_INFO
&END HF_INFO
&END
&VDW_POTENTIAL
POTENTIAL_TYPE PAIR_POTENTIAL
&PAIR_POTENTIAL
TYPE DFTD3
R_CUTOFF 15
LONG_RANGE_CORRECTION TRUE
REFERENCE_FUNCTIONAL revPBE0
PARAMETER_FILE_NAME dftd3.dat
&END
&END
&XC_GRID
XC_DERIV SPLINE2
&END
&END XC
&AUXILIARY_DENSITY_MATRIX_METHOD
METHOD BASIS_PROJECTION
ADMM_PURIFICATION_METHOD MO_DIAG
&END AUXILIARY_DENSITY_MATRIX_METHOD
&END DFT
&SUBSYS
&TOPOLOGY
COORD_FILE_NAME init.xyz
COORD_FILE_FORMAT XYZ
CONN_FILE_FORMAT GENERATE
&END TOPOLOGY
&CELL
ABC [angstrom] //CELL//
&END CELL
&KIND H
BASIS_SET TZV2P-GTH
BASIS_SET AUX_FIT cpFIT3
POTENTIAL GTH-PBE-q1
&END KIND
&KIND O
BASIS_SET TZV2P-GTH
BASIS_SET AUX_FIT cpFIT3
POTENTIAL GTH-PBE-q6
&END KIND
&END SUBSYS
&END FORCE_EVAL
8 changes: 8 additions & 0 deletions examples/cp2k_run_batch/run_calcs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#! /bin/bash

for i in $(find ./production/ -mindepth 1 -type d); do
cd $i
cp2k -i in.cp2k
cd -
done

Loading
Loading