Version 17 (modified by 12 years ago) ( diff ) | ,
---|
VisIt Scaling Code
Click here to download supplemental files
VisIt normally creates plots using the unscaled computational units that AstroBEAR writes to Chombo files. This required us to write a set of modules that extract scaling data from HDF5 files and use it to create scaled plots in VisIt. These files are written in C and Python, and should be placed in the base directory of the problem the user wants to visualize. The four files in this package are:
_ChomboSupplement.so
: A shared object written in C that extracts data from the problem's output data files using the HDF5 API. Each function creates, uses and closes its HDF5 objects internally, so users do not need to worry about resources getting chewed up by stray object handles. This module was compiled using version 1.6.2 of the HDF5 library.
ChomboSupplement.py
: A SWIG-generated Python interface module that allows other Python modules to use functions from_ChomboSupplement.so
.ChomboSupplement.py
was generated using SWIG v1.3.31 and Python v2.5.1.
ChomboSupplement.pyc
: A byte-compiled version ofChomboSupplement.py
; there is no functional difference between the two.
MakeVisitPlot.py
: A set of functions that uses the VisIt API and_ChomboSupplement.so
functions to produce scaled plots. Produced using Python v2.5.1 and v1.6.1 of thevisit.so
module.
The scaling code assumes that the data being plotted comes from one of AstroBEAR's extended Chombo files that contains the variable scaling factors (see the Making Movies In VisIt page for more details on how to load a Chombo HDF5 database). Follow the steps below to use the Chombo files to generate a scaled plot.
- Make sure that the
visit.so
module is installed somewhere in Python's search path. If you are using a precompiled version, then it probably exists already, but may not be on the search path. If you have a source-installed package, then enter the following commands to build and install the visit module.
cd VISIT_DIR/ARCHITECTURE_DIR/src/visitpy/visitmodule python build_visitfrontend.py build python build_visitfrontend.py install
Note that you may be told you don't have permission to do this, in which case you may have to ask your system administrator to do it. Another option is to rebuild the entire VisIt package using the build_visit script from VisIt's website, making sure to use the
-w
option to enable the module.
- Place the four files listed above in your problem directory.
- Move to the problem directory, launch VisIt and load the
out/chombo*.hdf
database.
- Bring up a command window (Controls → Command)
- Enter the following commands into the command window and click the Execute button:
import MakeVisitPlot MakeVisitPlot.makeScaledPlot(plot_type, var_name)
where
plot_type
is a string version of the type of VisIt plot (e.g.,"Pseudocolor"
) andvar_name
is a string version of the variable you wish to plot ("rho"
,"E"
, etc.).
This should create and draw plots from the frames in the
out/chombo*.hdf
database:
Attachments (2)
- Screenshot-Commands.png (21.6 KB ) - added by 17 years ago.
- Screenshot-Window 1.png (60.7 KB ) - added by 17 years ago.
Download all attachments as: .zip