Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
brlec committed Oct 1, 2021
2 parents b59b699 + d2b760f commit 44eb24b
Show file tree
Hide file tree
Showing 127 changed files with 2,660 additions and 166,091 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Surfaxe primarily supports the [VASP](https://www.vasp.at/) DFT code, however mo
![Bond analysis example](example_data/figures/bond_analysis_plot.png)

**Surface energy convergence checks with respect to vacuum and slab thickness**
![Surface energy convergence example](example_data/figures/110_surface_energy.png)
![Surface energy convergence example](example_data/figures/010_surface_energy.png)

See the [tutorials directory](tutorials/) for more examples.

Expand Down Expand Up @@ -78,21 +78,22 @@ Generation:

Convergence:

* `surfaxe-parsefols`: Parses the convergence folders set up with `surfaxe-generate` where calculations were run with VASP. Extracts the relevant data and plots convergence graphs of the variation of surface energy and energy per atom with respect to slab and vacuum thickness.
* `surfaxe-parse-energies`: Extracts the relevant data from the convergence folders set up with `surfaxe-generate` where calculations were run with VASP. Plots convergence graphs of the variation of surface energy with respect to slab and vacuum thickness. Can optionally parse core atom and vacuum energies as well.
* `surfaxe-parse-structures`: Collects the structures' metadata into a json file and optionally performs bond analysis as in `surfaxe-bonds`.

Analysis:

* `surfaxe-bonds`: Parses the structure, looking for bonds between specified atoms.
* `surfaxe-simplenn`: Predicts the coordination environment of atoms for simple structures.
* `surfaxe-complexnn`: Predcts the coordination environment of atoms in more complex structures where the default prediction algorithm fails.
* `surfaxe-potential`: Calculates and optionally plots the planar and macroscopic potential of the slab along c-axis.
* `surfaxe-potential`: Calculates the planar potential of the slab along c-axis, the gradient of the planar potential and optionally macroscopic potential.
* `surfaxe-cartdisp`: Calculates the Cartesian displacements of atoms during relaxation from intial and final structures.

Plotting:

* `surfaxe-plot-surfen` and `surfaxe-plot-enatom`: Plot the surface energy and energy per atom based on data from `surfaxe-parsefols` with individual customisability
* `surfaxe-plot-bonds`: Plots the bond distance with respect to fractional coordinate, based on `surfaxe-bonds`
* `surfaxe-plot-potential`: Plots the planar and macroscopic potential based on data already analysed with `surfaxe-potential`
* `surfaxe-plot-potential`: Plots the planar (and macroscopic) potential based on data already analysed with `surfaxe-potential`

Data:

Expand Down Expand Up @@ -142,6 +143,7 @@ Surfaxe is compatible with python 3.7+ and requires the following packages:
* [Pandas](https://pandas.pydata.org/)
* [Matplotlib](https://matplotlib.org/)
* [Numpy](https://numpy.org/)
* [Scikit-learn](https://scikit-learn.org/stable/)

## Contributors

Expand Down
15 changes: 10 additions & 5 deletions docs/command_line_examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,21 @@ minimum vacuum thickness of 30 Å.
Post-processing commands
========================

**surfaxe-parsefols**: Parses data produced by electronic structure codes once calculations
**surfaxe-parse-energies**: Parses data produced by electronic structure codes once calculations
have been run in then directory structures produced by the pre-processing commands.
Can optionally collect vacuum and core energies.

Example: :mod:`surfaxe-parsefols --hkl 0,0,1 -b 8.83099` saves a csv file of surface energies
and energies per atom for each slab-vacuum combination, as well as plots for each. See the
Tutorials directory for examples.
Example: :mod:`surfaxe-parse-energies --hkl 0,0,1 -b 8.83099` saves a csv file of surface energies
and energies per atom for each slab-vacuum combination. See the Tutorials directory for examples.

**surfaxe-plot-surfen** and **surfaxe-plot-enatom** can be used to customise the surface
energy and energy per atom plots independetnly based on the data already collated
with **surfaxe-parsefols**.
with **surfaxe-parse-energies**.

**surfaxe-parse-structures**: Parses the (relaxed) structures from convergence calculations
and collates them into the same json format as is created when surface slabs are generated. Can
optionally perform bond analysis for multiple specified bonds. Useful for comparison of relaxed
and unrelaxed surfaces slabs and determination of convergence.

=================
Analysis commands
Expand Down
9 changes: 6 additions & 3 deletions docs/tutorials.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,12 @@ on SnO2 slabs, we could set up the config dict as follows:
}
}
Alternatively, one of the ready-made :mod:`surfaxe` config dicts (:mod:`PBEsol_config.json`,
:mod:`PBE_config.json` or :mod:`HSE06_config.json`) can be used and further modified
using :mod:`user_incar_settings`, :mod:`user_kpoints_settings` and :mod:`user_potcar_settings`
Alternatively, one of the ready-made :mod:`surfaxe` config dicts (:mod:`PBEsol.json`,
:mod:`PBEsol_relax.json`, :mod:`PBE.json`, :mod:`PBE_relax.json` or :mod:`HSE06.json`)
can be used and further modified using :mod:`user_incar_settings`,
:mod:`user_kpoints_settings` and :mod:`user_potcar_settings`. The :mod:`relax` config dicts
contain additional parameters necessary for geometric relaxations of slabs.
The POTCAR functional (i.e. PBE, PBE_54) can be chosen with :mod:`user_potcar_functional`.

`Pymatgen documentation <https://pymatgen.org/pymatgen.io.vasp.sets.html#pymatgen.io.vasp.sets.DictSet>`_
covers exact behaviour of the :mod:`user_incar_settings`, :mod:`user_kpoints_settings` and :mod:`user_potcar_settings`
Expand Down
29 changes: 29 additions & 0 deletions example_data/convergence/Y2Ti2S2O5/010_data.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
,hkl_string,hkl_tuple,slab_thickness,vac_thickness,slab_index,atoms,area,bandgap,slab_energy,slab_per_atom,time_taken,surface_energy,surface_energy_ev,vacuum_potential,vacuum_gradient,surface_energy_fm,surface_energy_boettger,surface_energy_ouc,surface_energy_prim
0,10,"(0, 1, 0)",10,10,0,24,26.109033226959006,2.0735,-185.11670083,-7.713195867916667,82.966,0.6182291598998413,0.038591083639191,5.989,-0.0010909507996537,0.624414524227934,,0.6201775886163629,0.6242678804464569
1,10,"(0, 1, 0)",20,10,0,48,26.109033226959006,2.1285,-372.26815681,-7.755586600208333,238.487,0.6122150316693984,0.0382156698919724,8.004,-27.83894302436476,0.6245857603255839,0.6234152793254065,0.6161118891024416,0.6242924727626296
2,10,"(0, 1, 0)",30,10,0,72,26.109033226959006,2.1312,-559.41826332,-7.769698101666667,512.387,0.6066149078413943,0.0378660991161919,9.013,-42.77089474741916,0.6251710008256812,0.6243953733210382,0.6124601939909592,0.6247310694812499
3,10,"(0, 1, 0)",40,10,0,96,26.109033226959006,2.132,-746.56943472,-7.776764945,1057.408,0.6006880860148462,0.0374961352069192,9.617,-31.64388527254158,0.6254295433272173,0.6256677188925434,0.6084818008809328,0.6248429682013087
4,10,"(0, 1, 0)",50,10,0,120,26.109033226959006,2.1321,-933.72164294,-7.781013691166667,1958.69,0.5944431777954221,0.0371063157175669,10.02,-25.957897822820776,0.6253699994358771,0.6255677205708391,0.6041853213780303,0.6246367805284914
5,10,"(0, 1, 0)",60,10,0,144,26.109033226959006,2.132,-1120.87378597,-7.783845735902777,2627.405,0.5882182692403387,0.0367177446467127,10.312,-20.827615338039227,0.6253304552089126,0.6303012076183377,0.5999088415394686,0.6244505925200498
6,10,"(0, 1, 0)",70,10,0,168,26.109033226959006,2.1321000000000003,-1308.02850051,-7.785883931607143,3436.714,0.5812044461773388,0.0362799279761135,10.529,-18.56130894730448,0.6245019964739968,,0.5948434471930251,0.6234754900036569
7,10,"(0, 1, 0)",10,20,0,24,26.109033226959006,2.0736,-185.11974419,-7.713322674583334,110.146,0.6172954863552089,0.038532801894832,3.993,0.0003095252147527,0.6234415039416388,,0.6192439150717305,0.6233342069018245
8,10,"(0, 1, 0)",20,20,0,48,26.109033226959006,2.1285,-372.27097932,-7.7556454025,333.479,0.6113491127782863,0.0381616175267344,6.003,0.0012092054648693,0.6236411479511461,0.6220338605732418,0.6152459702113294,0.6234265538715176
9,10,"(0, 1, 0)",30,20,0,72,26.109033226959006,2.1316,-559.42024568,-7.769725634444445,699.293,0.6060067388808085,0.0378281360100379,7.211,0.0153266809930384,0.6244447916400894,0.6229865459172204,0.6118520250303733,0.624122900520664
10,10,"(0, 1, 0)",40,20,0,96,26.109033226959006,2.1321,-746.57054715,-7.776776532812501,1325.026,0.6003468032020045,0.0374748316605495,8.017,-13.904195398747328,0.6249308735477241,0.624309978221156,0.608140518068091,0.624501685388467
11,10,"(0, 1, 0)",50,20,0,120,26.109033226959006,2.1321,-933.72192707,-7.781016058916666,2102.562,0.5943560094472167,0.0371008744973293,8.594,-25.676865880598363,0.6250860973793749,0.6275318753620306,0.6040981530298247,0.624549612180286
12,10,"(0, 1, 0)",60,20,0,144,26.109033226959006,2.1293,-1120.87540738,-7.783856995694445,2450.94,0.5877208362642539,0.0366866938991419,9.189,-21.562867439498785,0.6245969417828158,0.6310657138841974,0.5994114085633836,0.623953159543965
13,10,"(0, 1, 0)",70,20,0,168,26.109033226959006,2.132,-1308.03080748,-7.785897663571428,4547.272,0.5804966899942632,0.0362357484390925,9.365,-18.88490601554195,0.6235188130992987,,0.5941356910099496,0.6227677338205811
14,10,"(0, 1, 0)",10,30,0,24,26.109033226959006,2.0755000000000003,-185.11949463,-7.71331227625,134.06,0.6173720489602943,0.0385375810836638,3.028,-0.2004808007991027,0.6237197074108916,,0.6193204776768159,0.6234107695069099
15,10,"(0, 1, 0)",20,30,0,48,26.109033226959006,2.1285,-372.27001096,-7.755625228333333,426.152,0.6116461963023136,0.0381801620663117,4.803,-0.0016303806538539,0.6243415132035082,0.6218781951388214,0.615543053735357,0.6237236373955449
16,10,"(0, 1, 0)",30,30,0,72,26.109033226959006,2.1318,-559.41853944,-7.769701936666667,944.82,0.6065301968840598,0.0378608112911398,6.008,0.0011377676644748,0.625573172235843,0.6232062538415826,0.6123754830336247,0.6246463585239154
17,10,"(0, 1, 0)",40,30,0,96,26.109033226959006,2.1276,-746.56851088,-7.776755321666666,1150.802,0.6009715112315522,0.037513827168012,7.042,-0.6069821149785554,0.6263621450339413,0.626883860467861,0.6087652260976386,0.6251263934180147
18,10,"(0, 1, 0)",50,30,0,120,26.109033226959006,2.1325000000000003,-933.72147916,-7.781012326333333,2413.666,0.594493423922475,0.0371094521799297,7.563,-0.25530708120691,0.62623171617547,0.629762229090268,0.6042355675050831,0.6246870266555443
19,10,"(0, 1, 0)",60,30,0,144,26.109033226959006,2.1326,-1120.87632388,-7.783863360277778,3220.328,0.5874396628889164,0.0366691425024292,8.1,-8.185983737437137,0.6255256135924825,0.6323024901800101,0.5991302351880461,0.6236719861686274
20,10,"(0, 1, 0)",70,30,0,168,26.109033226959006,2.1321,-1308.03254862,-7.7859080275,5174.478,0.5799625250070675,0.036202404806933,8.472,-19.089171826224625,0.6243961341612396,,0.5936015260227536,0.6222335688333853
21,10,"(0, 1, 0)",10,40,0,24,26.109033226959006,2.0736,-185.11929839,-7.713304099583333,200.246,0.6174322535027672,0.0385413391699605,2.396,0.0007412872583242,0.6239804531932147,,0.6193806822192888,0.6234709740493828
22,10,"(0, 1, 0)",20,40,0,48,26.109033226959006,2.1285,-372.26887949,-7.755601656041667,534.265,0.611993320403804,0.0382018302374409,4.002,0.0001361447826771,0.6250897197846992,0.6224871893654808,0.6158901778368474,0.6240707614970353
23,10,"(0, 1, 0)",30,40,0,72,26.109033226959006,2.1318,-559.41783476,-7.769692149444444,1196.542,0.6067463859229658,0.0378743062373886,5.15,-0.0011061609051547,0.6263909849943083,0.6243988093732378,0.6125916720725306,0.6248625475628212
24,10,"(0, 1, 0)",40,40,0,96,26.109033226959006,2.1245,-746.56886704,-7.776759031666667,1331.967,0.6008622447728751,0.0375070065401295,6.127,0.0506209535859644,0.6270550435346652,0.6279661064535512,0.6086559596389617,0.6250171269593375
25,10,"(0, 1, 0)",50,40,0,120,26.109033226959006,2.1297,-933.72280627,-7.781023385583333,2095.765,0.5940862793527061,0.0370840374127781,6.814,-0.0321019918556597,0.6268272778049437,0.6312377343133156,0.6038284229353142,0.6242798820857755
26,10,"(0, 1, 0)",60,40,0,144,26.109033226959006,2.1312,-1120.87887831,-7.783881099374999,3081.298,0.5866559883605842,0.0366202239925458,7.31,-0.1817689545497925,0.6259451865032694,0.6291997933706984,0.598346560659714,0.6228883116402953
27,10,"(0, 1, 0)",70,40,0,168,26.109033226959006,2.1255,-1308.03384322,-7.785915733452382,3405.351,0.5795653541922318,0.0361776126212379,7.813,-0.3958670338727575,0.6254027520253296,,0.5932043552079181,0.6218363980185498
Binary file added example_data/figures/010_surface_energy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed example_data/figures/110_surface_energy.png
Binary file not shown.
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
license='MIT',
packages=['surfaxe'],
zip_safe=False,
install_requires=['scipy', 'numpy', 'spglib', 'pymatgen','pandas'],
install_requires=['scipy', 'numpy', 'spglib', 'pymatgen','pandas','scikit-learn'],
python_requires='>=3.7',
classifiers=[
'Programming Language :: Python',
Expand All @@ -36,7 +36,8 @@
],
entry_points={
'console_scripts': [
'surfaxe-parsefols = surfaxe.cli.parsefols:main',
'surfaxe-parse-energy = surfaxe.cli.parseenergy:main',
'surfaxe-parse-structures = surfaxe.cli.parsestructures:main',
'surfaxe-bonds = surfaxe.cli.bonds:main',
'surfaxe-simplenn = surfaxe.cli.simplenn:main',
'surfaxe-complexnn = surfaxe.cli.complexnn:main',
Expand Down
Loading

0 comments on commit 44eb24b

Please sign in to comment.