Hi Ian, I have the following patch that fixes the EnSightReader for the files you sent to Utkarsh. Would you mind trying it out? If you have other files you can try it on, please do so.
You'll have to build ParaView from the repository: http://www.paraview.org/Wiki/ParaView:Build_And_Install http://www.paraview.org/Wiki/ParaView/Git And then apply this patch in ParaView/VTK git apply --stat ensight.patch Thanks, Dan On Fri, Nov 14, 2014 at 10:39 PM, Utkarsh Ayachit < [email protected]> wrote: > Ability to change filenames depends on specific reader > implementations. I am not entire familiar with the internal > implementation, but if you have a couple of sample datasets/script to > reproduce the segfault, I can check if its a minor fix to the reader > to enable this or if it just can't support it. > > Either case, you should be able to call Delete(reader) to delete old > reader once you're done with it to avoid memory bloat. > > Utkarsh > > On Tue, Nov 11, 2014 at 8:39 AM, Ian Krukow <[email protected]> > wrote: > > Hi all, > > > > I want to apply the same pipeline to a series of Ensight data files in > order > > to save extractions in a different format. For the first file, this works > > fine. For the second file, I thought I could change the input file by > > changing the CaseFileName attribute: > > > > reader.CaseFileName = nextfile > > > > But when I run > > > > reader.UpdatePipeline() > > > > I get a segmentation fault. This depends neither on the file, nor on the > > pipeline following. > > > > I tried a workaround by building up a new pipeline for each file. It > works, > > and as I have only two files by now, it is ok to do that, but for more > > files, memory usage would explode. Therefore, my question is: Is it > possible > > only to change the input file of the EnSightReader, while keeping the > > pipeline? > > > > Kind regards > > Ian > > _______________________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > Please keep messages on-topic and check the ParaView Wiki at: > > http://paraview.org/Wiki/ParaView > > > > Follow this link to subscribe/unsubscribe: > > http://public.kitware.com/mailman/listinfo/paraview > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the ParaView Wiki at: > http://paraview.org/Wiki/ParaView > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/paraview >
From c2694aff73b86ec3d2fe0514fa7a294a0c997b4e Mon Sep 17 00:00:00 2001 From: Dan Lipsa <[email protected]> Date: Thu, 11 Dec 2014 13:01:38 -0500 Subject: [PATCH] FIX: EnSightReader does not crash if you change CaseFileName Change-Id: Ieee311ef497b505d468e63f61592fc5f435ee859 --- IO/EnSight/vtkEnSightReader.cxx | 7 +++++++ IO/EnSight/vtkEnSightReader.h | 2 ++ IO/EnSight/vtkGenericEnSightReader.cxx | 7 +++++++ IO/EnSight/vtkGenericEnSightReader.h | 6 ++++++ 4 files changed, 22 insertions(+) diff --git a/IO/EnSight/vtkEnSightReader.cxx b/IO/EnSight/vtkEnSightReader.cxx index 4913d18..60dd27a 100644 --- a/IO/EnSight/vtkEnSightReader.cxx +++ b/IO/EnSight/vtkEnSightReader.cxx @@ -160,6 +160,13 @@ vtkEnSightReader::~vtkEnSightReader() } //---------------------------------------------------------------------------- +void vtkEnSightReader::ClearForNewCaseFileName() +{ + this->UnstructuredPartIds->Reset(); + vtkGenericEnSightReader::ClearForNewCaseFileName(); +} + +//---------------------------------------------------------------------------- int vtkEnSightReader::RequestData( vtkInformation *vtkNotUsed(request), vtkInformationVector **vtkNotUsed(inputVector), diff --git a/IO/EnSight/vtkEnSightReader.h b/IO/EnSight/vtkEnSightReader.h index 8e8d8ce..ffd0a0f 100644 --- a/IO/EnSight/vtkEnSightReader.h +++ b/IO/EnSight/vtkEnSightReader.h @@ -116,6 +116,8 @@ protected: vtkInformationVector**, vtkInformationVector*); + virtual void ClearForNewCaseFileName(); + // Description: // Set the Measured file name. vtkSetStringMacro(MeasuredFileName); diff --git a/IO/EnSight/vtkGenericEnSightReader.cxx b/IO/EnSight/vtkGenericEnSightReader.cxx index c3ac7df..67bc9df 100644 --- a/IO/EnSight/vtkGenericEnSightReader.cxx +++ b/IO/EnSight/vtkGenericEnSightReader.cxx @@ -599,6 +599,12 @@ int vtkGenericEnSightReader::DetermineEnSightVersion(int quiet) } //---------------------------------------------------------------------------- +void vtkGenericEnSightReader::ClearForNewCaseFileName() +{ + this->TranslationTable->PartIdMap.clear(); +} + +//---------------------------------------------------------------------------- void vtkGenericEnSightReader::SetCaseFileName(const char* fileName) { char *endingSlash; @@ -624,6 +630,7 @@ void vtkGenericEnSightReader::SetCaseFileName(const char* fileName) this->CaseFileName = NULL; } + this->ClearForNewCaseFileName(); this->Modified(); if (!this->CaseFileName) { diff --git a/IO/EnSight/vtkGenericEnSightReader.h b/IO/EnSight/vtkGenericEnSightReader.h index 75be7ac..359f13e 100644 --- a/IO/EnSight/vtkGenericEnSightReader.h +++ b/IO/EnSight/vtkGenericEnSightReader.h @@ -237,6 +237,12 @@ protected: vtkInformationVector*); // Description: + // Clear data structures such that setting a new case file name works. + // WARNING: Derived classes should call the base version after they clear + // their own structures. + virtual void ClearForNewCaseFileName(); + + // Description: // Internal function to read in a line up to 256 characters. // Returns zero if there was an error. int ReadLine(char result[256]); -- 2.1.1
_______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/paraview
