[vtkusers] How to write discontinuous field data
Gerard Gorman
g.gorman at imperial.ac.uk
Sat Aug 16 02:35:36 EDT 2008
The approach we've taken is to create discontinuous points - add the
point every times that it appears in an element. This way you end up
with a node numbering the same as your scalar field node number which is
what you want. This way the discontinuous field can be visualised exactly.
Cheers
Gerard
Gerrick Bivins emailed the following on 15/08/08 21:24:
> I ran into this issue as well and went about implementing the "shrinkfilter"
> method described below.
> This solved my problem but I've found that my surface is now not "smooth".
> It looks as if normals are per polygon rather than per vertex. Is this an
> artifact of exploding the mesh connectivity or is there a filter I can apply
> to obtain better results. I've tried vtkSmoothPolyDataFilter but I don't
> quite understand the parameters so I was unable to get quality results.
> Thanks in advance for any advice here.
> Gerrick http://www.nabble.com/file/p19004953/badNormals.jpg
> http://www.nabble.com/file/p19004953/goodNormals.jpeg
>
>
> Serge Lalonde wrote:
>> Hello,
>>
>> I'm using ParaView in order to evalutate the visualization capabilities
>> of VTK. In order to do a fair evaluation, I am exporting the
>> discontinuous scalar field data from our current application (a magnetic
>> FE field solver) to a .vtk file (using the ASCII simple legacy format
>> according to http://www.vtk.org/pdf/file-formats.pdf).
>>
>> The problem is that I can't seem to figure out how to write out the
>> discontinuous scalar field. I searched the help and the archives and
>> this isn't covered anywhere. There are references to "pulling your hair
>> out", and that it is supported, but it's not explained. Help!
>>
>> Here is my setup:
>> - Tetrahedral elements (hence the data set is an unstructured grid)
>> - The scalar field is discontinuous at the cell boundaries. This means
>> that my field stores a (possibly different) value for each point, based
>> on which cell is accessed.
>>
>> I tried generating the following file (abbreviated):
>>
>> # vtk DataFile Version 3.0
>> Export of the mesh and field data for the field.
>> ASCII
>> DATASET UNSTRUCTURED_GRID
>> POINTS 3196 double
>> <x y z values for all 3196 points here>
>> ...
>> CELLS 16528 82640
>> 4 <four 0-based indices into the points above to describe all the 16528
>> tetrahedra>
>> ...
>> CELL_TYPES 16528
>> 10 <repeated 16528 times because all elements are tetrahedra>
>> ...
>> CELL_DATA 16528
>> FIELD ScalarField 1
>> FieldNameHere 4 16528 double
>> <four field values to specify the field values at each point of the
>> tetrahedra for all 16528 tetrahedra>
>> ...
>>
>> When I open this file, it almost looks right except that ParaView
>> calculates the magnitude of the four values for each cell when I select
>> "FieldNameHere" and displays that. So I never see any field variation in
>> a cell. I suspect that I have to use POINT_DATA, but I am unclear on how
>> to specify multiple scalar values (one for each cell sharing that point).
>>
>> How can this be specified? Would I be better off using the XML file
>> format? Do I have to lose the connectivity of my mesh to get what I want
>> (i.e. repeat the same point N-times, where N is the number of times the
>> point is shared by a cell)?
>>
>> Thanks.
>> _______________________________________________
>> This is the private VTK discussion list.
>> Please keep messages on-topic. Check the FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>>
>
More information about the vtkusers
mailing list