Skip to content

Commit b58a55c

Browse files
committed
add CPMD addons 4.3 to GitHub
1 parent dfd1571 commit b58a55c

File tree

252 files changed

+152866
-3
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

252 files changed

+152866
-3
lines changed

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022 Car-Parrinello Molecular Dynamics
3+
Copyright (c) 2022 CPMD (Car-Parrinello Molecular Dynamics)
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

+14-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,14 @@
1-
# tests
2-
Test suite for the CPMD distribution
1+
CPMD Tests
2+
==============
3+
4+
This repository contains a series of input files that can be used for testing the CPMD installation.
5+
6+
7+
## Copyright Notice
8+
9+
The CPMD program is © 1990-2022 by IBM Corp. and © 1994-2001 by Max Planck Institute, Stuttgart.
10+
11+
12+
## License
13+
14+
The CPMD is freely distributed under the MIT License.

external-potential/H_MT_PBE

+1,570
Large diffs are not rendered by default.

external-potential/O_MT_PBE

+1,935
Large diffs are not rendered by default.

external-potential/README

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
2+
test to illustrate the use of an external potential file.
3+
4+
first run the wavefunction optimization for the normal case
5+
(single water molecule in gasphase) and create a cubefile
6+
from the file DENSITY with cpmd2cube.
7+
8+
then compile the file mkextpot.f and run the program to create
9+
the external potential. you'll need to specify the cell dimensions,
10+
the origin and the real space mesh.
11+
12+
now run the wavefunction optimization for the external potential
13+
case and create another cube file from DENSITY file.
14+
15+
create a difference cube file from the two density cubefiles,
16+
e.g. using the cubman utility from the gaussian software package.
17+
18+
this cubefile now contains the response of the electron density
19+
to the external potential and can be visualize with standard
20+
tools. see e.g. http://www.theochem.ruhr-uni-bochum.de/go/cpmd-vmd.html
21+
for some examples.
22+
23+
the script runme.sh performs all the commands described above,
24+
h2o-dens-diff.vmd contains an example visualization of the
25+
density difference and h2o-dens-diff.png a sample snapshot image
26+
of that visualization.
27+
28+
both runs together take less than 20 minutes on an
29+
600MHz alpha workstation or and 1.3GHz amd athlon pc
30+
and need about 220MB RAM.
31+
32+
33+
tested with cpmd v3.8.4, cpmd2cube-0.1.2-cvs (+ bochum patches)
34+
and vmd v1.8.2
584 KB
Binary file not shown.

external-potential/h2o-dens-diff.png

42.1 KB
Loading

