I think what you want is:
1) create your own bounding box.
2) use "within" to select those atoms.
3) provide an array of atomic masses -- Jmol doesn't have that.
4) use "inline FOR" and array function .sum to total up the masses.
Something like this:
boundbox {0 0 0} {15 15 15}
Var volume = 15*15*15
Var atomic_masses = [1.1,2.5,3,4,5,12.1,14.3,16.0,9,10] # just testing
here -- put in the real atomic masses
Var totalMass = for(x;{within(boundbox)};atomic_masses[x.elemno]).sum
Var density = totalMass/volume
print density
The only problem I see is that if you have atoms ON the face or corners of
the bounding box, you will have to adjust for that if you want a true
density.
Bob
--
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107
If nature does not answer first what we want,
it is better to take what answer we get.
-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users