diff --git a/foofiles/atom.foo b/foofiles/atom.foo index 1c68b5f0..07d74b7b 100644 --- a/foofiles/atom.foo +++ b/foofiles/atom.foo @@ -6040,22 +6040,16 @@ contains ! Bond distances and bonding - bond_distance_to(b,angstrom) result (res) ::: PURE - ! Return the bond distance between atoms "a" and "b" + bond_distance_to(that) result (res) ::: PURE + ! Return the distance between "self" and "that" other atom. self :: IN - b :: ATOM, IN - angstrom :: BIN, optional, IN - res :: REAL + that :: ATOM, IN + res :: REAL r :: VEC{REAL}(3) - change :: BIN - - r = b.position - .position - res = sqrt(r(1)*r(1) + r(2)*r(2) + r(3)*r(3)) - change = FALSE - if (present (angstrom)) change = angstrom - if (change) res = res * STR:conversion_factor("angstrom") + r = that.position - .position + res = sqrt(dot_product(r,r)) end diff --git a/foofiles/roby.foo b/foofiles/roby.foo index 95a9b7a2..c001b826 100644 --- a/foofiles/roby.foo +++ b/foofiles/roby.foo @@ -3889,6 +3889,7 @@ contains ENSURE(.atom.allocated,"no atom data") table :: VEC{TABLE_COLUMN}@ + group :: VEC{INT}@ symbols :: VEC{STR}@ vals :: VEC{REAL}@ n_e, i :: INT @@ -3915,7 +3916,10 @@ contains if (.is_homoleptic) then ! Group atom indices do i = 1,.n_group - symbols(i) = .atom(.atom_group(i).element).chemical_formula + group = .atom_group(i).element + if (group.dim==1) then; symbols(i) = .atom(group(1)).tag + else; symbols(i) = .atom(group).chemical_formula + end end table.create(3) table(1).set_heading("Group") @@ -3995,6 +3999,7 @@ contains table :: VEC{TABLE_COLUMN}@ symbol :: VEC{STR}@ g_A,g_B :: VEC{INT}@ + grA,grB :: VEC{INT}@ n_A,n_B :: VEC{REAL}@ rAB,nAB,sAB,cAB,iAB :: VEC{REAL}@ tAB,pAB,aAB :: VEC{REAL}@ @@ -4034,7 +4039,7 @@ contains table( 1).set_subhead(" A") table( 2).set_heading("Grp") table( 2).set_subhead(" B") - table( 3).set_heading("min R(AB)") + table( 3).set_heading("min r(AB)") table( 3).set_subheading("/Angs.") table( 3).set_width_from(ONE) table( 4).set_heading("n_A") @@ -4069,9 +4074,9 @@ contains n_pair = n_pair.triangle_number g_A.create(n_pair) g_B.create(n_pair) + rAB.create(n_pair) n_A.create(n_pair) n_B.create(n_pair) - rAB.create(n_pair) nAB.create(n_pair) sAB.create(n_pair) cAB.create(n_pair) @@ -4086,10 +4091,12 @@ contains i = i + 1 g_A(i) = a g_B(i) = b + grA = .atom_group(a)[:] + grB = .atom_group(b)[:] + distAB = .atom.min_distance_between(grA,grB) + rAB(i) = distAB*ANGSTROM_PER_BOHR n_A(i) = .n1(a) n_B(i) = .n1(b) - distAB = .atom.min_bond_distance(.atom_group(a).element,.atom_group(b).element) - rAB(i) = distAB*ANGSTROM_PER_BOHR nAB(i) = .n2(a,b) sAB(i) = .n1(a) + .n1(b) - .n2(a,b) cAB(i) = .cov_index(a,b) @@ -4103,9 +4110,9 @@ contains ! Set table data table( 1).set_values(g_A) table( 2).set_values(g_B) - table( 3).set_values(n_A) - table( 4).set_values(n_B) - table( 5).set_values(rAB) + table( 3).set_values(rAB) + table( 4).set_values(n_A) + table( 5).set_values(n_B) table( 6).set_values(nAB) table( 7).set_values(sAB) table( 8).set_values(cAB) diff --git a/foofiles/vec{atom}.foo b/foofiles/vec{atom}.foo index 6012a8e0..8d1160b4 100644 --- a/foofiles/vec{atom}.foo +++ b/foofiles/vec{atom}.foo @@ -8859,8 +8859,8 @@ contains end - min_bond_distance(group_a,group_b) result (res) ::: PURE - ! Return the minimum bond distance between the atoms whose + min_distance_between(group_a,group_b) result (res) ::: PURE + ! Return the minimum distance between the atoms whose ! indices are listed in "group_a" and "group_b". self :: IN group_a :: VEC{INT}, IN