├── .gitignore ├── LICENSE ├── MANIFEST.in ├── README.md ├── __init__.py ├── docs ├── Makefile ├── build │ ├── doctrees │ │ ├── environment.pickle │ │ ├── index.doctree │ │ ├── thermo.gpumd.doctree │ │ ├── thermo.lammps.doctree │ │ ├── thermo.shared.doctree │ │ └── thermo.tools.doctree │ └── html │ │ ├── .buildinfo │ │ ├── _modules │ │ ├── index.html │ │ └── thermo │ │ │ ├── gpumd │ │ │ ├── calc.html │ │ │ ├── data.html │ │ │ ├── io.html │ │ │ └── preproc.html │ │ │ ├── lammps │ │ │ ├── calc.html │ │ │ ├── data.html │ │ │ └── io.html │ │ │ ├── shared │ │ │ └── force.html │ │ │ └── tools │ │ │ └── lj.html │ │ ├── _sources │ │ ├── index.rst.txt │ │ ├── thermo.gpumd.rst.txt │ │ ├── thermo.lammps.rst.txt │ │ ├── thermo.shared.rst.txt │ │ └── thermo.tools.rst.txt │ │ ├── _static │ │ ├── basic.css │ │ ├── css │ │ │ ├── badge_only.css │ │ │ └── theme.css │ │ ├── doctools.js │ │ ├── documentation_options.js │ │ ├── file.png │ │ ├── fonts │ │ │ ├── Inconsolata-Bold.ttf │ │ │ ├── Inconsolata-Regular.ttf │ │ │ ├── Inconsolata.ttf │ │ │ ├── Lato-Bold.ttf │ │ │ ├── Lato-Regular.ttf │ │ │ ├── Lato │ │ │ │ ├── lato-bold.eot │ │ │ │ ├── lato-bold.ttf │ │ │ │ ├── lato-bold.woff │ │ │ │ ├── lato-bold.woff2 │ │ │ │ ├── lato-bolditalic.eot │ │ │ │ ├── lato-bolditalic.ttf │ │ │ │ ├── lato-bolditalic.woff │ │ │ │ ├── lato-bolditalic.woff2 │ │ │ │ ├── lato-italic.eot │ │ │ │ ├── lato-italic.ttf │ │ │ │ ├── lato-italic.woff │ │ │ │ ├── lato-italic.woff2 │ │ │ │ ├── lato-regular.eot │ │ │ │ ├── lato-regular.ttf │ │ │ │ ├── lato-regular.woff │ │ │ │ └── lato-regular.woff2 │ │ │ ├── RobotoSlab-Bold.ttf │ │ │ ├── RobotoSlab-Regular.ttf │ │ │ ├── RobotoSlab │ │ │ │ ├── roboto-slab-v7-bold.eot │ │ │ │ ├── roboto-slab-v7-bold.ttf │ │ │ │ ├── roboto-slab-v7-bold.woff │ │ │ │ ├── roboto-slab-v7-bold.woff2 │ │ │ │ ├── roboto-slab-v7-regular.eot │ │ │ │ ├── roboto-slab-v7-regular.ttf │ │ │ │ ├── roboto-slab-v7-regular.woff │ │ │ │ └── roboto-slab-v7-regular.woff2 │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.svg │ │ │ ├── fontawesome-webfont.ttf │ │ │ ├── fontawesome-webfont.woff │ │ │ └── fontawesome-webfont.woff2 │ │ ├── jquery-3.4.1.js │ │ ├── jquery.js │ │ ├── js │ │ │ ├── modernizr.min.js │ │ │ └── theme.js │ │ ├── language_data.js │ │ ├── minus.png │ │ ├── plus.png │ │ ├── pygments.css │ │ ├── searchtools.js │ │ ├── underscore-1.3.1.js │ │ └── underscore.js │ │ ├── genindex.html │ │ ├── index.html │ │ ├── objects.inv │ │ ├── py-modindex.html │ │ ├── search.html │ │ ├── searchindex.js │ │ ├── thermo.gpumd.html │ │ ├── thermo.lammps.html │ │ ├── thermo.shared.html │ │ └── thermo.tools.html ├── make.bat └── source │ ├── conf.py │ ├── index.rst │ ├── thermo.gpumd.rst │ ├── thermo.lammps.rst │ ├── thermo.shared.rst │ └── thermo.tools.rst ├── requirements.txt ├── setup.py └── thermo ├── __init__.py ├── data ├── UFF.params └── readme.md ├── gpumd ├── __init__.py ├── calc.py ├── common.py ├── data.py ├── io.py └── preproc.py ├── lammps ├── __init__.py ├── calc.py ├── data.py └── io.py ├── math ├── __init__.py └── correlate.py ├── shared ├── __init__.py └── force.py └── tools ├── __init__.py └── lj.py /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | .idea/ 3 | venv/ 4 | venv3/ 5 | test/ 6 | 7 | notebooks/\.ipynb_checkpoints/ 8 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Alexander Gabourie 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include thermo/data/UFF.params 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # thermo 2 | 3 | This repository is a collection of structure and data processing functions geared towards calculating thermal properties from molecular dynamics simulations. The code is primarily designed to interface with [GPUMD](https://github.com/brucefan1983/GPUMD) with some supporting [LAMMPS](https://lammps.sandia.gov/) code. 4 | 5 | As of now, the development of the code reflects my needs as a researcher and the interface with **GPUMD** is far from complete. The code is also subject to change drastically with **GPUMD** as we determine permanant **GPUMD** features/formats. The [releases](https://github.com/AlexGabourie/thermo/releases) page identifies which **GPUMD** release corresponds to each **thermo** release. 6 | 7 | # Documentation: 8 | 9 | The latest version of the documentation (matches master branch) can be found here: 10 | 11 | https://thermomd.readthedocs.io/en/latest/ 12 | 13 | Version specific documentation can be found in the release files by going to docs/build/html/. The index.html file is the root of the documentation. 14 | 15 | # Installation: 16 | 17 | The current version of *thermo* has been moved to Python3 recently. Please create an issue if there are any bugs. 18 | 19 | To install the most recent version, use the following command: 20 | 21 | pip install git+https://github.com/AlexGabourie/thermo.git 22 | 23 | This will install all of the dependencies and the thermo package in the virtual environment. 24 | 25 | ## Installation issues: 26 | - If pyfftw fails to install, run the following line to install it: 27 | 28 | sudo apt-get install libfftw3-dev libfftw3-doc 29 | 30 | - If you get an error like: 'Failed building wheel for subprocess32,' run the following: 31 | 32 | sudo apt-get install python-dev 33 | -------------------------------------------------------------------------------- /__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hityingph/thermo/08faef51ad4333e816cadf838a224773152421fc/__init__.py -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | SOURCEDIR = source 8 | BUILDDIR = build 9 | 10 | # Put it first so that "make" without argument is like "make help". 11 | help: 12 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 13 | 14 | .PHONY: help Makefile 15 | 16 | # Catch-all target: route all unknown targets to Sphinx using the new 17 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 18 | %: Makefile 19 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -------------------------------------------------------------------------------- /docs/build/doctrees/environment.pickle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hityingph/thermo/08faef51ad4333e816cadf838a224773152421fc/docs/build/doctrees/environment.pickle -------------------------------------------------------------------------------- /docs/build/doctrees/index.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hityingph/thermo/08faef51ad4333e816cadf838a224773152421fc/docs/build/doctrees/index.doctree -------------------------------------------------------------------------------- /docs/build/doctrees/thermo.gpumd.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hityingph/thermo/08faef51ad4333e816cadf838a224773152421fc/docs/build/doctrees/thermo.gpumd.doctree -------------------------------------------------------------------------------- /docs/build/doctrees/thermo.lammps.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hityingph/thermo/08faef51ad4333e816cadf838a224773152421fc/docs/build/doctrees/thermo.lammps.doctree -------------------------------------------------------------------------------- /docs/build/doctrees/thermo.shared.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hityingph/thermo/08faef51ad4333e816cadf838a224773152421fc/docs/build/doctrees/thermo.shared.doctree -------------------------------------------------------------------------------- /docs/build/doctrees/thermo.tools.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hityingph/thermo/08faef51ad4333e816cadf838a224773152421fc/docs/build/doctrees/thermo.tools.doctree -------------------------------------------------------------------------------- /docs/build/html/.buildinfo: -------------------------------------------------------------------------------- 1 | # Sphinx build info version 1 2 | # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. 3 | config: 2355d0b1fa9ea7783a92e37a89cba092 4 | tags: 645f666f9bcd5a90fca523b33c5a78b7 5 | -------------------------------------------------------------------------------- /docs/build/html/_modules/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Overview: module code — thermo documentation 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 |
44 | 45 | 93 | 94 |
95 | 96 | 97 | 103 | 104 | 105 |
106 | 107 |
108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 |
126 | 127 |
    128 | 129 |
  • Docs »
  • 130 | 131 |
  • Overview: module code
  • 132 | 133 | 134 |
  • 135 | 136 |
  • 137 | 138 |
139 | 140 | 141 |
142 |
143 |
144 |
145 | 146 |

All modules for which code is available

147 | 157 | 158 |
159 | 160 |
161 | 175 | 176 |
177 |
178 | 179 |
180 | 181 |
182 | 183 | 184 | 185 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | -------------------------------------------------------------------------------- /docs/build/html/_modules/thermo/lammps/io.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | thermo.lammps.io — thermo documentation 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 |
44 | 45 | 93 | 94 |
95 | 96 | 97 | 103 | 104 | 105 |
106 | 107 |
108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 |
126 | 127 |
    128 | 129 |
  • Docs »
  • 130 | 131 |
  • Module code »
  • 132 | 133 |
  • thermo.lammps.io
  • 134 | 135 | 136 |
  • 137 | 138 |
  • 139 | 140 |
141 | 142 | 143 |
144 |
145 |
146 |
147 | 148 |

Source code for thermo.lammps.io

