Commit 9b57904e authored by Stelios Karozis's avatar Stelios Karozis

Change output of res2grid function

parent 236a9cf9
......@@ -6,7 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [0.0.2] - 2020-05-05
## [0.0.2] - 2020-05-11
### Added
- code for domain decomposition function
- code for identify desired atoms
......
......@@ -13,6 +13,6 @@ box_p=tbf.domain_decomposition(data=data_all,dx=2,dy=2,dz=2)
#Find atom type index in lists created above
group_ndx=tbf.resid_data(atom_type, group=['C1'])
#Assign desired atoms (from above function) to subdomains
box_res=tbf.res2grid(data_all,atom_num,box_p, group_ndx)
_,box_res=tbf.res2grid(data_all,atom_num,box_p, group_ndx)
print(box_res)
\ No newline at end of file
......@@ -226,12 +226,14 @@ def res2grid(data, atom_num, box_p, ndx):
box_p = {dictionary input from 'def domain_decomposition'}
ndx = {dictionary input from 'def resid_data'}
output: dictionary
output: dictionaries
"""
box_res={}
box_res_rev = {}
for step in data.keys():
box_res[step]={}
box_res_rev[step] = {}
for key in ndx.keys():
for i in ndx[key]:
#data[step]['x'][atom_num][x(0),y(1),z(2)]
......@@ -262,5 +264,9 @@ def res2grid(data, atom_num, box_p, ndx):
if zz<iz and zz>prev:
prev=iz
break
box_res[step][atom_num[i]]=[cnt_x,cnt_y,cnt_z]
return box_res
\ No newline at end of file
box_res[step][atom_num[i]]=(cnt_x,cnt_y,cnt_z)
#Make subdomain position the key and group the residues
for key, value in sorted(box_res[step].items()):
box_res_rev[step].setdefault(value, []).append(key.strip())
return box_res,box_res_rev
\ No newline at end of file
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