[Paraview] Using streamtracer/gradient filters on "multi-block" data set

Sohail Shafii sohailshafii at yahoo.com
Wed Mar 9 14:53:14 EST 2011


Hi,

So the reason why my required filters are greyed out after loading this CAS data set is due to a few lines in the XML file.  The streamtracer is an example:

         <DataTypeDomain name="input_type" composite_data_supported="1">
            <DataType value="vtkDataSet"/>
          </DataTypeDomain>
          <InputArrayDomain name="input_array" attribute_type="point"
                            number_of_components="3"/>

Now I did introduce a "vtkStructuredGrid" into the pipeline, which inherits from vtkDtaSet, so that shouldn't be a problem with the "DataType" portion above.  But what concerns me the "InputArrayDomain" requirement.  By default the data set loads in a bunch of 1-component arrays.  I thought that by creating the 3-component UVW array (see below), I wouldn't face any issues.  But for some reason I still do -- maybe that requirement is unfulfilled?

If anyone has any ideas, please let me know.

Sohail

--- On Wed, 3/2/11, Sohail Shafii <sohailshafii at yahoo.com> wrote:

From: Sohail Shafii <sohailshafii at yahoo.com>
Subject: Re: [Paraview] Using streamtracer/gradient filters on "multi-block" data set
To: "Berk Geveci" <berk.geveci at kitware.com>
Cc: paraview at paraview.org
Date: Wednesday, March 2, 2011, 1:46 PM

Not sure what you mean by that last statement -- do you mean transfer an array to pointdata? I tried to do this:

input = self.GetInput()
output = self.GetOuput()

output = vtk.vtkStructuredGrid()
output.ShallowCopy(input.GetBlock(0))

// create UVW array (3-component velocity array)

output.GetPointData().AddArray(UVWArray)

When I print output, I do see the added array in the point data section with the correct component and tuple count.  However, the bounds of the grid are suspect (like -0.1 to 0.3 for x; -0.1 to 2.6e-18 for y) and the grid extent is 0, -1, 0, -1, 0, -1.  

I also tried:

#yiv1702808980 p, #yiv1702808980 li {white-space:pre-wrap;}output.GetPointData().SetVectors(UVWArray)

Didn't work either. Something is still not right here...

Sohail

--- On Wed, 3/2/11, Berk Geveci <berk.geveci at kitware.com> wrote:

From: Berk Geveci <berk.geveci at kitware.com>
Subject: Re: [Paraview] Using streamtracer/gradient filters on "multi-block" data set
To: "Sohail Shafii" <sohailshafii at yahoo.com>
Cc: paraview at paraview.org
Date: Wednesday, March 2, 2011, 3:40 AM

I looks like you to apply cell data to point data.

On Tue, Mar 1, 2011 at 9:06 PM, Sohail Shafii <sohailshafii at yahoo.com> wrote:

Hi,

Let me correct myself; the block contained inside is a vtkStructuredGrid.  I did a printout what is in the pipeline (self.GetInput()):






