Skip to content

Commit

Permalink
add exercise/05 and update 04
Browse files Browse the repository at this point in the history
  • Loading branch information
weilinscenccs committed Apr 11, 2024
1 parent 40ba9c9 commit 46187d4
Show file tree
Hide file tree
Showing 12 changed files with 168 additions and 24 deletions.
6 changes: 3 additions & 3 deletions content/exercise/solutions/02/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Instructions for use on the EuroHPC cluster Leonardo Booster
`````

```{attention}
make sure we are in the path of `exercise/02`
make sure we are in the path at `exercise/02`
```

1. we could reuse the kstr, bmdl and shape from exercise/00
Expand All @@ -44,7 +44,7 @@ make sure we are in the path of `exercise/02`
```{literalinclude} solution.sh
:language: bash
:lines: 12-24
:lines: 13-25
```
````

Expand All @@ -55,7 +55,7 @@ make sure we are in the path of `exercise/02`
```{literalinclude} solution.sh
:language: bash
:lines: 28-38
:lines: 28-35
```
````

Expand Down
27 changes: 27 additions & 0 deletions content/exercise/solutions/04/FM.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#! /bin/bash
# generate kgrn and kfcd input files based on kgrn/fecr_FM.dat
for i in `seq 0 2 10` `seq 30 20 90` 100
do
cr=$(printf "%03d" $i)
fe=$(printf "%03d" $((100-i)))
folder=FM/FeCr$cr
mkdir -p $folder/{kgrn,kfcd}

ln -s $(pwd)/kstr $folder/kstr
ln -s $(pwd)/bmdl $folder/bmdl
ln -s $(pwd)/shape $folder/shape

for sws in `seq 2.59 0.02 2.69`
do
# -e "s/NCPA.=.../NCPA.= 17/" \
# -e "s/NKY..=.../NKY..= 21/" \
sed -e "s/JOBNAM=.*/JOBNAM=fecr-$sws/" \
-e "28 s/ 50.00/$fe.00/" \
-e "29 s/ 50.00/$cr.00/" \
-e "s/SWS......=......../SWS......=${sws}0000/" \
kgrn/fecr_FM.dat > $folder/kgrn/fecr-$sws.dat

sed -e "s/JOBNAM...=.*/JOBNAM...=fecr-$sws/" \
kfcd/fecr_FM.dat > $folder/kfcd/fecr-$sws.dat
done
done
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
KFCD MSGL..= 0 22 Jan 08
JOBNAM...=fecr
JOBNAM...=fecr_FM
STRNAM...=bcc
DIR001=../kstr/smx/
DIR002=../kgrn/chd/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
KGRN 13 Oct 12
JOBNAM=fecr
JOBNAM=fecr_FM
STRT..= A MSGL.= 0 EXPAN.= S FCD..= Y FUNC..= SCA
FOR001=../kstr/smx/bcc.tfh
FOR001=../kstr/smx/bcc30.tfh
Expand Down
29 changes: 17 additions & 12 deletions content/exercise/solutions/04/readme.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# exercise/04: formation energy for bcc FeCrx alloy
# exercise/04: Mixing enthalpy for bcc FeCrx alloy: FM

In this exercise we will practice how to get formation energy of bcc {math}`Fe_{ (1-x) }Cr_x` alloy with EMTO
In this exercise we will practice how to get Mixing enthalpy of bcc {math}`Fe_{ (1-x) }Cr_x` alloy with EMTO.

```{math}
E = E_{Fe_{(1-x)}Cr_x} - ( 1-x )E_{Fe_{bcc}} - x E_{Cr_{bcc}}
H = E_{Fe_{(1-x)}Cr_x} - ( 1-x )E_{Fe_{bcc}} - x E_{Cr_{bcc}}
```

The reference states are chosen as FM Fe and NM Cr, both in bcc structure. [^1] \
Expand All @@ -16,7 +16,7 @@ For each {math}`Fe_{ (1-x) }Cr_x`, we need its equilibrium volume and correspond
### create an input files for {math}`Fe_{50}Cr_{50}`

- we could copy the kgrn input from exercise00 and make some changes.
* `JOBNAM=fecr`
* `JOBNAM=fecr_FM`
* `FOR001=../kstr/smx/bcc.tfh`, `FOR004=../bmdl/mdl/bcc.mdl` and `IBZ..= 3`
* `MNTA.= 2`
* `AFM..= F`
Expand Down Expand Up @@ -44,7 +44,7 @@ For each {math}`Fe_{ (1-x) }Cr_x`, we need its equilibrium volume and correspond

````{hint}
:class: dropdown
```{literalinclude} kgrn/fecr.dat
```{literalinclude} kgrn/fecr_FM.dat
:diff: ../00/kgrn/cu.dat
```
````
Expand Down Expand Up @@ -72,10 +72,10 @@ For each {math}`Fe_{ (1-x) }Cr_x`, we need its equilibrium volume and correspond
│   ├── bcc.dat
│   └── mdl
├── kfcd
│   └── fecr.dat
│   └── fecr_FM.dat
├── kgrn
│   ├── chd
│   ├── fecr.dat
│   ├── fecr_FM.dat
│   └── pot
├── kstr
│   ├── bcc.dat
Expand All @@ -86,22 +86,27 @@ For each {math}`Fe_{ (1-x) }Cr_x`, we need its equilibrium volume and correspond
11 directories, 5 files
```
* check `NOS` from kgrn/fecr.prn
* check `NOS` from kgrn/fecr_FM.prn
```bash
grep -H NOS *.prn
fecr.prn: KKRFCD: NOS(Ef) = 7.000025 ELT = 7.000000
fecr.prn: KKRFCD: NOS(Ef) = 7.000025 ELT = 7.000000
fecr_FM.prn: KKRFCD: NOS(Ef) = 7.000025 ELT = 7.000000
fecr_FM.prn: KKRFCD: NOS(Ef) = 7.000025 ELT = 7.000000
```
````{hint}
:class: dropdown
increase `NCPA` to make sure cpa loop converged
```bash
sed -i 's/NCPA.= 7/NCPA.= 17/' fecr.dat
sed -i 's/NCPA.= 7/NCPA.= 17/' fecr_FM.dat
```
````
### create input files with different volumes for each {math}`Fe_{(1-x)}Cr_x`

```{literalinclude} solution.sh
```{literalinclude} FM.sh
:language: bash
:linenos:
```
- get equilibrium state for each concentration.
```bash
Eos.sh FeCr* > eos
cat eos
```
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#! /bin/bash
# generate kgrn and kfcd input files based on kgrn/fecr.dat
for i in 000 002 004 006 008 010 030 050 070 090 100
for i in `seq 0 1 5` `seq 15 10 45` 50
do
folder=FeCr$i
cr=$(printf "%03d" $i)
fe=$(printf "%03d" $((50-i)))
folder=PM/FeCr$(printf "%03d" $((2* i)) )
mkdir -p $folder/{kgrn,kfcd}

