Skip to content

Commit

Permalink
deploy: 780edf7
Browse files Browse the repository at this point in the history
  • Loading branch information
jkshenton committed Sep 17, 2024
1 parent 516a4ad commit b7ac965
Show file tree
Hide file tree
Showing 9 changed files with 167 additions and 28 deletions.
2 changes: 1 addition & 1 deletion search/search_index.json

Large diffs are not rendered by default.

Binary file modified sitemap.xml.gz
Binary file not shown.
24 changes: 14 additions & 10 deletions workshop/00_starting/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3064,17 +3064,21 @@ <h3 id="copying-and-pasting-from-your-laptop">Copying and pasting from your lapt
<p>To enable copying and pasting between your laptop and the VM, hover your mouse at the top of the virtual desktop and click on Copy &amp; Paste to enable this. </p>
<h2 id="loading-castep">Loading CASTEP</h2>
<p>Click the applications button in the bottom left and select software -&gt; CASTEP. This will launch a terminal with shortcuts for running CASTEP. </p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>You will have to run this additional command to load aliases to run CASTEP and its tools on the VM:</p>
<p><code>$ source /course_materials/vm_aliases.sh</code></p>
</div>
<h3 id="accessing-the-castep-help-system">Accessing the CASTEP help system</h3>
<p>To search the castep help system for keywords containing castep:</p>
<p><code>castep-serial castep.serial -s lattice</code></p>
<p><code>castep.serial -s lattice</code></p>
<p>To view detailed information on a particular keyword:</p>
<p><code>castep-serial castep.serial -h lattice_abc</code></p>
<p><code>castep.serial -h lattice_abc</code></p>
<h3 id="running-castep">Running CASTEP</h3>
<p>To run castep in serial with Si2 as the seedname, type</p>
<p><code>castep-serial castep.serial Si2</code></p>
<p><code>$ castep.serial Si2</code></p>
<p>To run castep in parallel using 16 core (the maximum for these virutal machines) with same Si2 seedname, type</p>
<p><code>castep-mpi mpirun -n 16 castep.mpi Si2</code></p>
<p>Note that the <code>castep-serial</code> and <code>castep-mpi</code> parts that the start of the above lines are particular to these virtual machines for the tutorial. Running castep on your own machines would typically involve either <code>castep.serial Si2</code> for the serial version or <code>mpirun -n 4 castep.mpi Si2</code> for the parallel version.</p>
<p><code>$ mpirun -n 16 castep.mpi Si2</code></p>
<h2 id="tutorial-files">Tutorial files</h2>
<p>The files needed for these tutorials can be found by navigating from Applications -&gt; Data -&gt; Course Materials (that will open up a file browser in the right place). They can also be accessed via the command line from this location: <code>/course_materials/</code>. Copy the files to somewhere in your home directory before trying to run CASTEP (you can't run CASTEP in the <code>/course_materials</code> directory. You can do that either using the graphical file browser or using the command line. For example:</p>
<p>Make a folder called Si2 in your home directory:</p>
Expand All @@ -3095,16 +3099,16 @@ <h2 id="summary-of-useful-commands">Summary of useful commands</h2>
<li><code>cp -r alice bob</code> - copy recursively <code>alice</code> to <code>bob</code>. You need this if you want to copy whole folders.</li>
<li><code>cp ../myfile ./</code> - copy the file <code>myfile</code> in the folder below to the current folder</li>
<li><code>cp ~/myfile ./</code> - copy the file <code>myfile</code> in your home folder to the current folder</li>
<li><code>castep-mpi mpirun -np 8 castep.mpi diamond</code> - submits a castep job with <code>diamond.cell</code> and <code>diamond.param</code> as inputs onto 8 cores with a time limit of 1 hour</li>
<li><code>mpirun -np 8 castep.mpi diamond</code> - submits a castep job with <code>diamond.cell</code> and <code>diamond.param</code> as inputs onto 8 cores with a time limit of 1 hour</li>
</ul>
<h3 id="c2x">c2x</h3>
<p>This is a handy free program written by Michael Rutter (TCM group Cambridge). It can convert
<code>castep.cell</code> and <code>castep.check</code> files into various formats eg <code>.cell</code>, <code>.pdb</code>. (and many other things!)</p>
<ul>
<li><code>castep-serial c2x -h</code> - list all the options</li>
<li><code>castep-serial c2x --pdbn castep.cell castep.pdb</code></li>
<li><code>castep-serial c2x --pdbn castep.check castep.pdb</code></li>
<li><code>castep-serial c2x --cell castep.check new.cell</code>
<li><code>c2x -h</code> - list all the options</li>
<li><code>c2x --pdbn castep.cell castep.pdb</code></li>
<li><code>c2x --pdbn castep.check castep.pdb</code></li>
<li><code>c2x --cell castep.check new.cell</code>
(useful at the end of geometry optimisation)</li>
</ul>

Expand Down
20 changes: 12 additions & 8 deletions workshop/01_bonding/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2993,13 +2993,13 @@ <h2 id="where-to-find-help">Where To Find Help</h2>
<li>There is information on this website: <a href="http://www.castep.org">www.castep.org</a>.</li>
<li>
<p>CASTEP has an in built help option to assist with using particular keywords. Information on using CASTEP can be seen by using:</p>
<p><code>$ castep-serial castep.serial --help</code></p>
<p><code>$ castep.serial --help</code></p>
<p>To get more information on a particular input file keyword (e.g. <code>kpoint_mp_grid</code>) use:</p>
<p><code>$ castep-serial castep.serial --help kpoints_mp_grid</code></p>
<p><code>$ castep.serial --help kpoints_mp_grid</code></p>
<p>If you don't know the keyword you need to use, then you can search on a particular keyword. This returns a list of keywords that you might be interested in, e.g. to look at all keywords which contain a reference to symmetry.</p>
<p><code>$ castep-serial castep.serial --search symmetry</code></p>
<p><code>$ castep.serial --search symmetry</code></p>
<p>Finally, to list all keywords, use:</p>
<p><code>$ castep-serial castep.serial --search all</code></p>
<p><code>$ castep.serial --search all</code></p>
<p>Note that the long-form arguments <code>--help</code> and <code>--search</code> can optionally be replaced with <code>-h</code> and <code>-s</code>, respectively.</p>
</li>
</ul>
Expand Down Expand Up @@ -3053,7 +3053,7 @@ <h3 id="vesta">Vesta</h3>
</li>
<li>
<p>Now run CASTEP using the 2-atom input files.</p>
<p><code>$ castep-serial castep.serial Si2</code></p>
<p><code>$ castep.serial Si2</code></p>
<p>This should only take a few seconds and produce a readable output file <code>Si2.castep</code>. Examine this file and try to understand the meaning of the various parts. In particular check the section following the header which lists all of the input parameters, both explicit and default. Note what default values of the major parameters CASTEP chose where you did not specify them explicitly. (There will be some whose meaning has not been explained. Don't worry about these.) </p>
<ul>
<li>Find the section of the file which monitors the SCF loop and the approach to convergence. How many SCF iterations did it need?</li>
Expand Down Expand Up @@ -3082,7 +3082,11 @@ <h3 id="vesta_1">Vesta</h3>
</ul>
<p>Now edit the file <code>Si2.charg_frm</code> with a text editor to remove the first 11 lines. The file should now begin with <code>1 1 1</code> and a number. You can now open <code>Si2.charg_frm</code> with Vesta. Note that Vesta needs both the <code>.cell</code> and <code>.charge_frm</code> files to make a plot. If you are working on a remote machine you will need to copy both of these back to your local machine to view with Vesta. You can find a walkthrough video of this process <a href="https://youtu.be/_c2Hk4jxmm4">here</a>.</p>
<p><img alt="Silicon Charge Density" src="../../img/silicon_charge_density.png" /></p>
<p>An alternative way to plot charge densities (and much more besides) is <a href="https://www.c2x.org.uk">c2x</a>.</p>
<p>An alternative way to plot charge densities (and much more besides) is <a href="https://www.c2x.org.uk">c2x</a>. You can use c2x to convert the <code>.den_fmt</code> file to a <code>.xsf</code> file which can be read by Vesta:</p>
<div class="highlight"><pre><span></span><code>```
$ c2x -c Si2.den_fmt Si2.xsf
```
</code></pre></div>
<h3 id="answer-the-following-questions">Answer the following questions:</h3>
<ol>
<li>Can you explain what you see as you vary the isosurface value?</li>
Expand All @@ -3093,8 +3097,8 @@ <h3 id="answer-the-following-questions">Answer the following questions:</h3>
</li>
<li>
<p>Repeat steps 1-8 using input files for sodium chloride and aluminium.</p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-4-1" name="__codelineno-4-1" href="#__codelineno-4-1"></a>/course_materials/Al.tgz
<a id="__codelineno-4-2" name="__codelineno-4-2" href="#__codelineno-4-2"></a>/course_materials/NaCl.tgz
<div class="highlight"><pre><span></span><code><a id="__codelineno-5-1" name="__codelineno-5-1" href="#__codelineno-5-1"></a>/course_materials/Al.tgz
<a id="__codelineno-5-2" name="__codelineno-5-2" href="#__codelineno-5-2"></a>/course_materials/NaCl.tgz
</code></pre></div>
<h3 id="think-about-the-following-questions">Think about the following questions:</h3>
<ul>
Expand Down
10 changes: 5 additions & 5 deletions workshop/02_bands_dos/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2970,7 +2970,7 @@ <h2 id="you-will-need">You will need:</h2>
<li><a href="http://plasma-gate.weizmann.ac.il/Grace/">Grace</a> - A 2D plotting program.</li>
<li><a href="http://www.perl.org">Perl</a> - a scripting language.</li>
</ul>
<p>These are available on the Arcus cluster.</p>
<p>These are available on the virtual machines.</p>
<h2 id="example-files">Example files:</h2>
<p>Copy the input files to your home directory</p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a>cp /course_materials/bandstructure.tgz ~/
Expand Down Expand Up @@ -2999,16 +2999,16 @@ <h2 id="example-1-graphite">Example 1 - Graphite.</h2>
<a id="__codelineno-3-11" name="__codelineno-3-11" href="#__codelineno-3-11"></a>%ENDBLOCK spectral_kpoint_path
</code></pre></div>
Run CASTEP using:</p>
<p><div class="highlight"><pre><span></span><code><a id="__codelineno-4-1" name="__codelineno-4-1" href="#__codelineno-4-1"></a>$ castep-mpi mpirun -np 16 castep.mpi graphite
<p><div class="highlight"><pre><span></span><code><a id="__codelineno-4-1" name="__codelineno-4-1" href="#__codelineno-4-1"></a>$ mpirun -np 16 castep.mpi graphite
</code></pre></div>
Once the CASTEP calculation has finished a <code>graphite.bands</code> file will be present in the directory. A band structure plot can be viewed by using the dispersion.pl tool.</p>
<p><div class="highlight"><pre><span></span><code><a id="__codelineno-5-1" name="__codelineno-5-1" href="#__codelineno-5-1"></a>$ castep-serial dispersion.pl -np -xg -bs -symmetry hexagonal graphite.bands | xmgrace -
<p><div class="highlight"><pre><span></span><code><a id="__codelineno-5-1" name="__codelineno-5-1" href="#__codelineno-5-1"></a>$ dispersion.pl -np -xg -bs -symmetry hexagonal graphite.bands | xmgrace -
</code></pre></div>
The <code>-xg</code> option tells dispersion.pl that you are using grace to plot the band structure, the <code>-bs</code> option tells the script that you want to plot using CASTEP output files, the <code>-symmetry hexagonal</code> option labels the high symmetry points on the bands structure plot.</p>
<p>When you view this band structure plot you will notice the bands are coloured from lowest to highest energy. Using information about the wavefunction CASTEP can improve this band structure plot, so bands are coloured due to the orbitals that contribute. The <code>orbitals2bands</code> tool can be used to alter the <code>Si.bands</code> file represent the orbitals that contribute to the bands. This tool can be run in the same directory that you ran CASTEP in.
The program <code>orbitals2bands</code> overwrites your <code>Si.bands</code> file, so it's best to copy it to another file to preserve it</p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-6-1" name="__codelineno-6-1" href="#__codelineno-6-1"></a>$ cp graphite.bands graphite.bands.orig
<a id="__codelineno-6-2" name="__codelineno-6-2" href="#__codelineno-6-2"></a>$ castep-serial orbitals2bands graphite
<a id="__codelineno-6-2" name="__codelineno-6-2" href="#__codelineno-6-2"></a>$ orbitals2bands graphite
</code></pre></div>
<h2 id="example-2-silicon-and-aluminium">Example 2 - Silicon and Aluminium.</h2>
<p>Very similar to example 1, but this time comparing a semiconductor and a metal, both with FCC crystal structures.</p>
Expand All @@ -3031,7 +3031,7 @@ <h2 id="irons-density-of-states">Iron's Density of States</h2>
<div class="highlight"><pre><span></span><code><a id="__codelineno-8-1" name="__codelineno-8-1" href="#__codelineno-8-1"></a>SPECTRAL_KPOINT_MP_GRID 12 12 12
</code></pre></div>
<p>Run CASTEP using these new input files then use the dos.pl plotting script</p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-9-1" name="__codelineno-9-1" href="#__codelineno-9-1"></a>castep-serial dos.pl -xg -np -w 0.2 Fe.bands | xmgrace -
<div class="highlight"><pre><span></span><code><a id="__codelineno-9-1" name="__codelineno-9-1" href="#__codelineno-9-1"></a>dos.pl -xg -np -w 0.2 Fe.bands | xmgrace -
</code></pre></div>
<p>Can you relate the features in the DOS to those in the Bandstructure?</p>
<p>You might find the <code>-mirror</code> option useful. The <code>-w</code> option sets the Gaussian broadening in eV. Try smaller (0.05) and larger (0.5) values - explain what you see.</p>
Expand Down
5 changes: 4 additions & 1 deletion workshop/03_geometry/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2956,7 +2956,7 @@ <h1 id="geometry-optimisation">Geometry Optimisation</h1>
<h2 id="exercise-1-dihydrogen-dimer">Exercise 1 - Dihydrogen dimer</h2>
<p>In this tutorial we will model the bond length of a H2 molecule. This will give you the opportunity to get used to
geometry optimisations and gain familiarity </p>
<p>Remember you can use <code>castep --help</code> to assist you with finding the appropriate input parameters.</p>
<p>Remember you can use <code>castep.serial --help</code> to assist you with finding the appropriate input parameters.</p>
<ol>
<li>
<p>Create a new file, <code>H2.cell</code> using your favourite text editor, e.g.</p>
Expand Down Expand Up @@ -3050,7 +3050,10 @@ <h4 id="c-wavefunction-convergence">C. Wavefunction Convergence</h4>
<div class="highlight"><pre><span></span><code><a id="__codelineno-9-1" name="__codelineno-9-1" href="#__codelineno-9-1"></a>elec_energy_tol: 0.1
</code></pre></div>
<p>This overwrites the default of <code>0.00001 ev</code> and will make the SCF convergence very fast. What does this do to the geometry optimisation?</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p><strong>NOTE:</strong> This is not something you want to do in practice! Hopefully working through this example will demonstrate why.</p>
</div>
<h2 id="exercise-2">Exercise 2</h2>
<p>Run a geometry optimisation on silicon.</p>
<p>You can use a silicon input file from one of the previous tutorials as a starting point for your input files.</p>
Expand Down
6 changes: 3 additions & 3 deletions workshop/05_phonon/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2966,7 +2966,7 @@ <h2 id="a-gammagamma-point-phonon-in-h-bn">A. <span class="arithmatex"><span cla
<p>This tells CASTEP to read the intput files and summaries the calculation in the <code>.castep</code> file, but does not run the electronic structure calculation. It is very useful to check syntax before submitting to a batch queue (and finding out later you’d made a spelling mistake!).</p>
<p>Check to see if any <code>.err</code> files are produced and fix issues, if any. If / when no errors are returned, congratulations. You have set up the input files, and you can delete the dryrun .castep file.
Once you have in place the <code>&lt;seed&gt;.cell</code> and <code>&lt;seed&gt;.param</code> files you are ready to submit the CASTEP job. This is done using our general script:</p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-4-1" name="__codelineno-4-1" href="#__codelineno-4-1"></a>castep-mpi mpirun -n 16 castep.mpi h-BN
<div class="highlight"><pre><span></span><code><a id="__codelineno-4-1" name="__codelineno-4-1" href="#__codelineno-4-1"></a>mpirun -n 16 castep.mpi h-BN
</code></pre></div>
<p>which requests a 16-core parallel run. When it has finished, you can examine the output file <code>h-BN.castep</code> and find the frequencies. What you see is explained further in the Phonons user guide linked above. There is also a machine-readable file <code>h-BN.phonon</code> which contains the frequencies and also the eigenvectors which we will analyse.</p>
</li>
Expand All @@ -2986,7 +2986,7 @@ <h2 id="a-gammagamma-point-phonon-in-h-bn">A. <span class="arithmatex"><span cla
</ol>
<h3 id="generation-of-ir-spectrum">Generation of IR spectrum</h3>
<p>The easiest way to generate a simple model IR spectrum is to use Castep’s <code>dos.pl</code> tool. To run this on the apptainer in the most effective way and automatically display a plot, the command</p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-7-1" name="__codelineno-7-1" href="#__codelineno-7-1"></a>castep-serial dos.pl -ir -xg -np h-BN.phonon | xmgrace -
<div class="highlight"><pre><span></span><code><a id="__codelineno-7-1" name="__codelineno-7-1" href="#__codelineno-7-1"></a>dos.pl -ir -xg -np h-BN.phonon | xmgrace -
</code></pre></div>
<p>will generate a plot script and use the <code>xmgrace</code> plotting program to display it. You can create a <code>gnuplot</code> script instead of <code>xmgrace</code> by changing the <code>-xg</code> flag to <code>-gp</code>. Alternatively you can generate a GNUPLOT script without plotting by</p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-8-1" name="__codelineno-8-1" href="#__codelineno-8-1"></a>dos.pl -ir -gp -np h-BN.phonon &gt; h-BN-phonon.plt
Expand Down Expand Up @@ -3067,7 +3067,7 @@ <h2 id="cii-phonon-dos-using-interpolation">C.II Phonon DOS using interpolation<
<p>You can run CASTEP on just 1-4 processors for this
You can try this several times with different fine q-point grids.
This will produce a <code>.castep</code> and <code>.phonon</code> file as before. You may analyse the .phonon file and generate a DOS using the <code>dos.pl</code> script</p>
<p><div class="highlight"><pre><span></span><code><a id="__codelineno-14-1" name="__codelineno-14-1" href="#__codelineno-14-1"></a>castep-serial dos.pl -xg -np NaH-dos.phonon | xmgrace -
<p><div class="highlight"><pre><span></span><code><a id="__codelineno-14-1" name="__codelineno-14-1" href="#__codelineno-14-1"></a>dos.pl -xg -np NaH-dos.phonon | xmgrace -
</code></pre></div>
(again, an X server running on the PC will be needed for grace to display; MobaXterm should have this enabled by default) .</p>
</li>
Expand Down
96 changes: 96 additions & 0 deletions workshop/serial_executables.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
awk_elf_to_xsf
bands2dos
bs_sc2pc
c2x
castep2casino
castep2cell
castep2cif
castep2cssr
castep2cube
castep2force.py
castep2ngwst
castep2pdb
castep2shak
castep2shx
castep2w90
castep2xsf
castep2xtl
castep2xyz
castepclean
castepconv.py
castep_GA
castep_md_reader.py
castep.py
castep.serial
cconv
cell2cell
cell2pdb
cell2sgroup
cell2shx
cell2xsf
cell2xtl
cell2xyz
celltools
ceteprouts.pm
charge2d
cif2cell
CijUtil.py
cssr2cell
cssr2gulp
cube_add
cube_info
cube_subtract
cube_to_xsf
current2nics
den2cube
den2grd
den2vasp
den2xplor
den2xsf
dispersion.pl
dos.pl
easy-install.pth
elastics.py
f2py
f2py3
f2py3.8
generate_strain.py
geom2dcd
geom2pdbseq
geom2xsf
geom2xtl
geom2xyz
geom2xyz.pl
md2xyz
mdtep
md_to_phonons.py
mode_follow
MolPDOS
optados
orbitals2bands
pdb2cell
pdb2pdb
pdb2shak
pdb2shx
pdb2xtl
perl_md.pl
perl_pimd.pl
phonon2xyz
phonon_kpoints
phonons
pimerge.pl
pot1d
rotate_Albite.py
rotCij.py
shx2cell
site.py
symmetry_snap
test-CijUtil.py
vasp2cell
vasp2cif
vasp2pdb
xtl2cell
xtl2cssr
xtl2pdb
xtl2sgroup
xtl2shx
32 changes: 32 additions & 0 deletions workshop/vm_aliases.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

# This file contains the aliases that are used in the workshop to make running
# the commands easier. You can source this file to make them available in your current shell.
# For example:
#
# source /course_materials/vm_aliases.sh

# Function to prepend a command to an executable
prepend_command() {
local command=$1
local executable=$2
alias "$executable"="$command $executable"
}

# Get the directory of the current script
SCRIPT_DIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")")

# Read the list of executables from the serial configuration file
serial_executables=$(cat "$SCRIPT_DIR/serial_executables.conf")

# Loop over the serial executables and create aliases
for exe in $serial_executables; do
prepend_command "castep-serial" "$exe"
done

# an extra alias for the serial version of castep
alias "castep"="castep-serial castep.serial"

# For the MPI executables, prepend castep-mpi to mpirun
# and that will anyway ensure that the mpi versions of the executables are used
alias "mpirun"="castep-mpi mpirun"

0 comments on commit b7ac965

Please sign in to comment.