vtkMultiBlockDataSet (0x3a7c1d0)
  Debug: Off
  Modified Time: 164250
  Reference Count: 2
  Registered Events: (none)
  Source: (none)
  Information: 0x3a7c230
  Data Released: False
  Global Release Data: Off
  UpdateTime: 164282
  Release Data: Off
  UpdateExtent: Initialized
  Update Number Of Pieces: 1
  Update Piece: 0
  Update Ghost Level: 0
  MaximumNumberOfPieces: -1
  ExtentTranslator: (0x3a7df30)
  RequestExactExtent: Off
   Field Data:
    Debug: Off
    Modified Time: 155460
    Reference Count: 1
    Registered Events: (none)
    Number Of Arrays: 0
    Number Of Components: 0
    Number Of Tuples: 0
  Number Of Children: 1
  Child 0: vtkUnstructuredGrid
    Debug: Off
    Modified Time: 164208
    Reference Count: 3
    Registered Events: (none)
    Source: (none)
    Information: 0x4920790
    Data Released: False
    Global Release Data: Off
    UpdateTime: 0
    Release Data: Off
    UpdateExtent: Not Initialized
    MaximumNumberOfPieces: 1
    RequestExactExtent: Off
     Field Data:
      Debug: Off
      Modified Time: 164167
      Reference Count: 1
      Registered Events: (none)
      Number Of Arrays: 0
      Number Of Components: 0
      Number Of Tuples: 0
    Number Of Points: 34943
    Number Of Cells: 31488
    Cell Data:
      Debug: Off
      Modified Time: 164206
      Reference Count: 1
      Registered Events: (none)
      Number Of Arrays: 24
      Array 0 name = PRESSURE
      Array 1 name = X_VELOCITY
      Array 2 name = X_VELOCITY_M1
      Array 3 name = X_VELOCITY_M2
      Array 4 name = Y_VELOCITY
      Array 5 name = Y_VELOCITY_M1
      Array 6 name = Y_VELOCITY_M2
      Array 7 name = Z_VELOCITY
      Array 8 name = Z_VELOCITY_M1
      Array 9 name = Z_VELOCITY_M2
      Array 10 name = TEMPERATURE
      Array 11 name = ENTHALPY
      Array 12 name = ENERGY_M1
      Array 13 name = ENERGY_M2
      Array 14 name = NUT
      Array 15 name = NUT_M1
      Array 16 name = NUT_M2
      Array 17 name = DENSITY
      Array 18 name = DENSITY_M1
      Array 19 name = DENSITY_M2
      Array 20 name = MU_LAM
      Array 21 name = MU_TURB
      Array 22 name = WALL_DIST
      Array 23 name = BODY_FORCES
      Number Of Components: 26
      Number Of Tuples: 31488
      Copy Tuple Flags: ( 1 1 1 1 1 0 1 )
      Interpolate Flags: ( 1 1 1 1 1 0 0 )
      Pass Through Flags: ( 1 1 1 1 1 1 1 )
      Scalars: (none)
      Vectors: (none)
      Normals: (none)
      TCoords: (none)
      Tensors: (none)
      GlobalIds: (none)
      PedigreeIds: (none)
    Point Data:
      Debug: Off
      Modified Time: 164208
      Reference Count: 1
      Registered Events: (none)
      Number Of Arrays: 0
      Number Of Components: 0
      Number Of Tuples: 0
      Copy Tuple Flags: ( 1 1 1 1 1 0 1 )
      Interpolate Flags: ( 1 1 1 1 1 0 0 )
      Pass Through Flags: ( 1 1 1 1 1 1 1 )
      Scalars: (none)
      Vectors: (none)
      Normals: (none)
      TCoords: (none)
      Tensors: (none)
      GlobalIds: (none)
      PedigreeIds: (none)
    Bounds: 
      Xmin,Xmax: (-0.1, 0.3)
      Ymin,Ymax: (-0.100002, 2.60209e-18)
      Zmin,Zmax: (-0.100002, 2.60209e-18)
    Compute Time: 379083
    Number Of Points: 34943
    Point Coordinates: 0x4aa82b0
    Locator: 0
    Number Of Pieces: 1
    Piece: -1
    Ghost Level: 0Maybe it's because the point data fields, like the scalars and vectors you mentioned, are empty? I could probably fill in the gaps.


Sohail

--- On Tue, 3/1/11, Berk Geveci <berk.geveci at kitware.com> wrote:


From: Berk Geveci <berk.geveci at kitware.com>
Subject: Re: [Paraview] Using streamtracer/gradient filters on "multi-block" data set
To: "Sohail Shafii" <sohailshafii at yahoo.com>

Cc: paraview at paraview.org
Date: Tuesday, March 1, 2011, 5:07 PM

By any chance, does this multi-block dataset contain a block that does not have arrays (scalars and/or vectors)? That's probably why those filters are disabled. You can always use
 Extract Blocks to extract the block you are interested in and then apply the filter. As for the Programmable Filter, if you set the output type to vtkUnstructuredGrid, you should be able to do:

self.GetOutput().ShallowCopy(self.GetInput().GetBlock(0))
assuming that block 0 is a uns. grid.
-berk

On Tue, Mar 1, 2011 at 5:29 PM, Sohail Shafii <sohailshafii at yahoo.com> wrote:



Hi,

I've read in a CAS file, which Paraview read in a Multi-block dataset, which contains within it a unstructured grid.



Initially I had a problem where all of the data items were one-tuple arrays.  So I created a UVW (3-tuple velocity) array and added it to the pipeline this way using a Python programmable filter:

input   = self.GetInput()


output = self.GetOutput()

output.ShallowCopy(input)

****create array here***
output.GetBlock(0).GetCellData().AddArray(UVWArray)

Note that "GetBlock(0)" gives me access to the grid object.  For some reason the gradients and streamtracer filters were greyed out and unavailable.  So I decided to make the output variable a vtkUnstructuredGrid instead and transferred the UVW array to it this way:




output.GetPointData().AddArray(UVWArray)

Nope...didn't work.  Any thoughts how I can modify the pipeline so that the streamtracer and gradients of unstructured data sets array can become usable? I'm guessing there is something in those classes which tells Paraview that they require certain input types. I've seen references to stuff like FillInputPortInformation. 



Thanks,
Sohail






      
_______________________________________________

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://www.paraview.org/mailman/listinfo/paraview













      




      
-----Inline Attachment Follows-----

_______________________________________________
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://www.paraview.org/mailman/listinfo/paraview



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20110309/b9fdfa8d/attachment-0001.htm>


More information about the ParaView mailing list