VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkRungeKutta4.h 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 =========================================================================*/ 00034 #ifndef vtkRungeKutta4_h 00035 #define vtkRungeKutta4_h 00036 00037 #include "vtkCommonMathModule.h" // For export macro 00038 #include "vtkInitialValueProblemSolver.h" 00039 00040 class VTKCOMMONMATH_EXPORT vtkRungeKutta4 : public vtkInitialValueProblemSolver 00041 { 00042 public: 00043 vtkTypeMacro(vtkRungeKutta4,vtkInitialValueProblemSolver); 00044 virtual void PrintSelf(ostream& os, vtkIndent indent); 00045 00047 static vtkRungeKutta4 *New(); 00048 00049 00051 00057 virtual int ComputeNextStep(double* xprev, double* xnext, double t, 00058 double& delT, double maxError, double& error) 00059 { 00060 double minStep = delT; 00061 double maxStep = delT; 00062 double delTActual; 00063 return this->ComputeNextStep(xprev, 0, xnext, t, delT, delTActual, 00064 minStep, maxStep, maxError, error); 00065 } 00066 virtual int ComputeNextStep(double* xprev, double* dxprev, double* xnext, 00067 double t, double& delT, 00068 double maxError, double& error) 00069 { 00070 double minStep = delT; 00071 double maxStep = delT; 00072 double delTActual; 00073 return this->ComputeNextStep(xprev, dxprev, xnext, t, delT, delTActual, 00074 minStep, maxStep, maxError, error); 00075 } 00076 virtual int ComputeNextStep(double* xprev, double* xnext, 00077 double t, double& delT, double& delTActual, 00078 double minStep, double maxStep, 00079 double maxError, double& error) 00080 { 00081 return this->ComputeNextStep(xprev, 0, xnext, t, delT, delTActual, 00082 minStep, maxStep, maxError, error); 00083 } 00084 virtual int ComputeNextStep(double* xprev, double* dxprev, double* xnext, 00085 double t, double& delT, double& delTActual, 00086 double minStep, double maxStep, 00087 double maxError, double& error); 00089 00090 protected: 00091 vtkRungeKutta4(); 00092 ~vtkRungeKutta4(); 00093 00094 virtual void Initialize(); 00095 00096 double* NextDerivs[3]; 00097 private: 00098 vtkRungeKutta4(const vtkRungeKutta4&); // Not implemented. 00099 void operator=(const vtkRungeKutta4&); // Not implemented. 00100 }; 00101 00102 #endif 00103 00104 00105 00106 00107 00108 00109 00110