Commit b82379c0 authored by Zhanping Liu's avatar Zhanping Liu

BUG: fixed bug 10413 about writing vector cell data by correcting

the loop order.

Added support for cell types VTK_POLYGON and
VTK_CONVEX_POINT_SET.
parent 08a75a7d
......@@ -86,7 +86,7 @@
//----------------------------------------------------------------------------
vtkStandardNewMacro(vtkEnSightWriter);
vtkCxxRevisionMacro(vtkEnSightWriter, "1.6");
vtkCxxRevisionMacro(vtkEnSightWriter, "1.7");
vtkCxxSetObjectMacro(vtkEnSightWriter, ModelMetadata, vtkModelMetadata);
......@@ -564,10 +564,12 @@ void vtkEnSightWriter::WriteData()
elementTypes.push_back(VTK_LINE);
elementTypes.push_back(VTK_TRIANGLE);
elementTypes.push_back(VTK_QUAD);
elementTypes.push_back(VTK_POLYGON);
elementTypes.push_back(VTK_TETRA);
elementTypes.push_back(VTK_HEXAHEDRON);
elementTypes.push_back(VTK_WEDGE);
elementTypes.push_back(VTK_PYRAMID);
elementTypes.push_back(VTK_CONVEX_POINT_SET);
elementTypes.push_back(VTK_QUADRATIC_EDGE);
elementTypes.push_back(VTK_QUADRATIC_TRIANGLE);
elementTypes.push_back(VTK_QUADRATIC_QUAD);
......@@ -579,10 +581,12 @@ void vtkEnSightWriter::WriteData()
elementTypes.push_back(this->GhostLevelMultiplier+VTK_LINE);
elementTypes.push_back(this->GhostLevelMultiplier+VTK_TRIANGLE);
elementTypes.push_back(this->GhostLevelMultiplier+VTK_QUAD);
elementTypes.push_back(this->GhostLevelMultiplier+VTK_POLYGON);
elementTypes.push_back(this->GhostLevelMultiplier+VTK_TETRA);
elementTypes.push_back(this->GhostLevelMultiplier+VTK_HEXAHEDRON);
elementTypes.push_back(this->GhostLevelMultiplier+VTK_WEDGE);
elementTypes.push_back(this->GhostLevelMultiplier+VTK_PYRAMID);
elementTypes.push_back(this->GhostLevelMultiplier+VTK_CONVEX_POINT_SET);
elementTypes.push_back(this->GhostLevelMultiplier+VTK_QUADRATIC_EDGE);
elementTypes.push_back(this->GhostLevelMultiplier+VTK_QUADRATIC_TRIANGLE);
elementTypes.push_back(this->GhostLevelMultiplier+VTK_QUADRATIC_QUAD);
......@@ -636,17 +640,16 @@ void vtkEnSightWriter::WriteData()
//figure out what type of data it is
int DataSize=DataArray->GetNumberOfComponents();
for (int CurrentDimension=0;
CurrentDimension<DataSize;
CurrentDimension++)
for (unsigned int k=0;k<elementTypes.size();k++)
{
for (unsigned int k=0;k<elementTypes.size();k++)
if (CellsByElement[elementTypes[k]].size()>0)
{
if (CellsByElement[elementTypes[k]].size()>0)
this->WriteElementTypeToFile(elementTypes[k],
cellArrayFiles[j]);
for (unsigned int m=0;m<CellsByElement[elementTypes[k]].size();m++)
{
this->WriteElementTypeToFile(elementTypes[k],
cellArrayFiles[j]);
for (unsigned int m=0;m<CellsByElement[elementTypes[k]].size();m++)
for ( int CurrentDimension = 0; CurrentDimension < DataSize;
CurrentDimension ++ )
{
this->WriteFloatToFile
( (float)
......@@ -661,8 +664,6 @@ void vtkEnSightWriter::WriteData()
}
}
}
}
//now write the empty blocks
......@@ -1048,6 +1049,9 @@ void vtkEnSightWriter::WriteElementTypeToFile(int elementType,FILE* fd)
case(VTK_QUAD):
this->WriteStringToFile("quad4",fd);
break;
case(VTK_POLYGON):
this->WriteStringToFile("nsided",fd);
break;
case(VTK_TETRA):
this->WriteStringToFile("tetra4",fd);
break;
......@@ -1060,6 +1064,9 @@ void vtkEnSightWriter::WriteElementTypeToFile(int elementType,FILE* fd)
case(VTK_PYRAMID):
this->WriteStringToFile("pyramid5",fd);
break;
case(VTK_CONVEX_POINT_SET):
this->WriteStringToFile("nfaced",fd);
break;
case(VTK_QUADRATIC_EDGE):
this->WriteStringToFile("bar3",fd);
break;
......@@ -1099,6 +1106,9 @@ void vtkEnSightWriter::WriteElementTypeToFile(int elementType,FILE* fd)
case(VTK_QUAD):
this->WriteStringToFile("g_quad4",fd);
break;
case(VTK_POLYGON):
this->WriteStringToFile("g_nsided",fd);
break;
case(VTK_TETRA):
this->WriteStringToFile("g_tetra4",fd);
break;
......@@ -1111,6 +1121,9 @@ void vtkEnSightWriter::WriteElementTypeToFile(int elementType,FILE* fd)
case(VTK_PYRAMID):
this->WriteStringToFile("g_pyramid5",fd);
break;
case(VTK_CONVEX_POINT_SET):
this->WriteStringToFile("g_nfaced",fd);
break;
case(VTK_QUADRATIC_EDGE):
this->WriteStringToFile("g_bar3",fd);
break;
......
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