Sunday, March 31, 2013

Jmol Scripts for Visualizing Multiple NBOs


In the previous part, single visualization scripts were created to display individual or interacting NBOs in Jmol viewer. We have used a simple Java application to generate the corresponding Jmol script files. Here, a slightly modified version of the previous application is described, which allows for generation of sets of macro files for specific NBOs or interacting NBO-NBO* pairs.


In brief, we browse for specific NBO "PLOT" (.32 - .40) file, click on it, and choose or leave default logical file name (LFN). In the next step, we proceed to the input of molecular orbitals (fields NBOs or NBO pairs). To visualize interacting orbitals, we check the "NBO Interactions" check box and enter list of interacting pairs (e.g. homo:lumo, 12:87).
Pairs are separated by comma and interacting pairs are denoted by column separator. For a simple list of orbitals, we enter comma separated list of orbital numbers (e.g. 10, 12, lumo). After clicking "Create" button, the corresponding script files will be created and confirmation printed in the text field below (Fig. 1). From there, we launch JmolViewer, go to "Macros" pull-down menu, and choose one of the listed macros.

Java Application - Details:

As indicated in Fig. 1 (magenta lines), we fill in the file path (Browse for and click any plot file), check the filename, and enter LFN type (37 for NBO).

  • File name is parsed from the selected path, filetype is removed. For example, by clicking on c:/nbo/form.37, directory c:/nbo is selected in field 1. and "form" is auto filled  in field 2.
  • Values for fields 1, 2, and 3 are recorded in newly created file "nbo_settings.xml' and re-used next time when application is launched. This file is stored together with the .jar executable.

In the next step, we will specify list of orbitals (1) or interaction orbital pairs (2).

  1. For list of orbitals, we enter comma separated order of orbital numbers (from .nbo file). For example, "10, 12,homo,lumo". Spaces are tolerated. The latest revision also features option to enter ranges of orbital, such as "5-10,12,homo,85-87".
  2. To indicate the interacting pair list, we have to check the box "NBO Interactions?" and type comma separated list of orbital numbers with column character indicating interaction pair. For example, list containing "12:87, 10:65, homo:lumo" will create three macro files for the following interacting pairs: 12-87, 10-65, and homo-lumo.

In this version, there is one additional feature - option to write macro files into the default JmolViewer .jmol/macros directory. Its path depends on the computer system (Win, Linux). If this check box is unchecked, macro files are created in the original directory (here c:/nbo) and have to be manually moved into .jmol/macros directory before launching JmolViewer.

Fig. 1 Interacting orbitals of formamide.

After clicking "Create", the corresponding macro files will be generated in the assigned directory. Summary of executed tasks is shown in the text area. Note the number of macro files created (here two), type of orbitals (here NBO), and path to the macro files.

  • Plot file number (.32-.40) is translated into the corresponding orbital type (PNAO, NBO, ...) and abbreviated in the file name (Fig. 2).
  • Spaces between interacting pairs are tolerated (12:87, \s homo:lumo), but other irregularities, such as "12-87" in the format are not checked for.
To clear output field and fields for NBO entry, click the "Clear text" button.

Fig. 2 Macro files created in the %USERPROFILE%/.jmol/macros directory.
Occasionally check for updates on this blog "Click here for update" link at the bottom of application window.


Download:

Download zipped .jar file by clicking the following link:

Latest version:     nbo_list_macro_rev3.1.zip

Other versions:    
rev2:   nbo_list_macro_rev2.0.zip
rev1:   nbo_list_macro_rev1.0.zip

History:
4/14/2013 - rev3.1 fixed bug with directory opening in the default place instead in the directory visited last.
4/9/2013   -  rev3.0 added option to delete files in default JmolViewer directory; Changed file naming to allow for numerical sorting of interacting orbitals in JmolViewer (from name_10:57-NBO.macro to 10:57_name-NBO.macro)
4/7/2013   -   rev2.0; added option to enter ranges of orbitals (e.g., 1-5, 6-9,12). Changed file naming to allow for numerical sorting of individual orbitals in JmolViewer (from name_1-NBO.macro to 1_name-NBO.macro)
3/31/2013   -   rev1.0; original version


Java classes (and application) were compiled with JDK 1.7. Any updates to the files will have revision suffix added to the filename (rev1.x) .
Contact me with any bugs, suggestions, or if there is a problem with the download (I'll e-mail you the files). 

References:


Back to TOP

No comments:

Post a Comment