Commit c4efd6a9 authored by miller86's avatar miller86

2.9RC->Trunk fixing bugs in Exodus plugin

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@25594 18c085ea-50e0-402c-830e-de6fd14e8384
parent 1a67beb9
......@@ -40,6 +40,8 @@
// avtDataObjectToDatasetFilter.C //
// ************************************************************************* //
#include <snprintf.h>
#include <avtDataObjectToDatasetFilter.h>
#include <avtCommonDataFunctions.h>
......@@ -171,10 +173,13 @@ avtDataObjectToDatasetFilter::PostExecute(void)
if ((atts.GetSpatialDimension()==3 && atts.GetTopologicalDimension()<3) ||
(atts.GetSpatialDimension()==2 && atts.GetTopologicalDimension()<2))
{
char dimDataStr[32];
debug3 << "avtDataObjectToDatastFilter converting ugrids to polydata "
<< "in postex." << endl;
int t0 = visitTimer->StartTimer();
tree->Traverse(CConvertUnstructuredGridToPolyData, NULL, dummy);
SNPRINTF(dimDataStr, sizeof(dimDataStr),
"avtTopoDim=%d", atts.GetTopologicalDimension());
tree->Traverse(CConvertUnstructuredGridToPolyData, dimDataStr, dummy);
visitTimer->StopTimer(t0, "converting ugrids to polydata in postex");
}
......
......@@ -488,7 +488,7 @@ CGetNumberOfOriginalZones(avtDataRepresentation &data, void *arg, bool &)
// ****************************************************************************
void
CConvertUnstructuredGridToPolyData(avtDataRepresentation &data, void *, bool &)
CConvertUnstructuredGridToPolyData(avtDataRepresentation &data, void *dataAndKey, bool &)
{
if (!data.Valid())
{
......@@ -500,6 +500,15 @@ CConvertUnstructuredGridToPolyData(avtDataRepresentation &data, void *, bool &)
{
vtkUnstructuredGrid *ugrid = (vtkUnstructuredGrid *) ds;
vtkPolyData *out_pd = vtkPolyData::New();
int avtTopoDim = 2;
if (dataAndKey)
{
int intVal;
if (sscanf((char*)dataAndKey, "avtTopoDim=%d", &intVal) == 1)
avtTopoDim = intVal;
}
out_pd->SetPoints(ugrid->GetPoints());
out_pd->GetPointData()->ShallowCopy(ugrid->GetPointData());
out_pd->GetCellData()->ShallowCopy(ugrid->GetCellData());
......@@ -508,60 +517,32 @@ CConvertUnstructuredGridToPolyData(avtDataRepresentation &data, void *, bool &)
out_pd->Allocate(ncells);
for (vtkIdType i = 0 ; i < ncells ; i++)
{
int celltype = ugrid->GetCellType(i);
if (celltype == VTK_HEXAHEDRON ||
celltype == VTK_VOXEL ||
celltype == VTK_WEDGE ||
celltype == VTK_TETRA ||
celltype == VTK_PYRAMID ||
celltype == VTK_QUADRATIC_TETRA ||
celltype == VTK_QUADRATIC_HEXAHEDRON ||
celltype == VTK_QUADRATIC_WEDGE ||
celltype == VTK_QUADRATIC_PYRAMID ||
celltype == VTK_QUADRATIC_LINEAR_QUAD ||
celltype == VTK_QUADRATIC_LINEAR_WEDGE
)
int cellTopoDim = ugrid->GetCell(i)->GetCellDimension();
if (cellTopoDim > avtTopoDim)
{
vtkIdType *pts;
static bool issuedWarning = false;
if (!issuedWarning)
{
avtCallback::IssueWarning("The data set has "
"a topologically three dimensional cell even "
"thought it supposedly is topologically 2D."
" This occurs most often when there is an error in "
"the file format reader. Your 3D cells are being "
"discarded. Please contact a VisIt developer to "
"resolve this issue. (This warning will only be "
"issued once per session.)");
avtCallback::IssueWarning("Encountered a cell of topological "
"dimension greater than the underlying dataset in which "
"it is embedded. This occurs most often when there is an "
"error in the file format reader. This cell and any others "
"like it are being discarded. Please contact a VisIt "
"developer to resolve this issue. (This warning will be "
"issued only once per session.)");
issuedWarning = true;
}
continue;
out_pd->InsertNextCell(VTK_EMPTY_CELL, 0, pts);
}
if(celltype == VTK_QUADRATIC_EDGE ||
celltype == VTK_QUADRATIC_TRIANGLE ||
celltype == VTK_QUADRATIC_QUAD
)
else
{
static bool issuedWarning2 = false;
if (!issuedWarning2)
{
avtCallback::IssueWarning("The data set has "
"a quadratic element in it and this code to "
"convert 2D elements to polydata is only capable "
"of 1:1 cell to cell translation, whereas quadratic "
"cells produce a 1:N translation. Please contact a "
"VisIt developer to resolve this issue. "
"(This warning will only be issued once per session.)");
issuedWarning2 = true;
}
continue;
vtkIdType *pts, npts;
ugrid->GetCellPoints(i, npts, pts);
out_pd->InsertNextCell(ugrid->GetCellType(i), npts, pts);
}
vtkIdType *pts, npts;
ugrid->GetCellPoints(i, npts, pts);
out_pd->InsertNextCell(celltype, npts, pts);
}
avtDataRepresentation new_data(out_pd, data.GetDomain(),
data.GetLabel());
avtDataRepresentation new_data(out_pd, data.GetDomain(), data.GetLabel());
data = new_data;
out_pd->Delete();
}
......
This diff is collapsed.
......@@ -101,10 +101,15 @@ GetExodusReadOptions(void)
"silo/LLNL-SM-654357.pdf\">Silo user's manual</a>. The nameschemes used here are identical "
"to those described in the Silo user's manual with one extension. The conversion specifier %%V "
"is used to denote the basename (non-material-specific) name of a set of scalar variables "
"holding material specific values. The ALEGRA nameschemes "
"for volume fraction and material specific variables are \"%s\" and \"%s\". The CTH "
"nameschemes are \"%s\" and \"%s\". Finally, it is assumed materials are identified starting "
"from one (1). The special material id of zero (0) is used to denote void.",
"holding material specific values."
"<p> "
"<p>The ALEGRA nameschemes for volume fraction and material specific variables are "
"\"%s\" and \"%s\"."
"<p> "
"<p>The CTH nameschemes are \"%s\" and \"%s\"."
"<p> "
"<p>Finally, it is assumed materials are identified starting from one (1). The special "
"material id of zero (0) is used to denote void.",
EXODUS_DETECT_COMPOUND_VARS,
EXODUS_MATERIAL_COUNT,
EXODUS_MATERIAL_CONVENTION,
......
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