149 | import atomman
150 | from ase import Atom
151 | 
152 | __author__ = "Alexander Gabourie"
153 | __email__ = "gabourie@stanford.edu"
154 | 
155 | 
156 | 
[docs]def ase_atoms_to_lammps(atoms, out_file='atoms.data', add_masses=True): 157 | """ 158 | Converts ASE atoms to a lammps data file. 159 | 160 | Args: 161 | atoms (ase.Atoms): 162 | Atoms to write to lammps data file 163 | 164 | out_file (str): 165 | File to save the structure data to 166 | 167 | add_masses (Bool): 168 | Determines if atom masses are written to data file 169 | 170 | """ 171 | sys = atomman.load_ase_Atoms(atoms) 172 | elem = sys.symbols 173 | # write data file 174 | atomman.dump_atom_data(sys, out_file) 175 | 176 | if add_masses: 177 | # Write block of string for mass inclusion 178 | mass_str = 'Masses\n\n' 179 | for i, element in enumerate(elem): 180 | mass_str += '{} {}\n'.format(str(i + 1), str(Atom(element).mass)) 181 | 182 | mass_str += '\n' 183 | 184 | # add the mass string to the correct part of the datafile 185 | with open(out_file, 'r') as f: 186 | lines = f.readlines() 187 | 188 | for i, line in enumerate(lines): 189 | if 'Atoms' in line: 190 | break 191 | 192 | lines.insert(len(lines)-1, mass_str) 193 | 194 | with open(out_file, 'w') as f: 195 | f.write(''.join(lines))
196 |
197 | 198 |
199 | 200 |
201 | 215 | 216 |
217 |
218 | 219 |
220 | 221 |
222 | 223 | 224 | 225 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | -------------------------------------------------------------------------------- /docs/build/html/_sources/index.rst.txt: -------------------------------------------------------------------------------- 1 | thermo - A GPUMD Helper Package 2 | =========================================== 3 | 4 | The thermo, or `thermo`_, package is a set of `Python`_ tools to interface with the molecular dynamics (MD) simulator `GPUMD`_ (and `LAMMPS`_ for comparison) for the purpose of thermodynamic simulations (i.e. thermal conductivity). 5 | 6 | Currently, the functionality is limited as it serves specific research purposes at this time; however, the long-term plan is to make this package to primarily serve `GPUMD`_ with only minor supporting functions for `LAMMPS`_ for the purpose of checking force-consistency between the simulators. 7 | 8 | The documenation is produced and maintained by `Alex Gabourie `_ at Stanford University. It outlines the structure and usage of the `thermo`_ package. 9 | 10 | Documentation 11 | ------------- 12 | 13 | | This package contains four subpackages: 14 | | 1. **gpumd** : Python interface specific to `GPUMD`_. 15 | | 2. **lammps** : Python interface specific to `LAMMPS`_. 16 | | 3. **shared** : Used strictly to compare `GPUMD`_ and `LAMMPS`_. 17 | | 4. **tools** : Extra support for more general MD related content. 18 | 19 | .. 20 | Subpackages 21 | ----------- 22 | 23 | .. toctree:: 24 | 25 | thermo.gpumd 26 | thermo.lammps 27 | thermo.shared 28 | thermo.tools 29 | 30 | .. 31 | Module contents 32 | --------------- 33 | 34 | .. automodule:: thermo 35 | :members: 36 | :undoc-members: 37 | :show-inheritance: 38 | 39 | .. _thermo: https://github.com/AlexGabourie/thermo 40 | .. _GPUMD: https://github.com/brucefan1983/GPUMD 41 | .. _LAMMPS: https://lammps.sandia.gov/ 42 | .. _Python: https://www.python.org/ 43 | 44 | 45 | * :ref:`genindex` 46 | 47 | .. * :ref:`modindex` 48 | .. * :ref:`search` 49 | -------------------------------------------------------------------------------- /docs/build/html/_sources/thermo.gpumd.rst.txt: -------------------------------------------------------------------------------- 1 | gpumd 2 | ==================== 3 | 4 | .. 5 | Submodules 6 | ---------- 7 | 8 | Calculations 9 | ------------------------ 10 | 11 | .. automodule:: thermo.gpumd.calc 12 | :members: 13 | :undoc-members: 14 | :show-inheritance: 15 | 16 | Data Loaders 17 | ------------------------ 18 | 19 | .. automodule:: thermo.gpumd.data 20 | :members: 21 | :undoc-members: 22 | :show-inheritance: 23 | 24 | Input/Output 25 | ---------------------- 26 | 27 | .. automodule:: thermo.gpumd.io 28 | :members: 29 | :undoc-members: 30 | :show-inheritance: 31 | 32 | Preprocessing 33 | --------------------------- 34 | 35 | .. automodule:: thermo.gpumd.preproc 36 | :members: 37 | :undoc-members: 38 | :show-inheritance: 39 | 40 | 41 | .. 42 | Module contents 43 | --------------- 44 | 45 | .. automodule:: thermo.gpumd 46 | :members: 47 | :undoc-members: 48 | :show-inheritance: 49 | -------------------------------------------------------------------------------- /docs/build/html/_sources/thermo.lammps.rst.txt: -------------------------------------------------------------------------------- 1 | lammps 2 | ===================== 3 | 4 | .. 5 | Submodules 6 | ---------- 7 | 8 | thermo.lammps.calc module 9 | ------------------------- 10 | 11 | Calculations 12 | ------------------------- 13 | 14 | .. automodule:: thermo.lammps.calc 15 | :members: 16 | :undoc-members: 17 | :show-inheritance: 18 | 19 | Data Loaders 20 | ------------------------- 21 | 22 | .. automodule:: thermo.lammps.data 23 | :members: 24 | :undoc-members: 25 | :show-inheritance: 26 | 27 | Input/Output 28 | ----------------------- 29 | 30 | .. automodule:: thermo.lammps.io 31 | :members: 32 | :undoc-members: 33 | :show-inheritance: 34 | 35 | .. 36 | Module contents 37 | --------------- 38 | 39 | .. automodule:: thermo.lammps 40 | :members: 41 | :undoc-members: 42 | :show-inheritance: 43 | -------------------------------------------------------------------------------- /docs/build/html/_sources/thermo.shared.rst.txt: -------------------------------------------------------------------------------- 1 | shared 2 | ===================== 3 | 4 | .. 5 | Submodules 6 | ---------- 7 | 8 | Force Comparison 9 | -------------------------- 10 | 11 | .. automodule:: thermo.shared.force 12 | :members: 13 | :undoc-members: 14 | :show-inheritance: 15 | 16 | .. 17 | Module contents 18 | --------------- 19 | 20 | .. automodule:: thermo.shared 21 | :members: 22 | :undoc-members: 23 | :show-inheritance: 24 | -------------------------------------------------------------------------------- /docs/build/html/_sources/thermo.tools.rst.txt: -------------------------------------------------------------------------------- 1 | tools 2 | ===================== 3 | 4 | .. 5 | Submodules 6 | ---------- 7 | 8 | Lennard Jones 9 | -------------------------- 10 | 11 | .. automodule:: thermo.tools.lj 12 | :members: 13 | :undoc-members: 14 | :show-inheritance: 15 | 16 | .. 17 | Module contents 18 | --------------- 19 | 20 | .. automodule:: thermo.shared 21 | :members: 22 | :undoc-members: 23 | :show-inheritance: 24 | -------------------------------------------------------------------------------- /docs/build/html/_static/css/badge_only.css: -------------------------------------------------------------------------------- 1 | .fa:before{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:""}.clearfix:after{clear:both}@font-face{font-family:FontAwesome;font-weight:normal;font-style:normal;src:url("../fonts/fontawesome-webfont.eot");src:url("../fonts/fontawesome-webfont.eot?#iefix") format("embedded-opentype"),url("../fonts/fontawesome-webfont.woff") format("woff"),url("../fonts/fontawesome-webfont.ttf") format("truetype"),url("../fonts/fontawesome-webfont.svg#FontAwesome") format("svg")}.fa:before{display:inline-block;font-family:FontAwesome;font-style:normal;font-weight:normal;line-height:1;text-decoration:inherit}a .fa{display:inline-block;text-decoration:inherit}li .fa{display:inline-block}li .fa-large:before,li .fa-large:before{width:1.875em}ul.fas{list-style-type:none;margin-left:2em;text-indent:-0.8em}ul.fas li .fa{width:.8em}ul.fas li .fa-large:before,ul.fas li .fa-large:before{vertical-align:baseline}.fa-book:before{content:""}.icon-book:before{content:""}.fa-caret-down:before{content:""}.icon-caret-down:before{content:""}.fa-caret-up:before{content:""}.icon-caret-up:before{content:""}.fa-caret-left:before{content:""}.icon-caret-left:before{content:""}.fa-caret-right:before{content:""}.icon-caret-right:before{content:""}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;z-index:400}.rst-versions a{color:#2980B9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27AE60;*zoom:1}.rst-versions .rst-current-version:before,.rst-versions .rst-current-version:after{display:table;content:""}.rst-versions .rst-current-version:after{clear:both}.rst-versions .rst-current-version .fa{color:#fcfcfc}.rst-versions .rst-current-version .fa-book{float:left}.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#E74C3C;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#F1C40F;color:#000}.rst-versions.shift-up{height:auto;max-height:100%;overflow-y:scroll}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:gray;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:solid 1px #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px;max-height:90%}.rst-versions.rst-badge .icon-book{float:none}.rst-versions.rst-badge .fa-book{float:none}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book{float:left}.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge .rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width: 768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}} 2 | -------------------------------------------------------------------------------- /docs/build/html/_static/doctools.js: -------------------------------------------------------------------------------- 1 | /* 2 | * doctools.js 3 | * ~~~~~~~~~~~ 4 | * 5 | * Sphinx JavaScript utilities for all documentation. 6 | * 7 | * :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | 12 | /** 13 | * select a different prefix for underscore 14 | */ 15 | $u = _.noConflict(); 16 | 17 | /** 18 | * make the code below compatible with browsers without 19 | * an installed firebug like debugger 20 | if (!window.console || !console.firebug) { 21 | var names = ["log", "debug", "info", "warn", "error", "assert", "dir", 22 | "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", 23 | "profile", "profileEnd"]; 24 | window.console = {}; 25 | for (var i = 0; i < names.length; ++i) 26 | window.console[names[i]] = function() {}; 27 | } 28 | */ 29 | 30 | /** 31 | * small helper function to urldecode strings 32 | */ 33 | jQuery.urldecode = function(x) { 34 | return decodeURIComponent(x).replace(/\+/g, ' '); 35 | }; 36 | 37 | /** 38 | * small helper function to urlencode strings 39 | */ 40 | jQuery.urlencode = encodeURIComponent; 41 | 42 | /** 43 | * This function returns the parsed url parameters of the 44 | * current request. Multiple values per key are supported, 45 | * it will always return arrays of strings for the value parts. 46 | */ 47 | jQuery.getQueryParameters = function(s) { 48 | if (typeof s === 'undefined') 49 | s = document.location.search; 50 | var parts = s.substr(s.indexOf('?') + 1).split('&'); 51 | var result = {}; 52 | for (var i = 0; i < parts.length; i++) { 53 | var tmp = parts[i].split('=', 2); 54 | var key = jQuery.urldecode(tmp[0]); 55 | var value = jQuery.urldecode(tmp[1]); 56 | if (key in result) 57 | result[key].push(value); 58 | else 59 | result[key] = [value]; 60 | } 61 | return result; 62 | }; 63 | 64 | /** 65 | * highlight a given string on a jquery object by wrapping it in 66 | * span elements with the given class name. 67 | */ 68 | jQuery.fn.highlightText = function(text, className) { 69 | function highlight(node, addItems) { 70 | if (node.nodeType === 3) { 71 | var val = node.nodeValue; 72 | var pos = val.toLowerCase().indexOf(text); 73 | if (pos >= 0 && 74 | !jQuery(node.parentNode).hasClass(className) && 75 | !jQuery(node.parentNode).hasClass("nohighlight")) { 76 | var span; 77 | var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg"); 78 | if (isInSVG) { 79 | span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); 80 | } else { 81 | span = document.createElement("span"); 82 | span.className = className; 83 | } 84 | span.appendChild(document.createTextNode(val.substr(pos, text.length))); 85 | node.parentNode.insertBefore(span, node.parentNode.insertBefore( 86 | document.createTextNode(val.substr(pos + text.length)), 87 | node.nextSibling)); 88 | node.nodeValue = val.substr(0, pos); 89 | if (isInSVG) { 90 | var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect"); 91 | var bbox = node.parentElement.getBBox(); 92 | rect.x.baseVal.value = bbox.x; 93 | rect.y.baseVal.value = bbox.y; 94 | rect.width.baseVal.value = bbox.width; 95 | rect.height.baseVal.value = bbox.height; 96 | rect.setAttribute('class', className); 97 | addItems.push({ 98 | "parent": node.parentNode, 99 | "target": rect}); 100 | } 101 | } 102 | } 103 | else if (!jQuery(node).is("button, select, textarea")) { 104 | jQuery.each(node.childNodes, function() { 105 | highlight(this, addItems); 106 | }); 107 | } 108 | } 109 | var addItems = []; 110 | var result = this.each(function() { 111 | highlight(this, addItems); 112 | }); 113 | for (var i = 0; i < addItems.length; ++i) { 114 | jQuery(addItems[i].parent).before(addItems[i].target); 115 | } 116 | return result; 117 | }; 118 | 119 | /* 120 | * backward compatibility for jQuery.browser 121 | * This will be supported until firefox bug is fixed. 122 | */ 123 | if (!jQuery.browser) { 124 | jQuery.uaMatch = function(ua) { 125 | ua = ua.toLowerCase(); 126 | 127 | var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || 128 | /(webkit)[ \/]([\w.]+)/.exec(ua) || 129 | /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || 130 | /(msie) ([\w.]+)/.exec(ua) || 131 | ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || 132 | []; 133 | 134 | return { 135 | browser: match[ 1 ] || "", 136 | version: match[ 2 ] || "0" 137 | }; 138 | }; 139 | jQuery.browser = {}; 140 | jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true; 141 | } 142 | 143 | /** 144 | * Small JavaScript module for the documentation. 145 | */ 146 | var Documentation = { 147 | 148 | init : function() { 149 | this.fixFirefoxAnchorBug(); 150 | this.highlightSearchWords(); 151 | this.initIndexTable(); 152 | if (DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) { 153 | this.initOnKeyListeners(); 154 | } 155 | }, 156 | 157 | /** 158 | * i18n support 159 | */ 160 | TRANSLATIONS : {}, 161 | PLURAL_EXPR : function(n) { return n === 1 ? 0 : 1; }, 162 | LOCALE : 'unknown', 163 | 164 | // gettext and ngettext don't access this so that the functions 165 | // can safely bound to a different name (_ = Documentation.gettext) 166 | gettext : function(string) { 167 | var translated = Documentation.TRANSLATIONS[string]; 168 | if (typeof translated === 'undefined') 169 | return string; 170 | return (typeof translated === 'string') ? translated : translated[0]; 171 | }, 172 | 173 | ngettext : function(singular, plural, n) { 174 | var translated = Documentation.TRANSLATIONS[singular]; 175 | if (typeof translated === 'undefined') 176 | return (n == 1) ? singular : plural; 177 | return translated[Documentation.PLURALEXPR(n)]; 178 | }, 179 | 180 | addTranslations : function(catalog) { 181 | for (var key in catalog.messages) 182 | this.TRANSLATIONS[key] = catalog.messages[key]; 183 | this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); 184 | this.LOCALE = catalog.locale; 185 | }, 186 | 187 | /** 188 | * add context elements like header anchor links 189 | */ 190 | addContextElements : function() { 191 | $('div[id] > :header:first').each(function() { 192 | $('\u00B6'). 193 | attr('href', '#' + this.id). 194 | attr('title', _('Permalink to this headline')). 195 | appendTo(this); 196 | }); 197 | $('dt[id]').each(function() { 198 | $('\u00B6'). 199 | attr('href', '#' + this.id). 200 | attr('title', _('Permalink to this definition')). 201 | appendTo(this); 202 | }); 203 | }, 204 | 205 | /** 206 | * workaround a firefox stupidity 207 | * see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075 208 | */ 209 | fixFirefoxAnchorBug : function() { 210 | if (document.location.hash && $.browser.mozilla) 211 | window.setTimeout(function() { 212 | document.location.href += ''; 213 | }, 10); 214 | }, 215 | 216 | /** 217 | * highlight the search words provided in the url in the text 218 | */ 219 | highlightSearchWords : function() { 220 | var params = $.getQueryParameters(); 221 | var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; 222 | if (terms.length) { 223 | var body = $('div.body'); 224 | if (!body.length) { 225 | body = $('body'); 226 | } 227 | window.setTimeout(function() { 228 | $.each(terms, function() { 229 | body.highlightText(this.toLowerCase(), 'highlighted'); 230 | }); 231 | }, 10); 232 | $('') 234 | .appendTo($('#searchbox')); 235 | } 236 | }, 237 | 238 | /** 239 | * init the domain index toggle buttons 240 | */ 241 | initIndexTable : function() { 242 | var togglers = $('img.toggler').click(function() { 243 | var src = $(this).attr('src'); 244 | var idnum = $(this).attr('id').substr(7); 245 | $('tr.cg-' + idnum).toggle(); 246 | if (src.substr(-9) === 'minus.png') 247 | $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); 248 | else 249 | $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); 250 | }).css('display', ''); 251 | if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { 252 | togglers.click(); 253 | } 254 | }, 255 | 256 | /** 257 | * helper function to hide the search marks again 258 | */ 259 | hideSearchWords : function() { 260 | $('#searchbox .highlight-link').fadeOut(300); 261 | $('span.highlighted').removeClass('highlighted'); 262 | }, 263 | 264 | /** 265 | * make the url absolute 266 | */ 267 | makeURL : function(relativeURL) { 268 | return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; 269 | }, 270 | 271 | /** 272 | * get the current relative url 273 | */ 274 | getCurrentURL : function() { 275 | var path = document.location.pathname; 276 | var parts = path.split(/\//); 277 | $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { 278 | if (this === '..') 279 | parts.pop(); 280 | }); 281 | var url = parts.join('/'); 282 | return path.substring(url.lastIndexOf('/') + 1, path.length - 1); 283 | }, 284 | 285 | initOnKeyListeners: function() { 286 | $(document).keyup(function(event) { 287 | var activeElementType = document.activeElement.tagName; 288 | // don't navigate when in search box or textarea 289 | if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT') { 290 | switch (event.keyCode) { 291 | case 37: // left 292 | var prevHref = $('link[rel="prev"]').prop('href'); 293 | if (prevHref) { 294 | window.location.href = prevHref; 295 | return false; 296 | } 297 | case 39: // right 298 | var nextHref = $('link[rel="next"]').prop('href'); 299 | if (nextHref) { 300 | window.location.href = nextHref; 301 | return false; 302 | } 303 | } 304 | } 305 | }); 306 | } 307 | }; 308 | 309 | // quick alias for translations 310 | _ = Documentation.gettext; 311 | 312 | $(document).ready(function() { 313 | Documentation.init(); 314 | }); 315 | -------------------------------------------------------------------------------- /docs/build/html/_static/documentation_options.js: -------------------------------------------------------------------------------- 1 | var DOCUMENTATION_OPTIONS = { 2 | URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), 3 | VERSION: '', 4 | LANGUAGE: 'None', 5 | COLLAPSE_INDEX: false, 6 | FILE_SUFFIX: '.html', 7 | HAS_SOURCE: true, 8 | SOURCELINK_SUFFIX: '.txt', 9 | NAVIGATION_WITH_KEYS: false 10 | }; -------------------------------------------------------------------------------- /docs/build/html/_static/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hityingph/thermo/08faef51ad4333e816cadf838a224773152421fc/docs/build/html/_static/file.png -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/Inconsolata-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hityingph/thermo/08faef51ad4333e816cadf838a224773152421fc/docs/build/html/_static/fonts/Inconsolata-Bold.ttf -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/Inconsolata-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hityingph/thermo/08faef51ad4333e816cadf838a224773152421fc/docs/build/html/_static/fonts/Inconsolata-Regular.ttf -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/Inconsolata.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hityingph/thermo/08faef51ad4333e816cadf838a224773152421fc/docs/build/html/_static/fonts/Inconsolata.ttf -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/Lato-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hityingph/thermo/08faef51ad4333e816cadf838a224773152421fc/docs/build/html/_static/fonts/Lato-Bold.ttf -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/Lato-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hityingph/thermo/08faef51ad4333e816cadf838a224773152421fc/docs/build/html/_static/fonts/Lato-Regular.ttf -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/Lato/lato-bold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hityingph/thermo/08faef51ad4333e816cadf838a224773152421fc/docs/build/html/_static/fonts/Lato/lato-bold.eot -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/Lato/lato-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hityingph/thermo/08faef51ad4333e816cadf838a224773152421fc/docs/build/html/_static/fonts/Lato/lato-bold.ttf -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/Lato/lato-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hityingph/thermo/08faef51ad4333e816cadf838a224773152421fc/docs/build/html/_static/fonts/Lato/lato-bold.woff -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/Lato/lato-bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hityingph/thermo/08faef51ad4333e816cadf838a224773152421fc/docs/build/html/_static/fonts/Lato/lato-bold.woff2 -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/Lato/lato-bolditalic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hityingph/thermo/08faef51ad4333e816cadf838a224773152421fc/docs/build/html/_static/fonts/Lato/lato-bolditalic.eot -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/Lato/lato-bolditalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hityingph/thermo/08faef51ad4333e816cadf838a224773152421fc/docs/build/html/_static/fonts/Lato/lato-bolditalic.ttf -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/Lato/lato-bolditalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hityingph/thermo/08faef51ad4333e816cadf838a224773152421fc/docs/build/html/_static/fonts/Lato/lato-bolditalic.woff -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/Lato/lato-bolditalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hityingph/thermo/08faef51ad4333e816cadf838a224773152421fc/docs/build/html/_static/fonts/Lato/lato-bolditalic.woff2 -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/Lato/lato-italic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hityingph/thermo/08faef51ad4333e816cadf838a224773152421fc/docs/build/html/_static/fonts/Lato/lato-italic.eot -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/Lato/lato-italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hityingph/thermo/08faef51ad4333e816cadf838a224773152421fc/docs/build/html/_static/fonts/Lato/lato-italic.ttf -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/Lato/lato-italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hityingph/thermo/08faef51ad4333e816cadf838a224773152421fc/docs/build/html/_static/fonts/Lato/lato-italic.woff -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/Lato/lato-italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hityingph/thermo/08faef51ad4333e816cadf838a224773152421fc/docs/build/html/_static/fonts/Lato/lato-italic.woff2 -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/Lato/lato-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hityingph/thermo/08faef51ad4333e816cadf838a224773152421fc/docs/build/html/_static/fonts/Lato/lato-regular.eot -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/Lato/lato-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hityingph/thermo/08faef51ad4333e816cadf838a224773152421fc/docs/build/html/_static/fonts/Lato/lato-regular.ttf -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/Lato/lato-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hityingph/thermo/08faef51ad4333e816cadf838a224773152421fc/docs/build/html/_static/fonts/Lato/lato-regular.woff -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/Lato/lato-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hityingph/thermo/08faef51ad4333e816cadf838a224773152421fc/docs/build/html/_static/fonts/Lato/lato-regular.woff2 -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/RobotoSlab-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hityingph/thermo/08faef51ad4333e816cadf838a224773152421fc/docs/build/html/_static/fonts/RobotoSlab-Bold.ttf -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/RobotoSlab-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hityingph/thermo/08faef51ad4333e816cadf838a224773152421fc/docs/build/html/_static/fonts/RobotoSlab-Regular.ttf -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hityingph/thermo/08faef51ad4333e816cadf838a224773152421fc/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hityingph/thermo/08faef51ad4333e816cadf838a224773152421fc/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hityingph/thermo/08faef51ad4333e816cadf838a224773152421fc/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hityingph/thermo/08faef51ad4333e816cadf838a224773152421fc/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2 -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hityingph/thermo/08faef51ad4333e816cadf838a224773152421fc/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hityingph/thermo/08faef51ad4333e816cadf838a224773152421fc/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hityingph/thermo/08faef51ad4333e816cadf838a224773152421fc/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hityingph/thermo/08faef51ad4333e816cadf838a224773152421fc/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2 -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hityingph/thermo/08faef51ad4333e816cadf838a224773152421fc/docs/build/html/_static/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hityingph/thermo/08faef51ad4333e816cadf838a224773152421fc/docs/build/html/_static/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hityingph/thermo/08faef51ad4333e816cadf838a224773152421fc/docs/build/html/_static/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hityingph/thermo/08faef51ad4333e816cadf838a224773152421fc/docs/build/html/_static/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /docs/build/html/_static/js/modernizr.min.js: -------------------------------------------------------------------------------- 1 | /* Modernizr 2.6.2 (Custom Build) | MIT & BSD 2 | * Build: http://modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-flexbox-hsla-multiplebgs-opacity-rgba-textshadow-cssanimations-csscolumns-generatedcontent-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-applicationcache-canvas-canvastext-draganddrop-hashchange-history-audio-video-indexeddb-input-inputtypes-localstorage-postmessage-sessionstorage-websockets-websqldatabase-webworkers-geolocation-inlinesvg-smil-svg-svgclippaths-touch-webgl-shiv-mq-cssclasses-addtest-prefixed-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-load 3 | */ 4 | ;window.Modernizr=function(a,b,c){function D(a){j.cssText=a}function E(a,b){return D(n.join(a+";")+(b||""))}function F(a,b){return typeof a===b}function G(a,b){return!!~(""+a).indexOf(b)}function H(a,b){for(var d in a){var e=a[d];if(!G(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function I(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:F(f,"function")?f.bind(d||b):f}return!1}function J(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+p.join(d+" ")+d).split(" ");return F(b,"string")||F(b,"undefined")?H(e,b):(e=(a+" "+q.join(d+" ")+d).split(" "),I(e,b,c))}function K(){e.input=function(c){for(var d=0,e=c.length;d',a,""].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},z=function(b){var c=a.matchMedia||a.msMatchMedia;if(c)return c(b).matches;var d;return y("@media "+b+" { #"+h+" { position: absolute; } }",function(b){d=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle)["position"]=="absolute"}),d},A=function(){function d(d,e){e=e||b.createElement(a[d]||"div"),d="on"+d;var f=d in e;return f||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(d,""),f=F(e[d],"function"),F(e[d],"undefined")||(e[d]=c),e.removeAttribute(d))),e=null,f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),B={}.hasOwnProperty,C;!F(B,"undefined")&&!F(B.call,"undefined")?C=function(a,b){return B.call(a,b)}:C=function(a,b){return b in a&&F(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=w.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(w.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(w.call(arguments)))};return e}),s.flexbox=function(){return J("flexWrap")},s.canvas=function(){var a=b.createElement("canvas");return!!a.getContext&&!!a.getContext("2d")},s.canvastext=function(){return!!e.canvas&&!!F(b.createElement("canvas").getContext("2d").fillText,"function")},s.webgl=function(){return!!a.WebGLRenderingContext},s.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:y(["@media (",n.join("touch-enabled),("),h,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c},s.geolocation=function(){return"geolocation"in navigator},s.postmessage=function(){return!!a.postMessage},s.websqldatabase=function(){return!!a.openDatabase},s.indexedDB=function(){return!!J("indexedDB",a)},s.hashchange=function(){return A("hashchange",a)&&(b.documentMode===c||b.documentMode>7)},s.history=function(){return!!a.history&&!!history.pushState},s.draganddrop=function(){var a=b.createElement("div");return"draggable"in a||"ondragstart"in a&&"ondrop"in a},s.websockets=function(){return"WebSocket"in a||"MozWebSocket"in a},s.rgba=function(){return D("background-color:rgba(150,255,150,.5)"),G(j.backgroundColor,"rgba")},s.hsla=function(){return D("background-color:hsla(120,40%,100%,.5)"),G(j.backgroundColor,"rgba")||G(j.backgroundColor,"hsla")},s.multiplebgs=function(){return D("background:url(https://),url(https://),red url(https://)"),/(url\s*\(.*?){3}/.test(j.background)},s.backgroundsize=function(){return J("backgroundSize")},s.borderimage=function(){return J("borderImage")},s.borderradius=function(){return J("borderRadius")},s.boxshadow=function(){return J("boxShadow")},s.textshadow=function(){return b.createElement("div").style.textShadow===""},s.opacity=function(){return E("opacity:.55"),/^0.55$/.test(j.opacity)},s.cssanimations=function(){return J("animationName")},s.csscolumns=function(){return J("columnCount")},s.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";return D((a+"-webkit- ".split(" ").join(b+a)+n.join(c+a)).slice(0,-a.length)),G(j.backgroundImage,"gradient")},s.cssreflections=function(){return J("boxReflect")},s.csstransforms=function(){return!!J("transform")},s.csstransforms3d=function(){var a=!!J("perspective");return a&&"webkitPerspective"in g.style&&y("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(b,c){a=b.offsetLeft===9&&b.offsetHeight===3}),a},s.csstransitions=function(){return J("transition")},s.fontface=function(){var a;return y('@font-face {font-family:"font";src:url("https://")}',function(c,d){var e=b.getElementById("smodernizr"),f=e.sheet||e.styleSheet,g=f?f.cssRules&&f.cssRules[0]?f.cssRules[0].cssText:f.cssText||"":"";a=/src/i.test(g)&&g.indexOf(d.split(" ")[0])===0}),a},s.generatedcontent=function(){var a;return y(["#",h,"{font:0/0 a}#",h,':after{content:"',l,'";visibility:hidden;font:3px/1 a}'].join(""),function(b){a=b.offsetHeight>=3}),a},s.video=function(){var a=b.createElement("video"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),c.h264=a.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")}catch(d){}return c},s.audio=function(){var a=b.createElement("audio"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),c.mp3=a.canPlayType("audio/mpeg;").replace(/^no$/,""),c.wav=a.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),c.m4a=(a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;")).replace(/^no$/,"")}catch(d){}return c},s.localstorage=function(){try{return localStorage.setItem(h,h),localStorage.removeItem(h),!0}catch(a){return!1}},s.sessionstorage=function(){try{return sessionStorage.setItem(h,h),sessionStorage.removeItem(h),!0}catch(a){return!1}},s.webworkers=function(){return!!a.Worker},s.applicationcache=function(){return!!a.applicationCache},s.svg=function(){return!!b.createElementNS&&!!b.createElementNS(r.svg,"svg").createSVGRect},s.inlinesvg=function(){var a=b.createElement("div");return a.innerHTML="",(a.firstChild&&a.firstChild.namespaceURI)==r.svg},s.smil=function(){return!!b.createElementNS&&/SVGAnimate/.test(m.call(b.createElementNS(r.svg,"animate")))},s.svgclippaths=function(){return!!b.createElementNS&&/SVGClipPath/.test(m.call(b.createElementNS(r.svg,"clipPath")))};for(var L in s)C(s,L)&&(x=L.toLowerCase(),e[x]=s[L](),v.push((e[x]?"":"no-")+x));return e.input||K(),e.addTest=function(a,b){if(typeof a=="object")for(var d in a)C(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},D(""),i=k=null,function(a,b){function k(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function l(){var a=r.elements;return typeof a=="string"?a.split(" "):a}function m(a){var b=i[a[g]];return b||(b={},h++,a[g]=h,i[h]=b),b}function n(a,c,f){c||(c=b);if(j)return c.createElement(a);f||(f=m(c));var g;return f.cache[a]?g=f.cache[a].cloneNode():e.test(a)?g=(f.cache[a]=f.createElem(a)).cloneNode():g=f.createElem(a),g.canHaveChildren&&!d.test(a)?f.frag.appendChild(g):g}function o(a,c){a||(a=b);if(j)return a.createDocumentFragment();c=c||m(a);var d=c.frag.cloneNode(),e=0,f=l(),g=f.length;for(;e",f="hidden"in a,j=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){f=!0,j=!0}})();var r={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,supportsUnknownElements:j,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:q,createElement:n,createDocumentFragment:o};a.html5=r,q(b)}(this,b),e._version=d,e._prefixes=n,e._domPrefixes=q,e._cssomPrefixes=p,e.mq=z,e.hasEvent=A,e.testProp=function(a){return H([a])},e.testAllProps=J,e.testStyles=y,e.prefixed=function(a,b,c){return b?J(a,b,c):J(a,"pfx")},g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+v.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f"),i("table.docutils.footnote").wrap("
"),i("table.docutils.citation").wrap("
"),i(".wy-menu-vertical ul").not(".simple").siblings("a").each(function(){var e=i(this);expand=i(''),expand.on("click",function(n){return t.toggleCurrent(e),n.stopPropagation(),!1}),e.prepend(expand)})},reset:function(){var n=encodeURI(window.location.hash)||"#";try{var e=$(".wy-menu-vertical"),i=e.find('[href="'+n+'"]');if(0===i.length){var t=$('.document [id="'+n.substring(1)+'"]').closest("div.section");0===(i=e.find('[href="#'+t.attr("id")+'"]')).length&&(i=e.find('[href="#"]'))}0this.docHeight||(this.navBar.scrollTop(i),this.winPosition=n)},onResize:function(){this.winResize=!1,this.winHeight=this.win.height(),this.docHeight=$(document).height()},hashChange:function(){this.linkScroll=!0,this.win.one("hashchange",function(){this.linkScroll=!1})},toggleCurrent:function(n){var e=n.closest("li");e.siblings("li.current").removeClass("current"),e.siblings().find("li.current").removeClass("current"),e.find("> ul li.current").removeClass("current"),e.toggleClass("current")}},"undefined"!=typeof window&&(window.SphinxRtdTheme={Navigation:e.exports.ThemeNav,StickyNav:e.exports.ThemeNav}),function(){for(var r=0,n=["ms","moz","webkit","o"],e=0;e0 62 | var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1 63 | var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1 64 | var s_v = "^(" + C + ")?" + v; // vowel in stem 65 | 66 | this.stemWord = function (w) { 67 | var stem; 68 | var suffix; 69 | var firstch; 70 | var origword = w; 71 | 72 | if (w.length < 3) 73 | return w; 74 | 75 | var re; 76 | var re2; 77 | var re3; 78 | var re4; 79 | 80 | firstch = w.substr(0,1); 81 | if (firstch == "y") 82 | w = firstch.toUpperCase() + w.substr(1); 83 | 84 | // Step 1a 85 | re = /^(.+?)(ss|i)es$/; 86 | re2 = /^(.+?)([^s])s$/; 87 | 88 | if (re.test(w)) 89 | w = w.replace(re,"$1$2"); 90 | else if (re2.test(w)) 91 | w = w.replace(re2,"$1$2"); 92 | 93 | // Step 1b 94 | re = /^(.+?)eed$/; 95 | re2 = /^(.+?)(ed|ing)$/; 96 | if (re.test(w)) { 97 | var fp = re.exec(w); 98 | re = new RegExp(mgr0); 99 | if (re.test(fp[1])) { 100 | re = /.$/; 101 | w = w.replace(re,""); 102 | } 103 | } 104 | else if (re2.test(w)) { 105 | var fp = re2.exec(w); 106 | stem = fp[1]; 107 | re2 = new RegExp(s_v); 108 | if (re2.test(stem)) { 109 | w = stem; 110 | re2 = /(at|bl|iz)$/; 111 | re3 = new RegExp("([^aeiouylsz])\\1$"); 112 | re4 = new RegExp("^" + C + v + "[^aeiouwxy]$"); 113 | if (re2.test(w)) 114 | w = w + "e"; 115 | else if (re3.test(w)) { 116 | re = /.$/; 117 | w = w.replace(re,""); 118 | } 119 | else if (re4.test(w)) 120 | w = w + "e"; 121 | } 122 | } 123 | 124 | // Step 1c 125 | re = /^(.+?)y$/; 126 | if (re.test(w)) { 127 | var fp = re.exec(w); 128 | stem = fp[1]; 129 | re = new RegExp(s_v); 130 | if (re.test(stem)) 131 | w = stem + "i"; 132 | } 133 | 134 | // Step 2 135 | re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; 136 | if (re.test(w)) { 137 | var fp = re.exec(w); 138 | stem = fp[1]; 139 | suffix = fp[2]; 140 | re = new RegExp(mgr0); 141 | if (re.test(stem)) 142 | w = stem + step2list[suffix]; 143 | } 144 | 145 | // Step 3 146 | re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; 147 | if (re.test(w)) { 148 | var fp = re.exec(w); 149 | stem = fp[1]; 150 | suffix = fp[2]; 151 | re = new RegExp(mgr0); 152 | if (re.test(stem)) 153 | w = stem + step3list[suffix]; 154 | } 155 | 156 | // Step 4 157 | re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; 158 | re2 = /^(.+?)(s|t)(ion)$/; 159 | if (re.test(w)) { 160 | var fp = re.exec(w); 161 | stem = fp[1]; 162 | re = new RegExp(mgr1); 163 | if (re.test(stem)) 164 | w = stem; 165 | } 166 | else if (re2.test(w)) { 167 | var fp = re2.exec(w); 168 | stem = fp[1] + fp[2]; 169 | re2 = new RegExp(mgr1); 170 | if (re2.test(stem)) 171 | w = stem; 172 | } 173 | 174 | // Step 5 175 | re = /^(.+?)e$/; 176 | if (re.test(w)) { 177 | var fp = re.exec(w); 178 | stem = fp[1]; 179 | re = new RegExp(mgr1); 180 | re2 = new RegExp(meq1); 181 | re3 = new RegExp("^" + C + v + "[^aeiouwxy]$"); 182 | if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) 183 | w = stem; 184 | } 185 | re = /ll$/; 186 | re2 = new RegExp(mgr1); 187 | if (re.test(w) && re2.test(w)) { 188 | re = /.$/; 189 | w = w.replace(re,""); 190 | } 191 | 192 | // and turn initial Y back to y 193 | if (firstch == "y") 194 | w = firstch.toLowerCase() + w.substr(1); 195 | return w; 196 | } 197 | } 198 | 199 | 200 | 201 | 202 | 203 | var splitChars = (function() { 204 | var result = {}; 205 | var singles = [96, 180, 187, 191, 215, 247, 749, 885, 903, 907, 909, 930, 1014, 1648, 206 | 1748, 1809, 2416, 2473, 2481, 2526, 2601, 2609, 2612, 2615, 2653, 2702, 207 | 2706, 2729, 2737, 2740, 2857, 2865, 2868, 2910, 2928, 2948, 2961, 2971, 208 | 2973, 3085, 3089, 3113, 3124, 3213, 3217, 3241, 3252, 3295, 3341, 3345, 209 | 3369, 3506, 3516, 3633, 3715, 3721, 3736, 3744, 3748, 3750, 3756, 3761, 210 | 3781, 3912, 4239, 4347, 4681, 4695, 4697, 4745, 4785, 4799, 4801, 4823, 211 | 4881, 5760, 5901, 5997, 6313, 7405, 8024, 8026, 8028, 8030, 8117, 8125, 212 | 8133, 8181, 8468, 8485, 8487, 8489, 8494, 8527, 11311, 11359, 11687, 11695, 213 | 11703, 11711, 11719, 11727, 11735, 12448, 12539, 43010, 43014, 43019, 43587, 214 | 43696, 43713, 64286, 64297, 64311, 64317, 64319, 64322, 64325, 65141]; 215 | var i, j, start, end; 216 | for (i = 0; i < singles.length; i++) { 217 | result[singles[i]] = true; 218 | } 219 | var ranges = [[0, 47], [58, 64], [91, 94], [123, 169], [171, 177], [182, 184], [706, 709], 220 | [722, 735], [741, 747], [751, 879], [888, 889], [894, 901], [1154, 1161], 221 | [1318, 1328], [1367, 1368], [1370, 1376], [1416, 1487], [1515, 1519], [1523, 1568], 222 | [1611, 1631], [1642, 1645], [1750, 1764], [1767, 1773], [1789, 1790], [1792, 1807], 223 | [1840, 1868], [1958, 1968], [1970, 1983], [2027, 2035], [2038, 2041], [2043, 2047], 224 | [2070, 2073], [2075, 2083], [2085, 2087], [2089, 2307], [2362, 2364], [2366, 2383], 225 | [2385, 2391], [2402, 2405], [2419, 2424], [2432, 2436], [2445, 2446], [2449, 2450], 226 | [2483, 2485], [2490, 2492], [2494, 2509], [2511, 2523], [2530, 2533], [2546, 2547], 227 | [2554, 2564], [2571, 2574], [2577, 2578], [2618, 2648], [2655, 2661], [2672, 2673], 228 | [2677, 2692], [2746, 2748], [2750, 2767], [2769, 2783], [2786, 2789], [2800, 2820], 229 | [2829, 2830], [2833, 2834], [2874, 2876], [2878, 2907], [2914, 2917], [2930, 2946], 230 | [2955, 2957], [2966, 2968], [2976, 2978], [2981, 2983], [2987, 2989], [3002, 3023], 231 | [3025, 3045], [3059, 3076], [3130, 3132], [3134, 3159], [3162, 3167], [3170, 3173], 232 | [3184, 3191], [3199, 3204], [3258, 3260], [3262, 3293], [3298, 3301], [3312, 3332], 233 | [3386, 3388], [3390, 3423], [3426, 3429], [3446, 3449], [3456, 3460], [3479, 3481], 234 | [3518, 3519], [3527, 3584], [3636, 3647], [3655, 3663], [3674, 3712], [3717, 3718], 235 | [3723, 3724], [3726, 3731], [3752, 3753], [3764, 3772], [3774, 3775], [3783, 3791], 236 | [3802, 3803], [3806, 3839], [3841, 3871], [3892, 3903], [3949, 3975], [3980, 4095], 237 | [4139, 4158], [4170, 4175], [4182, 4185], [4190, 4192], [4194, 4196], [4199, 4205], 238 | [4209, 4212], [4226, 4237], [4250, 4255], [4294, 4303], [4349, 4351], [4686, 4687], 239 | [4702, 4703], [4750, 4751], [4790, 4791], [4806, 4807], [4886, 4887], [4955, 4968], 240 | [4989, 4991], [5008, 5023], [5109, 5120], [5741, 5742], [5787, 5791], [5867, 5869], 241 | [5873, 5887], [5906, 5919], [5938, 5951], [5970, 5983], [6001, 6015], [6068, 6102], 242 | [6104, 6107], [6109, 6111], [6122, 6127], [6138, 6159], [6170, 6175], [6264, 6271], 243 | [6315, 6319], [6390, 6399], [6429, 6469], [6510, 6511], [6517, 6527], [6572, 6592], 244 | [6600, 6607], [6619, 6655], [6679, 6687], [6741, 6783], [6794, 6799], [6810, 6822], 245 | [6824, 6916], [6964, 6980], [6988, 6991], [7002, 7042], [7073, 7085], [7098, 7167], 246 | [7204, 7231], [7242, 7244], [7294, 7400], [7410, 7423], [7616, 7679], [7958, 7959], 247 | [7966, 7967], [8006, 8007], [8014, 8015], [8062, 8063], [8127, 8129], [8141, 8143], 248 | [8148, 8149], [8156, 8159], [8173, 8177], [8189, 8303], [8306, 8307], [8314, 8318], 249 | [8330, 8335], [8341, 8449], [8451, 8454], [8456, 8457], [8470, 8472], [8478, 8483], 250 | [8506, 8507], [8512, 8516], [8522, 8525], [8586, 9311], [9372, 9449], [9472, 10101], 251 | [10132, 11263], [11493, 11498], [11503, 11516], [11518, 11519], [11558, 11567], 252 | [11622, 11630], [11632, 11647], [11671, 11679], [11743, 11822], [11824, 12292], 253 | [12296, 12320], [12330, 12336], [12342, 12343], [12349, 12352], [12439, 12444], 254 | [12544, 12548], [12590, 12592], [12687, 12689], [12694, 12703], [12728, 12783], 255 | [12800, 12831], [12842, 12880], [12896, 12927], [12938, 12976], [12992, 13311], 256 | [19894, 19967], [40908, 40959], [42125, 42191], [42238, 42239], [42509, 42511], 257 | [42540, 42559], [42592, 42593], [42607, 42622], [42648, 42655], [42736, 42774], 258 | [42784, 42785], [42889, 42890], [42893, 43002], [43043, 43055], [43062, 43071], 259 | [43124, 43137], [43188, 43215], [43226, 43249], [43256, 43258], [43260, 43263], 260 | [43302, 43311], [43335, 43359], [43389, 43395], [43443, 43470], [43482, 43519], 261 | [43561, 43583], [43596, 43599], [43610, 43615], [43639, 43641], [43643, 43647], 262 | [43698, 43700], [43703, 43704], [43710, 43711], [43715, 43738], [43742, 43967], 263 | [44003, 44015], [44026, 44031], [55204, 55215], [55239, 55242], [55292, 55295], 264 | [57344, 63743], [64046, 64047], [64110, 64111], [64218, 64255], [64263, 64274], 265 | [64280, 64284], [64434, 64466], [64830, 64847], [64912, 64913], [64968, 65007], 266 | [65020, 65135], [65277, 65295], [65306, 65312], [65339, 65344], [65371, 65381], 267 | [65471, 65473], [65480, 65481], [65488, 65489], [65496, 65497]]; 268 | for (i = 0; i < ranges.length; i++) { 269 | start = ranges[i][0]; 270 | end = ranges[i][1]; 271 | for (j = start; j <= end; j++) { 272 | result[j] = true; 273 | } 274 | } 275 | return result; 276 | })(); 277 | 278 | function splitQuery(query) { 279 | var result = []; 280 | var start = -1; 281 | for (var i = 0; i < query.length; i++) { 282 | if (splitChars[query.charCodeAt(i)]) { 283 | if (start !== -1) { 284 | result.push(query.slice(start, i)); 285 | start = -1; 286 | } 287 | } else if (start === -1) { 288 | start = i; 289 | } 290 | } 291 | if (start !== -1) { 292 | result.push(query.slice(start)); 293 | } 294 | return result; 295 | } 296 | 297 | 298 | -------------------------------------------------------------------------------- /docs/build/html/_static/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hityingph/thermo/08faef51ad4333e816cadf838a224773152421fc/docs/build/html/_static/minus.png -------------------------------------------------------------------------------- /docs/build/html/_static/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hityingph/thermo/08faef51ad4333e816cadf838a224773152421fc/docs/build/html/_static/plus.png -------------------------------------------------------------------------------- /docs/build/html/_static/pygments.css: -------------------------------------------------------------------------------- 1 | .highlight .hll { background-color: #ffffcc } 2 | .highlight { background: #f8f8f8; } 3 | .highlight .c { color: #408080; font-style: italic } /* Comment */ 4 | .highlight .err { border: 1px solid #FF0000 } /* Error */ 5 | .highlight .k { color: #008000; font-weight: bold } /* Keyword */ 6 | .highlight .o { color: #666666 } /* Operator */ 7 | .highlight .ch { color: #408080; font-style: italic } /* Comment.Hashbang */ 8 | .highlight .cm { color: #408080; font-style: italic } /* Comment.Multiline */ 9 | .highlight .cp { color: #BC7A00 } /* Comment.Preproc */ 10 | .highlight .cpf { color: #408080; font-style: italic } /* Comment.PreprocFile */ 11 | .highlight .c1 { color: #408080; font-style: italic } /* Comment.Single */ 12 | .highlight .cs { color: #408080; font-style: italic } /* Comment.Special */ 13 | .highlight .gd { color: #A00000 } /* Generic.Deleted */ 14 | .highlight .ge { font-style: italic } /* Generic.Emph */ 15 | .highlight .gr { color: #FF0000 } /* Generic.Error */ 16 | .highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ 17 | .highlight .gi { color: #00A000 } /* Generic.Inserted */ 18 | .highlight .go { color: #888888 } /* Generic.Output */ 19 | .highlight .gp { color: #000080; font-weight: bold } /* Generic.Prompt */ 20 | .highlight .gs { font-weight: bold } /* Generic.Strong */ 21 | .highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ 22 | .highlight .gt { color: #0044DD } /* Generic.Traceback */ 23 | .highlight .kc { color: #008000; font-weight: bold } /* Keyword.Constant */ 24 | .highlight .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */ 25 | .highlight .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */ 26 | .highlight .kp { color: #008000 } /* Keyword.Pseudo */ 27 | .highlight .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */ 28 | .highlight .kt { color: #B00040 } /* Keyword.Type */ 29 | .highlight .m { color: #666666 } /* Literal.Number */ 30 | .highlight .s { color: #BA2121 } /* Literal.String */ 31 | .highlight .na { color: #7D9029 } /* Name.Attribute */ 32 | .highlight .nb { color: #008000 } /* Name.Builtin */ 33 | .highlight .nc { color: #0000FF; font-weight: bold } /* Name.Class */ 34 | .highlight .no { color: #880000 } /* Name.Constant */ 35 | .highlight .nd { color: #AA22FF } /* Name.Decorator */ 36 | .highlight .ni { color: #999999; font-weight: bold } /* Name.Entity */ 37 | .highlight .ne { color: #D2413A; font-weight: bold } /* Name.Exception */ 38 | .highlight .nf { color: #0000FF } /* Name.Function */ 39 | .highlight .nl { color: #A0A000 } /* Name.Label */ 40 | .highlight .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ 41 | .highlight .nt { color: #008000; font-weight: bold } /* Name.Tag */ 42 | .highlight .nv { color: #19177C } /* Name.Variable */ 43 | .highlight .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ 44 | .highlight .w { color: #bbbbbb } /* Text.Whitespace */ 45 | .highlight .mb { color: #666666 } /* Literal.Number.Bin */ 46 | .highlight .mf { color: #666666 } /* Literal.Number.Float */ 47 | .highlight .mh { color: #666666 } /* Literal.Number.Hex */ 48 | .highlight .mi { color: #666666 } /* Literal.Number.Integer */ 49 | .highlight .mo { color: #666666 } /* Literal.Number.Oct */ 50 | .highlight .sa { color: #BA2121 } /* Literal.String.Affix */ 51 | .highlight .sb { color: #BA2121 } /* Literal.String.Backtick */ 52 | .highlight .sc { color: #BA2121 } /* Literal.String.Char */ 53 | .highlight .dl { color: #BA2121 } /* Literal.String.Delimiter */ 54 | .highlight .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */ 55 | .highlight .s2 { color: #BA2121 } /* Literal.String.Double */ 56 | .highlight .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */ 57 | .highlight .sh { color: #BA2121 } /* Literal.String.Heredoc */ 58 | .highlight .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */ 59 | .highlight .sx { color: #008000 } /* Literal.String.Other */ 60 | .highlight .sr { color: #BB6688 } /* Literal.String.Regex */ 61 | .highlight .s1 { color: #BA2121 } /* Literal.String.Single */ 62 | .highlight .ss { color: #19177C } /* Literal.String.Symbol */ 63 | .highlight .bp { color: #008000 } /* Name.Builtin.Pseudo */ 64 | .highlight .fm { color: #0000FF } /* Name.Function.Magic */ 65 | .highlight .vc { color: #19177C } /* Name.Variable.Class */ 66 | .highlight .vg { color: #19177C } /* Name.Variable.Global */ 67 | .highlight .vi { color: #19177C } /* Name.Variable.Instance */ 68 | .highlight .vm { color: #19177C } /* Name.Variable.Magic */ 69 | .highlight .il { color: #666666 } /* Literal.Number.Integer.Long */ -------------------------------------------------------------------------------- /docs/build/html/_static/underscore.js: -------------------------------------------------------------------------------- 1 | // Underscore.js 1.3.1 2 | // (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc. 3 | // Underscore is freely distributable under the MIT license. 4 | // Portions of Underscore are inspired or borrowed from Prototype, 5 | // Oliver Steele's Functional, and John Resig's Micro-Templating. 6 | // For all details and documentation: 7 | // http://documentcloud.github.com/underscore 8 | (function(){function q(a,c,d){if(a===c)return a!==0||1/a==1/c;if(a==null||c==null)return a===c;if(a._chain)a=a._wrapped;if(c._chain)c=c._wrapped;if(a.isEqual&&b.isFunction(a.isEqual))return a.isEqual(c);if(c.isEqual&&b.isFunction(c.isEqual))return c.isEqual(a);var e=l.call(a);if(e!=l.call(c))return false;switch(e){case "[object String]":return a==String(c);case "[object Number]":return a!=+a?c!=+c:a==0?1/a==1/c:a==+c;case "[object Date]":case "[object Boolean]":return+a==+c;case "[object RegExp]":return a.source== 9 | c.source&&a.global==c.global&&a.multiline==c.multiline&&a.ignoreCase==c.ignoreCase}if(typeof a!="object"||typeof c!="object")return false;for(var f=d.length;f--;)if(d[f]==a)return true;d.push(a);var f=0,g=true;if(e=="[object Array]"){if(f=a.length,g=f==c.length)for(;f--;)if(!(g=f in a==f in c&&q(a[f],c[f],d)))break}else{if("constructor"in a!="constructor"in c||a.constructor!=c.constructor)return false;for(var h in a)if(b.has(a,h)&&(f++,!(g=b.has(c,h)&&q(a[h],c[h],d))))break;if(g){for(h in c)if(b.has(c, 10 | h)&&!f--)break;g=!f}}d.pop();return g}var r=this,G=r._,n={},k=Array.prototype,o=Object.prototype,i=k.slice,H=k.unshift,l=o.toString,I=o.hasOwnProperty,w=k.forEach,x=k.map,y=k.reduce,z=k.reduceRight,A=k.filter,B=k.every,C=k.some,p=k.indexOf,D=k.lastIndexOf,o=Array.isArray,J=Object.keys,s=Function.prototype.bind,b=function(a){return new m(a)};if(typeof exports!=="undefined"){if(typeof module!=="undefined"&&module.exports)exports=module.exports=b;exports._=b}else r._=b;b.VERSION="1.3.1";var j=b.each= 11 | b.forEach=function(a,c,d){if(a!=null)if(w&&a.forEach===w)a.forEach(c,d);else if(a.length===+a.length)for(var e=0,f=a.length;e2;a== 12 | null&&(a=[]);if(y&&a.reduce===y)return e&&(c=b.bind(c,e)),f?a.reduce(c,d):a.reduce(c);j(a,function(a,b,i){f?d=c.call(e,d,a,b,i):(d=a,f=true)});if(!f)throw new TypeError("Reduce of empty array with no initial value");return d};b.reduceRight=b.foldr=function(a,c,d,e){var f=arguments.length>2;a==null&&(a=[]);if(z&&a.reduceRight===z)return e&&(c=b.bind(c,e)),f?a.reduceRight(c,d):a.reduceRight(c);var g=b.toArray(a).reverse();e&&!f&&(c=b.bind(c,e));return f?b.reduce(g,c,d,e):b.reduce(g,c)};b.find=b.detect= 13 | function(a,c,b){var e;E(a,function(a,g,h){if(c.call(b,a,g,h))return e=a,true});return e};b.filter=b.select=function(a,c,b){var e=[];if(a==null)return e;if(A&&a.filter===A)return a.filter(c,b);j(a,function(a,g,h){c.call(b,a,g,h)&&(e[e.length]=a)});return e};b.reject=function(a,c,b){var e=[];if(a==null)return e;j(a,function(a,g,h){c.call(b,a,g,h)||(e[e.length]=a)});return e};b.every=b.all=function(a,c,b){var e=true;if(a==null)return e;if(B&&a.every===B)return a.every(c,b);j(a,function(a,g,h){if(!(e= 14 | e&&c.call(b,a,g,h)))return n});return e};var E=b.some=b.any=function(a,c,d){c||(c=b.identity);var e=false;if(a==null)return e;if(C&&a.some===C)return a.some(c,d);j(a,function(a,b,h){if(e||(e=c.call(d,a,b,h)))return n});return!!e};b.include=b.contains=function(a,c){var b=false;if(a==null)return b;return p&&a.indexOf===p?a.indexOf(c)!=-1:b=E(a,function(a){return a===c})};b.invoke=function(a,c){var d=i.call(arguments,2);return b.map(a,function(a){return(b.isFunction(c)?c||a:a[c]).apply(a,d)})};b.pluck= 15 | function(a,c){return b.map(a,function(a){return a[c]})};b.max=function(a,c,d){if(!c&&b.isArray(a))return Math.max.apply(Math,a);if(!c&&b.isEmpty(a))return-Infinity;var e={computed:-Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;b>=e.computed&&(e={value:a,computed:b})});return e.value};b.min=function(a,c,d){if(!c&&b.isArray(a))return Math.min.apply(Math,a);if(!c&&b.isEmpty(a))return Infinity;var e={computed:Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;bd?1:0}),"value")};b.groupBy=function(a,c){var d={},e=b.isFunction(c)?c:function(a){return a[c]};j(a,function(a,b){var c=e(a,b);(d[c]||(d[c]=[])).push(a)});return d};b.sortedIndex=function(a, 17 | c,d){d||(d=b.identity);for(var e=0,f=a.length;e>1;d(a[g])=0})})};b.difference=function(a){var c=b.flatten(i.call(arguments,1));return b.filter(a,function(a){return!b.include(c,a)})};b.zip=function(){for(var a=i.call(arguments),c=b.max(b.pluck(a,"length")),d=Array(c),e=0;e=0;d--)b=[a[d].apply(this,b)];return b[0]}}; 24 | b.after=function(a,b){return a<=0?b():function(){if(--a<1)return b.apply(this,arguments)}};b.keys=J||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var c=[],d;for(d in a)b.has(a,d)&&(c[c.length]=d);return c};b.values=function(a){return b.map(a,b.identity)};b.functions=b.methods=function(a){var c=[],d;for(d in a)b.isFunction(a[d])&&c.push(d);return c.sort()};b.extend=function(a){j(i.call(arguments,1),function(b){for(var d in b)a[d]=b[d]});return a};b.defaults=function(a){j(i.call(arguments, 25 | 1),function(b){for(var d in b)a[d]==null&&(a[d]=b[d])});return a};b.clone=function(a){return!b.isObject(a)?a:b.isArray(a)?a.slice():b.extend({},a)};b.tap=function(a,b){b(a);return a};b.isEqual=function(a,b){return q(a,b,[])};b.isEmpty=function(a){if(b.isArray(a)||b.isString(a))return a.length===0;for(var c in a)if(b.has(a,c))return false;return true};b.isElement=function(a){return!!(a&&a.nodeType==1)};b.isArray=o||function(a){return l.call(a)=="[object Array]"};b.isObject=function(a){return a===Object(a)}; 26 | b.isArguments=function(a){return l.call(a)=="[object Arguments]"};if(!b.isArguments(arguments))b.isArguments=function(a){return!(!a||!b.has(a,"callee"))};b.isFunction=function(a){return l.call(a)=="[object Function]"};b.isString=function(a){return l.call(a)=="[object String]"};b.isNumber=function(a){return l.call(a)=="[object Number]"};b.isNaN=function(a){return a!==a};b.isBoolean=function(a){return a===true||a===false||l.call(a)=="[object Boolean]"};b.isDate=function(a){return l.call(a)=="[object Date]"}; 27 | b.isRegExp=function(a){return l.call(a)=="[object RegExp]"};b.isNull=function(a){return a===null};b.isUndefined=function(a){return a===void 0};b.has=function(a,b){return I.call(a,b)};b.noConflict=function(){r._=G;return this};b.identity=function(a){return a};b.times=function(a,b,d){for(var e=0;e/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")};b.mixin=function(a){j(b.functions(a), 28 | function(c){K(c,b[c]=a[c])})};var L=0;b.uniqueId=function(a){var b=L++;return a?a+b:b};b.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var t=/.^/,u=function(a){return a.replace(/\\\\/g,"\\").replace(/\\'/g,"'")};b.template=function(a,c){var d=b.templateSettings,d="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(d.escape||t,function(a,b){return"',_.escape("+ 29 | u(b)+"),'"}).replace(d.interpolate||t,function(a,b){return"',"+u(b)+",'"}).replace(d.evaluate||t,function(a,b){return"');"+u(b).replace(/[\r\n\t]/g," ")+";__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",e=new Function("obj","_",d);return c?e(c,b):function(a){return e.call(this,a,b)}};b.chain=function(a){return b(a).chain()};var m=function(a){this._wrapped=a};b.prototype=m.prototype;var v=function(a,c){return c?b(a).chain():a},K=function(a,c){m.prototype[a]= 30 | function(){var a=i.call(arguments);H.call(a,this._wrapped);return v(c.apply(b,a),this._chain)}};b.mixin(b);j("pop,push,reverse,shift,sort,splice,unshift".split(","),function(a){var b=k[a];m.prototype[a]=function(){var d=this._wrapped;b.apply(d,arguments);var e=d.length;(a=="shift"||a=="splice")&&e===0&&delete d[0];return v(d,this._chain)}});j(["concat","join","slice"],function(a){var b=k[a];m.prototype[a]=function(){return v(b.apply(this._wrapped,arguments),this._chain)}});m.prototype.chain=function(){this._chain= 31 | true;return this};m.prototype.value=function(){return this._wrapped}}).call(this); 32 | -------------------------------------------------------------------------------- /docs/build/html/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | thermo - A GPUMD Helper Package — thermo documentation 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 |
45 | 46 | 94 | 95 |
96 | 97 | 98 | 104 | 105 | 106 |
107 | 108 |
109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 |
127 | 128 |
    129 | 130 |
  • Docs »
  • 131 | 132 |
  • thermo - A GPUMD Helper Package
  • 133 | 134 | 135 |
  • 136 | 137 | 138 | View page source 139 | 140 | 141 |
  • 142 | 143 |
