[vtkusers] Re: Mapping/Interpolate scalars in a suitable way on a Finite Element Mesh

Steve Joyce Steve.Joyce at sercoassurance.com
Thu Oct 14 10:50:29 EDT 2004


Hi,

The interpolation is by colour rather than by value by default.
However, I've obtained reasonable results using a
vtkBandedPolyDataContourFilter, which uses the value interpolation
defined for the cell type to create sub-cells of a given scalar value,
which are then coloured. The number of sub-cells depends on your node
values and the number of values you have specified for the filter. It
works like a normal contour filter, but fills in the contours with the
appropriate colour (hence the name). Note that point scalars get
converted to cell scalars by this filter. I've only tried this for
linear hexahedrons so far.

Steve

>>> vtkusers-request at vtk.org 14/10/2004 15:26:16 >>>

------------------------------

I have read in a mesh from a Finite Element solver, into VTK and now I
want to map the stresses( point scalars) in a suitable way. The values
are mapped correctly in the points(nodes) but the interior of the cell
looks bad.

I have attached two pictures that shows the mapping. As seen in the
images, the diagonal of the quads has a constant value i.e. the result
is interpreted as two planar triangles. In a case with a quad element
and with a non-planar response surface this is not a good
representation. 


I want the mapping to be like a contour filter that clearly show the
stresses around a certain point(s). Any suggestions? Is it possibly to
somehow use the contourfilter on my scalars?




code extraction...


this->lut=vtkLookupTable::New();
this->lut->SetTableRange(this->filereader->GetOutput()->GetScalarRange());
this->lut->SetHueRange(0.667, 0.0);
this->lut->Build();


this->bar=vtkScalarBarActor::New();
this->bar->SetLookupTable(lut);
this->bar->SetNumberOfLabels(8);



this->pMapper=vtkPolyDataMapper::New();
this->pMapper->SetInput(gFilter->GetOutput());
this->pMapper->SetLookupTable(lut);
this->pMapper->SetScalarRange(this->filereader->GetOutput()->GetScalarRange());


// furhter down the pipeline..


this->actor->SetMapper(dataMapper);
//this->actor->GetProperty()->SetInterpolationToFlat();
this->actor->GetProperty()->SetInterpolationToGouraud();
this->actor->GetProperty()->SetAmbient(0.4);
this->actor->GetProperty()->SetDiffuse(0.2);
this->actor->GetProperty()->SetSpecular(0.2);
.....

Best Regards,

Peter


-------------- next part --------------
A non-text attachment was scrubbed...
Name: _scalar_problem.jpg
Type: image/pjpeg
Size: 18369 bytes
Desc: not available
Url :
http://public.kitware.com/pipermail/vtkusers/attachments/20041014/5f6b16a0/_scalar_problem.bin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: scalar_problem_wireframe.jpg
Type: image/pjpeg
Size: 31712 bytes
Desc: not available
Url :
http://public.kitware.com/pipermail/vtkusers/attachments/20041014/5f6b16a0/scalar_problem_wireframe.bin


------------------------------

_______________________________________________
vtkusers mailing list
vtkusers at vtk.org 
http://www.vtk.org/mailman/listinfo/vtkusers 


End of vtkusers Digest, Vol 6, Issue 26
***************************************




****Disclaimer***********
This e-mail and any attachments may contain confidential and/or privileged material; it  is for the intended addressee(s) only.  If you are not a named addressee, you must not use, retain or disclose such information.
 
Serco cannot guarantee that the e-mail or any attachments are free from viruses.
 
The views expressed in this e-mail are those of the originator and do not necessarily represent the views of Serco.
 
Nothing in this e-mail shall bind Serco in any contract or obligation.
 
Serco Group plc.  Registered in England and Wales.  No: 2048608
Registered Office:  Serco House, 16 Bartley Wood Business Park, Bartley Way, Hook, Hampshire, RG27 9UY, United Kingdom.
****End Disclaimer*******
<<<<GWIASIG 0.07>>>>



More information about the vtkusers mailing list