Commit 29febcc0 authored by js9's avatar js9

Allowing MTSD files to be grouped into longer time sequences.


git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@9703 18c085ea-50e0-402c-830e-de6fd14e8384
parent 2d96e502
......@@ -47,6 +47,7 @@
#include <avtFileFormatInterface.h>
#include <avtMTSDFileFormat.h>
#include <vector>
class avtIOInformation;
......@@ -81,12 +82,18 @@ class avtIOInformation;
//
// Mark C. Miller, Tue May 31 20:12:42 PDT 2005
// Added method SetCycleTimeInDatabaseMetaData
//
// Jeremy Meredith, Thu Jan 28 13:11:07 EST 2010
// MTSD files can now be grouped not just into a faux MD format by having
// more than one block, but also into a longer sequence of MT files,
// each chunk with one or more timesteps.
// ****************************************************************************
class DATABASE_API avtMTSDFileFormatInterface : public avtFileFormatInterface
{
public:
avtMTSDFileFormatInterface(avtMTSDFileFormat **, int);
avtMTSDFileFormatInterface(avtMTSDFileFormat ***,
int ntsgroups, int nblocks);
virtual ~avtMTSDFileFormatInterface();
virtual vtkDataSet *GetMesh(int, int, const char *);
......@@ -109,12 +116,21 @@ class DATABASE_API avtMTSDFileFormatInterface : public avtFileFormatInterface
virtual void PopulateIOInformation(int ts, avtIOInformation& ioInfo);
protected:
avtMTSDFileFormat **domains;
int nDomains;
avtMTSDFileFormat ***chunks;
int nTimestepGroups;
int nBlocks;
std::vector<int> tsPerGroup;
int nTotalTimesteps;
virtual int GetNumberOfFileFormats(void)
{ return nDomains; };
virtual avtFileFormat *GetFormat(int n) const { return domains[n]; };
{ return nTimestepGroups*nBlocks; };
virtual avtFileFormat *GetFormat(int n) const
{ int block = n % nBlocks;
int tsg = n / nBlocks;
return chunks[tsg][block]; };
void GenerateTimestepCounts();
int GetTimestepGroupForTimestep(int ts);
int GetTimestepWithinGroup(int ts);
};
......
......@@ -26,6 +26,11 @@ Definition:
// Hank Childs, Thu Jul 22 11:29:31 PDT 2004
// Register the file list
//
// Jeremy Meredith, Thu Jan 28 12:28:07 EST 2010
// MTSD now accepts grouping multiple files into longer sequences, so
// its interface has changed to accept both a number of timestep groups
// and a number of blocks.
//
// ****************************************************************************
avtDatabase *
......@@ -82,16 +87,21 @@ ExodusCommonPluginInfo::SetupDatabase(const char *const *list,
fileListId = avtExodusFileFormat::RegisterFileList(list, nList);
}
avtMTSDFileFormat **ffl = new avtMTSDFileFormat*[nList];
for (int i = 0 ; i < nList ; i++)
int nTimestepGroups = nList / nBlock;
avtMTSDFileFormat ***ffl = new avtMTSDFileFormat**[nTimestepGroups];
for (int i = 0 ; i < nTimestepGroups ; i++)
{
avtExodusFileFormat *exo = new avtExodusFileFormat(list[i]);
if (!containsManyFiles)
exo->SetFileList(fileListId);
ffl[i] = exo;
ffl[i] = new avtMTSDFileFormat*[nBlock];
for (int j = 0 ; j < nBlock ; j++)
{
avtExodusFileFormat *exo = new avtExodusFileFormat(list[i*nBlock+j]);
if (!containsManyFiles)
exo->SetFileList(fileListId);
ffl[i][j] = exo;
}
}
avtMTSDFileFormatInterface *inter
= new avtMTSDFileFormatInterface(ffl, nList);
= new avtMTSDFileFormatInterface(ffl, nTimestepGroups, nBlock);
return new avtGenericDatabase(inter);
}
......@@ -81,6 +81,11 @@ ExodusCommonPluginInfo::GetDatabaseType()
// Hank Childs, Thu Jul 22 11:29:31 PDT 2004
// Register the file list
//
// Jeremy Meredith, Thu Jan 28 12:28:07 EST 2010
// MTSD now accepts grouping multiple files into longer sequences, so
// its interface has changed to accept both a number of timestep groups
// and a number of blocks.
//
// ****************************************************************************
avtDatabase *
......@@ -137,16 +142,21 @@ ExodusCommonPluginInfo::SetupDatabase(const char *const *list,
fileListId = avtExodusFileFormat::RegisterFileList(list, nList);
}
avtMTSDFileFormat **ffl = new avtMTSDFileFormat*[nList];
for (int i = 0 ; i < nList ; i++)
int nTimestepGroups = nList / nBlock;
avtMTSDFileFormat ***ffl = new avtMTSDFileFormat**[nTimestepGroups];
for (int i = 0 ; i < nTimestepGroups ; i++)
{
avtExodusFileFormat *exo = new avtExodusFileFormat(list[i]);
if (!containsManyFiles)
exo->SetFileList(fileListId);
ffl[i] = exo;
ffl[i] = new avtMTSDFileFormat*[nBlock];
for (int j = 0 ; j < nBlock ; j++)
{
avtExodusFileFormat *exo = new avtExodusFileFormat(list[i*nBlock+j]);
if (!containsManyFiles)
exo->SetFileList(fileListId);
ffl[i][j] = exo;
}
}
avtMTSDFileFormatInterface *inter
= new avtMTSDFileFormatInterface(ffl, nList);
= new avtMTSDFileFormatInterface(ffl, nTimestepGroups, nBlock);
return new avtGenericDatabase(inter);
}
......@@ -79,13 +79,18 @@ avtDatabase *
GGCMCommonPluginInfo::SetupDatabase(const char *const *list,
int nList, int nBlock)
{
avtMTSDFileFormat **ffl = new avtMTSDFileFormat*[nList];
for (int i = 0 ; i < nList ; i++)
int nTimestepGroups = nList / nBlock;
avtMTSDFileFormat ***ffl = new avtMTSDFileFormat**[nTimestepGroups];
for (int i = 0 ; i < nTimestepGroups ; i++)
{
ffl[i] = new avtGGCMFileFormat(list[i], readOptions);
ffl[i] = new avtMTSDFileFormat*[nBlock];
for (int j = 0 ; j < nBlock ; j++)
{
ffl[i][j] = new avtGGCMFileFormat(list[i*nBlock + j], readOptions);
}
}
avtMTSDFileFormatInterface *inter
= new avtMTSDFileFormatInterface(ffl, nList);
= new avtMTSDFileFormatInterface(ffl, nTimestepGroups, nBlock);
return new avtGenericDatabase(inter);
}
......
......@@ -78,12 +78,17 @@ avtDatabase *
H5NimrodCommonPluginInfo::SetupDatabase(const char *const *list,
int nList, int nBlock)
{
avtMTSDFileFormat **ffl = new avtMTSDFileFormat*[nList];
for (int i = 0 ; i < nList ; i++)
int nTimestepGroups = nList / nBlock;
avtMTSDFileFormat ***ffl = new avtMTSDFileFormat**[nTimestepGroups];
for (int i = 0 ; i < nTimestepGroups ; i++)
{
ffl[i] = new avtH5NimrodFileFormat(list[i]);
ffl[i] = new avtMTSDFileFormat*[nBlock];
for (int j = 0 ; j < nBlock ; j++)
{
ffl[i][j] = new avtH5NimrodFileFormat(list[i*nBlock + j]);
}
}
avtMTSDFileFormatInterface *inter
= new avtMTSDFileFormatInterface(ffl, nList);
= new avtMTSDFileFormatInterface(ffl, nTimestepGroups, nBlock);
return new avtGenericDatabase(inter);
}
......@@ -79,13 +79,18 @@ avtDatabase *
HDF_UCCommonPluginInfo::SetupDatabase(const char *const *list,
int nList, int nBlock)
{
avtMTSDFileFormat **ffl = new avtMTSDFileFormat*[nList];
for (int i = 0 ; i < nList ; i++)
int nTimestepGroups = nList / nBlock;
avtMTSDFileFormat ***ffl = new avtMTSDFileFormat**[nTimestepGroups];
for (int i = 0 ; i < nTimestepGroups ; i++)
{
ffl[i] = new avtHDF_UCFileFormat(list[i], readOptions);
ffl[i] = new avtMTSDFileFormat*[nBlock];
for (int j = 0 ; j < nBlock ; j++)
{
ffl[i][j] = new avtHDF_UCFileFormat(list[i*nBlock + j], readOptions);
}
}
avtMTSDFileFormatInterface *inter
= new avtMTSDFileFormatInterface(ffl, nList);
= new avtMTSDFileFormatInterface(ffl, nTimestepGroups, nBlock);
return new avtGenericDatabase(inter);
}
......
......@@ -657,15 +657,25 @@ avtLAMMPSDumpFileFormat::FileContentsIdentify(const std::string &filename)
// Programmer: Jeremy Meredith
// Creation: February 9, 2009
//
// Modifications:
// Jeremy Meredith, Thu Jan 28 12:28:07 EST 2010
// MTSD now accepts grouping multiple files into longer sequences, so
// its interface has changed to accept both a number of timestep groups
// and a number of blocks.
// ****************************************************************************
avtFileFormatInterface *
avtLAMMPSDumpFileFormat::CreateInterface(const char *const *list,
int nList, int)
int nList, int nBlock)
{
avtMTSDFileFormat **ffl = new avtMTSDFileFormat*[nList];
for (int i = 0 ; i < nList ; i++)
int nTimestepGroups = nList / nBlock;
avtMTSDFileFormat ***ffl = new avtMTSDFileFormat**[nTimestepGroups];
for (int i = 0 ; i < nTimestepGroups ; i++)
{
ffl[i] = new avtLAMMPSDumpFileFormat(list[i]);
ffl[i] = new avtMTSDFileFormat*[nBlock];
for (int j = 0 ; j < nBlock ; j++)
{
ffl[i][j] = new avtLAMMPSDumpFileFormat(list[i*nBlock+j]);
}
}
return new avtMTSDFileFormatInterface(ffl, nList);
return new avtMTSDFileFormatInterface(ffl, nTimestepGroups, nBlock);
}
......@@ -560,15 +560,25 @@ avtLAMMPSStructureFileFormat::FileContentsIdentify(const std::string &filename)
// Programmer: Jeremy Meredith
// Creation: February 9, 2009
//
// Modifications:
// Jeremy Meredith, Thu Jan 28 12:28:07 EST 2010
// MTSD now accepts grouping multiple files into longer sequences, so
// its interface has changed to accept both a number of timestep groups
// and a number of blocks.
// ****************************************************************************
avtFileFormatInterface *
avtLAMMPSStructureFileFormat::CreateInterface(const char *const *list,
int nList, int)
int nList, int nBlock)
{
avtMTSDFileFormat **ffl = new avtMTSDFileFormat*[nList];
for (int i = 0 ; i < nList ; i++)
int nTimestepGroups = nList / nBlock;
avtMTSDFileFormat ***ffl = new avtMTSDFileFormat**[nTimestepGroups];
for (int i = 0 ; i < nTimestepGroups ; i++)
{
ffl[i] = new avtLAMMPSStructureFileFormat(list[i]);
ffl[i] = new avtMTSDFileFormat*[nBlock];
for (int j = 0 ; j < nBlock ; j++)
{
ffl[i][j] = new avtLAMMPSStructureFileFormat(list[i*nBlock+j]);
}
}
return new avtMTSDFileFormatInterface(ffl, nList);
return new avtMTSDFileFormatInterface(ffl, nTimestepGroups, nBlock);
}
......@@ -79,13 +79,18 @@ avtDatabase *
M3DC1CommonPluginInfo::SetupDatabase(const char *const *list,
int nList, int nBlock)
{
avtMTSDFileFormat **ffl = new avtMTSDFileFormat*[nList];
for (int i = 0 ; i < nList ; i++)
int nTimestepGroups = nList / nBlock;
avtMTSDFileFormat ***ffl = new avtMTSDFileFormat**[nTimestepGroups];
for (int i = 0 ; i < nTimestepGroups ; i++)
{
ffl[i] = new avtM3DC1FileFormat(list[i], readOptions);
ffl[i] = new avtMTSDFileFormat*[nBlock];
for (int j = 0 ; j < nBlock ; j++)
{
ffl[i][j] = new avtM3DC1FileFormat(list[i*nBlock + j], readOptions);
}
}
avtMTSDFileFormatInterface *inter
= new avtMTSDFileFormatInterface(ffl, nList);
= new avtMTSDFileFormatInterface(ffl, nTimestepGroups, nBlock);
return new avtGenericDatabase(inter);
}
......
......@@ -78,12 +78,17 @@ avtDatabase *
MM5CommonPluginInfo::SetupDatabase(const char *const *list,
int nList, int nBlock)
{
avtMTSDFileFormat **ffl = new avtMTSDFileFormat*[nList];
for (int i = 0 ; i < nList ; i++)
int nTimestepGroups = nList / nBlock;
avtMTSDFileFormat ***ffl = new avtMTSDFileFormat**[nTimestepGroups];
for (int i = 0 ; i < nTimestepGroups ; i++)
{
ffl[i] = new avtMM5FileFormat(list[i]);
ffl[i] = new avtMTSDFileFormat*[nBlock];
for (int j = 0 ; j < nBlock ; j++)
{
ffl[i][j] = new avtMM5FileFormat(list[i*nBlock + j]);
}
}
avtMTSDFileFormatInterface *inter
= new avtMTSDFileFormatInterface(ffl, nList);
= new avtMTSDFileFormatInterface(ffl, nTimestepGroups, nBlock);
return new avtGenericDatabase(inter);
}
......@@ -99,24 +99,34 @@ avtBasic_MTSD_NETCDFFileFormat::Identify(NETCDFFileObject *fileObject)
// Programmer: Brad Whitlock
// Creation: Wed Jul 11 18:26:32 PST 2007
//
// Modifications:
// Jeremy Meredith, Thu Jan 28 12:28:07 EST 2010
// MTSD now accepts grouping multiple files into longer sequences, so
// its interface has changed to accept both a number of timestep groups
// and a number of blocks.
// ****************************************************************************
avtFileFormatInterface *
avtBasic_MTSD_NETCDFFileFormat::CreateInterface(NETCDFFileObject *f,
const char *const *list, int nList, int nBlock)
{
avtMTSDFileFormat **ffl = new avtMTSDFileFormat*[nList];
for (int i = 0 ; i < nList ; i++)
int nTimestepGroups = nList / nBlock;
avtMTSDFileFormat ***ffl = new avtMTSDFileFormat**[nTimestepGroups];
for (int i = 0 ; i < nTimestepGroups ; i++)
{
if(f != 0)
ffl[i] = new avtMTSDFileFormat*[nBlock];
for (int j = 0 ; j < nBlock ; j++)
{
ffl[i] = new avtBasic_MTSD_NETCDFFileFormat(list[i], f);
f = 0;
if(f != 0)
{
ffl[i][j] = new avtBasic_MTSD_NETCDFFileFormat(list[i*nBlock+j], f);
f = 0;
}
else
ffl[i][j] = new avtBasic_MTSD_NETCDFFileFormat(list[i*nBlock+j]);
}
else
ffl[i] = new avtBasic_MTSD_NETCDFFileFormat(list[i]);
}
return new avtMTSDFileFormatInterface(ffl, nList);
return new avtMTSDFileFormatInterface(ffl, nTimestepGroups, nBlock);
}
avtBasic_MTSD_NETCDFFileFormat::avtBasic_MTSD_NETCDFFileFormat(const char *filename) :
......
......@@ -103,24 +103,30 @@ avtCCSM_MTSD_FileFormat::Identify(NETCDFFileObject *fileObject)
// Programmer: Brad Whitlock
// Creation: Wed Jul 11 18:26:32 PST 2007
//
// Modifications:
// Jeremy Meredith, Thu Jan 28 12:28:07 EST 2010
// MTSD now accepts grouping multiple files into longer sequences, so
// its interface has changed to accept both a number of timestep groups
// and a number of blocks.
// ****************************************************************************
avtFileFormatInterface *
avtCCSM_MTSD_FileFormat::CreateInterface(NETCDFFileObject *f,
const char *const *list, int nList, int nBlock)
{
avtMTSDFileFormat **ffl = new avtMTSDFileFormat*[nList];
for (int i = 0 ; i < nList ; i++)
int nTimestepGroups = nList / nBlock;
avtMTSDFileFormat ***ffl = new avtMTSDFileFormat**[nTimestepGroups];
for (int i = 0 ; i < nTimestepGroups ; i++)
{
if(f != 0)
ffl[i] = new avtMTSDFileFormat*[nBlock];
for (int j = 0 ; j < nBlock ; j++)
{
ffl[i] = new avtCCSM_MTSD_FileFormat(list[i], f);
f = 0;
ffl[i][j] = new avtCCSM_MTSD_FileFormat(list[i*nBlock+j],
(i==0) ? f : NULL);
}
else
ffl[i] = new avtCCSM_MTSD_FileFormat(list[i]);
}
return new avtMTSDFileFormatInterface(ffl, nList);
return new avtMTSDFileFormatInterface(ffl, nTimestepGroups, nBlock);
}
avtCCSM_MTSD_FileFormat::avtCCSM_MTSD_FileFormat(const char *filename) :
......
......@@ -77,6 +77,10 @@ avtFVCOMParticleFileFormat::Identify(NETCDFFileObject *fileObject)
// Creation: Thu May 4 16:18:57 PST 2006
//
// Modifications:
// Jeremy Meredith, Thu Jan 28 12:28:07 EST 2010
// MTSD now accepts grouping multiple files into longer sequences, so
// its interface has changed to accept both a number of timestep groups
// and a number of blocks.
//
// ****************************************************************************
......@@ -84,19 +88,19 @@ avtFileFormatInterface *
avtFVCOMParticleFileFormat::CreateInterface(NETCDFFileObject *f,
const char *const *list, int nList, int nBlock)
{
avtMTSDFileFormat **ffl = new avtMTSDFileFormat*[nList];
for (int i = 0 ; i < nList ; i++)
int nTimestepGroups = nList / nBlock;
avtMTSDFileFormat ***ffl = new avtMTSDFileFormat**[nTimestepGroups];
for (int i = 0 ; i < nTimestepGroups ; i++)
{
if(f != 0)
ffl[i] = new avtMTSDFileFormat*[nBlock];
for (int j = 0 ; j < nBlock ; j++)
{
ffl[i] = new avtFVCOMParticleFileFormat(list[i], f);
f = 0;
ffl[i][j] = new avtFVCOMParticleFileFormat(list[i*nBlock+j],
(i==0) ? f : NULL);
}
else
ffl[i] = new avtFVCOMParticleFileFormat(list[i]);
}
return new avtMTSDFileFormatInterface(ffl, nList);
return new avtMTSDFileFormatInterface(ffl, nTimestepGroups, nBlock);
}
// ****************************************************************************
......
......@@ -100,6 +100,10 @@ avtFVCOM_MTSDFileFormat::Identify(NETCDFFileObject *fileObject)
// Creation: Thu May 4 16:18:57 PST 2006
//
// Modifications:
// Jeremy Meredith, Thu Jan 28 12:28:07 EST 2010
// MTSD now accepts grouping multiple files into longer sequences, so
// its interface has changed to accept both a number of timestep groups
// and a number of blocks.
//
// ****************************************************************************
......@@ -108,19 +112,19 @@ avtFileFormatInterface *
avtFVCOM_MTSDFileFormat::CreateInterface(NETCDFFileObject *f,
const char *const *list, int nList, int nBlock)
{
avtMTSDFileFormat **ffl = new avtMTSDFileFormat*[nList];
for (int i = 0 ; i < nList ; i++)
int nTimestepGroups = nList / nBlock;
avtMTSDFileFormat ***ffl = new avtMTSDFileFormat**[nTimestepGroups];
for (int i = 0 ; i < nTimestepGroups ; i++)
{
if(f != 0)
ffl[i] = new avtMTSDFileFormat*[nBlock];
for (int j = 0 ; j < nBlock ; j++)
{
ffl[i] = new avtFVCOM_MTSDFileFormat(list[i], f);
f = 0;
ffl[i][j] = new avtFVCOM_MTSDFileFormat(list[i*nBlock+j],
(i==0) ? f : NULL);
}
else
ffl[i] = new avtFVCOM_MTSDFileFormat(list[i]);
}
return new avtMTSDFileFormatInterface(ffl, nList);
return new avtMTSDFileFormatInterface(ffl, nTimestepGroups, nBlock);
}
// ****************************************************************************
......
......@@ -99,34 +99,56 @@ avtLODIFileFormat::Identify(NETCDFFileObject *fileObject)
// Creation: Mon Aug 15 18:05:07 PST 2005
//
// Modifications:
// Jeremy Meredith, Thu Jan 28 12:28:07 EST 2010
// MTSD now accepts grouping multiple files into longer sequences, so
// its interface has changed to accept both a number of timestep groups
// and a number of blocks.
//
// ****************************************************************************
avtFileFormatInterface *
avtLODIFileFormat::CreateInterface(NETCDFFileObject *f,
const char *const *list, int nList, int)
const char *const *list, int nList, int nBlock)
{
avtMTSDFileFormat **ffl = new avtMTSDFileFormat*[nList];
for (int i = 0 ; i < nList ; i++)
ffl[i] = 0;
int nTimestepGroups = nList / nBlock;
avtMTSDFileFormat ***ffl = new avtMTSDFileFormat**[nTimestepGroups];
for (int i = 0 ; i < nTimestepGroups ; i++)
{
ffl[i] = new avtMTSDFileFormat*[nBlock];
for (int j = 0 ; j < nBlock ; j++)
{
ffl[i][j] = NULL;
}
}
TRY
{
ffl[0] = new avtLODIFileFormat(list[0], f);
for (int i = 1 ; i < nList ; i++)
ffl[i] = new avtLODIFileFormat(list[i]);
for (int i = 0 ; i < nTimestepGroups ; i++)
{
for (int j = 0 ; j < nBlock ; j++)
{
ffl[i][j] = new avtLODIFileFormat(list[i*nBlock+j],
(i==0) ? f : NULL);
}
}
}
CATCH(VisItException)
{
for (int i = 0 ; i < nList ; i++)
delete ffl[i];
for (int i = 0 ; i < nTimestepGroups ; i++)
{
for (int j = 0 ; j < nBlock ; j++)
{
if(ffl[i][j] != 0)
delete ffl[i][j];
}
delete [] ffl[i];
}
delete [] ffl;
RETHROW;
}
ENDTRY
return new avtMTSDFileFormatInterface(ffl, nList);
return new avtMTSDFileFormatInterface(ffl, nTimestepGroups, nBlock);
}
// ****************************************************************************
......
......@@ -110,34 +110,56 @@ avtLODIParticleFileFormat::Identify(NETCDFFileObject *fileObject)
// Creation: Mon Aug 15 18:05:07 PST 2005
//
// Modifications:
// Jeremy Meredith, Thu Jan 28 12:28:07 EST 2010
// MTSD now accepts grouping multiple files into longer sequences, so
// its interface has changed to accept both a number of timestep groups
// and a number of blocks.
//
// ****************************************************************************
avtFileFormatInterface *
avtLODIParticleFileFormat::CreateInterface(NETCDFFileObject *f,
const char *const *list, int nList, int)
const char *const *list, int nList, int nBlock)
{
avtMTSDFileFormat **ffl = new avtMTSDFileFormat*[nList];
for (int i = 0 ; i < nList ; i++)
ffl[i] = 0;
int nTimestepGroups = nList / nBlock;
avtMTSDFileFormat ***ffl = new avtMTSDFileFormat**[nTimestepGroups];
for (int i = 0 ; i < nTimestepGroups ; i++)
{
ffl[i] = new avtMTSDFileFormat*[nBlock];
for (int j = 0 ; j < nBlock ; j++)
{
ffl[i][j] = NULL;
}
}
TRY
{
ffl[0] = new avtLODIParticleFileFormat(list[0], f);
for (int i = 1 ; i < nList ; i++)
ffl[i] = new avtLODIParticleFileFormat(list[i]);
for (int i = 0 ; i < nTimestepGroups ; i++)