[vtkusers] about vtkStreamer
Petru Pau
ppau at risc.uni-linz.ac.at
Mon Aug 2 11:03:06 EDT 2004
Jeff,
> you need to intersect the streamline with the terminating boundary.
> [...] Are you sure that your intersection was successful?
The problem is that for some perfectly legal input the algorithm does
not get there.
There are two important points in the "while" loop that generates the
points on the stream line:
- at the computation of the next point:
if ((tmp= integrator->ComputeNextStep(...)) != 0)
{
/********************************** my code
*************************************/
if (tmp!=OUT_OF_DOMAIN)
break;
// compute intersection with edge and try to switch to
next cell
// ....
}
- at the computation of the velocity vector for the newly generated point:
if ( !func->FunctionValues(point2, velocity) )
{
retVal = OUT_OF_DOMAIN;
memcpy(lastPoint, point2, 3*sizeof(double));
break;
}
Now for a very simple example the loop exits from the second condition
(I enclose at the end of this message the .vtk file). This means that the
integration step has taken place succesfully, but the FunctionValues
fails; more exactly, it calls EvaluatePosition, and this fails. Note that
the point is in the current cell - see the attached image (the seed point is
(0.05, 0.02, 0).
Each computed point is projected on the current cell. I inserted the
following
code right before inserting the point. I wrote a function "Project"
because I
do not really know the meaning of the 0 or -1 returned by EvaluatePosition,
if the point under consideration is outside the cell and its projection
onto the
cell's plane is internal to the cell (or on its boundary).
if (cell->GetCellDimension()==2)
{
double projPoint[3];
if (Project(cell, point1, projPoint))
{
memcpy(point1, projPoint, 3*sizeof(double));
}
}
I think that for this case integrator->ComputeNextStep is successful because
both the initial point and the point+delta/2 fall within the cell; the
next point,
however, gets out of the cell, and FunctionValues somehow detects this.
Which means that I have to hack also around the call of FunctionValues.
Petru
-------------------
# vtk DataFile Version 2.0
Sample data for polydata
ASCII
DATASET POLYDATA
POINTS 5 float
0.0 0.0 0.0
2.0 0.0 0.0
0.0 2.0 0.0
2.0 2.0 1.0
1.5 3.5 1.5
POLYGONS 3 12
3 0 1 2
3 1 2 3
3 2 3 4
POINT_DATA 5
SCALARS scalars float 1
LOOKUP_TABLE default
0.0
1.0
2.0
3.0
4.0
VECTORS vectors float
1 1 21
4 2 21
6 3 21
8 4 21
10 5 21
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040802/3c3738ad/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: simple_ex_1.jpg
Type: image/jpeg
Size: 13052 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040802/3c3738ad/attachment.jpg>
More information about the vtkusers
mailing list