[vtkusers] interpolating using RungaKutta4
Berk Geveci
berklist at nycap.rr.com
Thu Aug 26 11:47:31 EDT 2004
What values does ComputeNextStep() return? The ComputeNextStep()
is a very simple and short function. You can easily figure out
what is going wrong by putting a break point in it and following
the execution. I could tell you more if I had access to the datasets.
-Berk
On Thu, 2004-08-26 at 11:12, tom fogal wrote:
> I'm trying to interpolate a point using RungaKutta4 and I'm not getting
> the results I would have expected.
>
> float seed[2][3];
> float delT = 0.5;
> float unused;
> vtkInterpolateDataSetAttributes *IntDataSetAttr;
> vtkInterpolatedVelocityField *IntVelField;
> vtkRungaKutta4 *RG4;
> MyCustomReaderObject *src[2];
>
> ... initialize data ...
>
> IntDataSetAttr->AddInput(src[0]->GetOutput());
> IntDataSetAttr->AddInput(src[1]->GetOutput());
> IntDataSetAttr->SetT(0.5);
> IntDataSetAttr->Update();
> IntVelField->AddDataSet(IntDataSetAttr->GetOutput());
> IntVelField->SelectVectors("V");
> RG4->SetFunctionSet(IntVelField);
>
> seed[0][0] = 0.1;
> seed[0][1] = 0.2;
> seed[0][2] = 0.3;
> seed[1][0] = 0.5;
> seed[1][1] = 0.6;
> seed[1][2] = 0.7;
> // seed[1] is for return value
> RG4->ComputeNextStep(seed[0], seed[1], 0.0, delT, unused, unused);
>
> std::cout << "interpolated points (start \t finish):\n"
> << "\t x: " << seed[0][0] << '\t' << seed[1][0] << '\n'
> << "\t y: " << seed[0][1] << '\t' << seed[1][1] << '\n'
> << "\t z: " << seed[0][2] << '\t' << seed[1][2] << '\n';
>
> I used to not set seed[1] but I was curious to see if it would use
> those values. ComputeNextStep seems to only copy seed[0] to seed[1].
> Any ideas what I'm doing wrong here? How is one supposed to use
> RungaKutta4 ?
>
> TIA,
>
> -tom
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
--
Berk Geveci <berklist at nycap.rr.com>
More information about the vtkusers
mailing list