VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkRungeKutta2.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 =========================================================================*/ 00028 #ifndef __vtkRungeKutta2_h 00029 #define __vtkRungeKutta2_h 00030 00031 #include "vtkCommonMathModule.h" // For export macro 00032 #include "vtkInitialValueProblemSolver.h" 00033 00034 class VTKCOMMONMATH_EXPORT vtkRungeKutta2 : public vtkInitialValueProblemSolver 00035 { 00036 public: 00037 vtkTypeMacro(vtkRungeKutta2,vtkInitialValueProblemSolver); 00038 00040 static vtkRungeKutta2 *New(); 00041 00043 00049 virtual int ComputeNextStep(double* xprev, double* xnext, double t, 00050 double& delT, double maxError, double& error) 00051 { 00052 double minStep = delT; 00053 double maxStep = delT; 00054 double delTActual; 00055 return this->ComputeNextStep(xprev, 0, xnext, t, delT, delTActual, 00056 minStep, maxStep, maxError, error); 00057 } 00058 virtual int ComputeNextStep(double* xprev, double* dxprev, double* xnext, 00059 double t, double& delT, 00060 double maxError, double& error) 00061 { 00062 double minStep = delT; 00063 double maxStep = delT; 00064 double delTActual; 00065 return this->ComputeNextStep(xprev, dxprev, xnext, t, delT, delTActual, 00066 minStep, maxStep, maxError, error); 00067 } 00068 virtual int ComputeNextStep(double* xprev, double* xnext, 00069 double t, double& delT, double& delTActual, 00070 double minStep, double maxStep, 00071 double maxError, double& error) 00072 { 00073 return this->ComputeNextStep(xprev, 0, xnext, t, delT, delTActual, 00074 minStep, maxStep, maxError, error); 00075 } 00076 virtual int ComputeNextStep(double* xprev, double* dxprev, double* xnext, 00077 double t, double& delT, double& delTActual, 00078 double minStep, double maxStep, 00079 double maxError, double& error); 00081 00082 protected: 00083 vtkRungeKutta2(); 00084 ~vtkRungeKutta2(); 00085 private: 00086 vtkRungeKutta2(const vtkRungeKutta2&); // Not implemented. 00087 void operator=(const vtkRungeKutta2&); // Not implemented. 00088 }; 00089 00090 #endif 00091 00092 00093 00094 00095 00096 00097 00098 00099 // VTK-HeaderTest-Exclude: vtkRungeKutta2.h