visualization plugin for paraviewbaranov/pvdgrid/pvdgrid.pdf · brief introduction into ......

15
Alexey I. Baranov Visualization Plugin for ParaView version 2.0 Springer

Upload: others

Post on 13-Aug-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Visualization Plugin for ParaViewbaranov/pvdgrid/pvdgrid.pdf · Brief introduction into ... ParaView plugins are made available as a separate part of the DGrid package. There are

Alexey I. Baranov

Visualization Plugin forParaView

version 2.0

Springer

Page 2: Visualization Plugin for ParaViewbaranov/pvdgrid/pvdgrid.pdf · Brief introduction into ... ParaView plugins are made available as a separate part of the DGrid package. There are
Page 3: Visualization Plugin for ParaViewbaranov/pvdgrid/pvdgrid.pdf · Brief introduction into ... ParaView plugins are made available as a separate part of the DGrid package. There are

Contents

1 Visualization with ParaView . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51.1 ParaView plugin installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

1.1.1 Installation of precompiled plugins . . . . . . . . . . . . . . . . . . . . . 61.1.2 Compilation of ParaView plugins . . . . . . . . . . . . . . . . . . . . . . . 6

1.2 Visualization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71.2.1 Visualizing the Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81.2.2 Basics of Grid Data Visualization . . . . . . . . . . . . . . . . . . . . . . . 131.2.3 Clipping in ParaView . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151.2.4 Saving state in ParaView . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151.2.5 Tips and Tricks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

3

Page 4: Visualization Plugin for ParaViewbaranov/pvdgrid/pvdgrid.pdf · Brief introduction into ... ParaView plugins are made available as a separate part of the DGrid package. There are
Page 5: Visualization Plugin for ParaViewbaranov/pvdgrid/pvdgrid.pdf · Brief introduction into ... ParaView plugins are made available as a separate part of the DGrid package. There are

Chapter 1Visualization with ParaView

The visualization of DGrid generated data can be performed with the freewareprogram ParaView R⃝ which is available for many platforms including MicrosoftWindows R⃝, Linux R⃝ and macOS R⃝. An additional ParaView plugin is necessaryfor that. It provides routines which read DGrid file formats, adds handy ParaViewfilters and GUI controls. Plugin for the version 5.2.0 consists of the single shared(dynamically linked) library (earlier versions of plugin contain more files).

The ParaView plugin installation is described in Sec. 1.1. Brief introduction intoParaView controls and basic visualization steps is given in Sec. 1.2.

Detailed information about the ParaView can be found in the Internet athttp://www.paraview.org.

1.1 ParaView plugin installation

ParaView plugins are made available as a separate part of the DGrid package. Thereare two ways to deploy them:

• Precompiled plugins are available for x86 32-bit and 64-bit versions of officialbuilds of ParaView for Microsoft Windows and 64-bit version of ParaView formacOS X. At the time of writing this User’s Guide the version of ParaView 5.2.0is supported. The x86 64-bit plugins have been tested on Microsoft Windows 7Professional, Microsoft Windows 10 Home and macOS X 10.9.5. They can bedownloaded from DGrid website as separate packages. The next subsection 1.1.1describes how to install the binary plugin.

• The plugins can be build from the source code. To do this, one has to build theParaView from the source code in advance on the same machine.

5

Page 6: Visualization Plugin for ParaViewbaranov/pvdgrid/pvdgrid.pdf · Brief introduction into ... ParaView plugins are made available as a separate part of the DGrid package. There are

6 1 Visualization with ParaView

This is the way to obtain the plugins when pre-build binary plugins are not avail-able for target ParaView version or when customized build of ParaView is used(compiler or libraries differ from those for official built).See the Sec. 1.1.2 for instructions how to build the plugins from source code.

1.1.1 Installation of precompiled plugins

When installing a precompiled plugin, download the package from the DGrid web-site and unpack it. Copy the plugin files 1:

• SMMDGridPlugin (or libSMMDGridPlugin)• elf mk.xml

into folder e.g.

PVDGrid-5.2.0

ParaView should be informed about new plugins capable to work with DGridfiles. One way to do it is to set up system variable called PV PLUGIN PATH to thepath of that plugin folder. Another way is to load plugin via Plugin Manager (menuTools – Manage Plugins ).

