mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: vtkUnstructuredReader: support for lines and vtkIdType
This commit is contained in:
@ -36,13 +36,14 @@ defineTypeNameAndDebug(Foam::vtkUnstructuredReader, 0);
|
||||
|
||||
template<>
|
||||
const char*
|
||||
Foam::NamedEnum<Foam::vtkUnstructuredReader::vtkDataType, 3>::names[] =
|
||||
Foam::NamedEnum<Foam::vtkUnstructuredReader::vtkDataType, 4>::names[] =
|
||||
{
|
||||
"int",
|
||||
"float",
|
||||
"string"
|
||||
"string",
|
||||
"vtkIdType"
|
||||
};
|
||||
const Foam::NamedEnum<Foam::vtkUnstructuredReader::vtkDataType, 3>
|
||||
const Foam::NamedEnum<Foam::vtkUnstructuredReader::vtkDataType, 4>
|
||||
Foam::vtkUnstructuredReader::vtkDataTypeNames;
|
||||
|
||||
|
||||
@ -384,6 +385,7 @@ void Foam::vtkUnstructuredReader::readField
|
||||
switch (vtkDataTypeNames[dataType])
|
||||
{
|
||||
case VTK_INT:
|
||||
case VTK_ID:
|
||||
{
|
||||
autoPtr<labelIOField> fieldVals
|
||||
(
|
||||
@ -724,7 +726,7 @@ void Foam::vtkUnstructuredReader::read(ISstream& inFile)
|
||||
else if (tag == "CELL_DATA")
|
||||
{
|
||||
readMode = CELL_DATA;
|
||||
wantedSize = cells_.size()+faces_.size();
|
||||
wantedSize = cells_.size()+faces_.size()+lines_.size();
|
||||
|
||||
label nCells(readLabel(inFile));
|
||||
if (nCells != wantedSize)
|
||||
|
||||
@ -25,9 +25,18 @@ Class
|
||||
Foam::vtkUnstructuredReader
|
||||
|
||||
Description
|
||||
Reader for vtk unstructured legacy files. Supports single CELLS, POINTS
|
||||
Reader for vtk unstructured_grid legacy files. Supports single CELLS, POINTS
|
||||
etc. entry only.
|
||||
|
||||
- POINTS becomes OpenFOAM points
|
||||
- CELLS gets split into OpenFOAM
|
||||
- cells
|
||||
- faces
|
||||
- lines
|
||||
- CELL_DATA or POINT_DATA gets stored on the corresponding objectRegistry
|
||||
in original vtk numbering order so use e.g. faceMap() to go from entry
|
||||
in faces() back to vtk numbering.
|
||||
|
||||
SourceFiles
|
||||
vtkUnstructuredReader.C
|
||||
|
||||
@ -61,10 +70,11 @@ public:
|
||||
{
|
||||
VTK_INT,
|
||||
VTK_FLOAT,
|
||||
VTK_STRING
|
||||
VTK_STRING,
|
||||
VTK_ID
|
||||
};
|
||||
|
||||
static const NamedEnum<vtkDataType, 3> vtkDataTypeNames;
|
||||
static const NamedEnum<vtkDataType, 4> vtkDataTypeNames;
|
||||
|
||||
|
||||
//- Enumeration defining the vtk dataset types
|
||||
|
||||
Reference in New Issue
Block a user