Commit 112077a5 authored by hrchilds's avatar hrchilds
Browse files

Update from January 22, 2006

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@603 18c085ea-50e0-402c-830e-de6fd14e8384
parent 3962f75d
......@@ -1356,6 +1356,9 @@ PluginManager::ReadPluginDir(vector<pair<string,string> > &files)
// Told PluginSymbol not to complain if it could not find
// the g++ initialization code.
//
// Hank Childs, Thu Jan 19 17:05:49 PST 2006
// Print out plugin errors to the screen. ['6629]
//
// ****************************************************************************
void
......@@ -1365,8 +1368,10 @@ PluginManager::PluginOpen(const string &pluginFile)
HINSTANCE lib = LoadLibrary(pluginFile.c_str());
if(!lib)
{
const char *pluginError = PluginError();
cerr << "Error opening plugin file: " << pluginError << endl;
EXCEPTION3(InvalidPluginException, "Error opening plugin file",
pluginFile.c_str(), PluginError());
pluginFile.c_str(), pluginError);
}
handle = (void *)lib;
......@@ -1375,8 +1380,10 @@ PluginManager::PluginOpen(const string &pluginFile)
handle = dlopen(pluginFile.c_str(), RTLD_LAZY);
if (!handle)
{
const char *pluginError = PluginError();
cerr << "Error opening plugin file: " << pluginError << endl;
EXCEPTION3(InvalidPluginException, "Error opening plugin file",
pluginFile.c_str(), PluginError());
pluginFile.c_str(), pluginError);
}
// Try to initialize static constructors. This is a g++ism.
......
......@@ -7206,6 +7206,9 @@ avtGenericDatabase::CommunicateGhostNodesFromGlobalNodeIds(
// Hank Childs, Sat Mar 5 19:26:05 PST 2005
// Added argument canDoCollectiveCommunication.
//
// Hank Childs, Fri Jan 20 17:11:59 PST 2006
// Added error message.
//
// ****************************************************************************
bool
......@@ -7241,7 +7244,13 @@ avtGenericDatabase::ApplyGhostForDomainNesting(avtDatasetCollection &ds,
bool rightMesh = dn->ConfirmMesh(doms, list);
if (!rightMesh)
{
debug1 << "UNUSUAL: the domain nesting object could not be used."
<< " This is expected behavior if there are multiple "
<< "meshes, but is indicative of an error if there is only"
<< " one mesh." << endl;
shouldStop = 1;
}
}
else
shouldStop = 1;
......
......@@ -501,6 +501,9 @@ avtStructuredDomainNesting::ApplyGhost(vector<int> domainList,
// Mark C. Miller, Wed Feb 16 14:32:55 PST 2005
// Account for possibility that some meshes may not exist
//
// Hank Childs, Fri Jan 20 17:11:59 PST 2006
// Add warning messages for failure.
//
// ****************************************************************************
bool
......@@ -536,11 +539,32 @@ avtStructuredDomainNesting::ConfirmMesh(vector<int> &domains,
vector<int> &extents = domainNesting[domains[i]].logicalExtents;
if ((extents[3]-extents[0]+2) != dims[0])
{
debug1 << "Warning: avtStructuredDomainNesting failing "
<< " because declared extents in I "
<< extents[3]-extents[0]+2
<< " are bigger than data set size " << dims[0]
<< "." << endl;
return false;
}
if ((extents[4]-extents[1]+2) != dims[1])
{
debug1 << "Warning: avtStructuredDomainNesting failing "
<< " because declared extents in J "
<< extents[4]-extents[1]+2
<< " are bigger than data set size " << dims[1]
<< "." << endl;
return false;
}
if (dims[2] > 1 && (extents[5]-extents[2]+2) != dims[2])
{
debug1 << "Warning: avtStructuredDomainNesting failing "
<< " because declared extents in K "
<< extents[5]-extents[2]+2
<< " are bigger than data set size " << dims[2]
<< "." << endl;
return false;
}
}
return true;
......
<?xml version="1.0"?>
<Plugin name="Chombo" type="database" label="Chombo" version="1.0" enabled="true" mdspecificcode="false" onlyengine="false" noengine="false" dbtype="STMD" haswriter="false" hasoptions="false">
<CXXFLAGS> $(HDF5_INCLUDE) </CXXFLAGS>
<LIBS> $(HDF5_LIB) </LIBS>
<Extensions> hdf5 h5 </Extensions>
</Plugin>
#include <ChomboPluginInfo.h>
#include <avtChomboFileFormat.h>
#include <avtSTMDFileFormatInterface.h>
#include <avtGenericDatabase.h>
// ****************************************************************************
// Method: ChomboCommonPluginInfo::GetDatabaseType
//
// Purpose:
// Returns the type of a Chombo database.
//
// Programmer: childs -- generated by xml2info
// Creation: Thu Jan 19 11:17:13 PDT 2006
//
// ****************************************************************************
DatabaseType
ChomboCommonPluginInfo::GetDatabaseType()
{
return DB_TYPE_STMD;
}
// ****************************************************************************
// Method: ChomboCommonPluginInfo::GetDefaultExtensions
//
// Purpose:
// Returns the default extensions for a Chombo database.
//
// Programmer: childs -- generated by xml2info
// Creation: Thu Jan 19 11:17:13 PDT 2006
//
// ****************************************************************************
std::vector<std::string>
ChomboCommonPluginInfo::GetDefaultExtensions()
{
std::vector<std::string> defaultExtensions;
defaultExtensions.push_back("hdf5");
defaultExtensions.push_back("h5");
return defaultExtensions;
}
// ****************************************************************************
// Method: ChomboCommonPluginInfo::SetupChomboDatabase
//
// Purpose:
// Sets up a Chombo 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 Chombo database from list.
//
// Programmer: childs -- generated by xml2info
// Creation: Thu Jan 19 11:17:13 PDT 2006
//
// ****************************************************************************
avtDatabase *
ChomboCommonPluginInfo::SetupDatabase(const char *const *list,
int nList, int nBlock)
{
avtSTMDFileFormat **ffl = new avtSTMDFileFormat*[nList];
for (int i = 0 ; i < nList ; i++)
{
ffl[i] = new avtChomboFileFormat(list[i]);
}
avtSTMDFileFormatInterface *inter
= new avtSTMDFileFormatInterface(ffl, nList);
return new avtGenericDatabase(inter);
}
#include <ChomboPluginInfo.h>
#if defined(__APPLE__)
#define GetEngineInfo Chombo_GetEngineInfo
#endif
// ****************************************************************************
// Function: GetEngineInfo
//
// Purpose:
// Return a new EnginePluginInfo for the Chombo database.
//
// Programmer: childs -- generated by xml2info
// Creation: Thu Jan 19 11:17:13 PDT 2006
//
// ****************************************************************************
extern "C" EngineDatabasePluginInfo* GetEngineInfo()
{
return new ChomboEnginePluginInfo;
}
// ****************************************************************************
// Method: ChomboCommonPluginInfo::GetWriter
//
// Purpose:
// Sets up a Chombo writer.
//
// Returns: A Chombo writer.
//
// Programmer: childs -- generated by xml2info
// Creation: Thu Jan 19 11:17:13 PDT 2006
//
// ****************************************************************************
avtDatabaseWriter *
ChomboEnginePluginInfo::GetWriter(void)
{
return NULL;
}
#include <ChomboPluginInfo.h>
#if defined(__APPLE__)
#define GetMDServerInfo Chombo_GetMDServerInfo
#endif
// ****************************************************************************
// Function: GetMDServerInfo
//
// Purpose:
// Return a new MDServerPluginInfo for the Chombo database.
//
// Programmer: childs -- generated by xml2info
// Creation: Thu Jan 19 11:17:13 PDT 2006
//
// ****************************************************************************
extern "C" MDServerDatabasePluginInfo* GetMDServerInfo()
{
return new ChomboMDServerPluginInfo;
}
// this makes compilers happy... remove if we ever have functions here
void ChomboMDServerPluginInfo::dummy()
{
}
// ************************************************************************* //
// File: ChomboPluginInfo.C
// ************************************************************************* //
#include <ChomboPluginInfo.h>
#include <visit-config.h>
#if defined(__APPLE__)
extern "C" const char *ChomboVisItPluginVersion = VERSION;
#else
extern "C" const char *VisItPluginVersion = VERSION;
#endif
#if defined(__APPLE__)
#define GetGeneralInfo Chombo_GetGeneralInfo
#endif
// ****************************************************************************
// Function: GetGeneralInfo
//
// Purpose:
// Return a new GeneralPluginInfo for the Chombo database.
//
// Programmer: childs -- generated by xml2info
// Creation: Thu Jan 19 11:17:13 PDT 2006
//
// ****************************************************************************
extern "C" GeneralDatabasePluginInfo* GetGeneralInfo()
{
return new ChomboGeneralPluginInfo;
}
// ****************************************************************************
// Method: ChomboGeneralPluginInfo::GetName
//
// Purpose:
// Return the name of the database plugin.
//
// Returns: A pointer to the name of the database plugin.
//
// Programmer: childs -- generated by xml2info
// Creation: Thu Jan 19 11:17:13 PDT 2006
//
// ****************************************************************************
char *
ChomboGeneralPluginInfo::GetName() const
{
return "Chombo";
}
// ****************************************************************************
// Method: ChomboGeneralPluginInfo::GetVersion
//
// Purpose:
// Return the version of the database plugin.
//
// Returns: A pointer to the version of the database plugin.
//
// Programmer: childs -- generated by xml2info
// Creation: Thu Jan 19 11:17:13 PDT 2006
//
// ****************************************************************************
char *
ChomboGeneralPluginInfo::GetVersion() const
{
return "1.0";
}
// ****************************************************************************
// Method: ChomboGeneralPluginInfo::GetID
//
// Purpose:
// Return the id of the database plugin.
//
// Returns: A pointer to the id of the database plugin.
//
// Programmer: childs -- generated by xml2info
// Creation: Thu Jan 19 11:17:13 PDT 2006
//
// ****************************************************************************
char *
ChomboGeneralPluginInfo::GetID() const
{
return "Chombo_1.0";
}
// ****************************************************************************
// Method: ChomboGeneralPluginInfo::EnabledByDefault
//
// Purpose:
// Return true if this plugin should be enabled by default; false otherwise.
//
// Returns: true/false
//
// Programmer: childs -- generated by xml2info
// Creation: Thu Jan 19 11:17:13 PDT 2006
//
// ****************************************************************************
bool
ChomboGeneralPluginInfo::EnabledByDefault() const
{
return true;
}
// ****************************************************************************
// Method: ChomboGeneralPluginInfo::HasWriter
//
// Purpose:
// Return true if this plugin has a database writer.
//
// Returns: true/false
//
// Programmer: childs -- generated by xml2info
// Creation: Thu Jan 19 11:17:13 PDT 2006
//
// ****************************************************************************
bool
ChomboGeneralPluginInfo::HasWriter() const
{
return false;
}
// ****************************************************************************
// ChomboPluginInfo.h
// ****************************************************************************
#ifndef CHOMBO_PLUGIN_INFO_H
#define CHOMBO_PLUGIN_INFO_H
#include <DatabasePluginInfo.h>
#include <database_plugin_exports.h>
class avtDatabase;
class avtDatabaseWriter;
// ****************************************************************************
// Class: ChomboDatabasePluginInfo
//
// Purpose:
// Classes that provide all the information about the Chombo plugin.
// Portions are separated into pieces relevant to the appropriate
// components of VisIt.
//
// Programmer: childs -- generated by xml2info
// Creation: Thu Jan 19 11:17:13 PDT 2006
//
// Modifications:
//
// ****************************************************************************
class ChomboGeneralPluginInfo : public virtual GeneralDatabasePluginInfo
{
public:
virtual char *GetName() const;
virtual char *GetVersion() const;
virtual char *GetID() const;
virtual bool EnabledByDefault() const;
virtual bool HasWriter() const;
};
class ChomboCommonPluginInfo : public virtual CommonDatabasePluginInfo, public virtual ChomboGeneralPluginInfo
{
public:
virtual DatabaseType GetDatabaseType();
virtual std::vector<std::string> GetDefaultExtensions();
virtual avtDatabase *SetupDatabase(const char * const *list,
int nList, int nBlock);
};
class ChomboMDServerPluginInfo : public virtual MDServerDatabasePluginInfo, public virtual ChomboCommonPluginInfo
{
public:
// this makes compilers happy... remove if we ever have functions here
virtual void dummy();
};
class ChomboEnginePluginInfo : public virtual EngineDatabasePluginInfo, public virtual ChomboCommonPluginInfo
{
public:
virtual avtDatabaseWriter *GetWriter(void);
};
#endif
This diff is collapsed.
// ************************************************************************* //
// avtChomboFileFormat.h //
// ************************************************************************* //
#ifndef AVT_Chombo_FILE_FORMAT_H
#define AVT_Chombo_FILE_FORMAT_H
#include <avtSTMDFileFormat.h>
#include <vector>
#include <hdf5.h>
// ****************************************************************************
// Class: avtChomboFileFormat
//
// Purpose:
// Reads in Chombo files as a plugin to VisIt.
//
// Programmer: childs -- generated by xml2avt
// Creation: Thu Jan 19 11:17:14 PDT 2006
//
// ****************************************************************************
class avtChomboFileFormat : public avtSTMDFileFormat
{
public:
avtChomboFileFormat(const char *);
virtual ~avtChomboFileFormat();
virtual const char *GetType(void) { return "Chombo"; };
virtual void FreeUpResources(void);
virtual void ActivateTimestep(void);
virtual vtkDataSet *GetMesh(int, const char *);
virtual vtkDataArray *GetVar(int, const char *);
virtual vtkDataArray *GetVectorVar(int, const char *);
virtual void PopulateDatabaseMetaData(avtDatabaseMetaData *);
virtual void *GetAuxiliaryData(const char *var, int,
const char *type, void *args,
DestructorFunction &);
protected:
bool initializedReader;
int dimension;
hid_t file_handle;
std::vector<std::string> varnames;
double dtime;
int cycle;
int max_level;
int num_levels;
std::vector<int> patchesPerLevel;
std::vector<int> refinement_ratio;
std::vector<double> dx;
std::vector<int> lowI;
std::vector<int> hiI;
std::vector<int> lowJ;
std::vector<int> hiJ;
std::vector<int> lowK;
std::vector<int> hiK;
void InitializeReader(void);
void GetLevelAndLocalPatchNumber(int global_patch,
int &level, int &local_patch) const;
void CalculateDomainNesting(void);
virtual int GetCycle(void) { return cycle; };
virtual double GetTime(void) { return dtime; };
virtual int GetCycleFromFilename(const char *f) const;
};
#endif
......@@ -181,6 +181,9 @@
# Brad Whitlock, Fri Jan 13 13:47:09 PST 2006
# Added ZeusMP reader.
#
# Hank Childs, Thu Jan 19 09:40:30 PST 2006
# Added Chombo reader.
#
##############################################################################
@SET_MAKE@
......@@ -194,7 +197,7 @@ CGNS=CGNS
EXODUS=Exodus TimeVaryingExodus
GDAL=GDAL
HDF4=Cosmos Enzo ZeusMP
HDF5=Tetrad SAMRAI CosmosPP Pixie FLASH
HDF5=Tetrad SAMRAI CosmosPP Pixie FLASH Chombo
MILI=Mili
NETCDF=NETCDF
PDB=KullLite PDB
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment