Commit bac029c0 authored by hrchilds's avatar hrchilds
Browse files

Update from January 6, 2005

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@391 18c085ea-50e0-402c-830e-de6fd14e8384
parent 6529da13
......@@ -627,9 +627,9 @@ More information about building VisIt follows after that.
#
# Unzipping VisIt's source code distribution
#
gunzip visit041108.tar.gz
tar xf visit041108.tar
cd visit041108
gunzip visit050110.tar.gz
tar xf visit050110.tar
cd visit050110
#
# HDF5 and Silo
......
......@@ -12,7 +12,7 @@
<Field name="id" type="stringVector">Streamline_1.0 InverseGhostZone_1.0 </Field>
<Field name="enabled" type="intVector">0 0 </Field>
</Object>
<Object name="HostProfileList" childObjects="29">
<Object name="HostProfileList" childObjects="27">
<Object name="HostProfile" childObjects="0">
<Field name="profileName" type="string">serial</Field>
<Field name="host" type="string">alc.llnl.gov</Field>
......@@ -321,50 +321,6 @@
<Field name="arguments" type="stringVector">-dir /usr/gapps/visit</Field>
<Field name="parallel" type="bool">true</Field>
</Object>
<Object name="HostProfile" childObjects="0">
<Field name="profileName" type="string">serial</Field>
<Field name="host" type="string">riptide.llnl.gov</Field>
<Field name="hostAliases" type="string">riptide</Field>
<Field name="timeout" type="int">480</Field>
<Field name="numProcessors" type="int">1</Field>
<Field name="numNodesSet" type="bool">false</Field>
<Field name="numNodes" type="int">0</Field>
<Field name="partitionSet" type="bool">false</Field>
<Field name="partition" type="string"></Field>
<Field name="bankSet" type="bool">false</Field>
<Field name="bank" type="string"></Field>
<Field name="timeLimitSet" type="bool">false</Field>
<Field name="timeLimit" type="string"></Field>
<Field name="launchMethodSet" type="bool">false</Field>
<Field name="launchMethod" type="string"></Field>
<Field name="forceStatic" type="bool">true</Field>
<Field name="forceDynamic" type="bool">false</Field>
<Field name="active" type="bool">true</Field>
<Field name="arguments" type="stringVector">-dir /usr/gapps/visit </Field>
<Field name="parallel" type="bool">false</Field>
</Object>
<Object name="HostProfile" childObjects="0">
<Field name="profileName" type="string">parallel</Field>
<Field name="host" type="string">riptide.llnl.gov</Field>
<Field name="hostAliases" type="string">riptide</Field>
<Field name="timeout" type="int">480</Field>
<Field name="numProcessors" type="int">8</Field>
<Field name="numNodesSet" type="bool">false</Field>
<Field name="numNodes" type="int">0</Field>
<Field name="partitionSet" type="bool">false</Field>
<Field name="partition" type="string"></Field>
<Field name="bankSet" type="bool">false</Field>
<Field name="bank" type="string"></Field>
<Field name="timeLimitSet" type="bool">false</Field>
<Field name="timeLimit" type="string"></Field>
<Field name="launchMethodSet" type="bool">false</Field>
<Field name="launchMethod" type="string"></Field>
<Field name="forceStatic" type="bool">true</Field>
<Field name="forceDynamic" type="bool">false</Field>
<Field name="active" type="bool">false</Field>
<Field name="arguments" type="stringVector">-dir /usr/gapps/visit </Field>
<Field name="parallel" type="bool">true</Field>
</Object>
<Object name="HostProfile" childObjects="0">
<Field name="profileName" type="string">serial</Field>
<Field name="host" type="string">snow.llnl.gov</Field>
......
......@@ -7,10 +7,12 @@
#include <ExprParser.h>
#include <string>
#include <set>
#include <vector>
#include <ImproperUseException.h>
#include <RecursiveExpressionException.h>
using std::set;
using std::string;
using std::vector;
ParsingExprList * ParsingExprList::instance = 0;
......@@ -298,43 +300,57 @@ ParsingExprList::GetExpressionTree(Expression *expr)
// Arguments:
// var the original variable name
//
// Note: refactored this from my original implementation in ViewerPlotList.
//
// Programmer: Jeremy Meredith
// Creation: December 14, 2004
// Creation: January 6, 2005
//
// ****************************************************************************
string
ParsingExprList::GetRealVariable(const string &var)
{
string realvar = var;
// Use a set to check for expression recursion
set<string> expandedVars;
expandedVars.insert(realvar);
Expression *expr = GetExpression(realvar);
while (expr)
// Use a stack to walk the expression tree
vector<string> varStack;
varStack.push_back(var);
while (!varStack.empty())
{
string realvar = varStack.back();
varStack.pop_back();
// Check for recursion
if (expandedVars.count(realvar))
{
EXCEPTION1(RecursiveExpressionException, realvar);
}
expandedVars.insert(realvar);
// If this variable is not an expression, then it is real
// Otherwise, descend into it
Expression *expr = GetExpression(realvar);
if (!expr)
{
// Found the real variable
return realvar;
}
ExprNode *tree = GetExpressionTree(expr);
if (!tree)
{
// We won't normally get here because error
// conditions will usually throw exceptions.
// Otherwise, every expression should have
// a tree.
return "";
}
const set<string> &varLeaves = tree->GetVarLeaves();
if (varLeaves.empty())
{
EXCEPTION1(ImproperUseException,
"After parsing, expression has no real variables.");
}
realvar = *varLeaves.begin();
if (expandedVars.count(realvar))
{
EXCEPTION1(RecursiveExpressionException, realvar);
}
expandedVars.insert(realvar);
expr = ParsingExprList::GetExpression(realvar);
varStack.insert(varStack.end(),
varLeaves.begin(), varLeaves.end());
}
return realvar;
EXCEPTION1(ImproperUseException,
"After parsing, expression has no real variables.");
}
......@@ -78,18 +78,32 @@ avtMultipleInputExpressionFilter::AddInputVariableName(const char *var)
// Kathleen Bonnell, Mon Mar 29 11:28:25 PST 2004
// Make sure that varnames is not empty before attempting to index.
//
// Hank Childs, Thu Jan 6 10:42:13 PST 2005
// Do a better job when there are mixed centerings.
//
// ****************************************************************************
bool
avtMultipleInputExpressionFilter::IsPointVariable(void)
{
avtDataAttributes &atts = GetInput()->GetInfo().GetAttributes();
if (varnames.size() > 0 && atts.ValidVariable(varnames[0]))
bool hasNodal = false;
bool hasZonal = false;
for (int i = 0 ; i < varnames.size() ; i++)
{
return (atts.GetCentering(varnames[0]) != AVT_ZONECENT);
if (!atts.ValidVariable(varnames[i]))
return avtExpressionFilter::IsPointVariable();
if (atts.GetCentering(varnames[i]) == AVT_ZONECENT)
hasZonal = true;
else
hasNodal = true;
}
return avtExpressionFilter::IsPointVariable();
if (hasZonal && hasNodal)
return !(MixedCenteringYieldsZonal());
return hasNodal;
}
......
......@@ -27,6 +27,10 @@
// Hank Childs, Mon Dec 27 10:37:15 PST 2004
// Changed inheritance from avtExpressionFilter to avtExpressionStreamer.
//
// Hank Childs, Thu Jan 6 11:00:35 PST 2005
// Added MixedCenteringYieldsZonal method to give derived types a hook into
// altering behavior of IsPointVariable.
//
// ****************************************************************************
class EXPRESSION_API avtMultipleInputExpressionFilter
......@@ -47,6 +51,7 @@ class EXPRESSION_API avtMultipleInputExpressionFilter
std::vector<char *> varnames;
virtual bool IsPointVariable(void);
virtual bool MixedCenteringYieldsZonal(void) { return true; };
};
#endif
......
......@@ -98,6 +98,9 @@ avtUnaryMathFilter::~avtUnaryMathFilter()
// Hank Childs, Tue Feb 10 08:33:05 PST 2004
// Account for case where there is no variable to work from ['4435].
//
// Hank Childs, Thu Jan 6 13:32:50 PST 2005
// Create the correct sized array.
//
// ****************************************************************************
vtkDataArray *
......@@ -210,7 +213,8 @@ avtUnaryMathFilter::DeriveVariable(vtkDataSet *in_ds)
// the mesh.
//
ncomps = 1;
nvals = in_ds->GetNumberOfCells();
nvals = (IsPointVariable() ? in_ds->GetNumberOfPoints()
: in_ds->GetNumberOfCells());
vtkFloatArray *tmp = vtkFloatArray::New();
dv = CreateArray(tmp);
tmp->Delete();
......
......@@ -220,6 +220,9 @@ avtExpressionEvaluatorFilter::AdditionalPipelineFilters(void)
// Hank Childs, Fri Dec 31 11:50:07 PST 2004
// Maintain our own cached version of the terminating source.
//
// Hank Childs, Thu Jan 6 11:08:56 PST 2005
// Beef up logic to insert identity filters.
//
// ****************************************************************************
avtPipelineSpecification_p
......@@ -336,6 +339,7 @@ avtExpressionEvaluatorFilter::PerformRestriction(
}
// Take the list of expressions and make the filters for them.
int numFiltersLastTime = 0;
while (createFilters && !expr_list.empty())
{
std::vector<string>::iterator back = expr_list.end() - 1;
......@@ -354,7 +358,7 @@ avtExpressionEvaluatorFilter::PerformRestriction(
vector<avtExpressionFilter*> &filters = pipelineState.GetFilters();
avtExpressionFilter *f = NULL;
if (filters.size() == 0)
if (filters.size() == numFiltersLastTime)
{
// The only way we can get here is if we have an expression of
// the form "A = B".
......@@ -363,6 +367,7 @@ avtExpressionEvaluatorFilter::PerformRestriction(
avtIdentityFilter *ident = new avtIdentityFilter();
string inputName = pipelineState.PopName();
ident->AddInputVariableName(inputName.c_str());
ident->SetOutputVariableName(var.c_str());
ident->SetInput(pipelineState.GetDataObject());
pipelineState.SetDataObject(ident->GetOutput());
pipelineState.AddFilter(ident);
......@@ -373,6 +378,7 @@ avtExpressionEvaluatorFilter::PerformRestriction(
f = filters.back();
}
f->SetOutputVariableName(var.c_str());
numFiltersLastTime = filters.size();
}
// Make sure we have real variables to pass to the database.
......
......@@ -16,6 +16,7 @@
#include <avtStructuredDomainBoundaries.h>
#include <avtStructuredDomainNesting.h>
#include <avtVariableCache.h>
#include <avtIntervalTree.h>
#include <InvalidVariableException.h>
#include <InvalidFilesException.h>
......@@ -53,6 +54,17 @@ void avtEnzoFileFormat::Grid::Print()
cerr << endl;
}
// ****************************************************************************
// Method: avtEnzoFileFormat::Grid::DetermineExtentsInParent
//
// Purpose:
// Use our spatial extents and the spatial extents of our parent, as well
// as our dimensions, to determine our logical extents within our parent.
//
// Programmer: Jeremy Meredith
// Creation: January 3, 2005
//
// ****************************************************************************
void avtEnzoFileFormat::Grid::DetermineExtentsInParent(vector<Grid> &grids)
{
Grid &p = grids[parentID];
......@@ -87,8 +99,20 @@ void avtEnzoFileFormat::Grid::DetermineExtentsInParent(vector<Grid> &grids)
}
}
void avtEnzoFileFormat::Grid::DetermineExtentsGlobally(int numLevels,
vector<Grid> &grids)
// ****************************************************************************
// Method: avtEnzoFileFormat::Grid::DetermineExtentsGlobally
//
// Purpose:
// Use the global extents from the parent, and our local extens within
// our parent, to determine our global extents.
//
// Programmer: Jeremy Meredith
// Creation: January 3, 2005
//
// ****************************************************************************
void
avtEnzoFileFormat::Grid::DetermineExtentsGlobally(int numLevels,
vector<Grid> &grids)
{
Grid &p = grids[parentID];
if (ID != 1)
......@@ -111,6 +135,19 @@ void avtEnzoFileFormat::Grid::DetermineExtentsGlobally(int numLevels,
}
}
// ****************************************************************************
// Method: avtEnzoFileFormat::ReadHierachyFile
//
// Purpose:
// Read the .hierarchy file and get the grid/level hierarchy.
//
// Arguments:
// none
//
// Programmer: Jeremy Meredith
// Creation: January 6, 2005
//
// ****************************************************************************
void
avtEnzoFileFormat::ReadHierachyFile()
{
......@@ -183,6 +220,13 @@ avtEnzoFileFormat::ReadHierachyFile()
h >> buff; // '='
h >> g.maxSpatialExtents[0] >> g.maxSpatialExtents[1] >> g.maxSpatialExtents[2];
while (buff != "NumberOfParticles")
{
h >> buff;
}
h >> buff; // '='
h >> g.numberOfParticles;
g.level = level;
g.parentID = parent;
g.DetermineExtentsInParent(grids);
......@@ -246,6 +290,21 @@ avtEnzoFileFormat::ReadHierachyFile()
h.close();
}
// ****************************************************************************
// Method: avtEnzoFileFormat::ReadParameterFile
//
// Purpose:
// The parameter file is the one without an extension, and it
// has some problem setup stuff in it. We are currently only
// using it to get the cycle and time.
//
// Arguments:
// none
//
// Programmer: Jeremy Meredith
// Creation: January 6, 2005
//
// ****************************************************************************
void
avtEnzoFileFormat::ReadParameterFile()
{
......@@ -254,7 +313,7 @@ avtEnzoFileFormat::ReadParameterFile()
ifstream r(fname_base.c_str());
if (!r)
EXCEPTION2(InvalidFilesException, fname_base.c_str(),
"This index file did not exist.");
"This parameter file did not exist.");
string buff("");
while (r)
......@@ -274,19 +333,43 @@ avtEnzoFileFormat::ReadParameterFile()
r.close();
}
// ****************************************************************************
// Method:
//
// Purpose:
// Find the smallest grid that contains some particles, or just the smallest
// grid if none have any particles.
//
// Arguments:
// none
//
// Programmer: Jeremy Meredith
// Creation: January 6, 2005
//
// ****************************************************************************
void
avtEnzoFileFormat::DetermineVariablesFromGridFile()
{
int smallest_grid = 0;
int smallest_grid_nzones = INT_MAX;
bool found_grid_with_particles = false;
for (int i=1; i<grids.size(); i++)
{
Grid &g = grids[i];
if (found_grid_with_particles && g.numberOfParticles <= 0)
continue;
int numZones = g.zdims[0]*g.zdims[1]*g.zdims[2];
if (numZones < smallest_grid_nzones)
if ((!found_grid_with_particles && g.numberOfParticles > 0) ||
(numZones < smallest_grid_nzones))
{
smallest_grid_nzones = numZones;
smallest_grid = g.ID;
if (!found_grid_with_particles ||
(found_grid_with_particles && g.numberOfParticles > 0))
{
smallest_grid_nzones = numZones;
smallest_grid = g.ID;
found_grid_with_particles = (g.numberOfParticles > 0);
}
}
}
......@@ -301,7 +384,7 @@ avtEnzoFileFormat::DetermineVariablesFromGridFile()
int32 n_datasets;
int32 n_file_attrs;
int32 status = SDfileinfo(file_handle, &n_datasets, &n_file_attrs);
SDfileinfo(file_handle, &n_datasets, &n_file_attrs);
for (int var = 0 ; var < n_datasets ; var++)
{
......@@ -332,7 +415,7 @@ avtEnzoFileFormat::DetermineVariablesFromGridFile()
}
// ****************************************************************************
// Method: avtEnzo constructor
// Method: avtEnzoFileFormat constructor
//
// Programmer: Jeremy Meredith
// Creation: January 3, 2005
......@@ -346,7 +429,6 @@ avtEnzoFileFormat::avtEnzoFileFormat(const char *filename)
numLevels = 0;
curTime = 0;
fname_base;
string fname(filename);
string extH(".hierarchy");
string extB(".boundary");
......@@ -372,10 +454,30 @@ avtEnzoFileFormat::avtEnzoFileFormat(const char *filename)
}
// ****************************************************************************
// Method: avtEnzoFileFormat destructure
//
// Programmer: Jeremy Meredith
// Creation: January 6, 2005
//
// ****************************************************************************
avtEnzoFileFormat::~avtEnzoFileFormat()
{
}
// ****************************************************************************
// Method: avtEnzoFileFormat::ReadAllMetaData
//
// Purpose:
// Read the metadata if we have not done so yet.
//
// Arguments:
// none
//
// Programmer: Jeremy Meredith
// Creation: January 6, 2005
//
// ****************************************************************************
void
avtEnzoFileFormat::ReadAllMetaData()
{
......@@ -424,13 +526,11 @@ avtEnzoFileFormat::GetCyle()
void
avtEnzoFileFormat::FreeUpResources(void)
{
/*
grids.clear();
varNames.clear();
particleVarNames.clear();
numGrids=0;
numLevels=0;
*/
}
......@@ -450,11 +550,10 @@ avtEnzoFileFormat::FreeUpResources(void)
void
avtEnzoFileFormat::PopulateDatabaseMetaData(avtDatabaseMetaData *md)
{
// read in the metadata if we have not done so yet
ReadAllMetaData();
float extents[6] = {grids[1].minSpatialExtents[0], grids[1].maxSpatialExtents[0],
grids[1].minSpatialExtents[1], grids[1].maxSpatialExtents[1],
grids[1].minSpatialExtents[2], grids[1].maxSpatialExtents[2]};
// BuildDomainNesting() <<--- we eventually want this here, probably
avtMeshMetaData *mesh = new avtMeshMetaData;
mesh->name = "mesh";
......@@ -462,8 +561,13 @@ avtEnzoFileFormat::PopulateDatabaseMetaData(avtDatabaseMetaData *md)
mesh->meshType = AVT_RECTILINEAR_MESH;
mesh->topologicalDimension = 3;
mesh->spatialDimension = 3;
mesh->hasSpatialExtents = false; // can we say yes?
mesh->hasSpatialExtents = true;
mesh->minSpatialExtents[0] = grids[1].minSpatialExtents[0];
mesh->minSpatialExtents[1] = grids[1].minSpatialExtents[1];
mesh->minSpatialExtents[2] = grids[1].minSpatialExtents[2];
mesh->maxSpatialExtents[0] = grids[1].maxSpatialExtents[0];
mesh->maxSpatialExtents[1] = grids[1].maxSpatialExtents[1];
mesh->maxSpatialExtents[2] = grids[1].maxSpatialExtents[2];
// spoof a group/domain mesh
mesh->numBlocks = numGrids;
mesh->blockTitle = "Grids";
......@@ -503,13 +607,13 @@ avtEnzoFileFormat::PopulateDatabaseMetaData(avtDatabaseMetaData *md)
pmesh->groupIds = groupIds;
md->Add(pmesh);
//md->AddGroupInformation(numLevels, numGrids, groupIds);
// grid variables
for (int v = 0 ; v < varNames.size(); v++)
{
AddScalarVarToMetaData(md, varNames[v], "mesh", AVT_ZONECENT);
}
// particle variables
for (int p = 0 ; p < particleVarNames.size(); p++)
{
AddScalarVarToMetaData(md, particleVarNames[p], "particles",
......@@ -548,8 +652,8 @@ avtEnzoFileFormat::PopulateDatabaseMetaData(avtDatabaseMetaData *md)
// meshname The name of the mesh of interest. This can be ignored if
// there is only one mesh.
//
// Programmer: meredith -- generated by xml2avt
// Creation: Fri Dec 3 17:19:52 PST 2004
// Programmer: Jeremy Meredith
// Creation: January 6, 2005
//
// ****************************************************************************
......@@ -560,9 +664,17 @@ avtEnzoFileFormat::GetMesh(int domain, const char *meshname)
if (string(meshname) == "mesh")
{
// rectilinear mesh
BuildDomainNesting(); // <<=== causing crashes!
// HACK HACK HACK
// There is a bug in VisIt versions before 1.4.2 that will apply
// the domain nesting from the AMR mesh to the particles, and
// cause a crash. We add the nesting here -- i.e. at the last
// possible moment -- so that the particle mesh can delete the
// nesting info if it needs to. For version 1.4.2 and later,
// this call to BuildDomainNesting should go into something like
// PopulateDatabaseMetaData.
BuildDomainNesting();
// rectilinear mesh
vtkFloatArray *coords[3];
int i;
int d = domain+1;
......@@ -590,6 +702,16 @@ avtEnzoFileFormat::GetMesh(int domain, const char *meshname)
}
else
{
// HACK HACK HACK
// There is a bug in VisIt versions before 1.4.2 that will apply
// the domain nesting from the AMR mesh to the particles, and
// cause a crash. We delete the nesting before particle plots for now.
void_ref_ptr nr;
cache->CacheVoidRef("any_mesh", AUXILIARY_DATA_DOMAIN_BOUNDARY_INFORMATION,
timestep, -1, nr);
cache->CacheVoidRef("any_mesh", AUXILIARY_DATA_DOMAIN_NESTING_INFORMATION,
timestep, -1, nr);
// particle mesh
char gridFileName[1000];
sprintf(gridFileName, "%s.grid%04d", fname_base.c_str(), domain+1);
......@@ -931,3 +1053,46 @@ avtEnzoFileFormat::GetVectorVar(int domain, const char *varname)
{
return NULL;
}
// ****************************************************************************
// Method: avtEnzoFileFormat::GetAuxiliaryData
//
// Purpose:
// Right now this only supports spatial interval trees. There is no
// other information like materials and species available.
//
// Arguments:
// type the kind of auxiliary data to create
//