Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nomad-lab
workflows-workshop
Commits
725c6a99
Commit
725c6a99
authored
Jun 28, 2021
by
davidwaroquiers
Browse files
Added abinit_quickstart.
parent
1acfbe65
Changes
1
Show whitespace changes
Inline
Side-by-side
tutorials/part2/01_abinit_quickstart/abinit_quickstart.ipynb
0 → 100644
View file @
725c6a99
%% Cell type:markdown id:exempt-cloud tags:
# Abinit - quickstart
https://abinit.github.io/abipy/flow_gallery/run_sic_relax.html#sphx-glr-flow-gallery-run-sic-relax-py
%% Cell type:code id:necessary-budapest tags:
```
python
!
abicheck
.
py
```
%% Cell type:markdown id:chronic-invention tags:
## Relaxation Flow
This example shows how to build a very simple Flow for the structural relaxation of SiC. One could use a similar logic to perform multiple relaxations with different input parameters…
%% Cell type:code id:handmade-dividend tags:
```
python
import
abipy.abilab
as
abilab
import
abipy.data
as
data
import
abipy.flowtk
as
flowtk
def
build_flow
(
workdir
):
pseudos
=
data
.
pseudos
(
"14si.pspnc"
,
"6c.pspnc"
)
structure
=
data
.
structure_from_ucell
(
"SiC"
)
# Initialize the input
relax_inp
=
abilab
.
AbinitInput
(
structure
,
pseudos
=
pseudos
)
# Set variables
relax_inp
.
set_vars
(
ecut
=
20
,
paral_kgb
=
1
,
iomode
=
3
,
# Relaxation part
ionmov
=
2
,
optcell
=
1
,
strfact
=
100
,
ecutsm
=
0.5
,
# Important!
dilatmx
=
1.15
,
# Important!
toldff
=
1e-6
,
tolmxf
=
1e-5
,
ntime
=
100
,
)
# K-points sampling
shiftk
=
[
[
0.5
,
0.5
,
0.5
],
[
0.5
,
0.0
,
0.0
],
[
0.0
,
0.5
,
0.0
],
[
0.0
,
0.0
,
0.5
]
]
relax_inp
.
set_kmesh
(
ngkpt
=
[
4
,
4
,
4
],
shiftk
=
shiftk
)
# Initialize the flow
flow
=
flowtk
.
Flow
(
workdir
)
# Register the task.
flow
.
register_relax_task
(
relax_inp
)
return
flow
```
%% Cell type:markdown id:related-music tags:
Build and run the flow:
%% Cell type:code id:steady-fellowship tags:
```
python
flow
=
build_flow
(
'flow_sic_relax'
)
flow
.
rmtree
()
scheduler
=
flow
.
make_scheduler
()
scheduler
.
start
()
```
%% Cell type:markdown id:confirmed-space tags:
To visualize the evolution of the lattice parameters during the structura relaxation use:
%% Cell type:code id:raising-valuable tags:
```
python
abifile
=
abilab
.
abiopen
(
'flow_sic_relax/w0/t0/outdata/out_HIST.nc'
)
abifile
.
plot
();
```
%% Cell type:code id:changing-bennett tags:
```
python
``
`
%%
Cell
type
:
code
id
:
passing
-
mineral
tags
:
```
python
```
%% Cell type:code id:prescribed-mexico tags:
```
python
```
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment