Commit a24432eb authored by hrchilds's avatar hrchilds

Merge 1.12.1RC to the trunk, picking up VizSchema plugin reader and also

changes to the build notes.


git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@8834 18c085ea-50e0-402c-830e-de6fd14e8384
parent 84b5cbba
......@@ -16,7 +16,6 @@ shell prompt.
Mesa 5.0 3-D Graphics Library http://www.mesa3d.org/
Python 2.5 Scripting Language http://www.python.org
Qt 4.4.3 GUI Toolkit http://www.trolltech.com
Silo 4.5.1 File I/O library http://silo.llnl.gov
VTK 5.0.0c Visualization Toolkit http://www.kitware.com
......@@ -36,6 +35,7 @@ build and install those libraries prior to building VisIt.
Library Version Description For More Information
======= ======= =========== ====================
Silo 4.7 File I/O library http://silo.llnl.gov
Boxlib ??? An AMR I/O library ???
ExodusII 4.46 File I/O library http://www.sourceforge.net/projects/exodusII
H5Part 1.3.3 Fili I/O library https://codeforge.lbl.gov/projects/h5part/
......@@ -501,8 +501,8 @@ Silo, read the BUILD_NOTES file in the Silo distribution for more information.
#
# Build Silo
#
sh silo060605.sh
cd silo060605
gunzip < silo-4.7.tar.gz | tar xvf -
cd silo-4.7
#
#
......@@ -521,21 +521,21 @@ cd silo060605
# which is described later in this document. The hdf5 library you use must
# be a serial version. VisIt will not work with a parallel version.
#
# env CFLAGS=-O2 ./configure --without-readline -with-hdf5=$VISITDIR/hdf5/1.6.5/$VISITARCH/include,$VISITDIR/hdf5/1.6.5/$VISITARCH/lib --without-exodus
# env CFLAGS=-O2 ./configure --without-readline -with-hdf5=$VISITDIR/hdf5/1.6.5/$VISITARCH/include,$VISITDIR/hdf5/1.6.5/$VISITARCH/lib
#
env CFLAGS=-O2 ./configure --without-readline --without-hdf5 --without-exodus
env CFLAGS=-O2 ./configure --without-readline --without-hdf5
make
#
# Install it in the visit directory under the silo directory.
#
mkdir $VISITDIR/silo
mkdir $VISITDIR/silo/4.5.1
mkdir $VISITDIR/silo/4.5.1/$VISITARCH
mkdir $VISITDIR/silo/4.5.1/$VISITARCH/{include,lib}
cp silo/silo/silo.{h,inc} $VISITDIR/silo/4.5.1/$VISITARCH/include
cp silo/sdx/sdx.{h,inc} $VISITDIR/silo/4.5.1/$VISITARCH/include
cp lib/libsilo.a $VISITDIR/silo/4.5.1/$VISITARCH/lib
mkdir $VISITDIR/silo/4.7
mkdir $VISITDIR/silo/4.7/$VISITARCH
mkdir $VISITDIR/silo/4.7/$VISITARCH/{include,lib}
cp silo/silo/silo.{h,inc} $VISITDIR/silo/4.7/$VISITARCH/include
cp lib/libsilo.a $VISITDIR/silo/4.7/$VISITARCH/lib
cp lib/libsiloh5.a $VISITDIR/silo/4.7/$VISITARCH/lib
cd ..
......
......@@ -83,11 +83,11 @@ Build Notes (if you still want to do it by hand)
http://www.llnl.gov/visit/3rd_party/vtk-5.0.0c.tar.gz
cmake 2.4.5 Make file generation http://www.cmake.org
http://www.llnl.gov/visit/3rd_party/cmake-2.4.5.tar.gz
Silo 4.5.1 File I/O library
http://www.llnl.gov/visit/3rd_party/silo060605.sh
Optional Version Description For More Information
======== ======= =========== ====================
Silo 4.7 File I/O library
https://wci.llnl.gov/codes/silo/silo-4.7/silo-4.7.tar.gz
Boxlib 2.5 An AMR I/O library
http://www.llnl.gov/visit/3rd_party/boxlib.tar.rz
CFITSIO 3006 File I/O library
......@@ -1231,8 +1231,8 @@ for HDF5. I needed to do a machine merge in order to get a universal binary,
because the endianness and word size is determined in configure.
# Build silo source into an archive library
sh silo060605.sh
cd silo060605
gunzip < silo-4.7.tar.gz | tar xvf -
cd silo-4.7
#
# Need to fake-out dependency tracking.
......@@ -1253,8 +1253,8 @@ chmod +x configure
./configure --prefix=$VISITPATH/silo CFLAGS="-O2 -fno-common" \
CXXFLAGS="-O2 -fno-common" \
LDFLAGS="-Wl,-headerpad_max_install_names,-undefined,dynamic_lookup" \
--disable-sdx --disable-browser --without-readline \
--without-exodus --without-python --with-hdf5=$HDF5INCLUDE,$HDF5LIB
--disable-browser --without-readline \
--without-python --with-hdf5=$HDF5INCLUDE,$HDF5LIB
# Compile the needed subroutines. Force make to ignore errors from
# archive creation, it should get us to where we want to be.
......@@ -1263,7 +1263,7 @@ make -i
gcc -dynamiclib -o libsilo.dylib silo/*/*.o \
-Wl,-headerpad_max_install_names,\
-install_name,@executable_path/../lib/libsilo.dylib,\
-compatibility_version,4.5,-current_version,4.5.1 \
-compatibility_version,4.7,-current_version,4.7 \
-L$HDF5LIB -lhdf5 -lsz -lz
# Install headers. Ignore archive creation errors.
......
......@@ -373,6 +373,10 @@
# Brad Whitlock, Mon Sep 14 15:45:59 PDT 2009
# I added the Adventure reader.
#
# Hank Childs, Wed Nov 4 11:19:20 PST 2009
# Added Vs (VizSchema) plugin on behalf of Marc Durant and Sveta
# Shesharina of Tech-X.
#
##############################################################################
@SET_MAKE@
......@@ -400,6 +404,7 @@ HDF5_TARGET= \
SAMRAI \
Tetrad \
UNIC \
Vs \
XDMF
MILI=Mili
......
VizSchema Database Reader Plugin for VisIt
VizSchema is a specification for markup added to hdf5 files
to describe the data contained within. Properly marked-up
files can be opened using this database reader, and thus
displayed in VisIt. VizSchema also allows users to specify
run information and other miscellaneous data in a standardized
manner. VizSchema is designed to be versatile and can be
added to data files after the fact.
VizSchema requires VisIt to be compiled with support for HDF5
For details about VizSchema, and contact information for developers,
please visit the development website at:
https://ice.txcorp.com/trac/vizschema/wiki
Tech-X Corporation
5621 Arapaho Ave, Suite A
Boulder, CO
USA
\ No newline at end of file
<?xml version="@VERSION@"?>
<Plugin name="Vs" type="database" label="Vs Files" version="@VERSION@" enabled="true" mdspecificcode="false" engspecificcode="false" onlyengine="false" noengine="false" dbtype="STMD" haswriter="false" hasoptions="false">
<Files components="M">
avtVsFileFormat.C
VsFilter.C
VsH5Reader.C
VsSchema.C
VsUtils.C
</Files>
<Files components="E">
avtVsFileFormat.C
VsFilter.C
VsH5Reader.C
VsSchema.C
VsUtils.C
</Files>
<CXXFLAGS>
$(HDF5_INCLUDE)
</CXXFLAGS>
<LIBS>
$(HDF5_LIB) $(SZIP_LIB)
</LIBS>
<Extensions>
vsh5
h5
</Extensions>
<Attribute name="" purpose="" persistent="true" keyframe="true" exportAPI="" exportInclude="">
</Attribute>
</Plugin>
/*****************************************************************************
*
* Copyright (c) 2000 - 2008, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-400142
* All rights reserved.
*
* This file is part of VisIt. For details, see https://visit.llnl.gov/. The
* full copyright notice is contained in the file COPYRIGHT located at the root
* of the VisIt distribution or at http://www.llnl.gov/visit/copyright.html.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the disclaimer (as noted below) in the
* documentation and/or other materials provided with the distribution.
* - Neither the name of the LLNS/LLNL nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY,
* LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
*****************************************************************************/
#include <VsPluginInfo.h>
#include <avtVsFileFormat.h>
#include <avtSTMDFileFormatInterface.h>
#include <avtGenericDatabase.h>
#include <DBOptionsAttributes.h>
#include <DebugStream.h>
// definition of VISIT_VERSION
#include <visit-config.h>
#include <visit-hdf5.h>
#include <hdf5.h>
//by default we load 100% of data
const int VsCommonPluginInfo::defaultStride = 1;
std::string VsCommonPluginInfo::strideSettingAxis1_Name ="Stride for loading data - Axis 1:";
std::string VsCommonPluginInfo::strideSettingAxis2_Name ="Stride for loading data - Axis 2:";
std::string VsCommonPluginInfo::strideSettingAxis3_Name ="Stride for loading data - Axis 3:";
// ****************************************************************************
// Method: VsCommonPluginInfo::VsCommonPluginInfo
//
// Purpose:
// Constructs a VsCommonPluginInfo with default values
//
// Programmer: Marc Durant
// Creation: omitted
//
// ****************************************************************************
VsCommonPluginInfo::VsCommonPluginInfo() {
settings.resize(3);
settings[0] = defaultStride;
settings[1] = defaultStride;
settings[2] = defaultStride;
}
// ****************************************************************************
// Method: VsCommonPluginInfo::GetDatabaseType
//
// Purpose:
// Returns the type of a Vs database.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
DatabaseType
VsCommonPluginInfo::GetDatabaseType()
{
return DB_TYPE_STSD;
}
// ****************************************************************************
// Method: VsCommonPluginInfo::SetupDatabase
//
// Purpose:
// Sets up a Vs database.
//
// Arguments:
// list A list of file names.
// nList The number of timesteps in list.
// nBlocks The number of blocks in the list.
//
// Returns: A Vs database from list.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
avtDatabase *
VsCommonPluginInfo::SetupDatabase(const char *const *list,
int nList, int nBlock)
{
#if HDF5_VERSION_GE(1,8,1)
avtSTMDFileFormat **ffl = new avtSTMDFileFormat*[nList];
for (int i = 0 ; i < nList ; i++)
{
ffl[i] = new avtVsFileFormat(list[i], settings);
}
avtSTMDFileFormatInterface *inter
= new avtSTMDFileFormatInterface(ffl, nList);
return new avtGenericDatabase(inter);
#else
#ifdef VISIT_VERSION //Visit 2.0.0 and later use VISIT_VERSION instead of VERSION, and require a different debugstream accessor as well
DebugStream::Stream3() <<"VsCommonPluginInfo::SetupDatabase() - Vizschema database plugin requires hdf5 1.8.1 or later." <<std::endl;
DebugStream::Stream3() <<"VsCommonPluginInfo::SetupDatabase() - Plugin is disabled and will not open files." <<std::endl;
#else
debug3 <<"VsCommonPluginInfo::SetupDatabase() - Vizschema database plugin requires hdf5 1.8.1 or later." <<std::endl;
debug3 <<"VsCommonPluginInfo::SetupDatabase() - Plugin is disabled and will not open files." <<std::endl;
#endif
return NULL;
#endif
}
// ****************************************************************************
// Method: VsCommonPluginInfo::GetReadOptions
//
// Purpose:
// Returns a list of available plugin settings and their defaults
//
// Arguments:
//
// Returns: A DBOptionsAttributes object populated with setting names & defaults
//
// Programmer: Marc Durant
// Creation: omitted
//
// ****************************************************************************
DBOptionsAttributes *
VsCommonPluginInfo::GetReadOptions() const
{
/* This code is from the SILO plugin and is here as reference
DBOptionsAttributes *rv = new DBOptionsAttributes;
vector<string> ignoreOpts;
ignoreOpts.push_back("Always"); // 0
ignoreOpts.push_back("Auto"); // 1
ignoreOpts.push_back("Never"); // 2
ignoreOpts.push_back("Undef"); // 3
rv->SetEnum(SILO_RDOPT_IGNORE_SEXTS, 3); // Undef
rv->SetEnumStrings(SILO_RDOPT_IGNORE_SEXTS, ignoreOpts);
rv->SetEnum(SILO_RDOPT_IGNORE_DEXTS, 3); // Undef
rv->SetEnumStrings(SILO_RDOPT_IGNORE_DEXTS, ignoreOpts);
rv->SetBool(SILO_RDOPT_FORCE_SINGLE, true);
rv->SetBool(SILO_RDOPT_SEARCH_ANNOTINT, false);
// Specify obsolete options and their default values
rv->SetObsolete(SILO_RDOPT_IGNORE_SEXTS2);
rv->SetObsolete(SILO_RDOPT_IGNORE_DEXTS2);
return rv;*/
DBOptionsAttributes *rv = new DBOptionsAttributes;
rv->SetInt(VsCommonPluginInfo::strideSettingAxis1_Name.c_str(), defaultStride);
rv->SetInt(VsCommonPluginInfo::strideSettingAxis2_Name.c_str(), defaultStride);
rv->SetInt(VsCommonPluginInfo::strideSettingAxis3_Name.c_str(), defaultStride);
return rv;
}
// ****************************************************************************
// Method: VsCommonPluginInfo::SetReadOptions
//
// Purpose:
// Accepts a list of settings and values, stores those values for the plugin
//
// Arguments:
// opts A DBOptionsAttributes object containing settings
//
// Returns:
//
// Programmer: Marc Durant
// Creation: omitted
//
// ****************************************************************************
void VsCommonPluginInfo::SetReadOptions(DBOptionsAttributes *opts) {
for (int i = 0; i < opts->GetNumberOfOptions(); i++)
{
string optname = opts->GetName(i);
if (optname == VsCommonPluginInfo::strideSettingAxis1_Name.c_str()) {
settings[0] = opts->GetInt(VsCommonPluginInfo::strideSettingAxis1_Name.c_str());
if (settings[0] < 0)
settings[0] = defaultStride;
}
if (optname == VsCommonPluginInfo::strideSettingAxis2_Name.c_str()) {
settings[1] = opts->GetInt(VsCommonPluginInfo::strideSettingAxis2_Name.c_str());
if (settings[1] < 0)
settings[1] = defaultStride;
}
if (optname == VsCommonPluginInfo::strideSettingAxis3_Name.c_str()) {
settings[2] = opts->GetInt(VsCommonPluginInfo::strideSettingAxis3_Name.c_str());
if (settings[2] < 0)
settings[2] = defaultStride;
}
}
}
/*****************************************************************************
*
* Copyright (c) 2000 - 2008, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-400142
* All rights reserved.
*
* This file is part of VisIt. For details, see https://visit.llnl.gov/. The
* full copyright notice is contained in the file COPYRIGHT located at the root
* of the VisIt distribution or at http://www.llnl.gov/visit/copyright.html.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the disclaimer (as noted below) in the
* documentation and/or other materials provided with the distribution.
* - Neither the name of the LLNS/LLNL nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY,
* LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
*****************************************************************************/
#include <VsPluginInfo.h>
#if defined(__APPLE__)
#define GetEngineInfo Vs_GetEngineInfo
#endif
// ****************************************************************************
// Function: GetEngineInfo
//
// Purpose:
// Return a new EnginePluginInfo for the Vs database.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
extern "C" EngineDatabasePluginInfo* GetEngineInfo()
{
return new VsEnginePluginInfo;
}
// ****************************************************************************
// Method: VsEnginePluginInfo::GetWriter
//
// Purpose:
// Sets up a Vs writer.
//
// Returns: A Vs writer.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
avtDatabaseWriter *
VsEnginePluginInfo::GetWriter(void)
{
return NULL;
}
#include <hdf5.h>
#include <visit-hdf5.h>
#if HDF5_VERSION_GE(1,8,1)
/**
*
* @file VsFilter.cpp
*
* @brief Implementation for inspecting an HDF5 file
*
* @version $Id: VsFilter.C 496 2009-08-05 22:57:22Z mdurant $
*
* Copyright &copy; 2007-2008, Tech-X Corporation
* See LICENSE file for conditions of use.
*
*/
// vsh5
#include <VsFilter.h>
#include <VsSchema.h>
#include <VsUtils.h>
#include <hdf5.h>
struct RECURSION_DATA {
VsH5Meta* meta;
std::ostream* debugStream;
int depth;
std::string path;
};
VsFilter::VsFilter(std::ostream& dbgstrm) : debugStrmRef(dbgstrm) {
}
VsFilter::VsFilter(hid_t fId, std::ostream& dbgstrm) :
debugStrmRef(dbgstrm), fileId(fId) {
makeH5Meta();
}
void VsFilter::makeH5Meta() {
h5meta.ptr = 0;
// Create the list of vs datasets and groups
// corresponding to variables, variables with mesh and meshes.
RECURSION_DATA data;
data.debugStream = &debugStrmRef;
data.meta = &h5meta;
data.depth = 0;
data.path = "";
H5Giterate(fileId, "/", NULL, visitIfc, &data);
}
herr_t VsFilter::visitIfc(hid_t locId, const char* name, void* opdata) {
RECURSION_DATA* data = static_cast< RECURSION_DATA* >(opdata);
VsH5Meta* metaPtr = data->meta;
std::ostream& osRef = *(data->debugStream);
//cerr <<"working with interface " << endl;
herr_t ret = 0;
H5G_stat_t statbuf;
H5Gget_objinfo (locId, name, false, &statbuf);
//the fully qualified name of this object
std::string fullName = makeCanonicalName(data->path, name);//data->path + "/" + name;
switch (statbuf.type) {
case H5G_GROUP: {
osRef << "VsFilter::visitIfc: node '" << name << "' is a group." << std::endl;
hid_t groupId = H5Gopen(locId, name, H5P_DEFAULT);
// Metadata for this group
VsGMeta* gm = new VsGMeta();
gm->name = name;
gm->depth = data->depth + 1;
gm->path = data->path;
gm->iid = groupId;
// Collect attributes of the group
std::pair<VsIMeta*, std::ostream*> gpd(gm, &osRef);
H5Aiterate(groupId, H5_INDEX_NAME, H5_ITER_INC, NULL, visitAttrib, &gpd);
// Check is gm's isMesh is true and add to meshes
// Check if the group is a mesh and register. Move the ptr to the mesh
if (gm->isMesh) {
osRef << "VsFilter::visitIfc: node '" << name << "' is a mesh."
<< std::endl;
std::pair<std::string, VsGMeta*> el(fullName, gm);
metaPtr->gMeshes2.insert(el);
metaPtr->ptr = gm;
}
else if (gm->isVsVars) {
osRef << "VsFilter::visitIfc: node '" << name << "' is vsVars." <<
std::endl;
std::pair<std::string, VsGMeta*> el(fullName, gm);
metaPtr->vsVars2.insert(el);
metaPtr->ptr = gm;
}
else {
// If group is not a mesh - delete it - needs to be changed to work with groups
// which are variables
osRef << "VsFilter::visitIfc: node '" << name << "' is not a mesh."
<< " Deleting." << std::endl;
delete gm;
}
// recurse to examine child groups
RECURSION_DATA nextLevelData;
nextLevelData.debugStream = data->debugStream;
nextLevelData.depth = data->depth + 1;
nextLevelData.path = fullName;
nextLevelData.meta = data->meta;
osRef <<"VsFilter::visitIfc(...): Recursing with path " <<fullName <<" and depth " <<nextLevelData.depth <<"." <<std::endl;
H5Giterate(locId, name, NULL, visitIfc, &nextLevelData);
osRef <<"VsFilter::visitIfc(...): Returned from recursion" <<std::endl;
break;
}
case H5G_DATASET: {
osRef << "VsFilter::visitIfc: node '" << name <<
"' is a dataset." << std::endl;
hid_t datasetId = H5Dopen(locId, name, H5P_DEFAULT);
osRef << "VsFilter::visitIfc: node '" << name <<
"' opened." << std::endl;
// Metadata for this dataset
VsDMeta* vm = new VsDMeta();
std::string sname = name;
vm->name = sname;
vm->path = data->path;
vm->depth = data->depth + 1;
vm->type = H5Tget_native_type(H5Dget_type(datasetId), H5T_DIR_DEFAULT);
vm->iid = datasetId;
getDims(vm->iid, true, vm->dims);
// Collect attributes of this dataset
std::pair<VsIMeta*, std::ostream*> gpd(vm, &osRef);
H5Aiterate(datasetId, H5_INDEX_NAME, H5_ITER_INC, NULL, visitAttrib,
&gpd);
//all datasets get registered in a general list
std::pair<std::string, VsDMeta*> el(fullName, vm);
metaPtr->datasets.insert(el);
// Test isVariable etc and add register
if (vm->isVariable) {
std::pair<std::string, VsDMeta*> el2(fullName, vm);
metaPtr->vars2.insert(el2);
osRef <<"VsFilter::visitIfc: node '" <<name <<
"' is a Variable." <<std::endl;
}
if (vm->isVariableWithMesh) {
std::pair<std::string, VsDMeta*> el2(fullName, vm);
metaPtr->varsWithMesh2.insert(el2);
osRef <<"VsFilter::visitIfc: node '" <<name <<
"' is a variable with mesh." <<std::endl;
}
if (vm->isMesh) {
std::pair<std::string, VsDMeta*> el2(fullName, vm);
metaPtr->dMeshes2.insert(el2);
osRef <<"VsFilter::visitIfc: node '" <<name <<
"' is a dataset mesh." <<std::endl;
}
// If this dataset is not a var, mesh or varWith mesh, and its parent is a
// mesh group, attach to this mesh and do not change the ptr. Otherwise delete it.
if (metaPtr->ptr) {
if ((!vm->isVariable) && (!vm->isVariableWithMesh)&&(!vm->isMesh) &&
(static_cast<VsGMeta*>(metaPtr->ptr)->isMesh)) {
(static_cast<VsGMeta*>(metaPtr->ptr))->datasets.push_back(vm);
}
if ((!vm->isVariable) && (!vm->isVariableWithMesh)&&(!vm->isMesh) &&
(!static_cast<VsGMeta*>(metaPtr->ptr)->isMesh) &&
(metaPtr->ptr)) {
delete vm;
}
}
}
default:
break;
}
return ret;
}
herr_t VsFilter::visitAttrib(hid_t dId, const char* name,
const H5A_info_t* ai, void* opdata) {
std::pair<VsIMeta*, std::ostream*>* gpdPtr =
static_cast<std::pair<VsIMeta*, std::ostream*>*>(opdata);
// VsIMeta* iMetaPtr = static_cast<VsIMeta*>(opdata);
VsIMeta* iMetaPtr = gpdPtr->first;
std::ostream& osRef = *gpdPtr->second;
osRef << "VsFilter::visitAttrib(...): getting attribute '" <<
name << "'." << std::endl;
hid_t attId = H5Aopen_name(dId, name);
// Metadata for this attribute
VsAMeta* am = new VsAMeta();
am->type = H5Tget_native_type(H5Aget_type(attId), H5T_DIR_DEFAULT);
am->aid = attId;
am->name = name;
// 0 shows that it is attribute
getDims(am->aid, false, am->dims);
// add attrib metadata
am->depth = iMetaPtr->depth+1;
iMetaPtr->attribs.push_back(am);
// check for type attribute
std::string aname = name;
if (aname.compare(VsSchema::typeAtt) == 0) {
std::string attValue;
herr_t err = getAttributeHelper(attId, &attValue, 0, 0);
if (err == 0) {
osRef << "VsFilter::visitAttrib(...): attribute '" << name <<
"' is '" << attValue << "'." << std::endl;
// See if this dataset or group is a mesh
if (attValue.compare(VsSchema::meshKey) == 0) {
iMetaPtr->isMesh = true;
}
// See if this group is derived vars
if ( (iMetaPtr->isGroup) && (attValue.compare(VsSchema::vsVarsKey) == 0)) {
(static_cast<VsGMeta*>(iMetaPtr))->isVsVars = true;
}
if (!iMetaPtr->isGroup) {
// See if this dataset is a variable or variableWithMesh
if(attValue.compare(VsSchema::varKey) == 0) {
iMetaPtr->isVariable = true;
}
if(attValue.compare(VsSchema::varWithMeshKey) == 0) {
iMetaPtr->isVariableWithMesh = true;
}
}
}
else {
osRef << "VsFilter::visitAttrib(...): error getting attribute '" <<
name << "'. Is this of type H5T_STR_NULLTERM and a SCALAR?" << std::endl;
}
}
else {
osRef << "VsFilter::visitAttrib(...): attribute '" << name <<
"' is not '" << VsSchema::typeAtt << "'." << std::endl;
}
return 0;
}
void VsFilter::write() const {
h5meta.write(debugStrmRef);
}
void VsFilter::setFile(hid_t fId) {
fileId = fId;
h5meta.clear();
makeH5Meta();
}
#endif
#include <hdf5.h>
#include <visit-hdf5.h>
#if HDF5_VERSION_GE(1,8,1)
/**