make_grid.make_structure(map(sum,SORBATE_NUMBER),O_N,WATER_NUMBER,DOMAIN,Metal=SORBATE,binding_mode=binding_mode,long_slab=full_layer_pick,long_slab_HL=half_layer_pick,local_structure=LOCAL_STRUCTURE,add_distal_wild=ADD_DISTAL_LIGAND_WILD,use_domains=TABLE_DOMAINS,N_raxr=NUMBER_SPECTRA,domain_raxr_el=RESONANT_EL_LIST,layered_water=layered_water_pars['yes_OR_no'],layered_sorbate=layered_sorbate_pars['yes_OR_no'],tab_path=os.path.join(output_file_path,'table.tab'))
##want to output the data for plotting?##
PLOT=not running_mode
##want to print out the protonation status?##
PRINT_PROTONATION=not running_mode
##want to print bond valence?##
PRINT_BV=not running_mode
##want to print the xyz files to build a 3D structure?##
PRINT_MODEL_FILES=not running_mode

################################################build up ref domains############################################
#add atoms for bulk and two ref domains (ref_domain1<half layer> and ref_domain2<full layer>)                  #
#In those two reference domains, the atoms are ordered according to first hight (z values), then y values      #
#it is a super surface structure by stacking the surface slab on bulk slab, the repeat vector was counted      #
################################################################################################################
batch_path_head=batch_path.module_path_locator()
domain_creator.add_atom_in_slab(bulk,os.path.join(batch_path_head,'bulk.str'))
domain_creator.add_atom_in_slab(ref_L_domain1,os.path.join(batch_path_head,'half_layer2.str'))
domain_creator.add_atom_in_slab(ref_S_domain1,os.path.join(batch_path_head,'half_layer3.str'))
domain_creator.add_atom_in_slab(ref_L_domain2,os.path.join(batch_path_head,'full_layer2.str'))
domain_creator.add_atom_in_slab(ref_S_domain2,os.path.join(batch_path_head,'full_layer3.str'))

##set up Fourier pars if there are RAXR datasets
#Fourier component looks like A_Dn0_n1, where n0, n1 are used to specify the index for domain, and spectra, respectively
#Each spectra will have its own set of A and P list, and each domain has its own set of P and A list
rgh_raxr,F1F2=setup_domain_hematite_rcut.setup_raxr_pars(NUMBER_SPECTRA,batch_path_head,F1F2_FILE,RESONANT_EL_LIST)

###################create domain classes and initiate the chemical equivalent domains####################
##id list according to the order in the reference domain (used to set up ref domain)
ref_id_list_L_1=["O1_1_0","O1_2_0","Fe1_2_0","Fe1_3_0","O1_3_0","O1_4_0","Fe1_4_0","Fe1_6_0","O1_5_0","O1_6_0","O1_7_0","O1_8_0","Fe1_8_0","Fe1_9_0","O1_9_0","O1_10_0","Fe1_10_0","Fe1_12_0","O1_11_0","O1_12_0",\
'O1_1_1','O1_2_1','Fe1_2_1','Fe1_3_1','O1_3_1','O1_4_1','Fe1_4_1','Fe1_6_1','O1_5_1','O1_6_1','O1_7_1','O1_8_1','Fe1_8_1','Fe1_9_1','O1_9_1','O1_10_1','Fe1_10_1','Fe1_12_1','O1_11_1','O1_12_1']
Exemple #2
0
HL-->0          1           2           3             4              5(Face-sharing)     6           7
CS(O1O2)        CS(O2O3)    ES(O1O3)    ES(O1O4)      TD(O1O2O3)     TD(O1O3O4)          OS          Clean

TERNARY HL-->     8         9           10            11             12                  13          14
                  M(HO1)    M(HO2)      M(HO3)        B(HO1_HO2)     B(HO1_HO3)          B(HO2_HO3)  T(HO1_HO2_HO3)

FL-->15         16          17          18            19             20(Face-sharing)    21          22
CS(O5O6)        ES(O5O7)    ES(O5O8)    CS(O6O7)      TD(O5O6O7)     TD(O5O7O8)          OS          Clean

