Skip to content

Commit

Permalink
Update figures in tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
ttadano committed Oct 31, 2017
1 parent da0c502 commit b7cc3f9
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 23 deletions.
Binary file added docs/img/Si_phband_DFT.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/Si_phdos_DFT.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/img/si_phband.png
Binary file not shown.
Binary file removed docs/img/si_phdos.png
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# html_static_path = ['_static']

# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
Expand Down
21 changes: 4 additions & 17 deletions docs/source/tutorial_pages/01_silicon.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,6 @@ Using the script :red:`displace.py` in the tools/ directory, you can generate th

$ python displace.py --xTAPP=si222.cg --mag=0.02 si222.pattern_HARMONIC

**LAMMPS**
::

$ python displace.py --LAMMPS=si222.lammps --mag=0.02 si222.pattern_HARMONIC


The ``--mag`` option specifies the displacement length in units of Angstrom.
You need to specify an input file with equilibrium atomic positions either by the ``--QE``, ``--VASP``, ``--xTAPP``, or ``--LAMMPS``.

Expand All @@ -109,7 +103,6 @@ as follows::

.. important::
In QE, you need to set tprnfor=.true. to print out atomic forces.
In LAMMPS, you need to save atomic forces by adding the dump option of LAMMPS.

The next step is to collect the displacement data and force data by the Python script :red:`extract.py` (also in the tools/ directory). This script can extract atomic displacements, atomic forces, and total energies from multiple output files as follows:

Expand All @@ -131,12 +124,6 @@ The next step is to collect the displacement data and force data by the Python s
$ python extract.py --xTAPP=si222.cg --get=disp *.str > disp.dat
$ python extract.py --xTAPP=si222.cg --get=force *.str > force.dat
**LAMMPS**
::

$ python extract.py --LAMMPS=si222.lammps --get=disp disp*.lammps > disp.dat
$ python extract.py --LAMMPS=si222.lammps --get=force FORCE.* > force.dat

In the above examples, atomic displacements of all the configurations are merged as *disp.dat*, and the corresponding atomic forces are saved in the file *force.dat*. These files will be used in the following fitting procedure as ``DFILE`` and ``FFILE``. (See :ref:`Format of DFILE and FFILE<label_format_DFILE>`).


Expand Down Expand Up @@ -230,8 +217,8 @@ For visualizing phonon dispersion relations, we provide a Python script :red:`pl

Then, the phonon dispersion is shown by a pop-up window as follows:

.. image:: ../img/si_phband.png
:scale: 60
.. image:: ../img/Si_phband_DFT.png
:scale: 40
:align: center

You can save the figure as png, eps, or other formats from this window.
Expand Down Expand Up @@ -263,8 +250,8 @@ The command

will show the phonon DOS of Si by a pop-up window:

.. image:: ../img/si_phdos.png
:scale: 60
.. image:: ../img/Si_phdos_DFT.png
:scale: 40
:align: center

To improve the resolution of DOS, try again with a denser :math:`k` grid and a smaller ``DELTA_E`` value.
Expand Down
3 changes: 2 additions & 1 deletion tools/plotband.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

# font styles
mpl.rc('font', **{'family': 'Times New Roman', 'sans-serif': ['Helvetica']})
mpl.rc('text', usetex=True)

# line colors and styles
color = ['b', 'g', 'r', 'm', 'k', 'c', 'y', 'r']
Expand Down Expand Up @@ -207,7 +208,7 @@ def get_xy_minmax(array):
ax.xaxis.grid(True, linestyle='-')

if options.print_key:
plt.legend(loc='lower right', prop={'size': 10})
plt.legend(loc='best', prop={'size': 10})

# plt.savefig('band_tmp.png', dpi=300, transparent=True)
plt.show()
9 changes: 5 additions & 4 deletions tools/plotdos.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,11 @@ def sum_atom_projected_dos(pdos_tmp, natoms_tmp):
counter_line += 1

if options.unitname.lower() == "mev":
plt.xlabel("Frequency (meV)", fontsize=16, labelpad=20)
plt.xlabel("Frequency (meV)", fontsize=16)
elif options.unitname.lower() == "thz":
plt.xlabel("Frequency (THz)", fontsize=16, labelpad=20)
plt.xlabel("Frequency (THz)", fontsize=16)
else:
plt.xlabel("Frequency (cm${}^{-1}$)", fontsize=16, labelpad=10)
plt.xlabel("Frequency (cm${}^{-1}$)", fontsize=16)

plt.ylabel("Phonon DOS", fontsize=16, labelpad=20)

Expand All @@ -214,5 +214,6 @@ def sum_atom_projected_dos(pdos_tmp, natoms_tmp):

if options.print_key:
plt.legend(loc='upper right', prop={'size': 12})


plt.tight_layout()
plt.show()

0 comments on commit b7cc3f9

Please sign in to comment.