Attached Files | tensor_sample.zip [^] (14,209 bytes) 2010-04-30 02:04
tensor.PNG [^] (118,964 bytes) 2011-05-23 21:42
0001-Fix-for-bug-0010637-EnSight-symmetric-tensor-compone.patch [^] (5,787 bytes) 2015-09-13 09:45 [Show Content] [Hide Content]From eb3b0379c3327a988e6ee830d32811080fd9bf21 Mon Sep 17 00:00:00 2001
From: Yvan Fournier <yvan.fournier@edf.fr>
Date: Sun, 13 Sep 2015 15:34:46 +0200
Subject: [PATCH] Fix for bug 0010637 (EnSight symmetric tensor components XZ
and YZ are interchanged).
---
.../Default/vtkPEnSightGoldBinaryReader.cxx | 6 +++---
.../VTKExtensions/Default/vtkPEnSightGoldReader.cxx | 17 +++++++++++------
VTK | 2 +-
3 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/ParaViewCore/VTKExtensions/Default/vtkPEnSightGoldBinaryReader.cxx b/ParaViewCore/VTKExtensions/Default/vtkPEnSightGoldBinaryReader.cxx
index 2781071..8d60782 100644
--- a/ParaViewCore/VTKExtensions/Default/vtkPEnSightGoldBinaryReader.cxx
+++ b/ParaViewCore/VTKExtensions/Default/vtkPEnSightGoldBinaryReader.cxx
@@ -1893,8 +1893,8 @@ int vtkPEnSightGoldBinaryReader::ReadTensorsPerNode(
this->ReadFloatArray(comp2, numPts);
this->ReadFloatArray(comp3, numPts);
this->ReadFloatArray(comp4, numPts);
- this->ReadFloatArray(comp5, numPts);
this->ReadFloatArray(comp6, numPts);
+ this->ReadFloatArray(comp5, numPts);
for (i = 0; i < numPts; i++)
{
tuple[0] = comp1[i];
@@ -2607,8 +2607,8 @@ int vtkPEnSightGoldBinaryReader::ReadTensorsPerElement(
this->ReadFloatArray(comp2, numCells);
this->ReadFloatArray(comp3, numCells);
this->ReadFloatArray(comp4, numCells);
- this->ReadFloatArray(comp5, numCells);
this->ReadFloatArray(comp6, numCells);
+ this->ReadFloatArray(comp5, numCells);
for (i = 0; i < numCells; i++)
{
tuple[0] = comp1[i];
@@ -2662,8 +2662,8 @@ int vtkPEnSightGoldBinaryReader::ReadTensorsPerElement(
this->ReadFloatArray(comp2, numCellsPerElement);
this->ReadFloatArray(comp3, numCellsPerElement);
this->ReadFloatArray(comp4, numCellsPerElement);
- this->ReadFloatArray(comp5, numCellsPerElement);
this->ReadFloatArray(comp6, numCellsPerElement);
+ this->ReadFloatArray(comp5, numCellsPerElement);
for (i = 0; i < numCellsPerElement; i++)
{
tuple[0] = comp1[i];
diff --git a/ParaViewCore/VTKExtensions/Default/vtkPEnSightGoldReader.cxx b/ParaViewCore/VTKExtensions/Default/vtkPEnSightGoldReader.cxx
index 302340d..0d6b019 100644
--- a/ParaViewCore/VTKExtensions/Default/vtkPEnSightGoldReader.cxx
+++ b/ParaViewCore/VTKExtensions/Default/vtkPEnSightGoldReader.cxx
@@ -841,6 +841,7 @@ int vtkPEnSightGoldReader::ReadTensorsPerNode(const char* fileName, const char*
int timeStep, vtkMultiBlockDataSet *compositeOutput)
{
char line[256];
+ int symmTensorOrder[6] = {0, 1, 2, 3, 5, 4};
int partId, realId, numPts, i, j;
vtkFloatArray *tensors;
vtkDataSet *output;
@@ -946,7 +947,8 @@ int vtkPEnSightGoldReader::ReadTensorsPerNode(const char* fileName, const char*
//tensors->InsertComponent(j, i, atof(line));
// Same behaviour as Vector Per Node variables: we inject data as component,
// and not as tuple.
- this->InsertVariableComponent(tensors, j, i, &val, realId, 0, SCALAR_PER_NODE);
+ this->InsertVariableComponent(tensors, j, symmTensorOrder[i],
+ &val, realId, 0, SCALAR_PER_NODE);
}
}
tensors->SetName(description);
@@ -1344,11 +1346,12 @@ int vtkPEnSightGoldReader::ReadVectorsPerElement(const char* fileName,
//----------------------------------------------------------------------------
int vtkPEnSightGoldReader::ReadTensorsPerElement(const char* fileName,
- const char* description,
- int timeStep,
- vtkMultiBlockDataSet *compositeOutput)
+ const char* description,
+ int timeStep,
+ vtkMultiBlockDataSet *compositeOutput)
{
char line[256];
+ int symmTensorOrder[6] = {0, 1, 2, 3, 5, 4};
int partId, realId, numCells, numCellsPerElement, i, j, idx;
vtkFloatArray *tensors;
int lineRead, elementType;
@@ -1458,7 +1461,8 @@ int vtkPEnSightGoldReader::ReadTensorsPerElement(const char* fileName,
this->ReadNextDataLine(line);
value = atof(line);
//tensors->InsertComponent(j, i, value);
- this->InsertVariableComponent(tensors,j,i,&value,realId,0,SCALAR_PER_ELEMENT);
+ this->InsertVariableComponent(tensors,j,symmTensorOrder[i],
+ &value,realId,0,SCALAR_PER_ELEMENT);
}
}
lineRead = this->ReadNextDataLine(line);
@@ -1488,7 +1492,8 @@ int vtkPEnSightGoldReader::ReadTensorsPerElement(const char* fileName,
value = atof(line);
//tensors->InsertComponent(this->GetCellIds(idx, elementType)->GetId(j),
// i, value);
- this->InsertVariableComponent(tensors, j, i, &value, idx, elementType, SCALAR_PER_ELEMENT);
+ this->InsertVariableComponent(tensors, j, symmTensorOrder[i],
+ &value, idx, elementType, SCALAR_PER_ELEMENT);
}
}
lineRead = this->ReadNextDataLine(line);
diff --git a/VTK b/VTK
index 97cc876..78fd1f9 160000
--- a/VTK
+++ b/VTK
@@ -1 +1 @@
-Subproject commit 97cc8760d4019e8ba12cef50df8b011df4dc6510
+Subproject commit 78fd1f911c30dcd1eb66fa87217172feb4fc9204
--
2.5.1
0002-Fix-for-bug-0010637-EnSight-symmetric-tensor-compone.patch [^] (8,323 bytes) 2015-09-13 09:45 [Show Content] [Hide Content]From 78fd1f911c30dcd1eb66fa87217172feb4fc9204 Mon Sep 17 00:00:00 2001
From: Yvan Fournier <yvan.fournier@edf.fr>
Date: Sun, 13 Sep 2015 15:34:39 +0200
Subject: [PATCH] Fix for bug 0010637 (EnSight symmetric tensor components XZ
and YZ are interchanged).
---
IO/EnSight/vtkEnSight6BinaryReader.cxx | 16 ++++++++--------
IO/EnSight/vtkEnSight6Reader.cxx | 8 ++++----
IO/EnSight/vtkEnSightGoldBinaryReader.cxx | 6 +++---
IO/EnSight/vtkEnSightGoldReader.cxx | 8 +++++---
4 files changed, 20 insertions(+), 18 deletions(-)
diff --git a/IO/EnSight/vtkEnSight6BinaryReader.cxx b/IO/EnSight/vtkEnSight6BinaryReader.cxx
index 7bf332c..51eaf3c 100644
--- a/IO/EnSight/vtkEnSight6BinaryReader.cxx
+++ b/IO/EnSight/vtkEnSight6BinaryReader.cxx
@@ -1457,8 +1457,8 @@ int vtkEnSight6BinaryReader::ReadTensorsPerNode(
tensor[1] = tensorsRead[6*i+1];
tensor[2] = tensorsRead[6*i+2];
tensor[3] = tensorsRead[6*i+3];
- tensor[4] = tensorsRead[6*i+4];
- tensor[5] = tensorsRead[6*i+5];
+ tensor[4] = tensorsRead[6*i+5];
+ tensor[5] = tensorsRead[6*i+4];
tensors->InsertTuple(i, tensor);
}
@@ -1495,8 +1495,8 @@ int vtkEnSight6BinaryReader::ReadTensorsPerNode(
tensor[1] = tensorsRead[6*i+1];
tensor[2] = tensorsRead[6*i+2];
tensor[3] = tensorsRead[6*i+3];
- tensor[4] = tensorsRead[6*i+4];
- tensor[5] = tensorsRead[6*i+5];
+ tensor[4] = tensorsRead[6*i+5];
+ tensor[5] = tensorsRead[6*i+4];
tensors->InsertTuple(i, tensor);
}
@@ -2057,8 +2057,8 @@ int vtkEnSight6BinaryReader::ReadTensorsPerElement(
tensor[1] = tensorsRead[6*i+1];
tensor[2] = tensorsRead[6*i+2];
tensor[3] = tensorsRead[6*i+3];
- tensor[4] = tensorsRead[6*i+4];
- tensor[5] = tensorsRead[6*i+5];
+ tensor[4] = tensorsRead[6*i+5];
+ tensor[5] = tensorsRead[6*i+4];
tensors->InsertTuple(this->GetCellIds(idx, elementType)->GetId(i),
tensor);
@@ -2078,8 +2078,8 @@ int vtkEnSight6BinaryReader::ReadTensorsPerElement(
tensor[1] = tensorsRead[6*i+1];
tensor[2] = tensorsRead[6*i+2];
tensor[3] = tensorsRead[6*i+3];
- tensor[4] = tensorsRead[6*i+4];
- tensor[5] = tensorsRead[6*i+5];
+ tensor[4] = tensorsRead[6*i+5];
+ tensor[5] = tensorsRead[6*i+4];
tensors->InsertTuple(i, tensor);
}
delete [] tensorsRead;
diff --git a/IO/EnSight/vtkEnSight6Reader.cxx b/IO/EnSight/vtkEnSight6Reader.cxx
index 948e972..950b443 100644
--- a/IO/EnSight/vtkEnSight6Reader.cxx
+++ b/IO/EnSight/vtkEnSight6Reader.cxx
@@ -993,7 +993,7 @@ int vtkEnSight6Reader::ReadTensorsPerNode(
{
vtkEnSight6ReaderRead3(line, " %12e %12e %12e %12e %12e %12e",
&tensor[0], &tensor[1],
- &tensor[2], &tensor[3], &tensor[4], &tensor[5]);
+ &tensor[2], &tensor[3], &tensor[5], &tensor[4]);
tensors->InsertTuple(i, tensor);
lineRead = this->ReadNextDataLine(line);
}
@@ -1032,7 +1032,7 @@ int vtkEnSight6Reader::ReadTensorsPerNode(
this->ReadNextDataLine(line);
vtkEnSight6ReaderRead3(line, " %12e %12e %12e %12e %12e %12e",
&values[0], &values[1],
- &values[2], &values[3], &values[4], &values[5]);
+ &values[2], &values[3], &values[5], &values[4]);
for (j = 0; j < 6; j++)
{
tensors->InsertComponent(i*6 + j, k, values[j]);
@@ -1506,7 +1506,7 @@ int vtkEnSight6Reader::ReadTensorsPerElement(
this->ReadNextDataLine(line);
vtkEnSight6ReaderRead3(line, " %12e %12e %12e %12e %12e %12e",
&values[0], &values[1], &values[2],
- &values[3], &values[4], &values[5]);
+ &values[3], &values[5], &values[4]);
for (j = 0; j < 6; j++)
{
tensors->InsertComponent(i*6 + j, k, values[j]);
@@ -1546,7 +1546,7 @@ int vtkEnSight6Reader::ReadTensorsPerElement(
this->ReadNextDataLine(line);
vtkEnSight6ReaderRead3(line, " %12e %12e %12e %12e %12e %12e",
&tensor[0], &tensor[1], &tensor[2],
- &tensor[3], &tensor[4], &tensor[5]);
+ &tensor[3], &tensor[5], &tensor[4]);
tensors->InsertTuple(this->GetCellIds(idx, elementType)->GetId(i),
tensor);
}
diff --git a/IO/EnSight/vtkEnSightGoldBinaryReader.cxx b/IO/EnSight/vtkEnSightGoldBinaryReader.cxx
index 27406c4..8253f80 100644
--- a/IO/EnSight/vtkEnSightGoldBinaryReader.cxx
+++ b/IO/EnSight/vtkEnSightGoldBinaryReader.cxx
@@ -1798,8 +1798,8 @@ int vtkEnSightGoldBinaryReader::ReadTensorsPerNode(
this->ReadFloatArray(comp2, numPts);
this->ReadFloatArray(comp3, numPts);
this->ReadFloatArray(comp4, numPts);
- this->ReadFloatArray(comp5, numPts);
this->ReadFloatArray(comp6, numPts);
+ this->ReadFloatArray(comp5, numPts);
for (i = 0; i < numPts; i++)
{
tuple[0] = comp1[i];
@@ -2475,8 +2475,8 @@ int vtkEnSightGoldBinaryReader::ReadTensorsPerElement(
this->ReadFloatArray(comp2, numCells);
this->ReadFloatArray(comp3, numCells);
this->ReadFloatArray(comp4, numCells);
- this->ReadFloatArray(comp5, numCells);
this->ReadFloatArray(comp6, numCells);
+ this->ReadFloatArray(comp5, numCells);
for (i = 0; i < numCells; i++)
{
tuple[0] = comp1[i];
@@ -2530,8 +2530,8 @@ int vtkEnSightGoldBinaryReader::ReadTensorsPerElement(
this->ReadFloatArray(comp2, numCellsPerElement);
this->ReadFloatArray(comp3, numCellsPerElement);
this->ReadFloatArray(comp4, numCellsPerElement);
- this->ReadFloatArray(comp5, numCellsPerElement);
this->ReadFloatArray(comp6, numCellsPerElement);
+ this->ReadFloatArray(comp5, numCellsPerElement);
for (i = 0; i < numCellsPerElement; i++)
{
tuple[0] = comp1[i];
diff --git a/IO/EnSight/vtkEnSightGoldReader.cxx b/IO/EnSight/vtkEnSightGoldReader.cxx
index 51c9457..3e9b640 100644
--- a/IO/EnSight/vtkEnSightGoldReader.cxx
+++ b/IO/EnSight/vtkEnSightGoldReader.cxx
@@ -815,6 +815,7 @@ int vtkEnSightGoldReader::ReadTensorsPerNode(const char* fileName, const char* d
int timeStep, vtkMultiBlockDataSet *compositeOutput)
{
char line[256];
+ int symmTensorOrder[6] = {0, 1, 2, 3, 5, 4};
int partId, realId, numPts, i, j;
vtkFloatArray *tensors;
vtkDataSet *output;
@@ -913,7 +914,7 @@ int vtkEnSightGoldReader::ReadTensorsPerNode(const char* fileName, const char* d
for (j = 0; j < numPts; j++)
{
this->ReadNextDataLine(line);
- tensors->InsertComponent(j, i, atof(line));
+ tensors->InsertComponent(j, symmTensorOrder[i], atof(line));
}
}
tensors->SetName(description);
@@ -1307,6 +1308,7 @@ int vtkEnSightGoldReader::ReadTensorsPerElement(const char* fileName,
vtkMultiBlockDataSet *compositeOutput)
{
char line[256];
+ int symmTensorOrder[6] = {0, 1, 2, 3, 5, 4};
int partId, realId, numCells, numCellsPerElement, i, j, idx;
vtkFloatArray *tensors;
int lineRead, elementType;
@@ -1413,7 +1415,7 @@ int vtkEnSightGoldReader::ReadTensorsPerElement(const char* fileName,
{
this->ReadNextDataLine(line);
value = atof(line);
- tensors->InsertComponent(j, i, value);
+ tensors->InsertComponent(j, symmTensorOrder[i], value);
}
}
lineRead = this->ReadNextDataLine(line);
@@ -1442,7 +1444,7 @@ int vtkEnSightGoldReader::ReadTensorsPerElement(const char* fileName,
this->ReadNextDataLine(line);
value = atof(line);
tensors->InsertComponent(this->GetCellIds(idx, elementType)->GetId(j),
- i, value);
+ symmTensorOrder[i], value);
}
}
lineRead = this->ReadNextDataLine(line);
--
2.5.1
|