Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

Common/vtkRungeKutta45.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkRungeKutta45.h,v $
00005   Language:  C++
00006 
00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
00008   All rights reserved.
00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00010 
00011      This software is distributed WITHOUT ANY WARRANTY; without even 
00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00013      PURPOSE.  See the above copyright notice for more information.
00014 
00015 =========================================================================*/
00052 #ifndef __vtkRungeKutta45_h
00053 #define __vtkRungeKutta45_h
00054 
00055 #include "vtkInitialValueProblemSolver.h"
00056 
00057 class VTK_COMMON_EXPORT vtkRungeKutta45 : public vtkInitialValueProblemSolver
00058 {
00059 public:
00060   vtkTypeRevisionMacro(vtkRungeKutta45,vtkInitialValueProblemSolver);
00061 
00063   static vtkRungeKutta45 *New();
00064 
00066 
00081   virtual int ComputeNextStep(float* xprev, float* xnext, float t,
00082                               float& delT, float maxError, float& error) 
00083     {
00084       float minStep = delT;
00085       float maxStep = delT;
00086       float delTActual;
00087       return this->ComputeNextStep(xprev, 0, xnext, t, delT, delTActual,
00088                                    minStep, maxStep, maxError, error);
00089     }
00090   virtual int ComputeNextStep(float* xprev, float* dxprev, float* xnext, 
00091                               float t, float& delT, 
00092                               float maxError, float& error)
00093     {
00094       float minStep = delT;
00095       float maxStep = delT;
00096       float delTActual;
00097       return this->ComputeNextStep(xprev, dxprev, xnext, t, delT, delTActual,
00098                                    minStep, maxStep, maxError, error);
00099     }
00100   virtual int ComputeNextStep(float* xprev, float* xnext, 
00101                               float t, float& delT, float& delTActual,
00102                               float minStep, float maxStep,
00103                               float maxError, float& error)
00104     {
00105       return this->ComputeNextStep(xprev, 0, xnext, t, delT, delTActual,
00106                                    minStep, maxStep, maxError, error);
00107     }
00108   virtual int ComputeNextStep(float* xprev, float* dxprev, float* xnext, 
00109                               float t, float& delT, float& delTActual,
00110                               float minStep, float maxStep, 
00111                               float maxError, float& error);
00113 
00114 protected:
00115   vtkRungeKutta45();
00116   ~vtkRungeKutta45();
00117 
00118   virtual void Initialize();
00119 
00120   // Cash-Karp parameters
00121   static double A[5];
00122   static double B[5][5];
00123   static double C[6];
00124   static double DC[6];
00125 
00126   float* NextDerivs[6];
00127 
00128   int ComputeAStep(float* xprev, float* dxprev, float* xnext, float t, 
00129                    float& delT,  float& error);
00130 
00131 private:
00132   vtkRungeKutta45(const vtkRungeKutta45&);  // Not implemented.
00133   void operator=(const vtkRungeKutta45&);  // Not implemented.
00134 };
00135 
00136 #endif
00137 
00138 
00139 
00140 
00141 
00142 
00143 
00144