144 | 145 | 146 |
147 |
148 |
149 |
150 | 151 |
152 |

thermo - A GPUMD Helper Package

153 |

The thermo, or thermo, package is a set of Python tools to interface with the molecular dynamics (MD) simulator GPUMD (and LAMMPS for comparison) for the purpose of thermodynamic simulations (i.e. thermal conductivity).

154 |

Currently, the functionality is limited as it serves specific research purposes at this time; however, the long-term plan is to make this package to primarily serve GPUMD with only minor supporting functions for LAMMPS for the purpose of checking force-consistency between the simulators.

155 |

The documenation is produced and maintained by Alex Gabourie at Stanford University. It outlines the structure and usage of the thermo package.

156 |
157 |

Documentation

158 |
159 |
This package contains four subpackages:
160 |
1. gpumd : Python interface specific to GPUMD.
161 |
2. lammps : Python interface specific to LAMMPS.
162 |
3. shared : Used strictly to compare GPUMD and LAMMPS.
163 |
4. tools : Extra support for more general MD related content.
164 |
165 |
166 | 189 |
190 | 193 |
194 |
195 | 196 | 197 |
198 | 199 |
200 |
201 | 202 | 208 | 209 | 210 |
211 | 212 |
213 |

214 | © Copyright 2020, Alexander Gabourie 215 | 216 |

