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

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