From: Miguel <mi...@jm...> - 2005-10-05 15:17:40
|
Niels wrote: > Dear great masters Fledgling ... why hast thou come before us? > I just installed jmol, and it looks very cool, but I haven't > completely understood it yet. I am trying to use it to display a > simple system of red and white spheres.(Actually it is a binary > Lennard-Jones liquid with around 10000 particles). We advise caution when applying a tool to a task for which it was not intended. > I am writing a > script, but I cannot turn of all the bonds and applying the colors > right. I invoke jmol in the following way > > jmol -s myscript datafile.xyz > > Here the file myscript is given by > > select hydrogen; > color atom red; > select helium; > color atom white; > set bonds off > wireframe off; > hbonds off; You have made a noble attempt ... going to far as to use a noble gas. > But my script doesn't really work, because the atoms do not become > colored. The problem is that the script is applied before I load the > datafile, and therefore the atoms from the datafile arrive too late to > become colored. The behavior is unfortunate. Generally, one either runs a script or loads a molecule, but not both. > I can solve this problem by loading the data-file > first and subsequently running my script from the menu, but I would > rather invoke jmol with the script. To control order of execution, we advise that you load the data file as part of your script. > Furthermore my script does not turn of all the bonds in the system. I > still get bonds between hydrogen and helium. Alas, this tool was built for molecules, not fluid dynamics. > If the datafile has very > densely packed spheres, then I get a lot of errors called =22maximum > auto bond count reached=22, and the file takes a lot of time to load. Indeed ... we have seen this problem before. Long long ago there was no test for maximum bond count. In those times, loading a file such as yours in the manner in which you describe would have required even more patience ... for the number of bonds grows as a function of the square of the density. > I > can fix this problem by choosing =22don't compute bonds=22 from the men= u > before I load the datafile, but I would like to fix the problem by > invoking jmol with a script. Does the scripting language of jmol offer > equivalents of the following menu entries? > > edit -> preferences -> bonds -> =22don't compute bonds=22 > > display > bonds -> off We can see that you have searched thoroughly for a solution to your troubles. That is good. Within the all-powerful scripting language many things are possible. The proper chant ('set autobond off') must be applied at the appropriate time. It must be invoked prior to the loading of the data file, in order to prepare the way for an alien structure that does not conform with generally accepted standards of molecular structure ... for which the xyz= file format was intended (albiet in a very primitive way). My son, we believe that there is one other question that you wished to have asked ... In nature one often encounters opposing forces. Common examples are good/evil, yin/yan, thesis/antithesis, The Force/The Dark Side, red states/blue states, Red Sox/Yankees ... We see that you wish to represent opposing forces of red vs. white. Through the primitive xyz format you can control the respective number of= entities involved and their strategic placement. In addition, you will wish to control the size of the individual spheres.= Within the cryptic scripting language we use the word 'spacefill' (or the= even more enigmatic conjuration 'cpk') to define the radius of the selected spheres. We will assume that you desire a harmonious balance in the physical size of your red individuals and white individuals. The magical incantation you seek is as follows: set autobond off; load =22datafile.xyz=22; select hydrogen; color atoms red; select helium; color atoms white; select all; spacefill 0.5; =23 give all spheres a diameter of 0.5 angstroms Miguel |