Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class 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 =========================================================================*/
00041 #ifndef __vtkRungeKutta45_h
00042 #define __vtkRungeKutta45_h
00043 
00044 #include "vtkInitialValueProblemSolver.h"
00045 
00046 class VTK_COMMON_EXPORT vtkRungeKutta45 : public vtkInitialValueProblemSolver
00047 {
00048 public:
00049   vtkTypeRevisionMacro(vtkRungeKutta45,vtkInitialValueProblemSolver);
00050 
00052   static vtkRungeKutta45 *New();
00053 
00055 
00070   virtual int ComputeNextStep(float* xprev, float* xnext, float t,
00071                               float& delT, float maxError, float& error) 
00072     {
00073       float minStep = delT;
00074       float maxStep = delT;
00075       float delTActual;
00076       return this->ComputeNextStep(xprev, 0, xnext, t, delT, delTActual,
00077                                    minStep, maxStep, maxError, error);
00078     }
00079   virtual int ComputeNextStep(float* xprev, float* dxprev, float* xnext, 
00080                               float t, float& delT, 
00081                               float maxError, float& error)
00082     {
00083       float minStep = delT;
00084       float maxStep = delT;
00085       float delTActual;
00086       return this->ComputeNextStep(xprev, dxprev, xnext, t, delT, delTActual,
00087                                    minStep, maxStep, maxError, error);
00088     }
00089   virtual int ComputeNextStep(float* xprev, float* xnext, 
00090                               float t, float& delT, float& delTActual,
00091                               float minStep, float maxStep,
00092                               float maxError, float& error)
00093     {
00094       return this->ComputeNextStep(xprev, 0, xnext, t, delT, delTActual,
00095                                    minStep, maxStep, maxError, error);
00096     }
00097   virtual int ComputeNextStep(float* xprev, float* dxprev, float* xnext, 
00098                               float t, float& delT, float& delTActual,
00099                               float minStep, float maxStep, 
00100                               float maxError, float& error);
00102 
00103 protected:
00104   vtkRungeKutta45();
00105   ~vtkRungeKutta45();
00106 
00107   virtual void Initialize();
00108 
00109   // Cash-Karp parameters
00110   static double A[5];
00111   static double B[5][5];
00112   static double C[6];
00113   static double DC[6];
00114 
00115   float* NextDerivs[6];
00116 
00117   int ComputeAStep(float* xprev, float* dxprev, float* xnext, float t, 
00118                    float& delT,  float& error);
00119 
00120 private:
00121   vtkRungeKutta45(const vtkRungeKutta45&);  // Not implemented.
00122   void operator=(const vtkRungeKutta45&);  // Not implemented.
00123 };
00124 
00125 #endif
00126 
00127 
00128 
00129 
00130 
00131 
00132 
00133