{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Classification of atoms as solid or liquid" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "pyscal can also be used to distinguish solid and liquid atoms. The\n", "classification is based on [Steinhardt\\'s\n", "parameters](https://pyscal.readthedocs.io/en/latest/steinhardtparameters.html),\n", "specifically $q_6$. The method defines two neighboring atoms $i$ and $j$\n", "as having solid bonds if a parameter $s_{ij}$ {cite}`Auer2005`,\n", "\n", "> $$s_{ij} = \\sum_{m=-6}^6 q_{6m}(i) q_{6m}^*(j) \\geq \\mathrm{threshold}$$\n", "\n", "Additionally, a second order parameter is used to improve the\n", "distinction in solid-liquid boundaries {cite}`Bokeloh2014`. This is defined by the\n", "criteria,\n", "\n", "> $$\\langle s_{ij} \\rangle > \\mathrm{avgthreshold}$$\n", "\n", "If a particle has $n$ number of bonds with\n", "$s_{ij} \\geq \\mathrm{threshold}$ and the above condition is also\n", "satisfied, it is considered as a solid. The solid atoms can be clustered\n", "to find the largest solid cluster of atoms. \n", "\n", "Finding solid atoms in liquid start with reading in a file and\n", "calculation of neighbors.\n", "\n", "``` python\n", "import pyscal.core as pc\n", "sys = pc.System()\n", "sys.read_inputfile('conf.dump')\n", "sys.find_neighbors(method='cutoff', cutoff=4)\n", "```\n", "\n", "Once again, there are various methods for finding neighbors. Please\n", "check\n", "[here](../part2/intro.md)\n", "for details on neighbor calculation methods. Once the neighbors are\n", "calculated, solid atoms can be found directly by,\n", "\n", "``` python\n", "sys.find_solids(bonds=6, threshold=0.5, avgthreshold=0.6, cluster=True)\n", "```\n", "\n", "`bonds` set the number of minimum bonds a particle should have (as\n", "defined above), `threshold` and `avgthreshold` are the same quantities\n", "that appear in the equations above. Setting the keyword `cluster` to\n", "True returns the size of the largest solid cluster. It is also possible\n", "to check if each atom is solid or not.\n", "\n", "``` python\n", "atoms = sys.atom\n", "solids = [atom.solid for atom in atoms]\n", "```\n", "\n", "## References\n", "\n", "```{bibliography} ../references.bib\n", ":filter: docname in docnames\n", ":style: unsrt\n", "```" ] } ], "metadata": { "kernelspec": { "display_name": "py3", "language": "python", "name": "py3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.1" } }, "nbformat": 4, "nbformat_minor": 4 }