ParaView Wiki (http://www.paraview.org/Wiki/Plugin HowTo#Using Plugins) con-tains additional information on loading plugins in ParaView.

1.1.2 Compilation of ParaView plugins

First of all, download ParaView source code and build ParaView. Detailed instruc-tions can be obtained at ParaView website at http://paraview.org/Wiki/ParaView:Build And Install.To compile ParaView, some other software packages like Qt or CMake must beavailable.

Then download the plugin source code from DGrid website, create a folder

dgrid-4.6/PVDGrid

and unpack the plugin source code into it.As for ParaView, plugin build process is controlled by CMake build control sys-

tem (http://www.cmake.org) in which one should set up appropriate variables and

1 Plugin versions for ParaView < 5.2.0 include more files.

Page 7: Visualization Plugin for ParaViewbaranov/pvdgrid/pvdgrid.pdf · Brief introduction into ... ParaView plugins are made available as a separate part of the DGrid package. There are

1.2 Visualization 7

then generate the build configuration files like Makefile under Linux or MicrosoftVisual Studio solution file (*.sln) under Microsoft Windows. Usually, the only im-portant variable which has to be set up when configuring ParaView plugin build inCMake is the ParaView DIR which should point to ParaView build directory(and NOT to the ParaView source directory). Finally the plugin is build using thegenerated configuration file, e.g., invoking make command under Linux or openingthe solution in Microsoft Visual Studio and building it.

When everything runs successfully, plugin library file called SMMDGridPlu-gin or libSMMDGridPlugin should appear in the plugin build folder. Consult theSec. 1.1.1 on how to configure the ParaView to use the plugins.

1.2 Visualization

Start ParaView by typing paraview or clicking its icon. Load the DGrid plugin via’Plugin Manager’ if it is not loaded automatically yet (cf. 1.1.1).

ParaView plugin can visualize two types of files prepared by DGrid:

• DGrid Property files containing the calculated properties on the grid.• DGrid Structure files (STR) containing molecular/crystal structures or topologi-

cal graphs.

To test plugins prepare some property grid (for instance the electron density gridfor oxazole as described in DGrid User’s Guide).

1. Select the file to open (e.g. via menu File – Open ).2. Select the grid file. It will be scanned and boxes representing data sets found

in this file appear in the Pipeline Browser window. Normally each grid filecontains ’Structure’ data set with the structure and ’Property’ data set with thescalar field on the grid (Fig. 1.1).A window may appears with the suggestion to select the particular format. Selectthen the appropriate DGrid format.

3. Press Apply button at the Properties tab to load the data. Some controls of

the data set become then available at Properties tab. General information about

data set can be found at Information tab.

Remark 1.1. If the file is not listed in the selector box and cannot be chosen, se-lect All files (*) in the Files of Type menu of the selector box and try to openthat file. This can happen if the file has the extention which was not recognized byParaView.

Page 8: Visualization Plugin for ParaViewbaranov/pvdgrid/pvdgrid.pdf · Brief introduction into ... ParaView plugins are made available as a separate part of the DGrid package. There are

8 1 Visualization with ParaView

If there is a problem to load the file, check in the ParaView Plugin Manager

(accessible via menu items Tools – Manage Plugins ) if the DGrid plugins werefound and loaded. When plugins are not found, check how to add them to ParaViewin the Sec. 1.1.1. When plugins are found but can not be loaded, consult Sec. 1.1.2how to recompile them or reinstall the proper version of ParaView.

The detailed instructions on the visualization of the grid data and the usage ofall the tools is described in details in ParaView guide. A lot of valuable informationcan also be found at http://www.paraview.org (Wiki, Tutorials, FAQ). A brief guidehow to create isosurfaces, slices and basins is given in Sec. 1.2.2. Following sectiondescribes the visualization of ’Structure’ data set with current ParaView plugin.

Fig. 1.1 Visualization pipeline for structure plot and Atoms tab of ParaView plugin.

1.2.1 Visualizing the Structures

Property files in DGrid format include also the structure data of the moleculeor crystal structure. To visualize the structure, select the Structure data set in

the Pipeline Browser and then apply ’Plot Structure’ filter to it (select from

Page 9: Visualization Plugin for ParaViewbaranov/pvdgrid/pvdgrid.pdf · Brief introduction into ... ParaView plugins are made available as a separate part of the DGrid package. There are

1.2 Visualization 9

the menu Filters – Alphabetical – Plot Structure and press Apply on the

Properties tab. Two additional data sets Ball-n-Stick and Labels appear in

the Pipeline Browser . First contains the geometrical representation of molecularstructure and second contains labels of the structure elements (Fig. 1.1). Structureplot appearance is controlled via Properties tab of PlotStructure data set.

The option Map Scalars , which maps the colors assigned to visual objectsusing a colormap is activated by default. This means, that the color for an atom,bond, path etc. set at the corresponding tab of Plot Structure filter will be mappedand the object appears on the screen with different color. To switch this option off,select Structure pipeline object, go to its Property tab, find there the section

Scalar Coloring (if it is not shown press the button with the gear symbol at the top

of the tab to show all the properties of the tab) and uncheck the box Map Scalars .

1.2.1.1 Atoms tab

The controls for the Atoms tab are shown in Fig. 1.1.

• Desired atom can be selected using pop-up selector.

• Each atom type has default radius and color. They can be changed via Set Radiusfield and Set Color button.

• When several atoms of the same element type are present, a general name like”All C” appears in the atom list. This item allow to set same parameters for allatoms of that element type. Please note, that this item will discard the actualparameters of specific atoms!

1.2.1.2 Bonds tab

The controls for the Bonds tab are shown in Fig. 1.2.

• Atoms forming bond can be selected using popup selectors Bond between .General names are also available just like for atoms.

• Each bond type can have unique radius and color. They can be changed viaSet Radius field and Set Color button.

• The minimal and maximal bond lengths can be modified via Set Min./Max. Distancefields.

Page 10: Visualization Plugin for ParaViewbaranov/pvdgrid/pvdgrid.pdf · Brief introduction into ... ParaView plugins are made available as a separate part of the DGrid package. There are

10 1 Visualization with ParaView

Fig. 1.2 ParaView plugin – Bonds tab

1.2.1.3 Paths tab

To visualize the interconnection paths first the file with the data for the critical pointsand the path points, written in the DGrid Structure format, must be read in. Whenfile is read the Plot Structure filter can be started in the same way as in case of

the structure data, cf. page 8. In contrast to the atomic data, now the Atoms tabdoes not contain atomic symbols but the symbols for the critical points (and cores),i.e., Attr, Saddle, Ring, Min and Core respectively. General names for both criticalpoints and path types are also available.The controls for the Paths tab are shown in Fig. 1.3.

Fig. 1.3 ParaView plugin – Paths tab

Page 11: Visualization Plugin for ParaViewbaranov/pvdgrid/pvdgrid.pdf · Brief introduction into ... ParaView plugins are made available as a separate part of the DGrid package. There are

1.2 Visualization 11

• Desired path can be chosen using pop-up selector.

• Each path type has default radius and color given in the DGrid Structure file,cf. DGrid User’s Guide. They can be changed via Set Radius field and

Set Color button.

• Path can be made hidden using Visible checkbox.

1.2.1.4 Cell tab

The buttons for the Cell tab are shown in Fig. 1.4.

Fig. 1.4 ParaView plugin – Cell tab

The unit cell can be visualized using Cell tab controls. The unit cell data aretaken from the ’Lattice vectors’ part of the Property file, cf, DGrid User’s Guide.The color and radius of the cell cylinders can be set via Set Radius field and

Set Color button. The unit cell plot is activated when Show Unit Cell box ischecked.

1.2.1.5 General scale

The field Scale below the tab control sets up the general scale factor for all thespheres and cylinders used in the structure plot.

Page 12: Visualization Plugin for ParaViewbaranov/pvdgrid/pvdgrid.pdf · Brief introduction into ... ParaView plugins are made available as a separate part of the DGrid package. There are

12 1 Visualization with ParaView

1.2.1.6 Plotting labels

Labels can be shown for atoms, critical points and path fragments to make themrecognizable on the plot. Labels are created by Plot Structure filter and are shownas additional data set called ’Labels’. To plot the labels on the screen (see Fig. 1.5)do the following:

Fig. 1.5 ParaView plugin – Plotting labels

1. Go over ALL BUT ’Label’ data set boxes in Pipeline Browser , select Properties

tab and deactivate Pickable checkbox (if it is not shown press the button withthe gear symbol to show all the properties of the tab). Alternatively one mayswitch off the visibility of the data set by clicking on the eye icon left to the boxin the Pipeline Browser and turn it on back when the labels are plot.

2. Click on Select Points Through button at the top of the visualization window(small buttons below ’Layout #1’ text label on Fig. 1.5) and select with the mousethe part of scene for which the labels should be shown.

3. Go to menu View and activate Selection Display Inspector checkbox if

not activated yet. You may like to attach its window to the Properties and

Information tabs like shown on the Fig. 1.5 to save more space for the visual-ization window.

4. Go to the Selection Display Inspector and click on Point Labels .

5. Activate labels checkbox.

Page 13: Visualization Plugin for ParaViewbaranov/pvdgrid/pvdgrid.pdf · Brief introduction into ... ParaView plugins are made available as a separate part of the DGrid package. There are

1.2 Visualization 13

6. Label appearance (size, font, color etc.) can be tuned by pressing Edit Selection Label Propertiesbutton (with gear symbol).

1.2.2 Basics of Grid Data Visualization

1.2.2.1 Isosurface

Select the desired data set in the Pipeline Browser and apply ’Contour’ fil-

ter (from menu Filters ). The filter control panel appears on the Properties

tab. Specify the isosurface level at the Value Range window there and press

Apply to show the isosurface. Check whether the ’Representation’ popup is set

to Surface and set it to this value. The color of the isosurface can be modified at

Properties tab.

1.2.2.2 Slice

Select the desired data set in the Pipeline Browser and apply ’Slice’ filter (from

menu Filters ). The filter control panel appears on the Properties tab. Check that

Map Scalars checkbox is activated and that the ’Representation’ popup is set to

Surface . The position and orientation of the slice can be modified by the visual

controls shown on the 3D plot or via the fields on the Properties tab.

The colormap used for the slice can be changed by pressing the Choose Presetbutton (with a heart symbol), selecting a colormap in the ’Choose Preset’ windowthat appears and pressing Apply . Classical ELF colormap can be loaded by press-

ing Import button on the ’Choose Preset’ window and loading elf mk.xml file,shipped as a part of ParaView plugin.

To set custom range of values, corresponding to the full colorscale, press Rescale to custom rangebutton and modify the range min and max values in the window appeared.

1.2.2.3 Basin

The basin file contains a field of integer values which can be read in with the inter-face as described for the property grids on page 7. Special route must be followedfor the visualization of the basins as separate solid objects:

Page 14: Visualization Plugin for ParaViewbaranov/pvdgrid/pvdgrid.pdf · Brief introduction into ... ParaView plugins are made available as a separate part of the DGrid package. There are

14 1 Visualization with ParaView

1. After the basin file is read, apply Generate Basin Surfaces filter (from

menu Filters ) on its Property data set. This will create new data set called

GenerateBasinSurfaces .

2. Apply Plot Basin filter on this new data set. Set ’Representation’ popup to

Surface . The basin number to be visualized can be selected on the Propertytab.

3. Additionally, basin shape can be smoothed to produce more nice-looking plots.This is done by extracting the basin surface with ParaView Extract Surfacefilter and smoothing it with ParaView Smooth filter. The degree of smoothing

can be controlled by Number of iterations parameter. Very fine smoothing (>500) are not recommended since it may spoil out important shape features and istime-consuming.

Basin color and other visualization settings can be modified on the Propertiestab. The color of the isosurface or basin can not only be constant for all the points ofthe object but be controlled by the value of other property at that point (Fig. 1.6). Tomake such plots, data sets containing property for generating object (e.g. basin orisosurface) and property used to color it should be merged into new combined dataset using Append Attribute filter from menu Filters . More than 2 propertiescan be merged as well. The property used to color the object can be selected, usingpopup control in the ’Coloring’ section of the Properties tab.

Fig. 1.6 ParaView plugin – Density basin surface colored according to laplacian values

Page 15: Visualization Plugin for ParaViewbaranov/pvdgrid/pvdgrid.pdf · Brief introduction into ... ParaView plugins are made available as a separate part of the DGrid package. There are

1.2 Visualization 15

1.2.3 Clipping in ParaView

The visualization elements in ParaView can be clipped with the Clip filter (from

menu Filters ). Several types of clipping surfaces are available (e.g. Box, Sphere)

and one can clip either internal or external of that (activate Inside Out for the

latter). One can also clip the Ball-n-Stick structure plots.

1.2.4 Saving state in ParaView

The visualization scene produced with ParaView can be very complex. When Par-aView is closed, the whole arrangement, called state, is lost unless saved. The sav-ing of a state is performed with File → Save State . The state can then be later

loaded with File → Load State .

1.2.5 Tips and Tricks

The colormap is shown automatically by default for any kind of data, i.e. also forthe structures. To switch it off permanently, go to menu Edit – Settings , select

tab General and modify under

Color/Opacity Map Range Options middle popup control from

Automatically Show and/or Hide Color Bars to

Automatically Hide Unused Color Bars .

To avoid pressing each time Apply button one can activate Apply changes to parameters automaticallybutton from the Paraview toolbar.