ln -s $(pwd)/kstr $folder/kstr
Expand All @@ -14,12 +16,14 @@ do
# -e "s/NCPA.=.../NCPA.= 17/" \
# -e "s/NKY..=.../NKY..= 21/" \
sed -e "s/JOBNAM=.*/JOBNAM=fecr-$sws/" \
-e "28 s/ 50.00/$i.00/" \
-e "29 s/ 50.00/$i.00/" \
-e "28 s/ 25.00/$fe.00/" \
-e "29 s/ 25.00/$fe.00/" \
-e "30 s/ 25.00/$cr.00/" \
-e "31 s/ 25.00/$cr.00/" \
-e "s/SWS......=......../SWS......=${sws}0000/" \
kgrn/fecr.dat > $folder/kgrn/fecr-$sws.dat
kgrn/fecr_PM.dat > $folder/kgrn/fecr-$sws.dat

sed -e "s/JOBNAM...=.*/JOBNAM...=fecr-$sws/" \
kfcd/fecr.dat > $folder/kfcd/fecr-$sws.dat
kfcd/fecr_PM.dat > $folder/kfcd/fecr-$sws.dat
done
done
2 changes: 2 additions & 0 deletions content/exercise/solutions/05/clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
rm -fvr Fe*
rm -fv */*.{prn,out,kgrn,kfcd} */*/*
10 changes: 10 additions & 0 deletions content/exercise/solutions/05/kfcd/fecr_FM.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
KFCD MSGL..= 0 22 Jan 08
JOBNAM...=fecr_PM
STRNAM...=bcc
DIR001=../kstr/smx/
DIR002=../kgrn/chd/
DIR003=../shape/shp/
DIR004=../bmdl/mdl/
DIR006=./
Lmaxs.= 30 NTH..= 41 NFI..= 81 FPOT..= N
OVCOR.= Y UBG..= N NPRN.= 0
60 changes: 60 additions & 0 deletions content/exercise/solutions/05/kgrn/fecr_PM.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
KGRN 13 Oct 12
JOBNAM=fecr_PM
STRT..= A MSGL.= 0 EXPAN.= S FCD..= Y FUNC..= SCA
FOR001=../kstr/smx/bcc.tfh
FOR001=../kstr/smx/bcc30.tfh
DIR002=pot/
DIR003=pot/
FOR004=../bmdl/mdl/bcc.mdl
DIR006=
DIR009=pot/
DIR010=chd/
DIR011=/tmp/
Self-consistent KKR calculation for bcc FeCrX
Band: 10 lines
NITER.= 50 NLIN.= 31 NPRN.= 0 NCPA.= 7 NT...= 1 MNTA.= 4
MODE..= 3D FRC..= N DOS..= N OPS..= N AFM..= F CRT..= M
Lmaxh.= 8 Lmaxt= 4 NFI..= 31 FIXG.= 2 SHF..= 0 SOFC.= Y
KMSH...= G IBZ..= 3 NKX..= 0 NKY..= 13 NKZ..= 0 FBZ..= N
KMSH2..= G IBZ2.= 1 NKX2.= 4 NKY2.= 0 NKZ2.= 51
ZMSH...= C NZ1..= 16 NZ2..= 8 NZ3..= 8 NRES.= 4 NZD.=1500
DEPTH..= 1.000 IMAGZ.= 0.020 EPS...= 0.200 ELIM..= -1.000
AMIX...= 0.100 EFMIX.= 1.000 VMTZ..= 0.000 MMOM..= 0.000
TOLE...= 1.d-07 TOLEF.= 1.d-07 TOLCPA= 1.d-06 TFERMI= 500.0 (K)
SWS......=2.686842 NSWS.= 1 DSWS..= 0.05 ALPCPA= 0.6020
Setup: 2 + NQ*NS lines
EFGS...= 0.000 HX....= 0.100 NX...= 5 NZ0..= 6 STMP..= N
Symb IQ IT ITA NZ CONC Sm(s) S(ws) WS(wst) QTR SPLT Fix
Fe 1 1 1 26 25.00 0.000 1.000 1.000 0.0 2.0 N
Fe 1 1 2 26 25.00 0.000 1.000 1.000 0.0 -2.0 N
Cr 1 1 3 24 25.00 0.000 1.000 1.000 0.0 -1.0 N
Cr 1 1 4 24 25.00 0.000 1.000 1.000 0.0 1.0 N
Atom: 4 lines + NT*NTA*6 lines
IEX...= 4 NP..= 251 NES..= 15 NITER=100 IWAT.= 0 NPRNA= 0
VMIX.....= 0.300000 RWAT....= 3.500000 RMAX....= 20.000000
DX.......= 0.030000 DR1.....= 0.002000 TEST....= 1.00E-12
TESTE....= 1.00E-12 TESTY...= 1.00E-12 TESTV...= 1.00E-12
Fe
Iz= 26 Norb= 10 Ion= 0 Config= 3d7_4s1
n 1 2 2 2 3 3 3 3 3 4
Kappa -1 -1 1 -2 -1 1 -2 2 -3 -1
Occup 2 2 2 4 2 2 4 4 3 1
Valen 0 0 0 0 0 0 0 1 1 1
Fe
Iz= 26 Norb= 10 Ion= 0 Config= 3d7_4s1
n 1 2 2 2 3 3 3 3 3 4
Kappa -1 -1 1 -2 -1 1 -2 2 -3 -1
Occup 2 2 2 4 2 2 4 4 3 1
Valen 0 0 0 0 0 0 0 1 1 1
Cr
Iz= 24 Norb= 9 Ion= 0 Config= 3d4_4s2
n 1 2 2 2 3 3 3 3 4
Kappa -1 -1 1 -2 -1 1 -2 2 -1
Occup 2 2 2 4 2 2 4 4 2
Valen 0 0 0 0 0 0 0 1 1
Cr
Iz= 24 Norb= 9 Ion= 0 Config= 3d4_4s2
n 1 2 2 2 3 3 3 3 4
Kappa -1 -1 1 -2 -1 1 -2 2 -1
Occup 2 2 2 4 2 2 4 4 2
Valen 0 0 0 0 0 0 0 1 1
35 changes: 35 additions & 0 deletions content/exercise/solutions/05/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# exercise/05: Mixing enthalpy for bcc FeCrx alloy: PM

In this exercise we will practice how to treat magnetic disorder with CPA.
It is the same story as exercise/04[^1], but here we treat the system within paramagnetic (PM) state.

```{math}
H = E_{Fe^\uparrow_{(1-x/2)}Fe^\downarrow_{(1-x/2)}Cr^\uparrow_{x/2}Cr^\downarrow_{x/2} } - ( 1-x )E_{Fe^\uparrow_{50}Fe^\downarrow_{50}} - x E_{Cr^\uparrow_{50}Cr^\downarrow_{50}}
```

[^1]: [ Electronic origin of the anomalous stability of Fe-rich bcc Fe-Cr alloys ](https://journals.aps.org/prb/abstract/10.1103/PhysRevB.73.104416)

- copy kgrn and kfcd input form exercise/04 and reuse its kstr, bmdl and shape.
```bash
cp -r ../04/{kgrn,kfcd} 05/
cd 05
ln -s ../04/kstr
ln -s ../04/bmdl
ln -s ../04/shape
cp kgrn/{fecr_FM,fecr_PM}.dat
cp kfcd/{fecr_FM,fecr_PM}.dat
```
- spin {math}`\uparrow` and {math}`\downarrow` as "alloy components".

```{literalinclude} kgrn/fecr_PM.dat
:caption: split the components to half in kgrn input
:lineno-match:
:lines: 27-31
```
* remember change `MNTA.= 4`.
- add "atomic config" for the extra components.
```{literalinclude} kgrn/fecr_PM.dat
:caption: split the components to half in kgrn input
:lineno-match:
:lines: 37-60
```
1 change: 1 addition & 0 deletions content/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ About the course
exercise/solutions/02/readme.md
exercise/solutions/03/readme.md
exercise/solutions/04/readme.md
exercise/solutions/05/readme.md

See also
--------
Expand Down
2 changes: 1 addition & 1 deletion content/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ optional settings:


```bash
export SQUEUE_FORMAT="%.20i %.8u %.15a %.15j %.3t %9r %19S %.10M %.10L %.5D %.4C %.10Q %40R"
export SQUEUE_FORMAT="%.15i %.8u %.15a %.15j %.3t %.10M %.10L %.5D %.4C %.10Q %16R %P"
```

0 comments on commit 46187d4

Please sign in to comment.