Commit 556d4e7c authored by Carl Poelking's avatar Carl Poelking
Browse files

Structure density customization.

parent af6d7114
......@@ -16,17 +16,17 @@ class PeriodicTable(object):
] # Allen scale
element_names = ["?",
"H ","He ",
"Li ","Be ","B ","C ","N ","O ","F ","Ne ",
"Na ","Mg ","Al ","Si ","P ","S ","Cl ","Ar ",
"K ","Ca ","Sc ","Ti ","V ","Cr ","Mn ","Fe ","Co ","Ni ","Cu ","Zn ","Ga ","Ge ", "As ","Se ","Br ","Kr ",
"Rb ","Sr ","Y ","Zr ","Nb ","Mo ","Tc ","Ru ","Rh ","Pd ","Ag ","Cd ","In ","Sn ", "Sb ","Te ","I ","Xe ",
"Cs ","Ba ",
"La ","Ce ","Pr ","Nd ","Pm ","Sm ","Eu ","Gd ","Tb ","Dy ","Ho ","Er ","Tm ","Yb ","Lu ",
"Hf ","Ta ","W ","Re ","Os ","Ir ","Pt ","Au ","Hg ","Tl ","Pb ","Bi ","Po ","At ","Rn ",
"Fr ","Ra ",
"Ac ","Th ","Pa ","U ","Np ","Pu ","Am ","Cm ", "Bk ","Cf ","Es ","Fm ","Md ","No ","Lr ",
"Rf ","Db ","Sg ","Bh ","Hs ","Mt ","Ds ","Rg ","Uub", "Uut","Uuq","Uup","Uuh" ]
"H","He",
"Li","Be","B","C","N","O","F","Ne",
"Na","Mg","Al","Si","P","S","Cl","Ar",
"K ","Ca","Sc","Ti","V","Cr","Mn","Fe","Co","Ni","Cu","Zn","Ga","Ge", "As","Se","Br","Kr",
"Rb","Sr","Y","Zr","Nb","Mo","Tc","Ru","Rh","Pd","Ag","Cd","In","Sn", "Sb","Te","I","Xe",
"Cs","Ba",
"La","Ce","Pr","Nd","Pm","Sm","Eu","Gd","Tb","Dy","Ho","Er","Tm","Yb","Lu",
"Hf","Ta","W","Re","Os","Ir","Pt","Au","Hg","Tl","Pb","Bi","Po","At","Rn",
"Fr","Ra",
"Ac","Th","Pa","U","Np","Pu","Am","Cm", "Bk","Cf","Es","Fm","Md","No","Lr",
"Rf","Db","Sg","Bh","Hs","Mt","Ds","Rg","Uub", "Uut","Uuq","Uup","Uuh" ]
element_mass = [-1.,
1.00794, 4.00260, 6.941, 9.012187, 10.811, 12.0107, 14.00674, 15.9994, 18.99840, 20.1797, 22.98977,
......
......@@ -581,6 +581,30 @@ class ParticleGraph(object):
elif descriptor_type == 'soap':
# Structure
structure = soap.tools.setup_structure_ase(self.label, atoms)
# Customize density
density_type = options["atomic_density"]["density_type"]
use_covrad = options["atomic_density"]["use_covrad"]
atom_rad_scale = float(options["atomic_density"]["atomic_radius"])
# ... Particle radii
if use_covrad:
radius_map = soap.soapy.elements.periodic_table.getPropertyDict("covrad", convert=lambda x: x*atom_rad_scale)
else:
radius_map = {}
for elem in soap.soapy.elements.PeriodicTable.element_names:
radius_map[elem] = atom_rad_scale
# ... Particle 'charge'
if density_type == "elneg_density":
charge_map = soap.soapy.elements.periodic_table.getPropertyDict("elneg")
elif density_type == "z_density":
charge_map = soap.soapy.elements.periodic_table.getPropertyDict("z")
elif density_type == "number_density":
charge_map = {}
for elem in soap.soapy.elements.PeriodicTable.element_names:
charge_map[elem] = 1.
else:
raise NotImplementedError("Density type '%s'" % density_type)
# ... Apply
soap.tools.setup_structure_density(structure, radius_map=radius_map, charge_map=charge_map)
# Options
options_soap = soap.Options()
for item in options_descriptor.items():
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment