Commit 1d945ca6 authored by ghweber's avatar ghweber

Merged 1.12RC into trunk.

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@6902 18c085ea-50e0-402c-830e-de6fd14e8384
parent 9f906169
# generated automatically by aclocal 1.10.1 -*- Autoconf -*-
# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# 2005 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
......
......@@ -83,6 +83,12 @@ DEFAULT_GDAL_LIB=$VISITHOME/gdal/1.3.2/$ARCH/lib
DEFAULT_H5PART_INCLUDE=$VISITHOME/h5part/1.4.0/$ARCH/include
DEFAULT_H5PART_LIB=$VISITHOME/h5part/1.4.0/$ARCH/lib
##
## FastBit
##
DEFAULT_FASTBIT_INCLUDE=$VISITHOME/fastbit/ibis1.0.7/linux-ia64_gcc-4.1.2/include
DEFAULT_FASTBIT_LIB=$VISITHOME/fastbit/ibis1.0.7/linux-ia64_gcc-4.1.2/lib
##
## HDF4
##
......
......@@ -9238,7 +9238,6 @@ else
fi
if test "$DEFAULT_FASTBIT_LIB" != "" ; then
FASTBIT_LIB="-L$DEFAULT_FASTBIT_LIB -lfastbit -lrt"
H5PART_LIBDIR="$DEFAULT_FASTBIT_LIB"
fi
fi
if test "$FASTBIT_LIB" != "" ; then
......
......@@ -929,6 +929,10 @@ dnl bin/db_xml2makefile shell script. Adjusted sed commands for generating
dnl ITAPS implementations .xml files to include spaces for db_xml2makefile
dnl to work properly.
dnl
dnl Gunther H. Weber, Fri Apr 17 13:22:44 PDT 2009
dnl Do not add "-lrt" for FastBit on MacOS (Darwin machines)
dnl Do not change H5PART_LIBDIR in FastBit config.
dnl
dnl --------------------------------------------------------------------------
dnl
......@@ -2564,7 +2568,6 @@ else
fi
if test "$DEFAULT_FASTBIT_LIB" != "" ; then
FASTBIT_LIB="-L$DEFAULT_FASTBIT_LIB -lfastbit -lrt"
H5PART_LIBDIR="$DEFAULT_FASTBIT_LIB"
fi
fi
if test "$FASTBIT_LIB" != "" ; then
......
<?xml version="1.0"?>
<Plugin name="H5Part" type="database" label="H5Part" version="1.0" enabled="true" mdspecificcode="false" onlyengine="false" noengine="false" dbtype="MTMD" haswriter="false" hasoptions="false">
<CXXFLAGS> $(HDF5_INCLUDE) $(H5PART_INCLUDE) </CXXFLAGS>
<LIBS> $(H5PART_LIB) $(HDF5_LIB) $(ZLIB_LIB) </LIBS>
<Extensions> h5part </Extensions>
<Attribute name="" purpose="" persistent="true" exportAPI="" exportInclude=""> </Attribute>
<Plugin name="H5Part" type="database" label="H5Part" version="1.0" enabled="true" mdspecificcode="false" engspecificcode="false" onlyengine="false" noengine="false" dbtype="MTMD" haswriter="false" hasoptions="true" specifiedFilenames="false">
<CXXFLAGS>
$(HDF5_INCLUDE)
$(H5PART_INCLUDE)
</CXXFLAGS>
<LIBS>
$(H5PART_LIB)
$(HDF5_LIB)
$(ZLIB_LIB)
</LIBS>
<Extensions>
h5part
</Extensions>
<Attribute name="" purpose="" persistent="true" keyframe="true" exportAPI="" exportInclude="">
</Attribute>
</Plugin>
......@@ -40,6 +40,7 @@
#include <avtH5PartFileFormat.h>
#include <avtMTMDFileFormatInterface.h>
#include <avtGenericDatabase.h>
#include <avtH5PartOptions.h>
// ****************************************************************************
// Method: H5PartCommonPluginInfo::GetDatabaseType
......@@ -47,8 +48,8 @@
// Purpose:
// Returns the type of a H5Part database.
//
// Programmer: ghweber -- generated by xml2info
// Creation: Tue Aug 28 15:08:01 PST 2007
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
DatabaseType
......@@ -58,7 +59,7 @@ H5PartCommonPluginInfo::GetDatabaseType()
}
// ****************************************************************************
// Method: H5PartCommonPluginInfo::SetupH5PartDatabase
// Method: H5PartCommonPluginInfo::SetupDatabase
//
// Purpose:
// Sets up a H5Part database.
......@@ -70,8 +71,8 @@ H5PartCommonPluginInfo::GetDatabaseType()
//
// Returns: A H5Part database from list.
//
// Programmer: ghweber -- generated by xml2info
// Creation: Tue Aug 28 15:08:01 PST 2007
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
avtDatabase *
......@@ -80,5 +81,38 @@ H5PartCommonPluginInfo::SetupDatabase(const char *const *list,
{
return new avtGenericDatabase(
new avtMTMDFileFormatInterface(
new avtH5PartFileFormat(list[0])));
new avtH5PartFileFormat(list[0], readOptions)));
}
// ****************************************************************************
// Method: H5PartCommonPluginInfo::GetReadOptions
//
// Purpose:
// Gets the read options.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
DBOptionsAttributes *
H5PartCommonPluginInfo::GetReadOptions() const
{
return GetH5PartReadOptions();
}
// ****************************************************************************
// Method: H5PartCommonPluginInfo::GetWriteOptions
//
// Purpose:
// Gets the write options.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
DBOptionsAttributes *
H5PartCommonPluginInfo::GetWriteOptions() const
{
return GetH5PartWriteOptions();
}
......@@ -48,8 +48,8 @@
// Purpose:
// Return a new EnginePluginInfo for the H5Part database.
//
// Programmer: ghweber -- generated by xml2info
// Creation: Tue Aug 28 15:08:01 PST 2007
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
extern "C" EngineDatabasePluginInfo* GetEngineInfo()
......@@ -58,15 +58,15 @@ extern "C" EngineDatabasePluginInfo* GetEngineInfo()
}
// ****************************************************************************
// Method: H5PartCommonPluginInfo::GetWriter
// Method: H5PartEnginePluginInfo::GetWriter
//
// Purpose:
// Sets up a H5Part writer.
//
// Returns: A H5Part writer.
//
// Programmer: ghweber -- generated by xml2info
// Creation: Tue Aug 28 15:08:01 PST 2007
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
avtDatabaseWriter *
......
......@@ -48,8 +48,8 @@
// Purpose:
// Return a new MDServerPluginInfo for the H5Part database.
//
// Programmer: ghweber -- generated by xml2info
// Creation: Tue Aug 28 15:08:01 PST 2007
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
extern "C" MDServerDatabasePluginInfo* GetMDServerInfo()
......@@ -61,3 +61,4 @@ extern "C" MDServerDatabasePluginInfo* GetMDServerInfo()
void H5PartMDServerPluginInfo::dummy()
{
}
......@@ -59,8 +59,8 @@ extern "C" const char *VisItPluginVersion = VERSION;
// Purpose:
// Return a new GeneralPluginInfo for the H5Part database.
//
// Programmer: ghweber -- generated by xml2info
// Creation: Tue Aug 28 15:08:01 PST 2007
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
extern "C" GeneralDatabasePluginInfo* GetGeneralInfo()
......@@ -76,8 +76,8 @@ extern "C" GeneralDatabasePluginInfo* GetGeneralInfo()
//
// Returns: A pointer to the name of the database plugin.
//
// Programmer: ghweber -- generated by xml2info
// Creation: Tue Aug 28 15:08:01 PST 2007
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
......@@ -95,8 +95,8 @@ H5PartGeneralPluginInfo::GetName() const
//
// Returns: A pointer to the version of the database plugin.
//
// Programmer: ghweber -- generated by xml2info
// Creation: Tue Aug 28 15:08:01 PST 2007
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
......@@ -114,8 +114,8 @@ H5PartGeneralPluginInfo::GetVersion() const
//
// Returns: A pointer to the id of the database plugin.
//
// Programmer: ghweber -- generated by xml2info
// Creation: Tue Aug 28 15:08:01 PST 2007
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
......@@ -132,8 +132,8 @@ H5PartGeneralPluginInfo::GetID() const
//
// Returns: true/false
//
// Programmer: ghweber -- generated by xml2info
// Creation: Tue Aug 28 15:08:01 PST 2007
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
......@@ -150,8 +150,8 @@ H5PartGeneralPluginInfo::EnabledByDefault() const
//
// Returns: true/false
//
// Programmer: ghweber -- generated by xml2info
// Creation: Tue Aug 28 15:08:01 PST 2007
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
......@@ -166,8 +166,8 @@ H5PartGeneralPluginInfo::HasWriter() const
// Purpose:
// Returns the default extensions for a H5Part database.
//
// Programmer: ghweber -- generated by xml2info
// Creation: Tue Aug 28 15:08:01 PST 2007
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
std::vector<std::string>
......
......@@ -56,8 +56,8 @@ class avtDatabaseWriter;
// Portions are separated into pieces relevant to the appropriate
// components of VisIt.
//
// Programmer: ghweber -- generated by xml2info
// Creation: Tue Aug 28 15:08:01 PST 2007
// Programmer: generated by xml2info
// Creation: omitted
//
// Modifications:
//
......@@ -80,6 +80,8 @@ class H5PartCommonPluginInfo : public virtual CommonDatabasePluginInfo, public v
virtual DatabaseType GetDatabaseType();
virtual avtDatabase *SetupDatabase(const char * const *list,
int nList, int nBlock);
virtual DBOptionsAttributes *GetReadOptions() const;
virtual DBOptionsAttributes *GetWriteOptions() const;
};
class H5PartMDServerPluginInfo : public virtual MDServerDatabasePluginInfo, public virtual H5PartCommonPluginInfo
......
......@@ -2,6 +2,9 @@
// avtH5PartFileFormat.C //
// ************************************************************************* //
#define H5_USE_16_API
#include <hdf5.h>
#include <avtH5PartFileFormat.h>
#include <string>
......@@ -12,11 +15,13 @@
#include <vtkUnstructuredGrid.h>
#include <avtDatabaseMetaData.h>
#include <DBOptionsAttributes.h>
#include <Expression.h>
#include <InvalidVariableException.h>
#include <InvalidFilesException.h>
#include <InvalidDBTypeException.h>
#include <BadIndexException.h>
#include <vtkCellType.h>
#include <vtkPolyData.h>
......@@ -32,7 +37,6 @@
#include <DebugStream.h>
#ifdef PARALLEL
#include <avtParallel.h>
#endif
......@@ -49,11 +53,72 @@ using namespace std;
// Kathleen Bonnell, Wed Jul 2 8:49:52 PDT 2008
// Removed unreferenced variables.
//
// Gunther H. Weber, Fri Apr 17 12:42:38 PDT 2009
// Added option allowing to ignore files with FastBit index so that
// they get passed on to the HDF_UC file format.
//
// Gunther H. Weber, Fri Apr 17 14:24:33 PDT 2009
// Fixed handling of FastBit option in case there is a config file without
// the option saved.
//
// ****************************************************************************
avtH5PartFileFormat::avtH5PartFileFormat(const char *filename)
: avtMTMDFileFormat(filename)
avtH5PartFileFormat::avtH5PartFileFormat(const char *filename,
DBOptionsAttributes *atts) : avtMTMDFileFormat(filename)
{
// Depending on options reject file if it has a FastBit index
bool ignoreFilesWithFastBitIndex = true;
if (atts != NULL)
for (int i = 0; i < atts->GetNumberOfOptions(); ++i)
if (atts->GetName(i) == "Ignore files with FastBit index")
ignoreFilesWithFastBitIndex =
atts->GetBool("Ignore files with FastBit index");
if (ignoreFilesWithFastBitIndex)
{
bool hasIndex = false;
hid_t filehandle = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT);
if (filehandle > 0)
{
//
// Get current automatic stack traversal function to re-enable it later and
// disable HDF5's automatic error printing
//
H5E_auto_t h5e_autofunc;
void* h5e_clientdata;
H5Eget_auto(&h5e_autofunc, &h5e_clientdata);
H5Eset_auto(0, 0);
hid_t indexGroup = H5Gopen(filehandle, "__H5PartIndex__");
if (indexGroup > 0)
{
hasIndex = true;
H5Gclose(indexGroup);
}
//
// Re-enable HDF5's automatic diagnostic output
//
H5Eset_auto(h5e_autofunc, h5e_clientdata);
H5Fclose(filehandle);
}
else
{
EXCEPTION1(InvalidDBTypeException, "Cannot be a H5Part file, since "
"it is not even an HDF5 file.");
}
if (hasIndex)
{
EXCEPTION1(InvalidDBTypeException, "May be an H5Part file, but has an "
"FastBit index. Rejecting file so that HDF_UC plugin can take "
"a turn. If you want to open this file with the H5Part plugin "
" disable the file reader option \"Ignore files with FastBit "
" index\".");
}
}
// INITIALIZE DATA MEMBERS
H5PartFile *file;
fname = filename;
......@@ -402,6 +467,10 @@ avtH5PartFileFormat::GetMesh(int timestate, int domain, const char *meshname)
// Programmer: kurts
// Creation: Tue Aug 28 17:35:50 PDT 2007
//
// Modifications:
// Gunther H. Weber, Fri Apr 17 13:55:07 PDT 2009
// Read block origin from file.
//
// ****************************************************************************
vtkDataSet *
......@@ -442,6 +511,15 @@ avtH5PartFileFormat::GetMeshBlock(int timestate, int domain)
if (status != H5PART_SUCCESS)
EXCEPTION1(VisItException, "Could not read field information");
double xOrigin = 0;
double yOrigin = 0;
double zOrigin = 0;
status = H5Block3dGetFieldOrigin(file, fieldName, &xOrigin, &yOrigin, &zOrigin);
if (status != H5PART_SUCCESS)
{
EXCEPTION1(VisItException, "Could not read field origin.");
}
double xSpacing = 0;
double ySpacing = 0;
double zSpacing = 0;
......@@ -462,7 +540,7 @@ avtH5PartFileFormat::GetMeshBlock(int timestate, int domain)
float *xarray = (float *) coords[0]->GetVoidPointer(0);
for (int i=subBlockDims[0]; i <= subBlockDims[1]; i++)
{
xarray[i-subBlockDims[0]] = i * xSpacing;
xarray[i-subBlockDims[0]] = xOrigin + i * xSpacing;
}
// set y coordinates
......@@ -470,7 +548,7 @@ avtH5PartFileFormat::GetMeshBlock(int timestate, int domain)
coords[1]->SetNumberOfTuples(subBlockDims[3] - subBlockDims[2] + 1);
float *yarray = (float *) coords[1]->GetVoidPointer(0);
for (int i=subBlockDims[2]; i <= subBlockDims[3]; i++) {
yarray[i-subBlockDims[2]] = i * ySpacing;
yarray[i-subBlockDims[2]] = yOrigin + i * ySpacing;
}
// set z coordinates
......@@ -478,7 +556,7 @@ avtH5PartFileFormat::GetMeshBlock(int timestate, int domain)
coords[2]->SetNumberOfTuples(subBlockDims[5] - subBlockDims[4] + 1);
float *zarray = (float *) coords[2]->GetVoidPointer(0);
for (int i=subBlockDims[4]; i <= subBlockDims[5]; i++) {
zarray[i-subBlockDims[4]] = i * zSpacing;
zarray[i-subBlockDims[4]] = zOrigin + i * zSpacing;
}
// create vtkRectilinearGrid objects + set dims and coords
......
......@@ -13,6 +13,8 @@
#include <vector>
#include <string>
class DBOptionsAttributes;
// ****************************************************************************
// Class: avtH5PartFileFormat
//
......@@ -26,12 +28,15 @@
// Kurt Stockinger, Tue Aug 28 17:35:50 PDT 2007
// Added support for field data
//
// Gunther H. Weber, Fri Apr 17 13:03:47 PDT 2009
// Added option to reject file if FastBit index is present.
//
// ****************************************************************************
class avtH5PartFileFormat : public avtMTMDFileFormat
{
public:
avtH5PartFileFormat(const char *);
avtH5PartFileFormat(const char *, DBOptionsAttributes *);
virtual ~avtH5PartFileFormat() {;};
//
......
/* XPM */
static const char *Truecolor_xpm[] = {
/* columns rows colors chars-per-pixel */
"32 32 256 2",
" c #7A7E3B",
". c #3B7E7B",
"X c #7A5B5D",
"o c #577E5F",
"O c #757747",
"+ c #756758",
"@ c #637759",
"# c #6F7253",
"$ c #755569",
"% c #75447A",
"& c #6B5573",
"* c #487774",
"= c #537071",
"- c #63676A",
"; c #FA1E19",
": c #DF371B",
"> c #F42A14",
", c #F1340D",
"< c #DC1B3A",
"1 c #F41925",
"2 c #F40836",
"3 c #EC1431",
"4 c #DC2C29",
"5 c #CA2C3B",
"6 c #CF332F",
"7 c #E82723",
"8 c #BA5B1E",
"9 c #9B7E1A",
"0 c #B57906",
"q c #B46718",
"w c #AC7314",
"e c #9F5B39",
"r c #B45529",
"t c #B14D34",
"y c #996733",
"u c #877734",
"i c #96732A",
"p c #A86427",
"a c #DB5704",
"s c #D94415",
"d c #C75516",
"f c #D35010",
"g c #F54601",
"h c #E85700",
"j c #F55700",
"k c #E84606",
"l c #C96805",
"z c #DB6800",
"x c #C97900",
"c c #DB7900",
"v c #E86800",
"b c #F56800",
"n c #E87900",
"m c #F57900",
"M c #C74427",
"N c #BA1E59",
"B c #9F375B",
"V c #B42A54",
"C c #B1344C",
"Z c #9C1B7A",
"A c #B41965",
"S c #B40875",
"D c #AC1471",
"F c #9C2C69",
"G c #8A2C7B",
"H c #8F336F",
"J c #A82763",
"K c #DC0B4B",
"L c #CA1B4C",
"P c #CA0B5C",
"I c #D01051",
"U c #E80544",
"Y c #C42746",
"T c #C40568",
"R c #995544",
"E c #994455",
"W c #875556",
"Q c #935050",
"! c #AB4443",
"~ c #876745",
"^ c #874467",
"/ c #3BBB3F",
"( c #77B806",
") c #77A617",
"_ c #66B817",
"` c #72B112",
"' c #758A35",
"] c #6F9431",
"[ c #48B439",
"{ c #54AF32",
"} c #66A629",
"| c #66A628",
" . c #3BDD1E",
".. c #35E819",
"X. c #32ED16",
"o. c #35D729",
"O. c #26DA36",
"+. c #38C934",
"@. c #14EA37",
"#. c #23E82A",
"$. c #48D716",
"%. c #54D210",
"&. c #66C907",
"*. c #76C801",
"=. c #65D901",
"-. c #76D900",
";. c #60C412",
":. c #4AE905",
">. c #57E900",
",. c #65E900",
"<. c #76E900",
"1. c #48C727",
"2. c #38A657",
"3. c #26B857",
"4. c #35B44C",
"5. c #358A75",
"6. c #2F9471",
"7. c #08B478",
"8. c #14AF72",
"9. c #26A669",
"0. c #26A669",
"q. c #4E8B5B",
"w. c #529250",
"e. c #638A47",
"r. c #48A349",
"t. c #458B64",
"y. c #08D756",
"u. c #14D250",
"i. c #26C946",
"p. c #26C946",
"a. c #08E845",
"s. c #08C767",
"d. c #9C8C0B",
"f. c #929310",
"g. c #B58B00",
"h. c #B59700",
"j. c #A88F02",
"k. c #8AA605",
"l. c #9BA400",
"z. c #89B600",
"x. c #9BB600",
"c. c #84A010",
"v. c #A8A400",
"b. c #B5A400",
"n. c #A8B600",
"m. c #B5B600",
"M. c #878A23",
"N. c #C98B00",
"B. c #DB8B00",
"V. c #C99700",
"C. c #DB9700",
"Z. c #E88B00",
"A. c #F58B00",
"S. c #F59700",
"D. c #E89700",
"F. c #C9A400",
"G. c #DBA400",
"H. c #C9B600",
"J. c #DBB600",
"K. c #E8A400",
"L. c #F5A400",
"P. c #E8B600",
"I. c #F5B600",
"U. c #89C800",
"Y. c #9BC800",
"T. c #89D900",
"R. c #9BD900",
"E. c #A8C800",
"W. c #B5C800",
"Q. c #A8D900",
"!. c #B5D900",
"~. c #89E900",
"^. c #9BE900",
"/. c #A8E900",
"(. c #B5E900",
"). c #C9C800",
"_. c #DBC800",
"`. c #C9D900",
"'. c #DBD900",
"]. c #E8C800",
"[. c #F5C800",
"{. c #E8D900",
"}. c #F5D900",
"|. c #C9E900",
" X c #DBE900",
".X c #E8E900",
"XX c #F5E900",
"oX c #7A1E99",
"OX c #752A93",
"+X c #6F348E",
"@X c #571EBD",
"#X c #7519A4",
"$X c #7508B5",
"%X c #6319B6",
"&X c #6F13B0",
"*X c #4B2CBB",
"=X c #5232AE",
"-X c #632AA5",
";X c #3B5B9D",
":X c #177E9F",
">X c #357787",
",X c #356798",
"<X c #237799",
"1X c #2F7292",
"2X c #3555A9",
"3X c #3544B9",
"4X c #2B55B3",
"5X c #0877B4",
"6X c #1370B0",
"7X c #2367AA",
"8X c #485596",
"9X c #54508F",
"0X c #664786",
"qX c #604A89",
"wX c #486785",
"eX c #4844A6",
"rX c #3B1ED9",
"tX c #352AD3",
"yX c #2F34CF",
"uX c #0A0AFF",
"iX c #170AFF",
"pX c #0A1AFF",
"aX c #171AFD",
"sX c #3519E4",
"dX c #2509FE",
"fX c #3508F5",
"gX c #2319F6",
"hX c #3216EA",
"jX c #092BFB",
"kX c #1232EE",
"lX c #232AE5",