217 |
218 | Built with Sphinx using a theme provided by Read the Docs. 219 | 220 |
221 | 222 |
223 |
224 | 225 |
226 | 227 |
228 | 229 | 230 | 231 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | -------------------------------------------------------------------------------- /docs/build/html/objects.inv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hityingph/thermo/08faef51ad4333e816cadf838a224773152421fc/docs/build/html/objects.inv -------------------------------------------------------------------------------- /docs/build/html/py-modindex.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Python Module Index — thermo documentation 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 |
47 | 48 | 96 | 97 |
98 | 99 | 100 | 106 | 107 | 108 |
109 | 110 |
111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 |
129 | 130 |
    131 | 132 |
  • Docs »
  • 133 | 134 |
  • Python Module Index
  • 135 | 136 | 137 |
  • 138 | 139 |
  • 140 | 141 |
142 | 143 | 144 |
145 |
146 |
147 |
148 | 149 | 150 |

Python Module Index

151 | 152 |
153 | t 154 |
155 | 156 | 157 | 158 | 160 | 161 | 163 | 166 | 167 | 168 | 171 | 172 | 173 | 176 | 177 | 178 | 181 | 182 | 183 | 186 | 187 | 188 | 191 | 192 | 193 | 196 | 197 | 198 | 201 | 202 | 203 | 206 | 207 | 208 | 211 |
 
159 | t
164 | thermo 165 |
    169 | thermo.gpumd.calc 170 |
    174 | thermo.gpumd.data 175 |
    179 | thermo.gpumd.io 180 |
    184 | thermo.gpumd.preproc 185 |
    189 | thermo.lammps.calc 190 |
    194 | thermo.lammps.data 195 |
    199 | thermo.lammps.io 200 |
    204 | thermo.shared.force 205 |
    209 | thermo.tools.lj 210 |
212 | 213 | 214 |
215 | 216 |
217 |
218 | 219 | 220 |
221 | 222 |
223 |

224 | © Copyright 2020, Alexander Gabourie 225 | 226 |

227 |
228 | Built with Sphinx using a theme provided by Read the Docs. 229 | 230 |
231 | 232 |
233 |
234 | 235 |
236 | 237 |
238 | 239 | 240 | 241 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | -------------------------------------------------------------------------------- /docs/build/html/search.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Search — thermo documentation 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 |
45 | 46 | 94 | 95 |
96 | 97 | 98 | 104 | 105 | 106 |
107 | 108 |
109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 |
127 | 128 |
    129 | 130 |
  • Docs »
  • 131 | 132 |
  • Search
  • 133 | 134 | 135 |
  • 136 | 137 | 138 | 139 |
  • 140 | 141 |
142 | 143 | 144 |
145 |
146 |
147 |
148 | 149 | 157 | 158 | 159 |
160 | 161 |
162 | 163 |
164 | 165 |
166 |
167 | 168 | 169 |
170 | 171 |
172 |

173 | © Copyright 2020, Alexander Gabourie 174 | 175 |

