Commit 64d8ce12 authored by cyrush's avatar cyrush

broaden support for block structured nodelists to include nodelist info at silo_path = /Nodelists/

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@21629 18c085ea-50e0-402c-830e-de6fd14e8384
parent f7a861df
...@@ -1686,6 +1686,9 @@ avtSiloFileFormat::ReadTopDirStuff(DBfile *dbfile, const char *dirname, ...@@ -1686,6 +1686,9 @@ avtSiloFileFormat::ReadTopDirStuff(DBfile *dbfile, const char *dirname,
// Katheen Biagas, Thu Jun 6 13:11:27 PDT 2013 // Katheen Biagas, Thu Jun 6 13:11:27 PDT 2013
// Enable reading of mrgtrees on Windows. // Enable reading of mrgtrees on Windows.
// //
// Cyrus Harrison, Fri Aug 16 10:07:47 PDT 2013
// Added support for nodelists placed @ /Nodelists/
//
// **************************************************************************** // ****************************************************************************
void void
...@@ -2028,8 +2031,7 @@ avtSiloFileFormat::ReadMultimeshes(DBfile *dbfile, ...@@ -2028,8 +2031,7 @@ avtSiloFileFormat::ReadMultimeshes(DBfile *dbfile,
// //
// Handle special case for enumerated scalar rep for nodelists // Handle special case for enumerated scalar rep for nodelists
// //
if (codeNameGuess == "BlockStructured" && if ( !haveAddedNodelistEnumerations[name_w_dir])
!haveAddedNodelistEnumerations[name_w_dir])
{ {
haveAddedNodelistEnumerations[name_w_dir] = true; haveAddedNodelistEnumerations[name_w_dir] = true;
AddNodelistEnumerations(dbfile, md, name_w_dir); AddNodelistEnumerations(dbfile, md, name_w_dir);
...@@ -6958,6 +6960,10 @@ avtSiloFileFormat::GetMrgTreeNodelistsVar(int domain, string listsname) ...@@ -6958,6 +6960,10 @@ avtSiloFileFormat::GetMrgTreeNodelistsVar(int domain, string listsname)
// //
// Mark C. Miller, Tue Jul 10 20:08:37 PDT 2012 // Mark C. Miller, Tue Jul 10 20:08:37 PDT 2012
// Add support for nodelist vars in MRG Trees. // Add support for nodelist vars in MRG Trees.
//
// Cyrus Harrison, Fri Aug 16 10:07:47 PDT 2013
// Added support for nodelists placed @ /Nodelists/
//
// **************************************************************************** // ****************************************************************************
vtkDataArray * vtkDataArray *
...@@ -6970,7 +6976,7 @@ avtSiloFileFormat::GetVar(int domain, const char *v) ...@@ -6970,7 +6976,7 @@ avtSiloFileFormat::GetVar(int domain, const char *v)
// //
// Handle possible special case of nodelists spoofed as a variable // Handle possible special case of nodelists spoofed as a variable
// //
if (codeNameGuess == "BlockStructured" && string(v) == "Nodelists") if (string(v) == "Nodelists")
{ {
vtkDataArray *nlvar = GetNodelistsVar(domain); vtkDataArray *nlvar = GetNodelistsVar(domain);
if (nlvar != 0) if (nlvar != 0)
...@@ -15745,18 +15751,39 @@ AddAle3drlxstatEnumerationInfo(avtScalarMetaData *smd) ...@@ -15745,18 +15751,39 @@ AddAle3drlxstatEnumerationInfo(avtScalarMetaData *smd)
// //
// Mark C. Miller, Thu Apr 12 23:14:21 PDT 2012 // Mark C. Miller, Thu Apr 12 23:14:21 PDT 2012
// Replaced use of NChooseR enumeration mode with ByBitMap. // Replaced use of NChooseR enumeration mode with ByBitMap.
//
// Cyrus Harrison, Fri Aug 16 10:07:47 PDT 2013
// Added support for nodelists placed @ /Nodelists/
//
// **************************************************************************** // ****************************************************************************
void void
avtSiloFileFormat::AddNodelistEnumerations(DBfile *dbfile, avtDatabaseMetaData *md, avtSiloFileFormat::AddNodelistEnumerations(DBfile *dbfile, avtDatabaseMetaData *md,
string meshname) string meshname)
{ {
if (meshname != "hydro_mesh") // mesh names that adhere to this nodelist format
if (!( meshname != "hydro_mesh" ||
meshname != "MMESH" ||
meshname != "MESH") )
return; return;
if (DBInqVarType(dbfile, "/Global/Nodelists") != DB_DIR) // check for nodelists
return; ostringstream oss;
string nodelist_base = "/Global/Nodelists";
if (DBInqVarType(dbfile, nodelist_base.c_str()) != DB_DIR)
{
// it not found @ "/Global/Nodelists", check for "Nodelists" in the root of the silo file.
nodelist_base = "/Nodelists";
if (DBInqVarType(dbfile, nodelist_base.c_str()) != DB_DIR)
return;
}
debug5 << "Adding Nodelist for mesh = " << meshname <<endl;
debug5 << "Nodelist silo base path = " << nodelist_base <<endl;
DBReadVar(dbfile, "/Global/Nodelists/NumberNodelists", &numNodeLists); oss.str("");
oss << nodelist_base << "/NumberNodelists";
DBReadVar(dbfile, oss.str().c_str(), &numNodeLists);
// Note, if we ever remove the restriction on meshname, above, we need // Note, if we ever remove the restriction on meshname, above, we need
// to make sure we don't wind up defining the same name scalar on different // to make sure we don't wind up defining the same name scalar on different
...@@ -15768,32 +15795,35 @@ avtSiloFileFormat::AddNodelistEnumerations(DBfile *dbfile, avtDatabaseMetaData * ...@@ -15768,32 +15795,35 @@ avtSiloFileFormat::AddNodelistEnumerations(DBfile *dbfile, avtDatabaseMetaData *
nlBlockToWindowsMap.clear(); nlBlockToWindowsMap.clear();
for (i = 0; i < numNodeLists; i++) for (i = 0; i < numNodeLists; i++)
{ {
char *tmpName = 0; char tmpVarName[256]; oss.str("");
SNPRINTF(tmpVarName, sizeof(tmpVarName), "/Global/Nodelists/Nodelist%d/Name", i); oss << nodelist_base << "/Nodelist" << i << "/Name";
tmpName = (char*) DBGetVar(dbfile, tmpVarName); char *tmpName = (char*) DBGetVar(dbfile, oss.str().c_str());
debug5 << "For nodelist \"" << tmpName << "\", value = " << i << endl; debug5 << "For nodelist \"" << tmpName << "\", value = " << i << endl;
smd->AddEnumNameValue(tmpName, i); smd->AddEnumNameValue(tmpName, i);
free(tmpName); free(tmpName);
SNPRINTF(tmpVarName, sizeof(tmpVarName), "/Global/Nodelists/Nodelist%d/NumberWindows", i); oss.str("");
oss << nodelist_base << "/Nodelist" << i << "/NumberWindows";
int numWindows; int numWindows;
DBReadVar(dbfile, tmpVarName, &numWindows); DBReadVar(dbfile, oss.str().c_str(), &numWindows);
debug5 << " NumberWindows = " << numWindows << endl; debug5 << " NumberWindows = " << numWindows << endl;
for (int j = 0; j < numWindows; j++) for (int j = 0; j < numWindows; j++)
{ {
debug5 << " For Window " << j << endl; debug5 << " For Window " << j << endl;
SNPRINTF(tmpVarName, sizeof(tmpVarName), "/Global/Nodelists/Nodelist%d/Block%d", i, j); oss.str("");
oss << nodelist_base << "/Nodelist" << i << "/Block" << j;
int blockNum; int blockNum;
DBReadVar(dbfile, tmpVarName, &blockNum); DBReadVar(dbfile, oss.str().c_str(), &blockNum);
nlBlockToWindowsMap[blockNum].push_back(i); nlBlockToWindowsMap[blockNum].push_back(i);
debug5 << " Block = " << blockNum << endl; debug5 << " Block = " << blockNum << endl;
debug5 << " Extents = "; debug5 << " Extents = ";
SNPRINTF(tmpVarName, sizeof(tmpVarName), "/Global/Nodelists/Nodelist%d/Extents%d", i, j); oss.str("");
oss << nodelist_base << "/Nodelist" << i << "/Extents" << j;
int extents[6]; int extents[6];
DBReadVar(dbfile, tmpVarName, extents); DBReadVar(dbfile, oss.str().c_str(), extents);
for (int k = 0; k < 6; k++) for (int k = 0; k < 6; k++)
{ {
nlBlockToWindowsMap[blockNum].push_back(extents[k]); nlBlockToWindowsMap[blockNum].push_back(extents[k]);
......
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