[Paraview] Point blanking in structured grid
Berk Geveci
berk.geveci at kitware.com
Tue Jun 23 10:27:27 EDT 2009
Hi George,
I am moving this discussion to the mailing list. Please post further
messages there.
ParaView partially supports blanking of structured grids. There are
several things that do not work well currently:
- The geometry filter - the filter that we use to extract the surface
of the mesh - ignore blanking information
- IO - the only reader that support blanking is the Plot3D reader.
There are no writers that support blanking
I suggest that you post feature request for these features at the
paraview bug tracker (http://paraview.org/Bug) as they are useful
features.
Best,
-berk
On Sat, Jun 20, 2009 at 4:00 PM, George Gerber<george.gerber at gmail.com> wrote:
> Hi Berk,
>
> I would like to apply Paraview on my Delft3D model data. Delft3D is finite
> difference, structured mesh solver for large water bodies (oceans and
> lakes).
>
> Delft3D imposes the shoreline on the grid by 'blanking'/ignoring (if that is
> the term) certain cells on the edges of the computational mesh. I have
> written a python/tvtk script which creates a structured mesh. In this script
> I use a function 'blank_point(i)' to blank points which should be ignored.
> This seems to work when I check the result by calling 'is_point_visible(i)',
> which returns zero (false).
>
> However, when I import the grid into paraview these grid points are still
> used to draw the grid. This is undesirable since the blanked cells all have
> the same coordinates x=0,y=0 (Delft3D convention), which messes up the mesh.
>
> Does Paraview support blanking in structured grids?
>
> FYI, below is my code
> Best regards,
> George
>
> #===========================
> def VTK_SG(M,N,K,X,Y,Z):
> from enthought.tvtk.api import tvtk
> from enthought.tvtk.misc import write_data
> from numpy import array, concatenate
> # Create the VTK grid
> sg=tvtk.StructuredGrid(dimensions=(M,N,K))
> '''A structured grid assumes that points are input in a certain order,
> which determines the connectivity between cells'''
>
> X=X.reshape(len(X),1)
> Y=Y.reshape(len(Y),1)
> Z=Z.reshape(len(Z),1)
> pts = concatenate((X,Y,Z),axis=1)
> sg.points=pts
> # blank the unused points (identified by: x=0, y=0)
> for i in range(len(pts)):
> if (pts[i,0]==0.0) and (pts[i,1]==0.0): sg.blank_point(i)
> write_data(sg,'d3d_grid.vts')
> print 'wrote grid file.'
> return sg
>
More information about the ParaView
mailing list