external-potential/h2o-dens-diff.vmd

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
#!/usr/local/bin/vmd
2+
# VMD script written by save_state $Revision: 1.1 $
3+
# VMD version: 1.8.2
4+
set viewplist {}
5+
set fixedlist {}
6+
display projection Orthographic
7+
display nearclip set 0.000000
8+
display farclip set 10.000000
9+
display depthcue off
10+
mol new {h2o-dens-diff.cube} type cube waitfor all
11+
mol addfile {h2o-dens-extpot.cube} type cube waitfor all
12+
mol addfile {h2o-dens-nopot.cube} type cube waitfor all
13+
mol delrep 0 top
14+
mol representation CPK 0.600000 0.200000 25.000000 20.000000
15+
mol color Name
16+
mol selection {all}
17+
mol material Opaque
18+
mol addrep top
19+
mol selupdate 0 top 0
20+
mol colupdate 0 top 0
21+
mol scaleminmax top 0 0.000000 0.000000
22+
mol smoothrep top 0 0
23+
mol drawframes top 0 {now}
24+
mol representation Isosurface 0.002000 0.000000 0.000000 0.000000
25+
mol color ColorID 12
26+
mol selection {all}
27+
mol material Opaque
28+
mol addrep top
29+
mol selupdate 1 top 0
30+
mol colupdate 1 top 0
31+
mol scaleminmax top 1 0.000000 0.000000
32+
mol smoothrep top 1 0
33+
mol drawframes top 1 {now}
34+
mol representation Isosurface -0.002000 0.000000 0.000000 0.000000
35+
mol color ColorID 13
36+
mol selection {all}
37+
mol material Opaque
38+
mol addrep top
39+
mol selupdate 2 top 0
40+
mol colupdate 2 top 0
41+
mol scaleminmax top 2 0.000000 0.000000
42+
mol smoothrep top 2 0
43+
mol drawframes top 2 {now}
44+
mol representation Isosurface 0.100000 1.000000 0.000000 0.000000
45+
mol color ColorID 7
46+
mol selection {all}
47+
mol material Opaque
48+
mol addrep top
49+
mol selupdate 3 top 0
50+
mol colupdate 3 top 0
51+
mol scaleminmax top 3 0.000000 0.000000
52+
mol smoothrep top 3 0
53+
mol drawframes top 3 {now}
54+
mol showrep top 3 0
55+
mol representation Isosurface 0.100000 2.000000 0.000000 0.000000
56+
mol color ColorID 3
57+
mol selection {all}
58+
mol material Opaque
59+
mol addrep top
60+
mol selupdate 4 top 0
61+
mol colupdate 4 top 0
62+
mol scaleminmax top 4 0.000000 0.000000
63+
mol smoothrep top 4 0
64+
mol drawframes top 4 {now}
65+
mol showrep top 4 0
66+
mol rename top {h2o-dens-diff.cube}
67+
set viewpoints([molinfo top]) {{{1.000000 0.000000 0.000000 -4.227511} {0.000000 1.000000 0.000000 -4.167324} {0.000000 0.000000 1.000000 -3.968829} {0.000000 0.000000 0.000000 1.000000}} {{0.490640 0.868967 -0.064525 0.000000} {-0.377160 0.278545 0.883271 0.000000} {0.785507 -0.409043 0.464405 0.000000} {0.000000 0.000000 0.000000 1.000000}} {{1.053002 0.000000 0.000000 0.000000} {0.000000 1.053002 0.000000 0.000000} {0.000000 0.000000 1.053002 0.000000} {0.000000 0.000000 0.000000 1.000000}} {{1.000000 0.000000 0.000000 0.120000} {0.000000 1.000000 0.000000 -0.010000} {0.000000 0.000000 1.000000 0.000000} {0.000000 0.000000 0.000000 1.000000}}}
68+
lappend viewplist [molinfo top]
69+
set topmol [molinfo top]
70+
# done with molecule 0
71+
foreach v $viewplist {
72+
molinfo $v set {center_matrix rotate_matrix scale_matrix global_matrix} $viewpoints($v)
73+
}
74+
foreach v $fixedlist {
75+
molinfo $v set fixed 1
76+
}
77+
unset viewplist
78+
unset fixedlist
79+
mol top $topmol
80+
unset topmol
81+
proc vmdrestoremycolors {} {
82+
color Display {Background} silver
83+
}
84+
vmdrestoremycolors
573 KB
Binary file not shown.

external-potential/h2o-dens-extpot.in

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
&CPMD
2+
OPTIMIZE WAVEFUNCTION
3+
RESTART WAVEFUNCTION COORDINATES LATEST
4+
EXTERNAL POTENTIAL
5+
RHOOUT
6+
&END
7+
8+
&DFT
9+
FUNCTIONAL PBE
10+
&END
11+
12+
&SYSTEM
13+
SYMMETRY
14+
0
15+
CUTOFF
16+
120.0
17+
CELL
18+
15.0 1.0 1.0 0.0 0.0 0.0
19+
MESH
20+
108 108 108
21+
&END
22+
23+
&ATOMS
24+
*O_MT_PBE KLEINMAN-BYLANDER
25+
LMAX=P
26+
1
27+
5.570575 5.593517 5.669178
28+
29+
*H_MT_PBE KLEINMAN-BYLANDER
30+
LMAX=S
31+
2
32+
5.562867 7.428055 5.669178
33+
7.340606 5.111259 5.669178
34+
&END
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
REMARK pdb file created from cpmd Wannier file: DENSITY
2+
HETATM 1 O MOL 1 3.917 3.929 3.969 1.00 0.00
3+
HETATM 2 H MOL 1 3.913 4.900 3.969 1.00 0.00
4+
HETATM 3 H MOL 1 4.853 3.674 3.969 1.00 0.00
5+
TER 4 MOL 99
6+
END
542 KB
Binary file not shown.

external-potential/h2o-dens-nopot.in

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
&CPMD
2+
OPTIMIZE WAVEFUNCTION
3+
RHOOUT
4+
&END
5+
6+
&DFT
7+
FUNCTIONAL PBE
8+
&END
9+
10+
&SYSTEM
11+
SYMMETRY
12+
0
13+
CUTOFF
14+
120.0
15+
CELL
16+
15.0 1.0 1.0 0.0 0.0 0.0
17+
MESH
18+
108 108 108
19+
&END
20+
21+
&ATOMS
22+
*O_MT_PBE KLEINMAN-BYLANDER
23+
LMAX=P
24+
1
25+
5.570575 5.593517 5.669178
26+
27+
*H_MT_PBE KLEINMAN-BYLANDER
28+
LMAX=S
29+
2
30+
5.562867 7.428055 5.669178
31+
7.340606 5.111259 5.669178
32+
&END

