Commit 4660ebd2 authored by js9's avatar js9
Browse files

Some related changes:

- have VTK reader set topo dim properly for
  1D meshes in 2D/3D space, or 2D meshes in 3D space
- have facelist filter properly handle some
  cases of mixed-topological-dimension meshes
- have tecplot allow topoDim<spatialDim meshes through
  without forcing them to be point meshes


git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@8904 18c085ea-50e0-402c-830e-de6fd14e8384
parent 49461444
......@@ -267,6 +267,11 @@ avtFacelistFilter::SetCreateEdgeListFor2DDatasets(bool val)
// Hank Childs, Thu Dec 28 09:10:40 PST 2006
// Renamed method to ExecuteDataTree.
//
// Jeremy Meredith, Mon Nov 9 13:06:08 EST 2009
// Add a test to see if we have a lower-topo-dimension domain than
// was advertised in the contract. (This can come up if you have
// a data set with different topological dimensions in different domains.)
//
// ****************************************************************************
avtDataTree_p
......@@ -298,6 +303,25 @@ avtFacelistFilter::ExecuteDataTree(vtkDataSet *in_ds, int domain,
cells->Delete();
}
// We currently don't have a topological dimension on a per-domain
// basis, so let's try to check in little more detail to be sure.....
if (in_ds->GetDataObjectType() == VTK_STRUCTURED_GRID)
{
vtkStructuredGrid *sgrid = (vtkStructuredGrid *) in_ds;
int dims[3];
sgrid->GetDimensions(dims);
if ((dims[0] == 1 && dims[1] == 1) ||
(dims[0] == 1 && dims[2] == 1) ||
(dims[1] == 1 && dims[2] == 1))
{
tDim = 1;
}
else if (dims[0] == 1 || dims[1] == 1 || dims[2] == 1)
{
tDim = 2;
}
}
vtkDataSet *out_ds = NULL;
avtDataTree_p out_dt;
switch (tDim)
......
......@@ -746,6 +746,13 @@ avtTecplotFileFormat::ParseBLOCK(int numI, int numJ, int numK)
// Mark C. Miller, Tue Sep 1 10:52:13 PDT 2009
// Made it deal with POINT zones that contain more spatial dimensions
// than topological ones.
//
// Jeremy Meredith, Mon Nov 9 13:04:25 EST 2009
// Don't force an M-topo-dimension zone in a N-spatial-dimension block
// (where M<N) to become a point mesh. These types of blocks are
// perfectly valid, but extra support may need to be added to VisIt
// proper to handle them correctly.
//
// ****************************************************************************
void
avtTecplotFileFormat::ParsePOINT(int numI, int numJ, int numK)
......@@ -760,11 +767,6 @@ avtTecplotFileFormat::ParsePOINT(int numI, int numJ, int numK)
else
topologicalDimensionOfZone = 3;
// If we have fewer topological dimenions than spatial dimensions,
// then the only reasonable thing is zero topological dimension.
if (topologicalDimensionOfZone < spatialDimension)
topologicalDimensionOfZone = 0;
topologicalDimension = MAX(topologicalDimension, topologicalDimensionOfZone);
int numElementsI = (numI <= 1) ? 1 : numI-1;
......
......@@ -695,6 +695,10 @@ avtVTKFileFormat::FreeUpResources(void)
// added expressions to extract their components. I also added support
// label variables.
//
// Jeremy Meredith, Mon Nov 9 13:03:18 EST 2009
// Expand the test for lower topological dimensions to include
// structured grids.
//
// ****************************************************************************
void
......@@ -743,7 +747,7 @@ avtVTKFileFormat::PopulateDatabaseMetaData(avtDatabaseMetaData *md)
}
//
// See if we have a point mesh.
// Some mesh types can have a lower topological dimension
//
if (vtkType == VTK_UNSTRUCTURED_GRID)
{
......@@ -764,6 +768,22 @@ avtVTKFileFormat::PopulateDatabaseMetaData(avtDatabaseMetaData *md)
types->Delete();
}
else if (vtkType == VTK_STRUCTURED_GRID)
{
vtkStructuredGrid *sgrid = (vtkStructuredGrid *) dataset;
int dims[3];
sgrid->GetDimensions(dims);
if ((dims[0] == 1 && dims[1] == 1) ||
(dims[0] == 1 && dims[2] == 1) ||
(dims[1] == 1 && dims[2] == 1))
{
topo = 1;
}
else if (dims[0] == 1 || dims[1] == 1 || dims[2] == 1)
{
topo = 2;
}
}
else if (vtkType == VTK_POLY_DATA)
{
vtkPolyData *pd = (vtkPolyData *) dataset;
......
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