#!/usr/bin/env python # coding: utf-8 # ## Distinction of solid and liquid # In[1]: import os import pyiron from ase.io import read import pyscal.core as pc import matplotlib.pyplot as plt import numpy as np # In[2]: pr = pyiron.Project('ADIS') # In[3]: pr.job_table() # We will start with a small configuration in which a small solid cluster is embedded in a liquid. # In[4]: job = pr.load("Nucleus") struct = job.get_structure() # One good idea is to get the q6 values. # Pyiron can calculate the q6 values and cluster them. Let's see how that works. # In[5]: from pyiron.atomistics.structure.pyscal import get_steinhardt_parameter_job # In[6]: q46, cluster = get_steinhardt_parameter_job(job, clustering=True) # We will switch a bit onto pyscal now. All the features of pyscal are not yet available on pyiron. # In[7]: sys = pc.System() sys.read_inputfile(struct, format="ase") sys.find_neighbors(method="cutoff", cutoff=0) sys.calculate_q(6, averaged=True) # from the previous example, we saw that the solid structures had average q6 roughly above 0.3 # In[8]: atoms = sys.atoms for count, atom in enumerate(atoms): if atom.get_q(6, averaged=True) > 0.3: atom.solid = 1 else: atom.solid = 0