Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

vtkRungeKutta45.h

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