176 |
177 | Built with Sphinx using a theme provided by Read the Docs. 178 | 179 |
180 | 181 |
182 |
183 | 184 |
185 | 186 |
187 | 188 | 189 | 190 | 195 | 196 | 197 | 198 | 199 | 200 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | -------------------------------------------------------------------------------- /docs/build/html/searchindex.js: -------------------------------------------------------------------------------- 1 | Search.setIndex({docnames:["index","thermo.gpumd","thermo.lammps","thermo.shared","thermo.tools"],envversion:{"sphinx.domains.c":1,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":1,"sphinx.domains.javascript":1,"sphinx.domains.math":2,"sphinx.domains.python":1,"sphinx.domains.rst":1,"sphinx.domains.std":1,"sphinx.ext.viewcode":1,sphinx:56},filenames:["index.rst","thermo.gpumd.rst","thermo.lammps.rst","thermo.shared.rst","thermo.tools.rst"],objects:{"thermo.gpumd":{calc:[1,0,0,"-"],data:[1,0,0,"-"],io:[1,0,0,"-"],preproc:[1,0,0,"-"]},"thermo.gpumd.calc":{get_gkma_kappa:[1,1,1,""],hnemd_spectral_kappa:[1,1,1,""],running_ave:[1,1,1,""]},"thermo.gpumd.data":{get_frequency_info:[1,1,1,""],load_compute:[1,1,1,""],load_dos:[1,1,1,""],load_force:[1,1,1,""],load_hac:[1,1,1,""],load_heatmode:[1,1,1,""],load_kappa:[1,1,1,""],load_kappamode:[1,1,1,""],load_omega2:[1,1,1,""],load_saved_heatmode:[1,1,1,""],load_saved_kappamode:[1,1,1,""],load_sdc:[1,1,1,""],load_shc:[1,1,1,""],load_thermo:[1,1,1,""],load_vac:[1,1,1,""],load_velocity:[1,1,1,""],reduce_frequency_info:[1,1,1,""],tail:[1,1,1,""]},"thermo.gpumd.io":{ase_atoms_to_gpumd:[1,1,1,""],convert_gpumd_atoms:[1,1,1,""],create_basis:[1,1,1,""],create_kpoints:[1,1,1,""],import_trajectory:[1,1,1,""],lammps_atoms_to_gpumd:[1,1,1,""],load_xyz:[1,1,1,""]},"thermo.gpumd.preproc":{add_basis:[1,1,1,""],add_group_by_position:[1,1,1,""],add_group_by_type:[1,1,1,""],repeat:[1,1,1,""],set_velocities:[1,1,1,""]},"thermo.lammps":{calc:[2,0,0,"-"],data:[2,0,0,"-"],io:[2,0,0,"-"]},"thermo.lammps.calc":{get_GKTC:[2,1,1,""],get_heat_flux:[2,1,1,""]},"thermo.lammps.data":{extract_dt:[2,1,1,""],get_dimensions:[2,1,1,""]},"thermo.lammps.io":{ase_atoms_to_lammps:[2,1,1,""]},"thermo.shared":{force:[3,0,0,"-"]},"thermo.shared.force":{compare_forces:[3,1,1,""],load_forces:[3,1,1,""]},"thermo.tools":{lj:[4,0,0,"-"]},"thermo.tools.lj":{LJ:[4,2,1,""],lb_mixing:[4,1,1,""],load_UFF:[4,1,1,""]},"thermo.tools.lj.LJ":{acknowledge_pair:[4,3,1,""],acknowledge_pairs:[4,3,1,""],add_UFF_params:[4,3,1,""],add_param:[4,3,1,""],create_file:[4,3,1,""],custom_cutoff:[4,3,1,""],ignore_pair:[4,3,1,""],ignore_pairs:[4,3,1,""],remove_custom_cutoff:[4,3,1,""],remove_param:[4,3,1,""],replace_UFF_params:[4,3,1,""],set_cut_scale:[4,3,1,""],set_global_cutoff:[4,3,1,""]}},objnames:{"0":["py","module","Python module"],"1":["py","function","Python function"],"2":["py","class","Python class"],"3":["py","method","Python method"]},objtypes:{"0":"py:module","1":"py:function","2":"py:class","3":"py:method"},terms:{"byte":1,"case":1,"class":4,"default":[2,4],"final":1,"float":[1,2,4],"function":[0,1],"import":[1,4],"int":[1,2],"long":[0,1],"new":4,"return":[1,2,3,4],"true":[1,2,4],ASE:[1,2],DOS:1,For:1,Not:1,The:[0,1,2,3,4],Used:0,Will:4,abbrevi:[],abov:[],accept:[1,4],acknowledg:4,acknowledge_pair:4,add:4,add_basi:1,add_group_by_posit:1,add_group_by_typ:1,add_mass:2,add_param:4,add_uff_param:4,added:1,addit:1,after:1,aggreg:[],alex:0,all:[1,2,3,4],allow:1,along:1,alreadi:1,also:[1,4],amount:4,amu:1,angstrom:[1,4],ani:[1,4],anstrom:[],append:1,appli:4,appropri:1,arbitrari:4,area:[],arg1:3,arg2:3,arg:[1,2,3,4],argument:1,arrai:1,ase:[1,2],ase_atoms_to_gpumd:1,ase_atoms_to_lammp:2,assign:1,assum:1,assumpt:[],atom:[1,2,4],atom_ord:4,atom_typ:1,autocorr:[],autocorrel:[],ave:[],averag:1,awar:1,balanc:[],base:[1,4],basi:1,becom:1,befor:1,below:2,berthelot:4,between:[0,3],bin:1,bin_count:1,bin_f_siz:1,binari:1,block:1,block_siz:1,bookkeep:1,bool:[1,2,4],boundari:1,box:1,build:1,calc:[1,2],calcul:0,can:[1,4],cell:[1,2],check:0,clean:1,cluster:1,collect:1,column:1,command:3,compar:[0,3],compare_forc:3,comparison:0,compat:1,compil:3,compon:[],compress:2,comput:1,concern:1,conduct:[0,1,2],consist:0,contain:[0,1,3],content:0,convers:1,convert:[1,2],convert_gpumd_atom:1,coordin:1,core:1,corr_xi_x:[],corr_xo_x:[],corr_yi_i:[],corr_yo_i:[],corr_z_z:[],correct:1,correl:1,correspond:1,creat:[1,2],create_basi:1,create_fil:4,create_kpoint:1,current:[0,1,4],custom:[1,3,4],custom_cutoff:4,cut_scal:4,cutoff:[1,4],data:[0,4],decomposit:[],defin:[1,4],depend:1,descript:[],determin:[2,4],dict1:3,dict2:3,dict:[1,2,3,4],dictionari:[3,4],dictonari:1,differ:[],dimens:2,dir:1,direct:1,directori:[1,2],distanc:[1,2],documen:0,dodz:[],doe:[2,4],dos:1,dos_i:[],dos_x:[],dos_z:[],dosi:1,dosx:1,dosz:1,dure:[1,4],dynam:0,each:[1,4],effect:[],eigen:1,eigenvector:1,eigfil:1,ein:1,either:3,element:[1,4],elsewher:1,emd:2,end:1,energi:[],ensur:1,entri:4,eout:1,epsilon:4,equlibrium:[],etc:[],eva:1,everi:1,examin:2,exampl:1,exclud:1,exist:[2,4],exlcud:[],extra:[0,1],extract:[1,2,3],extract_dt:2,f1_dict:3,f2_dict:3,facilit:3,factor:4,fals:[1,4],fare:[],fast:1,faster:1,fee:[],file:[1,2,3,4],filehandl:1,filenam:[1,2,3,4],find:2,first:1,flag:3,flow:[],flux:[1,2],fmax:1,fmin:1,follow:3,forc:[0,1],force_fil:3,form:2,formal:2,format:[1,3],found:2,four:0,freq:1,freqeuenc:1,frequenc:1,from:[1,2,3,4],full:4,gabouri:0,gather:1,gener:[0,1],get:[1,2],get_dimens:2,get_frequency_info:1,get_gkma_kappa:1,get_gktc:2,get_heat_flux:2,get_sim_dimens:[],given:[2,3],gk3:[],gkma:1,global:4,gpa:1,gpumd:[3,4],gpumd_fil:1,grab:1,grant:[],green:[1,2],group:1,group_index:1,gxl:1,hac:1,hacf:[],hacf_i:[],hacf_x:[],hacxix:[],hacxox:[],hacyii:[],hacyoi:[],haczz:[],handl:1,happen:4,has:4,have:1,header:[],heat:[1,2],heat_flux:2,heat_out:2,heatflux:2,heatflux_fil:2,heatmod:1,help:1,here:1,high:1,hnema:1,hnemd:1,hnemd_spectral_decomp:[],hnemd_spectral_kappa:1,hold:1,how:1,howev:0,ident:1,ignor:[1,4],ignore_pair:4,import_trajectori:1,in_fil:1,includ:[1,4],increas:1,index:[0,1],indic:1,individu:1,info:1,inform:1,initi:[1,4],input:[0,3,4],inputfil:1,integ:1,integr:2,interfac:[0,4],intern:1,interv:1,item:4,its:1,j_in:[],j_out:[],jmxi:1,jmxijx:1,jmxo:1,jmxojx:1,jmyi:1,jmyiji:1,jmyo:1,jmyoji:1,jmz:1,jmzjz:1,jone:0,jwi:1,jwo:1,jxijx:1,jxjx:2,jxojx:1,jyiji:1,jyji:2,jyoji:1,jzjz:[1,2],k_i:[],k_in:[],k_o:[],k_out:[],k_x:[],k_y:[],kappa:1,kappamod:1,kei:[1,2,4],keyword:[],kinet:1,kmxi:1,kmxo:1,kmyi:1,kmyo:1,kmz:1,kpoint:1,kubo:[1,2],kwi:1,kwo:1,kxi:1,kxo:1,kyi:1,kyo:1,label:1,lag:[1,2],lammp:[0,1,3],lammps_atoms_to_gpumd:1,lammpstrj_fil:[],larger:1,last:1,later:1,lb_mix:4,least:1,leav:4,len:1,lennard:0,limit:0,line:1,list:[1,2,4],ljparam:4,load:[1,2,3,4],load_comput:1,load_do:1,load_forc:[1,3],load_hac:1,load_heatmod:1,load_kappa:1,load_kappamod:1,load_omega2:1,load_saved_heatmod:1,load_saved_kappamod:1,load_sdc:1,load_shc:1,load_thermo:1,load_uff:4,load_vac:1,load_veloc:1,load_xyz:1,loader:0,locat:1,log:2,log_fil:2,lorentz:4,lower:1,made:1,mai:1,maintain:0,make:0,mani:1,map:1,mass:[1,2],mat:2,mat_fil:2,matlab:2,max:[1,2],max_lag:[],max_tau:1,maximum:1,memori:1,method:[],minor:0,mix:4,modal:1,molecular:0,more:0,mostli:1,movi:1,much:1,multi:1,multipl:[1,4],multiprocess:1,must:[1,2],mvac:1,n_basi:1,n_kpoint:1,name:[1,2],nbin:1,nc_conv:[],ncore:1,ndarra:[],ndarrai:1,ndiv:1,necessari:1,need:1,neighbor:1,nemd:1,nline:1,none:[1,2,4],note:1,noth:4,npoint:1,npy:1,nsampl:1,num_dos_point:1,num_omega:1,num_run:[],number:[1,2,4],numpi:1,object:[1,4],omega2:1,onc:[],one:1,onli:[0,1,2],oper:1,option:[1,4],order:[1,4],origin:1,orthogon:[],other:[1,4],otherwis:[],out:[1,3],out_fil:2,out_filenam:1,outermost:1,outlin:0,output:[0,3,4],output_interv:1,outputfil:1,over:2,packag:[1,4],pair:4,param:4,paramet:[1,4],part:1,pass:1,path:[1,3,4],pbc:1,per:1,perform:1,period:[],phonon:1,place:1,plan:0,plane:1,point:1,points_per_run:[],posit:1,potenti:[1,4],preempt:1,prematur:1,preproc:1,preprocess:0,preserv:1,previous:1,primarili:0,process:1,produc:0,profil:[],proper:1,provid:1,purpos:0,python:0,quantiti:1,rang:1,rate:2,raw:1,read:1,recalcul:1,recommend:1,reduce_frequency_info:1,relat:[0,1],relev:[1,4],remov:4,remove_custom_cutoff:4,remove_param:4,rep:1,repeat:1,replac:4,replace_uff_param:4,repres:4,represent:1,request:1,requir:[1,4],research:0,respect:4,restart:1,result:[1,2],return_data:1,return_out:[],rtc:1,rule:4,run:1,running_av:1,same:1,sampl:[1,2],sample_interv:1,save:[1,2],scale:[1,4],sdc:1,sdc_x:[],sdc_y:[],sdc_z:[],sdcx:1,sdcy:1,sdcz:1,second:1,see:[],select:1,serv:0,set:[0,1,4],set_cut_scal:4,set_global_cutoff:4,set_veloc:1,shape:1,share:0,shc3:[],shc:1,shift:1,should:[1,3],shrink:1,sigma:4,significantli:1,sim:[1,3],simul:[0,1,2,3,4],sinc:1,singl:[1,4],size:1,some:[],sort:[1,3],sort_kei:1,sourc:[1,2,3,4],space:[],special:[1,4],special_point:1,specif:[0,4],specifi:[1,4],spectral:1,split:1,srate:2,src:1,stanford:0,start:1,step:[1,2],still:1,storag:1,store:[1,4],str:[1,2,3,4],strictli:0,string:[1,2,4],structur:[0,1,2],stub:[],style:[1,4],subpackag:0,sup:[],supercel:[],support:[0,1],symbol:[1,4],symmetri:1,system:1,tabl:2,tag:1,tail:1,tau:[1,2],techniqu:3,temperatur:[1,2],term:0,text:[1,2],than:1,thei:1,thermal:[0,1,2],thermo:[1,2,3,4],thermodynam:0,thi:[0,1,4],third:1,those:1,three:1,thz:1,time:[0,1,2],timestep:2,toggl:1,too:1,tool:0,tot_tim:2,total:[1,2],train:[],trajectori:[1,2],transform:[],travel:[],tri:[],triclin:[],tupl:[1,4],two:4,txt:4,type:[1,3,4],udat:1,uff:4,unit:[1,4],univers:0,updat:1,upper:1,usag:[0,1],use:[1,4],useag:1,used:[1,2,4],useful:1,user:1,using:[1,2,4],vac:1,vac_i:[],vac_x:[],vac_z:[],vaci:1,vacx:1,vacz:1,valu:[1,3,4],vector:[1,3],veloc:1,virial:1,vol:[1,2],volum:[1,2],want:1,warn:[1,4],when:[1,3,4],where:4,whether:4,which:[1,2],width:[],work:1,wrapper:1,write:[1,2],written:2,xyz:1,you:1},titles:["thermo - A GPUMD Helper Package","gpumd","lammps","shared","tools"],titleterms:{"new":1,all:[],balanc:[],calcul:[1,2],comparison:3,data:[1,2],dictionari:[1,2],document:0,entri:1,forc:3,gpumd:[0,1],header:[],helper:0,input:[1,2],jone:4,lammp:2,lennard:4,loader:[1,2],metal:2,orthogon:[],output:[1,2],packag:0,preprocess:1,share:3,sheet:[],structur:[],thermo:0,tool:4,triclin:[],unit:2}}) -------------------------------------------------------------------------------- /docs/build/html/thermo.shared.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | shared — thermo documentation 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 |
46 | 47 | 98 | 99 |
100 | 101 | 102 | 108 | 109 | 110 |
111 | 112 |
113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 |
131 | 132 |
    133 | 134 |
  • Docs »
  • 135 | 136 |
  • shared
  • 137 | 138 | 139 |
  • 140 | 141 | 142 | View page source 143 | 144 | 145 |
  • 146 | 147 |
148 | 149 | 150 |
151 |
152 |
153 |
154 | 155 |
156 |

shared

157 |
158 |

Force Comparison

159 |
160 |
161 | thermo.shared.force.compare_forces(f1_dict, f2_dict)[source]
162 |

Compares the LAMMPS and GPUMD forces and returns dictionary of comparison 163 | Forces are dict2 - dict1 values.

164 |
165 |
Args:
166 |
arg1 (dict): f1_dict

dictionary containing extracted forces from a GPUMD or 167 | LAMMPS simulation

168 |
169 |
arg2 (dict): f2_dict

dictionary containing extracted forces from a GPUMD or 170 | LAMMPS simulation

171 |
172 |
173 |
174 |
Returns:

dict: comparison dictionary

175 |
176 |
177 |
178 | 179 |
180 |
181 | thermo.shared.force.load_forces(force_file, sim)[source]
182 |

Loads the forces from either GPUMD or LAMMPS output to facilitate a 183 | comparison between techniques.

184 |
185 |
Args:
186 |
arg1 (str)force_file

Filename with forces

187 |
188 |
arg2 (str)sim

If type == ‘LAMMPS’: 189 | The file path should be for the LAMMPS output forces 190 | LAMMPS file should be in the format given by the following LAMMPS input command: 191 | force all custom 1 <file> id fx fy fz 192 | If type == ‘GPUMD’: 193 | the force output file (f.out) path when GPUMD is compiled with the force flag

194 |
195 |
196 |
197 |
Returns:

dict: dictionary containing sorted force vectors

198 |
199 |
200 |
201 | 202 |
203 |
204 | 205 | 206 |
207 | 208 |
209 |
210 | 211 | 219 | 220 | 221 |
222 | 223 |
224 |

225 | © Copyright 2020, Alexander Gabourie 226 | 227 |

228 |
229 | Built with Sphinx using a theme provided by Read the Docs. 230 | 231 |
232 | 233 |
234 |
235 | 236 |
237 | 238 |
239 | 240 | 241 | 242 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=source 11 | set BUILDDIR=build 12 | 13 | if "%1" == "" goto help 14 | 15 | %SPHINXBUILD% >NUL 2>NUL 16 | if errorlevel 9009 ( 17 | echo. 18 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 19 | echo.installed, then set the SPHINXBUILD environment variable to point 20 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 21 | echo.may add the Sphinx directory to PATH. 22 | echo. 23 | echo.If you don't have Sphinx installed, grab it from 24 | echo.http://sphinx-doc.org/ 25 | exit /b 1 26 | ) 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /docs/source/conf.py: -------------------------------------------------------------------------------- 1 | autodoc_mock_imports = ['ase.io', 'numpy', 'scipy.integrate', 'os', 'math', 2 | 'ase', 'pyfftw', 'multiprocessing', 'traceback', 'scipy', 'scipy.io', 3 | 're', 'atomman', 'pandas'] 4 | # -*- coding: utf-8 -*- 5 | # 6 | # Configuration file for the Sphinx documentation builder. 7 | # 8 | # This file does only contain a selection of the most common options. For a 9 | # full list see the documentation: 10 | # http://www.sphinx-doc.org/en/master/config 11 | 12 | # -- Path setup -------------------------------------------------------------- 13 | 14 | # If extensions (or modules to document with autodoc) are in another directory, 15 | # add these directories to sys.path here. If the directory is relative to the 16 | # documentation root, use os.path.abspath to make it absolute, like shown here. 17 | # 18 | import os 19 | import sys 20 | sys.path.insert(0, os.path.abspath('../..')) 21 | sys.path.insert(0, os.path.abspath('../../thermo/')) 22 | 23 | 24 | # -- Project information ----------------------------------------------------- 25 | 26 | project = u'thermo' 27 | copyright = u'2020, Alexander Gabourie' 28 | author = u'Alexander Gabourie' 29 | 30 | # The short X.Y version 31 | version = u'' 32 | # The full version, including alpha/beta/rc tags 33 | release = u'' 34 | 35 | 36 | # -- General configuration --------------------------------------------------- 37 | 38 | # If your documentation needs a minimal Sphinx version, state it here. 39 | # 40 | # needs_sphinx = '1.0' 41 | 42 | # Add any Sphinx extension module names here, as strings. They can be 43 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom 44 | # ones. 45 | extensions = [ 46 | 'sphinx.ext.autodoc', 47 | 'sphinx.ext.viewcode', 48 | ] 49 | 50 | # Add any paths that contain templates here, relative to this directory. 51 | templates_path = ['_templates'] 52 | 53 | # The suffix(es) of source filenames. 54 | # You can specify multiple suffix as a list of string: 55 | # 56 | # source_suffix = ['.rst', '.md'] 57 | source_suffix = '.rst' 58 | 59 | # The master toctree document. 60 | master_doc = 'index' 61 | 62 | # The language for content autogenerated by Sphinx. Refer to documentation 63 | # for a list of supported languages. 64 | # 65 | # This is also used if you do content translation via gettext catalogs. 66 | # Usually you set "language" from the command line for these cases. 67 | language = None 68 | 69 | # List of patterns, relative to source directory, that match files and 70 | # directories to ignore when looking for source files. 71 | # This pattern also affects html_static_path and html_extra_path. 72 | exclude_patterns = [] 73 | 74 | # The name of the Pygments (syntax highlighting) style to use. 75 | pygments_style = None 76 | 77 | 78 | # -- Options for HTML output ------------------------------------------------- 79 | 80 | # The theme to use for HTML and HTML Help pages. See the documentation for 81 | # a list of builtin themes. 82 | # 83 | html_theme = 'sphinx_rtd_theme' 84 | 85 | # Theme options are theme-specific and customize the look and feel of a theme 86 | # further. For a list of options available for each theme, see the 87 | # documentation. 88 | # 89 | html_theme_options = { 90 | 'navigation_depth' : 4 91 | } 92 | 93 | # Add any paths that contain custom static files (such as style sheets) here, 94 | # relative to this directory. They are copied after the builtin static files, 95 | # so a file named "default.css" will overwrite the builtin "default.css". 96 | html_static_path = [] 97 | 98 | # Custom sidebar templates, must be a dictionary that maps document names 99 | # to template names. 100 | # 101 | # The default sidebars (for documents that don't match any pattern) are 102 | # defined by theme itself. Builtin themes are using these templates by 103 | # default: ``['localtoc.html', 'relations.html', 'sourcelink.html', 104 | # 'searchbox.html']``. 105 | # 106 | # html_sidebars = {} 107 | 108 | 109 | # -- Options for HTMLHelp output --------------------------------------------- 110 | 111 | # Output file base name for HTML help builder. 112 | htmlhelp_basename = 'thermodoc' 113 | 114 | 115 | # -- Options for LaTeX output ------------------------------------------------ 116 | 117 | latex_elements = { 118 | # The paper size ('letterpaper' or 'a4paper'). 119 | # 120 | # 'papersize': 'letterpaper', 121 | 122 | # The font size ('10pt', '11pt' or '12pt'). 123 | # 124 | # 'pointsize': '10pt', 125 | 126 | # Additional stuff for the LaTeX preamble. 127 | # 128 | # 'preamble': '', 129 | 130 | # Latex figure (float) alignment 131 | # 132 | # 'figure_align': 'htbp', 133 | } 134 | 135 | # Grouping the document tree into LaTeX files. List of tuples 136 | # (source start file, target name, title, 137 | # author, documentclass [howto, manual, or own class]). 138 | latex_documents = [ 139 | (master_doc, 'thermo.tex', u'thermo Documentation', 140 | u'Alexander Gabourie', 'manual'), 141 | ] 142 | 143 | 144 | # -- Options for manual page output ------------------------------------------ 145 | 146 | # One entry per manual page. List of tuples 147 | # (source start file, name, description, authors, manual section). 148 | man_pages = [ 149 | (master_doc, 'thermo', u'thermo Documentation', 150 | [author], 1) 151 | ] 152 | 153 | 154 | # -- Options for Texinfo output ---------------------------------------------- 155 | 156 | # Grouping the document tree into Texinfo files. List of tuples 157 | # (source start file, target name, title, author, 158 | # dir menu entry, description, category) 159 | texinfo_documents = [ 160 | (master_doc, 'thermo', u'thermo Documentation', 161 | author, 'thermo', 'One line description of project.', 162 | 'Miscellaneous'), 163 | ] 164 | 165 | 166 | # -- Options for Epub output ------------------------------------------------- 167 | 168 | # Bibliographic Dublin Core info. 169 | epub_title = project 170 | 171 | # The unique identifier of the text. This can be a ISBN number 172 | # or the project homepage. 173 | # 174 | # epub_identifier = '' 175 | 176 | # A unique identification for the text. 177 | # 178 | # epub_uid = '' 179 | 180 | # A list of files that should not be packed into the epub file. 181 | epub_exclude_files = ['search.html'] 182 | 183 | 184 | # -- Extension configuration ------------------------------------------------- 185 | -------------------------------------------------------------------------------- /docs/source/index.rst: -------------------------------------------------------------------------------- 1 | thermo - A GPUMD Helper Package 2 | =========================================== 3 | 4 | The thermo, or `thermo`_, package is a set of `Python`_ tools to interface with the molecular dynamics (MD) simulator `GPUMD`_ (and `LAMMPS`_ for comparison) for the purpose of thermodynamic simulations (i.e. thermal conductivity). 5 | 6 | Currently, the functionality is limited as it serves specific research purposes at this time; however, the long-term plan is to make this package to primarily serve `GPUMD`_ with only minor supporting functions for `LAMMPS`_ for the purpose of checking force-consistency between the simulators. 7 | 8 | The documenation is produced and maintained by `Alex Gabourie `_ at Stanford University. It outlines the structure and usage of the `thermo`_ package. 9 | 10 | Documentation 11 | ------------- 12 | 13 | | This package contains four subpackages: 14 | | 1. **gpumd** : Python interface specific to `GPUMD`_. 15 | | 2. **lammps** : Python interface specific to `LAMMPS`_. 16 | | 3. **shared** : Used strictly to compare `GPUMD`_ and `LAMMPS`_. 17 | | 4. **tools** : Extra support for more general MD related content. 18 | 19 | .. 20 | Subpackages 21 | ----------- 22 | 23 | .. toctree:: 24 | 25 | thermo.gpumd 26 | thermo.lammps 27 | thermo.shared 28 | thermo.tools 29 | 30 | .. 31 | Module contents 32 | --------------- 33 | 34 | .. automodule:: thermo 35 | :members: 36 | :undoc-members: 37 | :show-inheritance: 38 | 39 | .. _thermo: https://github.com/AlexGabourie/thermo 40 | .. _GPUMD: https://github.com/brucefan1983/GPUMD 41 | .. _LAMMPS: https://lammps.sandia.gov/ 42 | .. _Python: https://www.python.org/ 43 | 44 | 45 | * :ref:`genindex` 46 | 47 | .. * :ref:`modindex` 48 | .. * :ref:`search` 49 | -------------------------------------------------------------------------------- /docs/source/thermo.gpumd.rst: -------------------------------------------------------------------------------- 1 | gpumd 2 | ==================== 3 | 4 | .. 5 | Submodules 6 | ---------- 7 | 8 | Calculations 9 | ------------------------ 10 | 11 | .. automodule:: thermo.gpumd.calc 12 | :members: 13 | :undoc-members: 14 | :show-inheritance: 15 | 16 | Data Loaders 17 | ------------------------ 18 | 19 | .. automodule:: thermo.gpumd.data 20 | :members: 21 | :undoc-members: 22 | :show-inheritance: 23 | 24 | Input/Output 25 | ---------------------- 26 | 27 | .. automodule:: thermo.gpumd.io 28 | :members: 29 | :undoc-members: 30 | :show-inheritance: 31 | 32 | Preprocessing 33 | --------------------------- 34 | 35 | .. automodule:: thermo.gpumd.preproc 36 | :members: 37 | :undoc-members: 38 | :show-inheritance: 39 | 40 | 41 | .. 42 | Module contents 43 | --------------- 44 | 45 | .. automodule:: thermo.gpumd 46 | :members: 47 | :undoc-members: 48 | :show-inheritance: 49 | -------------------------------------------------------------------------------- /docs/source/thermo.lammps.rst: -------------------------------------------------------------------------------- 1 | lammps 2 | ===================== 3 | 4 | .. 5 | Submodules 6 | ---------- 7 | 8 | thermo.lammps.calc module 9 | ------------------------- 10 | 11 | Calculations 12 | ------------------------- 13 | 14 | .. automodule:: thermo.lammps.calc 15 | :members: 16 | :undoc-members: 17 | :show-inheritance: 18 | 19 | Data Loaders 20 | ------------------------- 21 | 22 | .. automodule:: thermo.lammps.data 23 | :members: 24 | :undoc-members: 25 | :show-inheritance: 26 | 27 | Input/Output 28 | ----------------------- 29 | 30 | .. automodule:: thermo.lammps.io 31 | :members: 32 | :undoc-members: 33 | :show-inheritance: 34 | 35 | .. 36 | Module contents 37 | --------------- 38 | 39 | .. automodule:: thermo.lammps 40 | :members: 41 | :undoc-members: 42 | :show-inheritance: 43 | -------------------------------------------------------------------------------- /docs/source/thermo.shared.rst: -------------------------------------------------------------------------------- 1 | shared 2 | ===================== 3 | 4 | .. 5 | Submodules 6 | ---------- 7 | 8 | Force Comparison 9 | -------------------------- 10 | 11 | .. automodule:: thermo.shared.force 12 | :members: 13 | :undoc-members: 14 | :show-inheritance: 15 | 16 | .. 17 | Module contents 18 | --------------- 19 | 20 | .. automodule:: thermo.shared 21 | :members: 22 | :undoc-members: 23 | :show-inheritance: 24 | -------------------------------------------------------------------------------- /docs/source/thermo.tools.rst: -------------------------------------------------------------------------------- 1 | tools 2 | ===================== 3 | 4 | .. 5 | Submodules 6 | ---------- 7 | 8 | Lennard Jones 9 | -------------------------- 10 | 11 | .. automodule:: thermo.tools.lj 12 | :members: 13 | :undoc-members: 14 | :show-inheritance: 15 | 16 | .. 17 | Module contents 18 | --------------- 19 | 20 | .. automodule:: thermo.shared 21 | :members: 22 | :undoc-members: 23 | :show-inheritance: 24 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | matplotlib 2 | pyfftw 3 | scipy 4 | numpy 5 | ase>=3.20.1 6 | pandas 7 | atomman==1.2.3 -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from distutils.core import setup 4 | import setuptools 5 | 6 | setup(name='thermo', 7 | version='0.3', 8 | description='MD thermal properties functions', 9 | author='Alexander Gabourie', 10 | author_email='gabourie@stanford.edu', 11 | packages=setuptools.find_packages(), 12 | include_package_data=True, 13 | install_requires=['matplotlib', 14 | 'pyfftw', 15 | 'scipy', 16 | 'ase>=3.20.1', 17 | 'atomman==1.2.3'], 18 | ) 19 | -------------------------------------------------------------------------------- /thermo/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hityingph/thermo/08faef51ad4333e816cadf838a224773152421fc/thermo/__init__.py -------------------------------------------------------------------------------- /thermo/data/UFF.params: -------------------------------------------------------------------------------- 1 | (dp0 2 | S'Ru' 3 | p1 4 | (F0.0024283898184332205 5 | F2.6397329018498255 6 | tp2 7 | sS'Re' 8 | p3 9 | (F0.002862030857439153 10 | F2.631714813386562 11 | tp4 12 | sS'Ra' 13 | p5 14 | (F0.017519097975839663 15 | F3.2758345866020275 16 | tp6 17 | sS'Rb' 18 | p7 19 | (F0.001734564156023729 20 | F3.6651573264293558 21 | tp8 22 | sS'Rn' 23 | p9 24 | (F0.01075429776734712 25 | F4.245132391938716 26 | tp10 27 | sS'Rh' 28 | p11 29 | (F0.0022982975067314406 30 | F2.6094423454330538 31 | tp12 32 | sS'Be' 33 | p13 34 | (F0.003685948831550424 35 | F2.4455169812952313 36 | tp14 37 | sS'Ba' 38 | p15 39 | (F0.015784533819815934 40 | F3.2989979532736764 41 | tp16 42 | sS'Bi' 43 | p17 44 | (F0.02246260582050729 45 | F3.893227398273283 46 | tp18 47 | sS'Bk' 48 | p19 49 | (F0.0005637333507077119 50 | F2.9747108198705927 51 | tp20 52 | sS'Br' 53 | p21 54 | (F0.010884390079048898 55 | F3.731974730289881 56 | tp22 57 | sS'H' 58 | p23 59 | (F0.0019080205716261018 60 | F2.5711337005530193 61 | tp24 62 | sS'P' 63 | p25 64 | (F0.013226051689680933 65 | F3.694556984127987 66 | tp26 67 | sS'Os' 68 | p27 69 | (F0.0016044718443219493 70 | F2.7796040005978586 71 | tp28 72 | sS'Es' 73 | p29 74 | (F0.0005203692468071187 75 | F2.939074871144979 76 | tp30 77 | sS'Hg' 78 | p31 79 | (F0.016695180001728392 80 | F2.4098810325696176 81 | tp32 82 | sS'Ge' 83 | p33 84 | (F0.01643499537832483 85 | F3.813046513640652 86 | tp34 87 | sS'Gd' 88 | p35 89 | (F0.000390276935105339 90 | F3.0005468826966624 91 | tp36 92 | sS'Ga' 93 | p37 94 | (F0.017996103118746186 95 | F3.9048090816091072 96 | tp38 97 | sS'Pr' 98 | p39 99 | (F0.00043364103900593224 100 | F3.2125807776140634 101 | tp40 102 | sS'Pt' 103 | p41 104 | (F0.003469128312047458 105 | F2.4535350697584946 106 | tp42 107 | sS'Pu' 108 | p43 109 | (F0.0006938256624094916 110 | F3.0504372109125217 111 | tp44 112 | sS'C' 113 | p45 114 | (F0.0045532309095622885 115 | F3.4308509635584463 116 | tp46 117 | sS'Pb' 118 | p47 119 | (F0.02875040088609331 120 | F3.828191791849038 121 | tp48 122 | sS'Pa' 123 | p49 124 | (F0.0009540102858130509 125 | F3.0504372109125217 126 | tp50 127 | sS'Pd' 128 | p51 129 | (F0.002081476987228475 130 | F2.5827153838888437 131 | tp52 132 | sS'Cd' 133 | p53 134 | (F0.009887015689335255 135 | F2.537279549263686 136 | tp54 137 | sS'Po' 138 | p55 139 | (F0.014093333767692798 140 | F4.195242063722858 141 | tp56 142 | sS'Pm' 143 | p57 144 | (F0.000390276935105339 145 | F3.1600177532437836 146 | tp58 147 | sS'Ho' 148 | p59 149 | (F0.00030354872730415256 150 | F3.0370737301404165 151 | tp60 152 | sS'Hf' 153 | p61 154 | (F0.003122215480842712 155 | F2.798312873678806 156 | tp62 157 | sS'K' 158 | p63 159 | (F0.001517743636520763 160 | F3.396105913550973 161 | tp64 162 | sS'He' 163 | p65 164 | (F0.0024283898184332205 165 | F2.1043027722474816 166 | tp66 167 | sS'Md' 168 | p67 169 | (F0.00047700514290652544 170 | F2.916802403191471 171 | tp68 172 | sS'Mg' 173 | p69 174 | (F0.004813415532965848 175 | F2.6914050275019648 176 | tp70 177 | sS'Mo' 178 | p71 179 | (F0.0024283898184332205 180 | F2.7190228877643157 181 | tp72 182 | sS'Mn' 183 | p73 184 | (F0.0005637333507077119 185 | F2.6379511044135446 186 | tp74 187 | sS'O' 188 | p75 189 | (F0.0026018462340355935 190 | F3.1181455134911875 191 | tp76 192 | sS'S' 193 | p77 194 | (F0.011881764468762544 195 | F3.594776327696269 196 | tp78 197 | sS'W' 198 | p79 199 | (F0.002905394961339746 200 | F2.7341681659727013 201 | tp80 202 | sS'Zn' 203 | p81 204 | (F0.00537714888367356 205 | F2.4615531582217574 206 | tp82 207 | sS'Eu' 208 | p83 209 | (F0.0003469128312047458 210 | F3.111909222464205 211 | tp84 212 | sS'Zr' 213 | p85 214 | (F0.0029921231691409328 215 | F2.78316759547042 216 | tp86 217 | sS'Er' 218 | p87 219 | (F0.00030354872730415256 220 | F3.0210375532138904 221 | tp88 222 | sS'Ni' 223 | p89 224 | (F0.0006504615585088984 225 | F2.5248069672097215 226 | tp90 227 | sS'No' 228 | p91 229 | (F0.00047700514290652544 230 | F2.893639036519822 231 | tp92 232 | sS'Na' 233 | p93 234 | (F0.0013009231170177968 235 | F2.6575508762126323 236 | tp94 237 | sS'Nb' 238 | p95 239 | (F0.002558482130135 240 | F2.819694442914174 241 | tp96 242 | sS'Nd' 243 | p97 244 | (F0.00043364103900593224 245 | F3.184962917351713 246 | tp98 247 | sS'Ne' 248 | p99 249 | (F0.0018212923638249155 250 | F2.88918454292912 251 | tp100 252 | sS'Np' 253 | p101 254 | (F0.0008239179741112712 255 | F3.0504372109125217 256 | tp102 257 | sS'Fr' 258 | p103 259 | (F0.002168205195029661 260 | F4.365403718887663 261 | tp104 262 | sS'Fe' 263 | p105 264 | (F0.0005637333507077119 265 | F2.5942970672246677 266 | tp106 267 | sS'Fm' 268 | p107 269 | (F0.0005203692468071187 270 | F2.927493187809155 271 | tp108 272 | sS'B' 273 | p109 274 | (F0.00780553870210678 275 | F3.6375394661670053 276 | tp110 277 | sS'F' 278 | p111 279 | (F0.002168205195029661 280 | F2.996983287824101 281 | tp112 282 | sS'Sr' 283 | p113 284 | (F0.010190564416639406 285 | F3.2437622327489755 286 | tp114 287 | sS'N' 288 | p115 289 | (F0.0029921231691409328 290 | F3.260689308393642 291 | tp116 292 | sS'Kr' 293 | p117 294 | (F0.00954010285813051 295 | F3.689211591819145 296 | tp118 297 | sS'Si' 298 | p119 299 | (F0.017432369768038476 300 | F3.826409994412757 301 | tp120 302 | sS'Sn' 303 | p121 304 | (F0.024587446911636356 305 | F3.9128271700723705 306 | tp122 307 | sS'Sm' 308 | p123 309 | (F0.0003469128312047458 310 | F3.1359634878539944 311 | tp124 312 | sS'V' 313 | p125 314 | (F0.0006938256624094916 315 | F2.8009855698332267 316 | tp126 317 | sS'Sc' 318 | p127 319 | (F0.0008239179741112712 320 | F2.935511276272418 321 | tp128 322 | sS'Sb' 323 | p129 324 | (F0.019470482651366357 325 | F3.9377723341802997 326 | tp130 327 | sS'Se' 328 | p131 329 | (F0.012618954235072628 330 | F3.746229109780127 331 | tp132 332 | sS'Co' 333 | p133 334 | (F0.0006070974546083051 335 | F2.5586611184990544 336 | tp134 337 | sS'Cm' 338 | p135 339 | (F0.0005637333507077119 340 | F2.9631291365347683 341 | tp136 342 | sS'Cl' 343 | p137 344 | (F0.009843651585434663 345 | F3.5163772404999194 346 | tp138 347 | sS'Ca' 348 | p139 349 | (F0.010320656728341187 350 | F3.0281647429590133 351 | tp140 352 | sS'Cf' 353 | p141 354 | (F0.0005637333507077119 355 | F2.9515474531989443 356 | tp142 357 | sS'Ce' 358 | p143 359 | (F0.0005637333507077119 360 | F3.1680358417070464 361 | tp144 362 | sS'Xe' 363 | p145 364 | (F0.014396882494996951 365 | F3.923517954690054 366 | tp146 367 | sS'Lu' 368 | p147 369 | (F0.0017779282599243223 370 | F3.242871334030835 371 | tp148 372 | sS'Cs' 373 | p149 374 | (F0.001951384675526695 375 | F4.024189509839913 376 | tp150 377 | sS'Cr' 378 | p151 379 | (F0.0006504615585088984 380 | F2.6931868249382456 381 | tp152 382 | sS'Cu' 383 | p153 384 | (F0.00021682051950296612 385 | F3.113691019900486 386 | tp154 387 | sS'La' 388 | p155 389 | (F0.0007371897663100849 390 | F3.1377452852902747 391 | tp156 392 | sS'Li' 393 | p157 394 | (F0.0010841025975148306 395 | F2.183592758161972 396 | tp158 397 | sS'Lw' 398 | p159 399 | (F0.00047700514290652544 400 | F2.882948251902138 401 | tp160 402 | sS'Tl' 403 | p161 404 | (F0.029487590652403393 405 | F3.872736727756055 406 | tp162 407 | sS'Tm' 408 | p163 409 | (F0.00026018462340355935 410 | F3.005892275005505 411 | tp164 412 | sS'Th' 413 | p165 414 | (F0.0011274667014154237 415 | F3.025492046804592 416 | tp166 417 | sS'Ti' 418 | p167 419 | (F0.0007371897663100849 420 | F2.828603430095577 421 | tp168 422 | sS'Te' 423 | p169 424 | (F0.017258913352436105 425 | F3.982317270087316 426 | tp170 427 | sS'Tb' 428 | p171 429 | (F0.00030354872730415256 430 | F3.074491476302311 431 | tp172 432 | sS'Tc' 433 | p173 434 | (F0.002081476987228475 435 | F2.6709143569847376 436 | tp174 437 | sS'Ta' 438 | p175 439 | (F0.003512492415948051 440 | F2.8241489365048755 441 | tp176 442 | sS'Yb' 443 | p177 444 | (F0.009887015689335255 445 | F2.9889651993608384 446 | tp178 447 | sS'Dy' 448 | p179 449 | (F0.00030354872730415256 450 | F3.054000805785083 451 | tp180 452 | sS'I' 453 | p181 454 | (F0.014700431222301105 455 | F4.009044231631527 456 | tp182 457 | sS'U' 458 | p183 459 | (F0.0009540102858130509 460 | F3.0246011480864516 461 | tp184 462 | sS'Y' 463 | p185 464 | (F0.003122215480842712 465 | F2.980056212179435 466 | tp186 467 | sS'Ac' 468 | p187 469 | (F0.0014310154287195764 470 | F3.0985457416921003 471 | tp188 472 | sS'Ag' 473 | p189 474 | (F0.001561107740421356 475 | F2.8045491647057883 476 | tp190 477 | sS'Ir' 478 | p191 479 | (F0.003165579584743305 480 | F2.5301523595185635 481 | tp192 482 | sS'Am' 483 | p193 484 | (F0.0006070974546083051 485 | F3.012128566032487 486 | tp194 487 | sS'Al' 488 | p195 489 | (F0.021898872469799577 490 | F4.008153332913386 491 | tp196 492 | sS'As' 493 | p197 494 | (F0.013399508105283306 495 | F3.7685015777336357 496 | tp198 497 | sS'Ar' 498 | p199 499 | (F0.008022359221609746 500 | F3.4459962417668324 501 | tp200 502 | sS'Au' 503 | p201 504 | (F0.0016912000521231358 505 | F2.9337294788361374 506 | tp202 507 | sS'At' 508 | p203 509 | (F0.012315405507768475 510 | F4.231768911166611 511 | tp204 512 | sS'In' 513 | p205 514 | (F0.02597509823645534 515 | F3.976080979060334 516 | tp206 517 | s. -------------------------------------------------------------------------------- /thermo/data/readme.md: -------------------------------------------------------------------------------- 1 | # Data Used With Thermo Package 2 | * UFF.params: Stores all LJ information from [Rappe's UFF paper](https://pubs.acs.org/doi/abs/10.1021/ja00051a040). Can be loaded with gpumd.data subpackage (location subject to change later). -------------------------------------------------------------------------------- /thermo/gpumd/__init__.py: -------------------------------------------------------------------------------- 1 | __all__ = ['io', 'preproc', 'data', 'calc'] 2 | -------------------------------------------------------------------------------- /thermo/gpumd/calc.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | from scipy.integrate import cumtrapz 3 | from .common import __get_direction, __get_path 4 | from thermo.math.correlate import corr 5 | from scipy import integrate 6 | 7 | __author__ = "Alexander Gabourie" 8 | __email__ = "gabourie@stanford.edu" 9 | 10 | 11 | def __scale_gpumd_tc(vol, T): 12 | """ 13 | Used to scale the thermal conductivity when converting GPUMD heat-flux correlations 14 | to thermal conductivity. 15 | 16 | Args: 17 | vol (float): 18 | Volume in angstroms^3 19 | 20 | T (float): 21 | Temperature in K 22 | 23 | Returns: 24 | float: Converted value 25 | """ 26 | 27 | one = 1.602176634e-19 * 9.651599e7 # eV^3/amu -> Jm^2/s^2*eV 28 | two = 1. / 1.e15 # fs -> s 29 | three = 1.e30 / 8.617333262145e-5 # K/(eV*Ang^3) -> K/(eV*m^3) w/ Boltzmann 30 | return one * two * three / (T * T * vol) 31 | 32 | 33 | def get_gkma_kappa(data, nbins, nsamples, dt, sample_interval, T=300, vol=1, max_tau=None, directions='xyz', 34 | outputfile='heatmode.npy', save=False, directory=None, return_data=True): 35 | """ 36 | Calculate the Green-Kubo thermal conductivity from modal heat current data from 'load_heatmode' 37 | 38 | Args: 39 | data (dict): 40 | Dictionary with heat currents loaded by 'load_heatmode' 41 | 42 | nbins (int): 43 | Number of bins used during the GPUMD simulation 44 | 45 | nsamples (int): 46 | Number of times heat flux was sampled with GKMA during GPUMD simulation 47 | 48 | dt (float): 49 | Time step during data collection in fs 50 | 51 | sample_interval (int): 52 | Number of time steps per sample of modal heat flux 53 | 54 | T (float): 55 | Temperature of system during data collection 56 | 57 | vol (float): 58 | Volume of system in angstroms^3 59 | 60 | max_tau (float): 61 | Correlation time to calculate up to. Units of ns 62 | 63 | directions (str): 64 | Directions to gather data from. Any order of 'xyz' is accepted. Excluding directions also allowed (i.e. 'xz' 65 | is accepted) 66 | 67 | outputfile (str): 68 | File name to save read data to. Output file is a binary dictionary. Loading from a binary file is much 69 | faster than re-reading data files and saving is recommended 70 | 71 | save (bool): 72 | Toggle saving data to binary dictionary. Loading from save file is much faster and recommended 73 | 74 | directory (str): 75 | Name of directory storing the input file to read 76 | 77 | return_data (bool): 78 | Toggle returning the loaded modal heat flux data. If this is False, the user should ensure that 79 | save is True 80 | 81 | Returns: 82 | dict: Input data dict but with correlation, thermal conductivity, and lag time data included 83 | 84 | .. csv-table:: Output dictionary (new entries) 85 | :stub-columns: 1 86 | 87 | **key**,tau,kmxi,kmxo,kmyi,kmyo,kmz,jmxijx,jmxojx,jmyijy,jmyojy,jmzjz 88 | **units**,ns,|gk1|,|gk1|,|gk1|,|gk1|,|gk1|,|gk2|,|gk2|,|gk2|,|gk2|,|gk2| 89 | 90 | .. |gk1| replace:: Wm\ :sup:`-1` K\ :sup:`-1` *x*\ :sup:`-1` 91 | .. |gk2| replace:: eV\ :sup:`3` amu\ :sup:`-1` *x*\ :sup:`-1` 92 | 93 | Here *x* is the size of the bins in THz. For example, if there are 4 bins per THz, *x* = 0.25 THz. 94 | """ 95 | out_path = __get_path(directory, outputfile) 96 | scale = __scale_gpumd_tc(vol, T) 97 | # set the heat flux sampling time: rate * timestep * scaling 98 | srate = sample_interval * dt # [fs] 99 | 100 | # Calculate total time 101 | tot_time = srate * (nsamples - 1) # [fs] 102 | 103 | # set the integration limit (i.e. tau) 104 | if max_tau is None: 105 | max_tau = tot_time # [fs] 106 | else: 107 | max_tau = max_tau * 1e6 # [fs] 108 | 109 | max_lag = int(np.floor(max_tau / srate)) 110 | size = max_lag + 1 111 | data['tau'] = np.squeeze(np.linspace(0, max_lag * srate, max_lag + 1)) # [ns] 112 | 113 | ### AUTOCORRELATION ### 114 | directions = __get_direction(directions) 115 | cplx = np.complex128 116 | # Note: loops necessary due to memory constraints 117 | # (can easily max out cluster mem.) 118 | if 'x' in directions: 119 | if 'jmxi' not in data.keys() or 'jmxo' not in data.keys(): 120 | raise ValueError("x direction data is missing") 121 | 122 | jx = np.sum(data['jmxi']+data['jmxo'], axis=0) 123 | data['jmxijx'] = np.zeros((nbins, size)) 124 | data['jmxojx'] = np.zeros((nbins, size)) 125 | data['kmxi'] = np.zeros((nbins, size)) 126 | data['kmxo'] = np.zeros((nbins, size)) 127 | for m in range(nbins): 128 | data['jmxijx'][m, :] = corr(data['jmxi'][m, :].astype(cplx), jx.astype(cplx), max_lag) 129 | data['kmxi'][m, :] = integrate.cumtrapz(data['jmxijx'][m, :], data['tau'], initial=0) * scale 130 | 131 | data['jmxojx'][m, :] = corr(data['jmxo'][m, :].astype(cplx), jx.astype(cplx), max_lag) 132 | data['kmxo'][m, :] = integrate.cumtrapz(data['jmxojx'][m, :], data['tau'], initial=0) * scale 133 | del jx 134 | 135 | if 'y' in directions: 136 | if 'jmyi' not in data.keys() or 'jmyo' not in data.keys(): 137 | raise ValueError("y direction data is missing") 138 | 139 | jy = np.sum(data['jmyi']+data['jmyo'], axis=0) 140 | data['jmyijy'] = np.zeros((nbins, size)) 141 | data['jmyojy'] = np.zeros((nbins, size)) 142 | data['kmyi'] = np.zeros((nbins, size)) 143 | data['kmyo'] = np.zeros((nbins, size)) 144 | for m in range(nbins): 145 | data['jmyijy'][m, :] = corr(data['jmyi'][m, :].astype(cplx), jy.astype(cplx), max_lag) 146 | data['kmyi'][m, :] = integrate.cumtrapz(data['jmyijy'][m, :], data['tau'], initial=0) * scale 147 | 148 | data['jmyojy'][m, :] = corr(data['jmyo'][m, :].astype(cplx), jy.astype(cplx), max_lag) 149 | data['kmyo'][m, :] = integrate.cumtrapz(data['jmyojy'][m, :], data['tau'], initial=0) * scale 150 | del jy 151 | 152 | if 'z' in directions: 153 | if 'jmz' not in data.keys(): 154 | raise ValueError("z direction data is missing") 155 | 156 | jz = np.sum(data['jmz'], axis=0) 157 | data['jmzjz'] = np.zeros((nbins, size)) 158 | data['kmz'] = np.zeros((nbins, size)) 159 | for m in range(nbins): 160 | data['jmzjz'][m, :] = corr(data['jmz'][m, :].astype(cplx), jz.astype(cplx), max_lag) 161 | data['kmz'][m, :] = integrate.cumtrapz(data['jmzjz'][m, :], data['tau'], initial=0) * scale 162 | del jz 163 | 164 | data['tau'] = data['tau'] / 1.e6 165 | 166 | if save: 167 | np.save(out_path, data) 168 | 169 | if return_data: 170 | return data 171 | return 172 | 173 | 174 | def running_ave(kappa, time): 175 | """ 176 | Gets running average. Reads and returns the structure input file from GPUMD. 177 | 178 | Args: 179 | kappa (ndarray): Raw thermal conductivity 180 | time (ndarray): Time vector that kappa was sampled at 181 | 182 | Returns: 183 | ndarray: Running average of kappa input 184 | """ 185 | return cumtrapz(kappa, time, initial=0)/time 186 | 187 | 188 | def hnemd_spectral_kappa(shc, Fe, T, V): 189 | """ 190 | Spectral thermal conductivity calculation from an SHC run 191 | 192 | Args: 193 | shc (dict): 194 | The data from a single SHC run as output by thermo.gpumd.data.load_shc 195 | 196 | Fe (float): 197 | HNEMD force in (1/A) 198 | 199 | T (float): 200 | HNEMD run temperature (K) 201 | 202 | V (float): 203 | Volume (A^3) during HNEMD run 204 | 205 | Returns: 206 | dict: Same as shc argument, but with spectral thermal conductivity included 207 | 208 | .. csv-table:: Output dictionary (new entries) 209 | :stub-columns: 1 210 | 211 | **key**,kwi,kwo 212 | **units**,|sh3|,|sh3| 213 | 214 | .. |sh3| replace:: Wm\ :sup:`-1` K\ :sup:`-1` THz\ :sup:`-1` 215 | """ 216 | if 'jwi' not in shc.keys() or 'jwo' not in shc.keys(): 217 | raise ValueError("shc argument must be from load_shc and contain in/out heat currents.") 218 | 219 | # ev*A/ps/THz * 1/A^3 *1/K * A ==> W/m/K/THz 220 | convert = 1602.17662 221 | shc['kwi'] = shc['jwi']*convert/(Fe*T*V) 222 | shc['kwo'] = shc['jwo'] * convert / (Fe * T * V) 223 | -------------------------------------------------------------------------------- /thermo/gpumd/common.py: -------------------------------------------------------------------------------- 1 | import re 2 | import os 3 | 4 | __author__ = "Alexander Gabourie" 5 | __email__ = "gabourie@stanford.edu" 6 | 7 | 8 | def __get_direction(directions): 9 | """ 10 | Creates a sorted list showing which directions the user asked for. Ex: 'xyz' -> ['x', 'y', 'z'] 11 | 12 | Args: 13 | directions (str): 14 | A string containing the directions the user wants to process (Ex: 'xyz', 'zy', 'x') 15 | 16 | Returns: 17 | list(str): An ordered list that simplifies the user input for future processing 18 | 19 | """ 20 | if not (bool(re.match('^[xyz]+$',directions)) 21 | or len(directions) > 3 22 | or len(directions) == 0): 23 | raise ValueError('Invalid directions used.') 24 | return sorted(list(set(directions))) 25 | 26 | 27 | def __get_path(directory, filename): 28 | if not directory: 29 | return os.path.join(os.getcwd(), filename) 30 | return os.path.join(directory, filename) 31 | 32 | 33 | def __check_list(data, varname=None, dtype=None): 34 | """ 35 | Checks if data is a list of dtype or turns a variable of dtype into a list 36 | 37 | Args: 38 | data: 39 | Data to check 40 | 41 | varname (str): 42 | Name of variable to check 43 | 44 | dtype (type) 45 | Data type to check data against 46 | Returns: 47 | list(dtype) 48 | """ 49 | 50 | if type(data) == dtype: 51 | return [data] 52 | 53 | if type(data) == list: 54 | for elem in data: 55 | if not type(elem) == dtype: 56 | if varname: 57 | raise ValueError('All entries for {} must be {}.'.format(str(varname), str(dtype))) 58 | return data 59 | 60 | raise ValueError('{} is not the correct type.'.format(str(varname))) 61 | 62 | 63 | def __check_range(npoints, maxpoints): 64 | """ 65 | Checks if requested points are valid 66 | 67 | Args: 68 | npoints (list(int)): 69 | Points to check 70 | 71 | maxpoints (int): 72 | Maximum number of points to read 73 | 74 | Returns: 75 | None 76 | """ 77 | if sum(npoints) > maxpoints: 78 | raise ValueError("More data requested than exists.") 79 | 80 | for points in npoints: 81 | if points < 1: 82 | raise ValueError("Only strictly positive numbers are allowed.") -------------------------------------------------------------------------------- /thermo/gpumd/preproc.py: -------------------------------------------------------------------------------- 1 | from .common import __check_list, __check_range 2 | from numpy import prod 3 | 4 | __author__ = "Alexander Gabourie" 5 | __email__ = "gabourie@stanford.edu" 6 | 7 | 8 | ######################################### 9 | # Structure preprocessing 10 | ######################################### 11 | 12 | def __get_group(split, pos, direction): 13 | """ 14 | Gets the group that an atom belongs to based on its position. Only works in 15 | one direction as it is used for NEMD. 16 | 17 | Args: 18 | split (list(float)): 19 | List of boundaries. First element should be lower boundary of 20 | sim. box in specified direction and the last the upper. 21 | 22 | position (float): 23 | Position of the atom 24 | 25 | direction (str): 26 | Which direction the split will work 27 | 28 | Returns: 29 | int: Group of atom 30 | 31 | """ 32 | if direction == 'x': 33 | d = pos[0] 34 | elif direction == 'y': 35 | d = pos[1] 36 | else: 37 | d = pos[2] 38 | errmsg = 'Out of bounds error: {}'.format(d) 39 | for i, val in enumerate(split[:-1]): 40 | if i == 0 and d < val: 41 | print(errmsg) 42 | return -1 43 | if val <= d < split[i + 1]: 44 | return i 45 | print(errmsg) 46 | return -1 47 | 48 | 49 | def __init_index(index, info, num_atoms): 50 | """ 51 | Initializes the index key for the info dict. 52 | 53 | Args: 54 | index (int): 55 | Index of atom in the Atoms object. 56 | 57 | info (dict): 58 | Dictionary that stores the velocity, and groups. 59 | 60 | num_atoms (int): 61 | Number of atoms in the Atoms object. 62 | 63 | Returns: 64 | int: Index of atom in the Atoms object. 65 | 66 | """ 67 | if index == num_atoms - 1: 68 | index = -1 69 | if index not in info: 70 | info[index] = dict() 71 | return index 72 | 73 | 74 | def __handle_end(info, num_atoms): 75 | """ 76 | Duplicates the index -1 entry for key that's num_atoms-1. Works in-place. 77 | 78 | Args: 79 | info (dict): 80 | Dictionary that stores the velocity, and groups. 81 | 82 | num_atoms (int): 83 | Number of atoms in the Atoms object. 84 | 85 | """ 86 | info[num_atoms - 1] = info[-1] 87 | 88 | 89 | def add_group_by_position(split, atoms, direction): 90 | """ 91 | Assigns groups to all atoms based on its position. Only works in 92 | one direction as it is used for NEMD. 93 | Returns a bookkeeping parameter, but atoms will be udated in-place. 94 | 95 | Args: 96 | split (list(float)): 97 | List of boundaries. First element should be lower boundary of sim. 98 | box in specified direction and the last the upper. 99 | 100 | atoms (ase.Atoms): 101 | Atoms to group 102 | 103 | direction (str): 104 | Which direction the split will work. 105 | 106 | Returns: 107 | int: A list of number of atoms in each group. 108 | 109 | """ 110 | info = atoms.info 111 | counts = [0] * (len(split) - 1) 112 | num_atoms = len(atoms) 113 | for index, atom in enumerate(atoms): 114 | index = __init_index(index, info, num_atoms) 115 | i = __get_group(split, atom.position, direction) 116 | if 'groups' in info[index]: 117 | info[index]['groups'].append(i) 118 | else: 119 | info[index]['groups'] = [i] 120 | counts[i] += 1 121 | __handle_end(info, num_atoms) 122 | atoms.info = info 123 | return counts 124 | 125 | 126 | def add_group_by_type(atoms, types): 127 | """ 128 | Assigns groups to all atoms based on atom types. Returns a 129 | bookkeeping parameter, but atoms will be udated in-place. 130 | 131 | Args: 132 | atoms (ase.Atoms): 133 | Atoms to group 134 | 135 | types (dict): 136 | Dictionary with types for keys and group as a value. 137 | Only one group allowed per atom. Assumed groups are integers 138 | starting at 0 and increasing in steps of 1. Ex. range(0,10). 139 | 140 | Returns: 141 | int: A list of number of atoms in each group. 142 | 143 | """ 144 | # atom symbol checking 145 | all_symbols = list(types) 146 | # check that symbol set matches symbol set of atoms 147 | if set(atoms.get_chemical_symbols()) - set(all_symbols): 148 | raise ValueError('Group symbols do not match atoms symbols.') 149 | if not len(set(all_symbols)) == len(all_symbols): 150 | raise ValueError('Group not assigned to all atom types.') 151 | 152 | num_groups = len(set([types[sym] for sym in set(all_symbols)])) 153 | num_atoms = len(atoms) 154 | info = atoms.info 155 | counts = [0] * num_groups 156 | for index, atom in enumerate(atoms): 157 | index = __init_index(index, info, num_atoms) 158 | group = types[atom.symbol] 159 | counts[group] += 1 160 | if 'groups' in info[index]: 161 | info[index]['groups'].append(group) 162 | else: 163 | info[index]['groups'] = [group] 164 | __handle_end(info, num_atoms) 165 | atoms.info = info 166 | return counts 167 | 168 | 169 | def set_velocities(atoms, custom=None): 170 | """ 171 | Sets the 'velocity' part of the atoms to be used in GPUMD. 172 | Custom velocities must be provided. They must also be in 173 | the units of eV^(1/2) amu^(-1/2). 174 | 175 | Args: 176 | atoms (ase.Atoms): 177 | Atoms to assign velocities to. 178 | 179 | custom (list(list)): 180 | list of len(atoms) with each element made from 181 | a 3-element list for [vx, vy, vz] 182 | 183 | """ 184 | if not custom: 185 | raise ValueError("No velocities provided.") 186 | 187 | num_atoms = len(atoms) 188 | info = atoms.info 189 | if not len(custom) == num_atoms: 190 | return ValueError('Incorrect number of velocities for number of atoms.') 191 | for index, (atom, velocity) in enumerate(zip(atoms, custom)): 192 | if not len(velocity) == 3: 193 | return ValueError('Three components of velocity not provided.') 194 | index = __init_index(index, info, num_atoms) 195 | info[index]['velocity'] = velocity 196 | __handle_end(info, num_atoms) 197 | atoms.info = info 198 | 199 | 200 | def __init_index2(index, info): # TODO merge this with other __init_index function 201 | if index not in info.keys(): 202 | info[index] = dict() 203 | 204 | 205 | def add_basis(atoms, index=None, mapping=None): 206 | """ 207 | Assigns a basis index for each atom in atoms. Updates atoms. 208 | 209 | Args: 210 | atoms (ase.Atoms): 211 | Atoms to assign basis to. 212 | 213 | index (list(int)): 214 | Atom indices of those in the unit cell. Order is important. 215 | 216 | mapping (list(int)): 217 | Mapping of all atoms to the relevant basis positions 218 | 219 | 220 | """ 221 | n = atoms.get_global_number_of_atoms() 222 | info = atoms.info 223 | info['unitcell'] = list() 224 | if index: 225 | if (mapping is None) or (len(mapping) != n): 226 | raise ValueError("Full atom mapping required if index is provided.") 227 | for idx in index: 228 | info['unitcell'].append(idx) 229 | for idx in range(n): 230 | __init_index2(idx, info) 231 | info[idx]['basis'] = mapping[idx] 232 | else: 233 | for idx in range(n): 234 | info['unitcell'].append(idx) 235 | # if no index provided, assume atoms is unit cell 236 | __init_index2(idx, info) 237 | info[idx]['basis'] = idx 238 | 239 | 240 | def repeat(atoms, rep): 241 | """ 242 | A wrapper of ase.Atoms.repeat that is aware of GPUMD's basis information. 243 | 244 | Args: 245 | atoms (ase.Atoms): 246 | Atoms to assign velocities to. 247 | 248 | rep (int | list(3 ints)): 249 | List of three positive integers or a single integer 250 | 251 | """ 252 | rep = __check_list(rep, varname='rep', dtype=int) 253 | replen = len(rep) 254 | if replen == 1: 255 | rep = rep*3 256 | elif not replen == 3: 257 | raise ValueError("rep must be a sequence of 1 or 3 integers.") 258 | __check_range(rep, 2**64) 259 | supercell = atoms.repeat(rep) 260 | sinfo = supercell.info 261 | ainfo = atoms.info 262 | n = atoms.get_global_number_of_atoms() 263 | for i in range(1, prod(rep, dtype=int)): 264 | for j in range(n): 265 | sinfo[i*n+j] = {'basis': ainfo[j]['basis']} 266 | 267 | return supercell 268 | -------------------------------------------------------------------------------- /thermo/lammps/__init__.py: -------------------------------------------------------------------------------- 1 | __all__ = ['calc', 'data', 'io'] 2 | -------------------------------------------------------------------------------- /thermo/lammps/calc.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import os 3 | from scipy import integrate 4 | from math import floor 5 | import scipy.io as sio 6 | from thermo.math.correlate import autocorr 7 | 8 | __author__ = "Alexander Gabourie" 9 | __email__ = "gabourie@stanford.edu" 10 | 11 | 12 | def __metal_to_SI(vol, T): 13 | """ 14 | Converts LAMMPS metal units to SI units for thermal conductivity calculations. 15 | 16 | Args: 17 | vol (float): 18 | Volume in angstroms^3 19 | 20 | T (float): 21 | Temperature in K 22 | 23 | Returns: 24 | float: Converted value 25 | """ 26 | kb = 1.38064852e-23 # m3*kg/(s2*K) 27 | vol = vol/(1.0e10)**3 # to m3 28 | # eV2*ns/(ps2*A4) to J2/(s*m4) 29 | to_SI = (1.602e-19)**2.*1.0e12*(1.0e10)**4.0*1000. 30 | return vol*to_SI/(kb*T**2) 31 | 32 | 33 | def get_heat_flux(directory='.', heatflux_file='heat_out.heatflux', mat_file='heat_flux.mat'): 34 | """ 35 | Gets the heat flux from a LAMMPS EMD simulation. Creates a compressed .mat 36 | file if only in text form. Loads .mat form if exists. 37 | 38 | Args: 39 | directory (str): 40 | Directory of simulation results 41 | 42 | heatflux_file (str): 43 | Filename of heatflux output 44 | 45 | mat_file (str): 46 | MATLAB file to load, if exists, or save to, if does not exist. 47 | Default save name of 'heat_flux.mat' 48 | 49 | Returns: 50 | dict: Dictionary with heat flux data 51 | 52 | .. csv-table:: Output dictionary (metal units) 53 | :stub-columns: 1 54 | 55 | **key**,jx,jy,jz,rate 56 | **units**,|j1|,|j1|,|j1|,timestep 57 | 58 | .. |j1| replace:: eV ps\ :sup:`-1` A\ :sup:`-2` 59 | """ 60 | heatflux_file = os.path.join(directory, heatflux_file) 61 | mat_file = os.path.join(directory, mat_file) 62 | 63 | # Check that directory exists 64 | if not os.path.isdir(directory): 65 | raise IOError('The path: {} is not a directory.'.format(directory)) 66 | 67 | # Go to directory and see if imported .mat file already exists 68 | if os.path.isfile(mat_file) and mat_file.endswith('.mat'): 69 | return sio.loadmat(mat_file) 70 | 71 | # Continue with the import since .mat file 72 | if not os.path.isfile(heatflux_file): 73 | raise IOError('The file: \'{}{}\' is not found.'.format(directory,heatflux_file)) 74 | 75 | # Read the file 76 | with open(heatflux_file, 'r') as hf_file: 77 | lines = hf_file.readlines()[2:] 78 | 79 | num_elem = len(lines) 80 | 81 | # Get timestep 82 | rate = int(lines[0].split()[0]) 83 | 84 | # read all data 85 | jx = np.zeros(num_elem) 86 | jy = np.zeros(num_elem) 87 | jz = np.zeros(num_elem) 88 | for i,line in enumerate(lines): 89 | vals = line.split() 90 | jx[i] = float(vals[1]) 91 | jy[i] = float(vals[2]) 92 | jz[i] = float(vals[3]) 93 | 94 | output = {'jx':jx, 'jy':jy, 'jz':jz, 'rate':rate} 95 | sio.savemat(mat_file, output) 96 | return output 97 | 98 | 99 | def get_GKTC(directory='.', T=300, vol=1, dt=None, rate=None, tau=None, 100 | heatflux_file='heat_out.heatflux',mat_file='heat_flux.mat'): 101 | """ 102 | Calculates the thermal conductivity (TC) using the Green-Kubo (GK) formalism. 103 | The 'metal' units in LAMMPS must be used. 104 | 105 | Args: 106 | directory (string): 107 | Directory of simulation 108 | 109 | T (float): 110 | Temperature of simulation. Units of K 111 | 112 | vol (float): 113 | Volume of the simulation cell. Units of A^3 114 | 115 | dt (float): 116 | Timestep of the of simulation. Units are fs 117 | 118 | rate (int): 119 | Rate at which the heat flux is sampled in number of timesteps. Default of rate=dt 120 | 121 | tau (int): 122 | max lag time to integrate over. Units of ns and default of tau=total time 123 | 124 | heatflux_file (str): 125 | Heatflux output filename. 126 | 127 | mat_file (str): 128 | MATLAB file to load, if exists, or save to, if does not exist. 129 | Default save name of 'heat_flux.mat' 130 | 131 | Returns: 132 | dict: Dictionary with Green-Kubo thermal conductivity data 133 | 134 | .. csv-table:: Output dictionary 135 | :stub-columns: 1 136 | 137 | **key**,kx,ky,kz,t,dt,T,V,jxjx,jyjy,jzjz,tot_time,tau,srate,directory 138 | **units**,|gk1|,|gk1|,|gk1|,ns,fs,K,|gk2|,|gk3|,|gk3|,|gk3|,ns,ns,ns,N/A 139 | 140 | .. |gk1| replace:: Wm\ :sup:`-1` K\ :sup:`-1` 141 | .. |gk2| replace:: A\ :sup:`3` 142 | .. |gk3| replace:: (eV ps\ :sup:`-1` A\ :sup:`-2`)\ :sup:`2` 143 | """ 144 | # Check that directory exists 145 | if not os.path.isdir(directory): 146 | raise IOError('The path: {} is not a directory.'.format(directory)) 147 | 148 | # get heat flux, pass args 149 | hf = get_heat_flux(directory, heatflux_file,mat_file) 150 | jx = np.squeeze(hf['jx']) 151 | jy = np.squeeze(hf['jy']) 152 | jz = np.squeeze(hf['jz']) 153 | 154 | scale = __metal_to_SI(vol, T) 155 | 156 | # Set timestep if not set 157 | if dt is None: 158 | dt = 1.0e-6 # [ns] 159 | else: 160 | dt = dt*1.0e-6 # [fs] -> [ns] 161 | 162 | # set the heat flux sampling rate: rate*timestep*scaling 163 | srate = rate*dt # [ns] 164 | 165 | # Calculate total time 166 | tot_time = srate*(len(jx)-1) # [ns] 167 | 168 | # set the integration limit (i.e. tau) 169 | if tau is None: 170 | tau = tot_time # [ns] 171 | 172 | max_lag = int(floor(tau/(srate))) 173 | t = np.squeeze(np.linspace(0, (max_lag)*srate, max_lag+1)) # [ns] 174 | 175 | jxjx = autocorr(np.squeeze(jx).astype(np.complex128), max_lag) 176 | jyjy = autocorr(np.squeeze(jy).astype(np.complex128), max_lag) 177 | jzjz = autocorr(np.squeeze(jz).astype(np.complex128), max_lag) 178 | 179 | kx = integrate.cumtrapz(jxjx, t, initial=0)*scale 180 | ky = integrate.cumtrapz(jyjy, t, initial=0)*scale 181 | kz = integrate.cumtrapz(jzjz, t, initial=0)*scale 182 | 183 | dt /= 1e6 # [ns] -> [fs] 184 | 185 | return {'kx':kx, 'ky':ky, 'kz':kz, 't':t, 'directory':directory, 186 | 'dt':dt, 'tot_time':tot_time,'tau':tau, 'T':T, 187 | 'V':vol, 'srate':srate, 'jxjx':jxjx, 'jyjy':jyjy, 'jzjz':jzjz} 188 | -------------------------------------------------------------------------------- /thermo/lammps/data.py: -------------------------------------------------------------------------------- 1 | import os 2 | import numpy as np 3 | 4 | __author__ = "Alexander Gabourie" 5 | __email__ = "gabourie@stanford.edu" 6 | 7 | 8 | def __get_path(directory, filename): 9 | if not directory: 10 | return os.path.join(os.getcwd(), filename) 11 | return os.path.join(directory, filename) 12 | 13 | 14 | def __process_box(out, filehandle): 15 | """ 16 | Processes the lines of a trajectory file dedicated to the box size and shape 17 | 18 | Args: 19 | out (dict): 20 | Stores all relevant box information 21 | 22 | filehandle (TextIOWrapper): 23 | The trajectory file handle 24 | 25 | """ 26 | for pair in [('x', 'xy'), ('y', 'xz'), ('z', 'yz')]: 27 | data = [float(i) for i in filehandle.readline().split()] 28 | out[pair[0]].append(data[1]-data[0]) 29 | triclinic = len(data) == 3 30 | out[pair[1]].append(data[2] if triclinic else None) 31 | 32 | if triclinic: 33 | a = np.array([out['x'][-1], 0, 0]) 34 | b = np.array([out['xy'][-1], out['y'], 0]) 35 | c = np.array([out['xz'][-1], out['yz'], out['z']]) 36 | Avec = np.cross(a, b) 37 | out['A'].append(np.linalg.norm(Avec)) 38 | out['V'].append(np.abs(np.dot(Avec, c))) 39 | else: 40 | out['A'].append(out['x'][-1]*out['y'][-1]) 41 | out['V'].append(out['A'][-1]*out['z'][-1]) 42 | 43 | 44 | def get_dimensions(filename, directory=None): 45 | """ 46 | Gets the dimensions of a 3D simulation from a LAMMPS trajectory. 47 | 48 | Args: 49 | filename (str): 50 | LAMMPS trajectory file to extract dimensions from 51 | 52 | directory (str): 53 | The directory the trajectory file is found in 54 | 55 | Returns: 56 | dict: Dictionary with keys given in the table below 57 | 58 | .. csv-table:: Output dictionary 59 | :stub-columns: 1 60 | 61 | **key**, x, y, z, A, V, xy, xz, yz 62 | **units**,|d1|,|d1|,|d1|,|d2|,|d3|,|d1|,|d1|,|d1| 63 | 64 | .. |d1| replace:: distance 65 | .. |d2| replace:: distance\ :sup:`2` 66 | .. |d3| replace:: distance\ :sup:`3` 67 | 68 | """ 69 | trjpath = __get_path(directory, filename) 70 | labels = ['x', 'y', 'z', 'A', 'V', 'xy', 'xz', 'yz'] 71 | out = dict() 72 | for label in labels: 73 | out[label] = [] 74 | 75 | with open(trjpath) as f: 76 | line = f.readline() 77 | while line: 78 | if 'BOX' in line: 79 | __process_box(out, f) 80 | line = f.readline() 81 | return out 82 | 83 | 84 | def extract_dt(log_file): 85 | """ 86 | Finds all time steps given in the lammps output log 87 | 88 | Args: 89 | log_file (str): 90 | LAMMPS log file to examine 91 | 92 | Returns: 93 | list(float): The timesteps found in log_file in units of time 94 | """ 95 | dt = list() 96 | if os.path.isfile(log_file): 97 | with open(log_file, 'r') as log: 98 | lines = log.readlines() 99 | 100 | for line in lines: 101 | elements = line.split() 102 | if len(elements) > 0 and ' '.join(elements[0:2]) == 'Time step': 103 | dt.append(float(elements[3])) 104 | if len(dt) == 0: 105 | print('No timesteps found in', log_file) 106 | else: 107 | print(log_file, 'not found') 108 | 109 | return dt 110 | -------------------------------------------------------------------------------- /thermo/lammps/io.py: -------------------------------------------------------------------------------- 1 | import atomman 2 | from ase import Atom 3 | 4 | __author__ = "Alexander Gabourie" 5 | __email__ = "gabourie@stanford.edu" 6 | 7 | 8 | def ase_atoms_to_lammps(atoms, out_file='atoms.data', add_masses=True): 9 | """ 10 | Converts ASE atoms to a lammps data file. 11 | 12 | Args: 13 | atoms (ase.Atoms): 14 | Atoms to write to lammps data file 15 | 16 | out_file (str): 17 | File to save the structure data to 18 | 19 | add_masses (Bool): 20 | Determines if atom masses are written to data file 21 | 22 | """ 23 | sys = atomman.load_ase_Atoms(atoms) 24 | elem = sys.symbols 25 | # write data file 26 | atomman.dump_atom_data(sys, out_file) 27 | 28 | if add_masses: 29 | # Write block of string for mass inclusion 30 | mass_str = 'Masses\n\n' 31 | for i, element in enumerate(elem): 32 | mass_str += '{} {}\n'.format(str(i + 1), str(Atom(element).mass)) 33 | 34 | mass_str += '\n' 35 | 36 | # add the mass string to the correct part of the datafile 37 | with open(out_file, 'r') as f: 38 | lines = f.readlines() 39 | 40 | for i, line in enumerate(lines): 41 | if 'Atoms' in line: 42 | break 43 | 44 | lines.insert(len(lines)-1, mass_str) 45 | 46 | with open(out_file, 'w') as f: 47 | f.write(''.join(lines)) 48 | -------------------------------------------------------------------------------- /thermo/math/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /thermo/math/correlate.py: -------------------------------------------------------------------------------- 1 | import pyfftw 2 | import multiprocessing 3 | import numpy as np 4 | 5 | 6 | def autocorr(f, max_lag): 7 | """ 8 | Computes a fast autocorrelation function and returns up to max_lag. 9 | 10 | Args: 11 | f (ndarray): 12 | Vector for autocorrelation 13 | 14 | max_lag (float): 15 | Lag at which to calculate up to 16 | 17 | Returns: 18 | ndarray: Autocorrelation vector 19 | 20 | """ 21 | N = len(f) 22 | d = N - np.arange(N) 23 | # https://dsp.stackexchange.com/questions/741/why-should-i-zero-pad-a-signal-before-taking-the-fourier-transform 24 | f = np.pad(f, (0, N), 'constant', constant_values=(0, 0)) 25 | fvi = np.zeros(2*N, dtype=type(f[0])) 26 | fwd = pyfftw.FFTW(f, fvi, flags=('FFTW_ESTIMATE',), threads=multiprocessing.cpu_count()) 27 | fwd() 28 | inv_arg = np.conjugate(fvi)*fvi 29 | acf = np.zeros_like(inv_arg) 30 | rev = pyfftw.FFTW(inv_arg, acf, direction='FFTW_BACKWARD', 31 | flags=('FFTW_ESTIMATE', ), threads=multiprocessing.cpu_count()) 32 | rev() 33 | acf = acf[:N]/d 34 | return np.real(acf[:max_lag+1]) 35 | 36 | 37 | def corr(f, g, max_lag): 38 | """ 39 | Computes fast correlation function and returns up to max_lag. Assumes f and g are same length. 40 | 41 | Args: 42 | f (ndarray): 43 | Vector for correlation 44 | 45 | g (ndarray): 46 | Vector for correlation 47 | 48 | max_lag (float): 49 | Lag at which to calculate up to 50 | 51 | Returns: 52 | ndarray: Correlation vector 53 | 54 | """ 55 | if not len(f) == len(g): 56 | raise ValueError('corr arguments must be the same length.') 57 | 58 | N = len(f) 59 | d = N - np.arange(N) 60 | f = np.pad(f, (0, N), 'constant', constant_values=(0, 0)) 61 | g = np.pad(g, (0, N), 'constant', constant_values=(0, 0)) 62 | 63 | fvi = np.zeros(2*N, dtype=type(f[0])) 64 | gvi = np.zeros(2*N, dtype=type(g[0])) 65 | 66 | fwd_f = pyfftw.FFTW(f, fvi, flags=('FFTW_ESTIMATE',), threads=multiprocessing.cpu_count()) 67 | fwd_f() 68 | 69 | fwd_g = pyfftw.FFTW(g, gvi, flags=('FFTW_ESTIMATE',), threads=multiprocessing.cpu_count()) 70 | fwd_g() 71 | 72 | inv_arg = np.conjugate(fvi)*gvi 73 | cf = np.zeros_like(inv_arg) 74 | rev = pyfftw.FFTW(inv_arg, cf, direction='FFTW_BACKWARD', 75 | flags=('FFTW_ESTIMATE', ), threads=multiprocessing.cpu_count()) 76 | rev() 77 | cf = cf[:N]/d 78 | return np.real(cf[:max_lag+1]) 79 | -------------------------------------------------------------------------------- /thermo/shared/__init__.py: -------------------------------------------------------------------------------- 1 | __all__ = ['force'] -------------------------------------------------------------------------------- /thermo/shared/force.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | __author__ = "Alexander Gabourie" 4 | __email__ = "gabourie@stanford.edu" 5 | 6 | def load_forces(force_file, sim): 7 | ''' 8 | Loads the forces from either GPUMD or LAMMPS output to facilitate a 9 | comparison between techniques. 10 | 11 | Args: 12 | arg1 (str) : force_file 13 | Filename with forces 14 | 15 | arg2 (str) : sim 16 | If type == 'LAMMPS': 17 | The file path should be for the LAMMPS output forces 18 | LAMMPS file should be in the format given by the following LAMMPS input command: 19 | force all custom 1 id fx fy fz 20 | If type == 'GPUMD': 21 | the force output file (f.out) path when GPUMD is compiled with the force flag 22 | 23 | Returns: 24 | dict: dictionary containing sorted force vectors 25 | 26 | ''' 27 | 28 | # Load force outputs 29 | if sim == 'LAMMPS': 30 | # LAMMPS 31 | with open(force_file, 'r') as f: 32 | llines = f.readlines() 33 | 34 | # remove header info 35 | llines = llines[9:] 36 | 37 | # process atomic forces 38 | n = len(llines) 39 | xf, yf, zf = np.zeros(n), np.zeros(n), np.zeros(n) 40 | for line in llines: 41 | num = line.split() 42 | ID = int(num[0])-1 43 | xf[ID] = float(num[1]) 44 | yf[ID] = float(num[2]) 45 | zf[ID] = float(num[3]) 46 | 47 | elif sim == 'GPUMD': 48 | # GPUMD 49 | with open(force_file, 'r') as f: 50 | glines = f.readlines() 51 | 52 | # process atomic forces 53 | xf, yf, zf = list(), list(), list() 54 | for line in glines: 55 | num = line.split() 56 | xf.append(float(num[0])) 57 | yf.append(float(num[1])) 58 | zf.append(float(num[2])) 59 | 60 | xf = np.array(xf) 61 | yf = np.array(yf) 62 | zf = np.array(zf) 63 | else: 64 | raise ValueError('Invalid simulation type passed. Forces not extracted.') 65 | 66 | # fill return dictionary 67 | out = dict() 68 | out['xf'] = xf 69 | out['yf'] = yf 70 | out['zf'] = zf 71 | return out 72 | 73 | def compare_forces(f1_dict, f2_dict): 74 | ''' 75 | Compares the LAMMPS and GPUMD forces and returns dictionary of comparison 76 | Forces are dict2 - dict1 values. 77 | 78 | Args: 79 | arg1 (dict): f1_dict 80 | dictionary containing extracted forces from a GPUMD or 81 | LAMMPS simulation 82 | 83 | arg2 (dict): f2_dict 84 | dictionary containing extracted forces from a GPUMD or 85 | LAMMPS simulation 86 | 87 | Returns: 88 | dict: comparison dictionary 89 | 90 | ''' 91 | 92 | out = dict() 93 | out['xdiff'] = f2_dict['xf'] - f1_dict['xf'] 94 | out['ydiff'] = f2_dict['yf'] - f1_dict['yf'] 95 | out['zdiff'] = f2_dict['zf'] - f1_dict['zf'] 96 | out['xnorm'] = np.linalg.norm(out['xdiff']) 97 | out['ynorm'] = np.linalg.norm(out['ydiff']) 98 | out['znorm'] = np.linalg.norm(out['zdiff']) 99 | return out 100 | -------------------------------------------------------------------------------- /thermo/tools/__init__.py: -------------------------------------------------------------------------------- 1 | __all__ = ['lj'] 2 | -------------------------------------------------------------------------------- /thermo/tools/lj.py: -------------------------------------------------------------------------------- 1 | import pickle 2 | import os 3 | 4 | __author__ = "Alexander Gabourie" 5 | __email__ = "gabourie@stanford.edu" 6 | 7 | ################################### 8 | # UFF 9 | ################################### 10 | 11 | def load_UFF(): 12 | """ 13 | Loads dictionary that stores relevant LJ from UFF. 14 | 15 | Returns: 16 | dict: 17 | Dictionary with atom symbols as the key and a tuple of epsilon and 18 | sigma in units of eV and Angstroms, respectively. 19 | """ 20 | path = os.path.abspath(os.path.join(__file__, '../../data/UFF.params')) 21 | return pickle.load(open(path, 'rb')) 22 | 23 | ################################# 24 | # Lorentz-Berthelot Mixing 25 | ################################# 26 | 27 | def lb_mixing(a1, a2): 28 | """ 29 | Applies Lorentz-Berthelot mixing rules on two atoms. 30 | 31 | Args: 32 | a1 (tuple): 33 | Tuple of (epsilon, sigma) 34 | 35 | a2 (tuple): 36 | Tuple of (epsilon, sigma) 37 | """ 38 | eps = (a1[0]*a2[0])**(1./2) 39 | sigma = (a1[1] + a2[1])/2. 40 | return eps, sigma 41 | 42 | ################################# 43 | # LJ Object 44 | ################################# 45 | 46 | class LJ(object): 47 | """ Stores all atoms for a simulation with their LJ parameters. 48 | 49 | A special dictionary with atom symbols for keys and the epsilon and 50 | sigma LJ parameters for the values. This object interfaces with the UFF 51 | LJ potential parameters but can also accept arbitrary parameters. 52 | 53 | Args: 54 | symbols (str or list(str)): 55 | Optional input. A single symbol or a list of symbols to add to 56 | the initial LJ list. 57 | 58 | ignore_pairs (list(sets)): 59 | List of sets where each set has two elements. Each element 60 | is a string for the symbol of the atom to ignore in that pair. 61 | Order in set is not important. 62 | 63 | cut_scale (float): 64 | Specifies the multiplicative factor to use on the sigma parameter 65 | to define the cutoffs. Default is 2.5. 66 | """ 67 | 68 | def __init__(self, symbols=None, ignore_pairs=None, cut_scale=2.5): 69 | self.ljdict = dict() 70 | self.ignore = list() 71 | self.cutoff = dict() 72 | self.global_cutoff = None 73 | self.cut_scale = cut_scale 74 | if symbols: 75 | self.add_UFF_params(symbols) 76 | 77 | if ignore_pairs: 78 | self.ignore_pairs(ignore_pairs) 79 | 80 | def add_UFF_params(self, symbols, replace=False): 81 | """ 82 | Adds UFF parameters to the LJ object. Will replace existing parameters 83 | if 'replace' is set to True. UFF parameters are loaded from the package. 84 | 85 | Args: 86 | symbols (str or list(str)): 87 | A single symbol or a list of symbols to add to the initial LJ list. 88 | 89 | replace (bool): 90 | Whether or not to replace existing symbols 91 | """ 92 | if type(symbols) == str: 93 | symbols = [symbols] # convert to list if one string 94 | UFF = load_UFF() 95 | for symbol in symbols: 96 | if not replace and symbol in self.ljdict: 97 | print("Warning: {} is already in LJ list and".format(symbol) +\ 98 | " will not be included.\nTo include, use " + \ 99 | "replace_UFF_params or toggle 'replace' boolean.\n") 100 | else: 101 | self.ljdict[symbol] = UFF[symbol] 102 | 103 | def replace_UFF_params(self, symbols, add=False): 104 | """ 105 | Replaces current LJ parameters with UFF values. Will add new entries if 106 | 'add' is set to True. UFF parameters are loaded from the package. 107 | 108 | Args: 109 | symbols (str or list(str)): 110 | A single symbol or a list of symbols to add to the initial LJ list. 111 | 112 | add (bool): 113 | Whether or not to replace existing symbols 114 | """ 115 | if type(symbols) == str: 116 | symbols = [symbols] # convert to list if one string 117 | UFF = load_UFF() 118 | for symbol in symbols: 119 | if symbol in self.ljdict or add: 120 | self.ljdict[symbol] = UFF[symbol] 121 | else: 122 | print("Warning: {} is not in LJ list and".format(symbol) +\ 123 | " cannot be replaced.\nTo include, use " + \ 124 | "add_UFF_params or toggle 'add' boolean.\n") 125 | 126 | 127 | def add_param(self, symbol, data, replace=True): 128 | """ 129 | Adds a custom parameter to the LJ object. 130 | 131 | Args: 132 | symbol (str): 133 | Symbol of atom type to add. 134 | 135 | data (tuple(float)): 136 | A two-element tuple of numbers to represent the epsilon and 137 | sigma LJ values. 138 | 139 | replace (bool): 140 | Whether or not to replace the item. 141 | """ 142 | 143 | # check params 144 | good = (tuple == type(data) and len(data) == 2 and \ 145 | all([isinstance(item, (int, float)) for item in data]) and \ 146 | type(symbol) == str) 147 | if good: 148 | if symbol in self.ljdict: 149 | if replace: 150 | self.ljdict[symbol] = data 151 | else: 152 | print("Warning: {} exists and cannot be added.\n".format(symbol)) 153 | else: 154 | self.ljdict[symbol] = data 155 | 156 | else: 157 | raise ValueError("Invalid data parameter.") 158 | 159 | def remove_param(self, symbol): 160 | """ 161 | Removes an element from the LJ object. If item does not exist, nothing 162 | happens. 163 | 164 | Args: 165 | symbol (str): 166 | Symbol of atom type to remove. 167 | """ 168 | # remove symbol from object 169 | self.ljdict.pop(symbol, None) 170 | # remove any ignore statements with symbol 171 | remove_list = list() 172 | for i, pair in enumerate(self.ignore): 173 | if symbol in pair: 174 | remove_list.append(i) 175 | 176 | for i in sorted(remove_list, reverse=True): 177 | del self.ignore[i] 178 | 179 | def ignore_pair(self, pair): 180 | """ 181 | Adds a pair to the list of pairs that will be ignored when output to file. 182 | 183 | Args: 184 | pair (set): 185 | A two-element set where each entry is a string of the symbol in 186 | the pair to ignore. 187 | """ 188 | self.__check_pair(pair) 189 | 190 | # check if pair exists already 191 | exists = False 192 | for curr_pair in self.ignore: 193 | if curr_pair == pair: 194 | return 195 | 196 | self.ignore.append(pair) 197 | 198 | def ignore_pairs(self, pairs): 199 | """ 200 | Adds a list of pairs that will be ignored when output to file. 201 | 202 | Args: 203 | pairs (list(set)): 204 | A list of two-element sets where each entry of each set is a 205 | string of the symbol in the pair to ignore. 206 | """ 207 | for pair in pairs: 208 | self.ignore_pair(pair) 209 | 210 | def acknowledge_pair(self, pair): 211 | """ 212 | Removes the pair from the ignore list and acknowledges it during the output. 213 | 214 | Args: 215 | pair (set): 216 | A two-element set where each entry is a string of the symbol in the 217 | pair to un-ignore. 218 | """ 219 | self.__check_pair(pair) 220 | 221 | # check if pair exists already 222 | exists = False 223 | for i, curr_pair in enumerate(self.ignore): 224 | if curr_pair == pair: 225 | del self.ignore[i] 226 | return 227 | 228 | raise ValueError('Pair not found.') 229 | 230 | def acknowledge_pairs(self, pairs): 231 | """ 232 | Removes pairs from the ignore list. 233 | 234 | Args: 235 | pairs (list(set)): 236 | A list of two-elements sets where each entry in each set is a string of 237 | the symbol in the pair to un-ignore. 238 | """ 239 | for pair in pairs: 240 | self.acknowledge_pair(pair) 241 | 242 | def custom_cutoff(self, pair, cutoff): 243 | """ 244 | Sets a custom cutoff for a specific pair of atoms. 245 | 246 | Args: 247 | pair (set): 248 | A two-element set where each entry is a string of the symbol in the 249 | pair. 250 | 251 | cutoff (float): 252 | Custom cutoff to use. In Angstroms. 253 | """ 254 | self.__check_pair(pair) 255 | self.__check_cutoff(cutoff) 256 | key = self.__get_cutkey(pair) 257 | self.cutoff[key] = cutoff 258 | 259 | def remove_custom_cutoff(self, pair): 260 | """ 261 | Removes a custom cutoff for a pair of atoms. 262 | 263 | Args: 264 | pair (set): 265 | A two-element set where each entry is a string of the symbol in the 266 | pair. 267 | """ 268 | self.__check_pair(pair) 269 | key = self.__get_cutkey(pair) 270 | self.cutoff.pop(key, None) 271 | 272 | def set_global_cutoff(self, cutoff): 273 | """ 274 | Sets a global cutoff for all pairs. 275 | Warning: setting this will remove all other cutoff parameters. 276 | 277 | Args: 278 | cutoff (float): 279 | Custom cutoff to use. In Angstroms. 280 | """ 281 | self.__check_cutoff(cutoff) 282 | self.global_cutoff = cutoff 283 | self.cutoff = dict() 284 | self.cut_scale = None 285 | 286 | def set_cut_scale(self, cut_scale): 287 | """ 288 | Sets the amount to scale the sigma values of each pair by to set the cutoff. 289 | Warning: setting this will remove any global cutoff, but leave custom cutoffs. 290 | 291 | Args: 292 | cut_scale (float): 293 | Scaling factor to be used on sigma 294 | """ 295 | self.__check_cutoff(cut_scale) 296 | self.global_cutoff = None 297 | self.cut_scale = cut_scale 298 | 299 | def create_file(self, filename='ljparams.txt', atom_order=None): 300 | """ 301 | Outputs a GPUMD style LJ parameters file using the atoms defined in atom_order 302 | in the order defined in atom_order. 303 | 304 | Args: 305 | filename (str): 306 | The filename or full path with filename of the output. 307 | 308 | atom_order (list(str)): 309 | List of atom symbols to include LJ params output file. The order will 310 | determine the order in the output file. *Required* 311 | Ex. ['a', 'b', 'c'] = pairs => 'aa', 'ab', 'ac', 'ba', 'bb', 'bc', 'ca', 312 | 'cb' 'cc' in this order. 313 | """ 314 | if not atom_order: 315 | raise ValueError('atom_order is required.') 316 | 317 | # check if atoms in atom_order exist in LJ 318 | for symbol in atom_order: 319 | if symbol not in self.ljdict: 320 | raise ValueError('{} atom does not exist in LJ'.format(symbol)) 321 | out_txt = 'lj {}\n'.format(len(atom_order)) 322 | for i, sym1 in enumerate(atom_order): 323 | for j, sym2 in enumerate(atom_order): 324 | pair = {sym1, sym2} 325 | if pair in self.ignore: 326 | if i+1==len(atom_order) and j+1==len(atom_order): 327 | out_txt += '0 0 0' 328 | else: 329 | out_txt += '0 0 0\n' 330 | continue 331 | 332 | a1 = self.ljdict[sym1] 333 | a2 = self.ljdict[sym2] 334 | 335 | eps, sig = lb_mixing(a1, a2) 336 | 337 | cutkey = self.__get_cutkey(pair) 338 | if self.global_cutoff: 339 | cutoff = self.global_cutoff 340 | elif cutkey in self.cutoff: 341 | cutoff = self.cutoff[cutkey] 342 | else: 343 | cutoff = self.cut_scale*sig 344 | 345 | if i+1==len(atom_order) and j+1==len(atom_order): 346 | out_txt += '{} {} {}'.format(eps, sig, cutoff) 347 | else: 348 | out_txt += '{} {} {}\n'.format(eps, sig, cutoff) 349 | 350 | with open(filename, 'w') as f: 351 | f.writelines(out_txt) 352 | 353 | def __get_cutkey(self, pair): 354 | keylist = sorted(list(pair)) 355 | if len(keylist) == 1: 356 | keylist.append(keylist[0]) 357 | key = ' '.join(keylist) 358 | return key 359 | 360 | def __check_pair(self, pair): 361 | # check params 362 | if not (type(pair) == set and (len(pair) == 2 or len(pair) == 1)): 363 | raise ValueError('Invalid pair.') 364 | 365 | # check pair 366 | good = True 367 | for item in list(pair): 368 | good = good and item in self.ljdict 369 | 370 | if not good: 371 | raise ValueError('Elements in pair not found in LJ object.') 372 | 373 | def __check_cutoff(self, cutoff): 374 | if not (isinstance(cutoff, (int, float)) and cutoff > 0): 375 | raise ValueError('Invalid cutoff.') 376 | 377 | def __str__(self): 378 | out_str = 'Symbol: Epsilon (eV), Sigma (Angs.)\n' 379 | for key in self.ljdict: 380 | cur = self.ljdict[key] 381 | out_str += "{}: {}, {}\n".format(key, cur[0], cur[1]) 382 | 383 | if self.cut_scale: 384 | out_str += "\nCutoff scaling factor = {}\n".format(self.cut_scale) 385 | else: # Global cutoff 386 | out_str += "\nGlobal cutoff = {} Angstroms\n".format(self.global_cutoff) 387 | 388 | 389 | if len(self.cutoff) > 0: 390 | out_str += "\nCustom Cutoffs\n" 391 | for pair in self.cutoff: 392 | lpair = pair.split() 393 | out_str += "[{}, {}] : {}\n".format(lpair[0], lpair[1], 394 | self.cutoff[pair]) 395 | 396 | if len(self.ignore) > 0: 397 | out_str += "\nIgnored Pairs (Order not important)\n" 398 | for pair in self.ignore: 399 | pair = list(pair) 400 | if len(pair) == 1: 401 | pair.append(pair[0]) 402 | out_str += "[{}, {}]\n".format(pair[0], pair[1]) 403 | 404 | return out_str 405 | --------------------------------------------------------------------------------