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

Peter Wallin petwa055 at student.liu.se
Thu Oct 14 10:25:42 EDT 2004


Hi there!

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://www.vtk.org/pipermail/vtkusers/attachments/20041014/5f6b16a0/attachment.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://www.vtk.org/pipermail/vtkusers/attachments/20041014/5f6b16a0/attachment-0001.bin>


More information about the vtkusers mailing list