[Paraview] Patch for split Ensight Gold data files

Georg Bauer bauer at lnm.mw.tum.de
Wed Oct 24 02:18:16 EDT 2007


Hello Martin,

Thank you for your interesting post.
I have also problems with reading Ensight cases when they are 
distributed over several files.
I hope that your bugfix will be taken over into the Paraview code 
repository soon.

Georg

Martin Küttler wrote:
> Hello.
>
> Paraview 3.0.1 does not display Ensight Gold variables correctly when they are 
> split into multiply files. I made some changes to the file 
> VTK/IO/vtkEnSightReader.cxx that seem to solve this problem, the patch file is 
> attached.
>
> Martin.
>   
> ------------------------------------------------------------------------
>
> --- vtkEnSightReader.orig.cxx	2007-10-22 14:33:31.508910796 +0200
> +++ vtkEnSightReader.cxx	2007-10-22 14:35:09.727049046 +0200
> @@ -1216,7 +1216,7 @@
>    vtkDataArray *times;
>    float newTime;
>    vtkIdList *numStepsList, *filenameNumbers;
> -  //int fileNum;
> +  int fileNum;
>    int validTime, filenameNum;
>    char* fileName, *fileName2;
>  
> @@ -1246,7 +1246,7 @@
>  
>      timeStep = 0;
>      timeStepInFile = 1;
> -    //fileNum = 1;
> +    fileNum = 0;
>      validTime = 1;
>      fileName = new char[strlen(this->VariableFileNames[i]) + 1];
>      strcpy(fileName, this->VariableFileNames[i]);
> @@ -1302,13 +1302,14 @@
>            {
>            numSteps = numStepsList->GetId(0);
>            timeStepInFile -= numSteps;
> -          for (i = 1; i < numStepsList->GetNumberOfIds(); i++)
> +          fileNum = 1;
> +          for (j = 1; j < numStepsList->GetNumberOfIds(); j++)
>              {
> -            numSteps += numStepsList->GetId(i);
> +            numSteps += numStepsList->GetId(j);
>              if (timeStep > numSteps)
>                {
> -              //fileNum++;
> -              timeStepInFile -= numStepsList->GetId(i);
> +              fileNum++;
> +              timeStepInFile -= numStepsList->GetId(j);
>                }
>              }
>            }
> @@ -1320,7 +1321,7 @@
>              {
>              filenameNumbers = this->FileSetFileNameNumbers->
>                GetItem(collectionNum);
> -            filenameNum = filenameNumbers->GetId(timeStep-1);
> +            filenameNum = filenameNumbers->GetId(fileNum);
>              this->ReplaceWildcards(fileName, filenameNum);
>              }
>            }
> @@ -1388,7 +1389,7 @@
>        }
>      timeStep = 0;
>      timeStepInFile = 1;
> -    //fileNum = 1;
> +    fileNum = 0;
>      validTime = 1;
>      fileName = new char[strlen(this->ComplexVariableFileNames[2*i]) + 1];
>      strcpy(fileName, this->ComplexVariableFileNames[2*i]);
> @@ -1445,13 +1446,14 @@
>            {
>            numSteps = numStepsList->GetId(0);
>            timeStepInFile -= numSteps;
> -          for (i = 1; i < numStepsList->GetNumberOfIds(); i++)
> +          fileNum = 1;
> +          for (j = 1; j < numStepsList->GetNumberOfIds(); j++)
>              {
> -            numSteps += numStepsList->GetId(i);
> +            numSteps += numStepsList->GetId(j);
>              if (timeStep > numSteps)
>                {
> -              //fileNum++;
> -              timeStepInFile -= numStepsList->GetId(i);
> +              fileNum++;
> +              timeStepInFile -= numStepsList->GetId(j);
>                }
>              }
>            }
>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> ParaView mailing list
> ParaView at paraview.org
> http://www.paraview.org/mailman/listinfo/paraview
>   



More information about the ParaView mailing list