TERNARY FL-->   23        24          25            26             27                  28          29
                M(HO1)    M(HO2)      M(HO3)        B(HO1_HO2)     B(HO1_HO3)          B(HO2_HO3)  T(HO1_HO2_HO3)
"""
##############################################main setup zone###############################################
#depository path for output files(structure model files(.xyz,.cif), optimized values (CTR,RAXR,E_Density) for plotting
batch_path_head=batch_path.module_path_locator()
output_file_path=output_path.module_path_locator()

#/pick_index/begin#
pickup_index=[[7], [19], [19]]#using matching index table above
SORBATE=[['Pb'], ['Pb'], ['Pb']]#same shape as pickup_index
half_layer=[3]#2 for short slab and 3 for long slab
full_layer=[0, 1]#0 for short slab and 1 for long slab
N_FL=len(full_layer)#number of full layer domains
N_HL=len(half_layer)#number of half layer domains
half_layer_pick=half_layer+[None]*N_FL
full_layer_pick=[None]*N_HL+full_layer
COHERENCE=[{True:range(len(pickup_index))}] #want to add up in coherence? items inside list corresponding to each domain
FULL_LAYER_PICK_INDEX=domain_creator.make_pick_index(full_layer_pick=full_layer_pick,
                                                     pick=pickup_index,
                                                     half_layer_cases=15,
#/raxs/begin#
RAXS_EL = 'Pb'
RAXS_FIT_MODE = 'MI'  #model dependent (MD) or Model independent (MI)
NUMBER_SPECTRA = 0
E0 = 11873
F1F2_FILE = 'As_K_edge_March28_2018.f1f2'
#/raxs/end#
if NUMBER_SPECTRA != 0:
    rgh_raxs, F1F2 = setup_domain_hematite_rcut.setup_raxr_pars_new(
        NUMBER_SPECTRA, F1F2_FILE)

#--global settings--#
#/globalsetting/begin#
#/path/begin#
batch_path_head = os.path.join(batch_path.module_path_locator(), 'Cu100')
output_file_path = output_path.module_path_locator()
#/path/end#
#/wavelength/begin#
wal = 0.551
#/wavelength/end#
#/slabnumber/begin#
num_surface_slabs = 1
num_sorbate_slabs = 2
#/slabnumber/end#

#--set unitcell--#
#/unitcell/begin#
lat_pars = [3.615, 3.615, 3.615, 90, 90, 90]
unitcell = model.UnitCell(*lat_pars)
#/unitcell/end#
Exemple #4
0
import dump_files.locate_path as output_path
import models.domain_creator as domain_creator
import accessory_functions.plotting_results.create_plots as create_plots
import models.domain_creator_sorbate as domain_creator_sorbate
import accessory_functions.make_par_table.make_parameter_table_GenX_5_beta as make_grid
import convert_files

##==========================================<program begins from here>=========================================##
COUNT_TIME=False
if COUNT_TIME:t_0=datetime.now()
VERSION=1.2#version number to make easier code update to compatible with gx files based on old version scripts

##<global handles>##
running_mode=0
RUN=running_mode
BATCH_PATH_HEAD,OUTPUT_FILE_PATH=batch_path.module_path_locator(),output_path.module_path_locator()
F1F2_FILE='Zr_K_edge.f1f2'
F1F2=np.loadtxt(os.path.join(BATCH_PATH_HEAD,F1F2_FILE))#the energy column should NOT have duplicate values after rounding up to 0 digit. If so, cut off rows of duplicate energy!
RAXR_EL='Zr'#resonant element
E0=18007#Adsorption edge energy
NUMBER_RAXS_SPECTRA=21#total number of RAXR spectra
RAXR_FIT_MODE='MI'#'MI' for model-independent, and 'MD' for model-dependent
FREEZE=True#FREEZE=True will have resonant el make no influence on the non-resonant structure factor. And it will otherwise.
NUMBER_DOMAIN,COHERENCE=2,True
HEIGHT_OFFSET=-2.6685#if set to 0, the top atomic layer is at 2.6685 in fractional unit before relaxation (should not be changed)
XY_OFFSET=[0,0]#takes effect only for structural atoms (not include Gaussian atoms)
GROUP_SCHEME=[[1,0]]#means group Domain1 and Domain2 for inplane and out of plane movement, set Domain2=Domain1 in side sim func

##<setting slabs>##
wal=0.7749136#wavelength,set this number right each time (read it from nQc data file)
c_lattice=20.04156#correct c each time (use q-corrected c),c_lattice=c_projected/sin(180-beta)
import batchfile.locate_path as batch_path
import dump_files.locate_path as output_path
import models.domain_creator as domain_creator
import supportive_functions.create_plots as create_plots
import models.domain_creator_sorbate as domain_creator_sorbate
import supportive_functions.make_parameter_table_GenX_5_beta as make_grid
import convert_files

##==========================================<program begins from here>=========================================##
COUNT_TIME=False
if COUNT_TIME:t_0=datetime.now()
VERSION=1.2#version number to make easier code update to compatible with gx files based on old version scripts

##<global handles>##
RUN=1
BATCH_PATH_HEAD,OUTPUT_FILE_PATH=batch_path.module_path_locator(),output_path.module_path_locator()
F1F2=np.loadtxt(os.path.join(BATCH_PATH_HEAD,'Zr_K_edge.f1f2'))#the energy column should NOT have duplicate values after rounding up to 0 digit. If so, cut off rows of duplicate energy!
RAXR_EL,E0,NUMBER_RAXS_SPECTRA,RAXR_FIT_MODE,FREEZE='Zr',18007,21,'MI',True#FREEZE=True will have resonant el make no influence on the non-resonant structure factor. And it will otherwise.
NUMBER_DOMAIN,COHERENCE=2,True
HEIGHT_OFFSET=-2.6685#if set to 0, the top atomic layer is at 2.6685 in fractional unit before relaxation (should not be changed)
XY_OFFSET=[0,0]#takes effect only for structural atoms (not include Gaussian atoms)
GROUP_SCHEME=[[1,0]]#means group Domain1 and Domain2 for inplane and out of plane movement, set Domain2=Domain1 in side sim func

##<setting slabs>##
wal=0.7749136#wavelength,set this number right each time (read it from nQc data file)
unitcell = model.UnitCell(5.1988, 9.0266, 20.04156, 90, 95.782, 90)#a,b,c,alpha,beta,gamma, correct c each time (use q-corrected c),c=c_projected/sin(180-beta)
inst = model.Instrument(wavel = wal, alpha = 2.0)
bulk, Domain1, Domain2 = model.Slab(T_factor='u'), model.Slab(c = 1.0,T_factor='u'), model.Slab(c = 1.0,T_factor='u')
domain_creator.add_atom_in_slab(bulk,os.path.join(BATCH_PATH_HEAD,'muscovite_001_bulk_u_corrected_new.str'),height_offset=HEIGHT_OFFSET)
domain_creator.add_atom_in_slab(Domain1,os.path.join(BATCH_PATH_HEAD,'muscovite_001_surface_Al_u_corrected_new.str'),attach='_D1',height_offset=HEIGHT_OFFSET)
domain_creator.add_atom_in_slab(Domain2,os.path.join(BATCH_PATH_HEAD,'muscovite_001_surface_Si_u_corrected_new.str'),attach='_D2',height_offset=HEIGHT_OFFSET)
from models.structure_tools import tool_box
from models.structure_tools import sorbate_tool
import accessory_functions.make_par_table.make_parameter_table_GenX_5_beta as make_grid

VERSION=1.2#version number to make easier code update to compatible with gx files based on old version scripts

#--global settings--#
#/globalsetting/begin#
#/fit_type/begin#
model_type = 'ctr'
raxr_fit_mode = 'MI'#'MI' for model-independent, and 'MD' for model-dependent
freeze=True#FREEZE=True will have resonant el make no influence on the non-resonant structure factor. And it will otherwise.
coherence = True
#/fit_type/end#
#/path/begin#
batch_path_head=os.path.join(batch_path.module_path_locator(),'Muscovite001')
output_file_path=output_path.module_path_locator()
#/path/end#
#/wavelength/begin#
wal=0.551
#/wavelength/end#

#/slab/begin#
num_surface_slabs = 1
height_offset = -2.6685
xy_offset = [0, 0]
group_scheme = [[1,0]]
#/slab/end#

#/raxr_setting/begin#
f1f2_file='Zr_K_edge.f1f2'