external-potential/h2o-dens-nopot.pdb

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
REMARK pdb file created from cpmd Wannier file: DENSITY
2+
HETATM 1 O MOL 1 3.917 3.929 3.969 1.00 0.00
3+
HETATM 2 H MOL 1 3.913 4.900 3.969 1.00 0.00
4+
HETATM 3 H MOL 1 4.853 3.674 3.969 1.00 0.00
5+
TER 4 MOL 99
6+
END

external-potential/mkextpot.f

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
C example program to create a grid file for use as
2+
c an external potential input in cpmd calculations.
3+
C this (simple) example assumes an orthorhombic cell
4+
C and produces a linear potential in z-direction.
5+
C
6+
C feel free to adapt for your own purposes.
7+
C you have to make sure, that the grid used here
8+
C matches the real space grid of your cpmd run.
9+
C
10+
C all parameters are in a.u.
11+
C
12+
C it is advisable to compile (and run) this program with
13+
C the same flags and on the same platform as your cpmd binary.
14+
C otherwise the binary grid data may be incompatible.
15+
C
16+
C 01/2004 <[email protected]>
17+
C
18+
program mkextpot
19+
implicit none
20+
integer nn(3)
21+
real*8 phi,origin(3),cell(3),delta(3), x, y
22+
integer i,j,k
23+
external phi
24+
25+
print*, 'give cell [a, b, c] (in bohr)'
26+
read*,(cell(i),i=1,3)
27+
28+
print*, 'give origin [x0,y0,z0] (in bohr)'
29+
read*,(origin(i),i=1,3)
30+
31+
print*, 'give mesh [na,nb,nc]'
32+
read*,(nn(i),i=1,3)
33+
34+
do i=1,3
35+
delta(i) = cell(i)/dble(nn(i))
36+
end do
37+
38+
print*,' '
39+
print*,'input parameters:'
40+
print*,'cell : ', (cell(i),i=1,3)
41+
print*,'origin: ', (origin(i),i=1,3)
42+
print*,'mesh: ', (nn(i),i=1,3)
43+
print*,'dx,dy,dz: ', (delta(i),i=1,3)
44+
print*,' '
45+
print*,'writing extpot.unfo.grid...'
46+
47+
open(99,file='extpot.unfo.grid',
48+
$ form='unformatted',status='unknown')
49+
50+
do i=1,nn(1)
51+
x=dble(i-1)*delta(1)+origin(1)
52+
do j=1,nn(2)
53+
y=dble(j-1)*delta(2)+origin(2)
54+
write(99) (phi(x,y,dble(k-1)*delta(3)+origin(3)),k=1,nn(3))
55+
enddo
56+
enddo
57+
close(99)
58+
59+
stop 'external potential grid written'
60+
end
61+
62+
63+
c potential function
64+
real*8 function phi(x,y,z)
65+
real*8 x,y,z
66+
67+
phi = 0.01*z
68+
69+
return
70+
end

external-potential/runme.sh

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/sh
2+
3+
# tested with cpmd v3.8.4
4+
# tested with cpmd2cube v0.1.3(?)
5+
# tested with vmd v1.8.2
6+
7+
./cpmd.x h2o-dens-nopot.in > h2o-dens-nopot.out
8+
./cpmd2cube.x -halfmesh -rho -o h2o-dens-nopot DENSITY
9+
10+
./mkextpot <<EOF
11+
15.0 15.0 15.0
12+
0.0 0.0 -7.5
13+
108 108 108
14+
EOF
15+
16+
./cpmd.x h2o-dens-extpot.in > h2o-dens-extpot.out
17+
./cpmd2cube.x -halfmesh -rho -o h2o-dens-extpot DENSITY
18+
19+
cubman <<EOF
20+
sub
21+
h2o-dens-nopot.cube
22+
yes
23+
h2o-dens-extpot.cube
24+
yes
25+
h2o-dens-diff.cube
26+
yes
27+
EOF
28+
29+
echo "now run 'vmd -e h2o-dens-diff.vmd' to view the result"

0 commit comments

Comments
 (0)