Skip to content

Commit

Permalink
Merge pull request #6 from raulf2012/dev
Browse files Browse the repository at this point in the history
Merging all changes up to PROJ_irox publication
  • Loading branch information
raulf2012 authored May 18, 2020
2 parents 7b22ba8 + 98a7aed commit 08568f4
Show file tree
Hide file tree
Showing 69 changed files with 3,289 additions and 2,833 deletions.
4 changes: 2 additions & 2 deletions __misc__/sc_temp_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def color_scale_interp(
):
"""
"""
#| - color_scale_interp
# | - color_scale_interp
# cl.scales["8"]["seq"]["Purples"]

black_white_cs = [
Expand Down Expand Up @@ -69,4 +69,4 @@ def clamp(x):

return(color_out)

#__|
# __|
16 changes: 8 additions & 8 deletions ase_modules/add_adsorbate.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

"""Methods to add atoms/adsorbates to surfaces."""

#| - Import Modules
# | - Import Modules
import numpy as np
import copy
import math

from operator import itemgetter
from ase.build import add_adsorbate
from misc_modules.numpy_methods import angle_between
#__|
# __|

def add_adsorbate_centered(active_element, slab, adsorbate, ads_height=2.5):
"""Add adsorbate to surface.
Expand All @@ -25,7 +25,7 @@ def add_adsorbate_centered(active_element, slab, adsorbate, ads_height=2.5):
adsorbate: ASE atoms object
ads_height: Float
"""
#| - add_adsorbate_centered
# | - add_adsorbate_centered
center = (sum(slab.cell)) / 2
act_metals = []
for atom in slab:
Expand All @@ -40,7 +40,7 @@ def add_adsorbate_centered(active_element, slab, adsorbate, ads_height=2.5):
add_adsorbate(slab, adsorbate, ads_height, position=ads_pos)

return slab
#__|
# __|


def add_graphene_layer(
Expand All @@ -58,7 +58,7 @@ def add_graphene_layer(
graph_surf_d:
graph_bond_d_real:
"""
#| - add_graphene_layer
# | - add_graphene_layer
slab = copy.deepcopy(slab)

# num_graph_units = graphene_units + 1
Expand Down Expand Up @@ -91,11 +91,11 @@ def add_graphene_layer(
y_unit_v = y_unit_v / np.linalg.norm(y_unit_v)


#| - STRAIN
# | - STRAIN
tmp = mag1 / num_graph_bond_lengths
strain = 100. * (graph_bond_d_real - tmp) / graph_bond_d_real
print("Strain: " + str(strain))
#__|
# __|

patt_cnt_x = 0
patt_cnt_y = 0
Expand Down Expand Up @@ -144,4 +144,4 @@ def add_graphene_layer(
C_pos_lst = np.array(C_pos_lst)

return(slab)
#__|
# __|
32 changes: 16 additions & 16 deletions ase_modules/adsorbates.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@

"""Adsorbate related methods."""

#| - IMPORT MODULES
# | - IMPORT MODULES
from ase import Atoms
from ase.build import molecule

import numpy as np
#__|
# __|

class Adsorbate:
"""Adsorbate atoms object class."""

#| - Adsorbate ************************************************************
# | - Adsorbate ************************************************************

def __init__(self):
"""Initialize Adsorbate class instance."""
#| - __init__
# | - __init__
self.tmp = 42
#__|
# __|

def ooh(self,
OO_bl=1.359,
Expand All @@ -36,7 +36,7 @@ def ooh(self,
OO_angle:
H_up_down:
"""
#| - ooh
# | - ooh
O_1_x = OO_bl * np.sin(np.radians(OO_angle))
O_1_y = OO_bl * np.cos(np.radians(OO_angle))

Expand All @@ -62,19 +62,19 @@ def ooh(self,
)

return(ooh_mol)
#__|
# __|

def o(self):
"""*O adsorbate."""
#| - o
# | - o
o_mol = Atoms(['O'],
positions=[
(0, 0, 0),
]
)

return(o_mol)
#__|
# __|

def oh(self,
OH_bl=0.978,
Expand All @@ -85,15 +85,15 @@ def oh(self,
OH_bl:
O-H bond length
"""
#| - oh
# | - oh
oh_mol = Atoms(["O", "H"],
positions=[
(0, 0, 0),
(0, 0, OH_bl),
]
)
return(oh_mol)
#__|
# __|

def h2o(self,
H_up_down="up",
Expand All @@ -104,7 +104,7 @@ def h2o(self,
H_up_down:
Hydrogen atom pointing up or down
"""
#| - h2o
# | - h2o
h2o_mol = molecule("H2O")

if H_up_down == "up":
Expand All @@ -113,7 +113,7 @@ def h2o(self,
pass

return(h2o_mol)
#__|
# __|

def get_adsorbate(self, adsorbate, **kwargs):
"""
Expand All @@ -123,10 +123,10 @@ def get_adsorbate(self, adsorbate, **kwargs):
adsorbate:
kwargs:
"""
#| - get_adsorbate
# | - get_adsorbate
ads = getattr(self, adsorbate)(**kwargs)

return(ads)
#__|
# __|

#__| **********************************************************************
# __| **********************************************************************
Loading

0 comments on commit 08568f4

Please sign in to comment.