diff --git a/CHANGELOG b/CHANGELOG index 16315f53cd130bec090ebbf968218257204fac10..5bfc074b101296570218afb33fa2a292ecb5294c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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 diff --git a/main.py b/main.py index 324decb5b59d96471103382b8af9d3e7fe968a3c..15284a1463313dac4717164284cad8e8f5bda4c6 100644 --- a/main.py +++ b/main.py @@ -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 diff --git a/tooba_f.py b/tooba_f.py index f34c835a16ee2c9e47554593a444eddb5b941bbd..f9f80dc6300010adbf77457d7f3fd6ef24541ed2 100644 --- a/tooba_f.py +++ b/tooba_f.py @@ -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 zzprev: 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