[visit-users] Creating length dependent coloured bonds in VisIt

Brad Whitlock whitlock2 at llnl.gov
Tue Mar 30 20:12:39 EDT 2010

You could probably use the CreateBonds operator to create the bonds 
between atoms. From there, you might have to use the DeferExpression 
operator (you may need to enable it in the Plugin manager window 
first) in order to ensure that your expression calculations are not 
done until after the CreateBonds operator has had a chance to create 
the bonds.


>Well, I'm starting from a file which contains the x, y, and z 
>coordinates of each atom. So, the mesh is a representation of the 
>points not the distances between the points. Do I need calculate the 
>bond lengths before I can use the "max_edge_length(mesh)" 
>expression? If so, how can this be accomplished?
>On Tue, Mar 30, 2010 at 2:03 PM, Meredith, Jeremy S. 
><<mailto:jsmeredith at ornl.gov>jsmeredith at ornl.gov> wrote:
>Sure, no problem. You're on the right track with expressions: the 
>one you want is called "max_edge_length", which reports the maximum 
>length of any edge of a mesh element. Since bonds are 1d mesh 
>elements with a single edge, this just calculates their length.
>So: just create a new expression called "bondlength", of type 
>"Scalar Mesh Variable", and define it as "max_edge_length(mesh)".
>Then plot that "bondlength" variable, presumably with the Molecule 
>plot or the Pseudocolor plot. The pseudocolor plot will show you the 
>"0" value for your atoms, but I believe the Molecule plot is smart 
>enough to know this only applies to bonds. You could make a second 
>Molecule plot showing only the atoms if you wanted to color them by 
>species, for example -- the setting to hide the bonds is in the 
>Molecule plot window.
>Either of those plots has support for picking a color map. You might 
>pick the "difference" color table, which shows lower values in red 
>and large values in blue, and you can clamp the lower and upper 
>values for the map. Or define your own color table, of course.
>If you have a known bond length you want to compare against, you 
>might plot a new expression like "2.0 - bondlength", and clamp the 
>values in the plot to the same absolute value, such as setting min 
>to -0.5 and max to +0.5. This ensures when you use the "difference" 
>color table, the value "0" maps to white, negative to blue, and 
>positive to red.
>Jeremy Meredith
>Oak Ridge National Laboratory
>From: Willie Maddox 
>[mailto:<mailto:wmaddox at mymail.mines.edu>wmaddox at mymail.mines.edu]
>Sent: Tuesday, March 30, 2010 3:23 PM
>To: <mailto:visit-users at email.ornl.gov>visit-users at email.ornl.gov
>Subject: [visit-users] Creating length dependent coloured bonds in VisIt
>Dear Sir or Madam,
>I am trying to find a software package that will allow me to 
>manipulate the colouring of bonds between atoms based on the bond 
>For example, if the ideal bond length in a particular crystal is say 
>2.0 angstroms and I perform a slab relaxation, I would like to 
>display the bonds that got stretched with one colour (say blue), and 
>the bonds that got compressed, with another (red maybe).
>In addition, I would like to be able to map the range of bond 
>lengths in this relaxed crystal to the red/blue colour gradient, or 
>any other colour gradient for that matter. In other words, a bond 
>length of 2.2 Angstroms would appear "more" blue than a neighbouring 
>bond 2.1 Angstroms long. Vice versa for the reds of course.
>I've spent a week scouring many crystal visualisation packages, both 
>proprietary (Materials Studio, Crystal Maker, etc.) and open source 
>(VESTA, VMD, etc.), and have yet to find any that can do this. 
>However, VisIt looks like its "Expressions" options may be the 
>ticket, but I'm not sure exactly how to implement it.
>Question: Can VisIt do this?
>Thanks in advance!
>-Willie Maddox
>Computational Materials Science
>Colorado School of Mines
>List subscription information: 
>Searchable list archives: 
>VisIt Users Wiki: <http://*visitusers.org/>http://*visitusers.org/
>Frequently Asked Questions for VisIt: 
>List subscription information: 
>Searchable list archives: https://*email.ornl.gov/pipermail/visit-users
>VisIt Users Wiki: http://*visitusers.org/
>Frequently Asked Questions for VisIt: http://*visit.llnl.gov/FAQ.html

Brad Whitlock                   Lawrence Livermore National Laboratory
whitlock2 at llnl.gov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://email.ornl.gov/pipermail/visit-users/attachments/20100330/6d2ccaac/attachment.html>

More information about the visit-users mailing list