VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkInitialValueProblemSolver.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 =========================================================================*/ 00031 #ifndef __vtkInitialValueProblemSolver_h 00032 #define __vtkInitialValueProblemSolver_h 00033 00034 #include "vtkCommonMathModule.h" // For export macro 00035 #include "vtkObject.h" 00036 00037 class vtkFunctionSet; 00038 00039 class VTKCOMMONMATH_EXPORT vtkInitialValueProblemSolver : public vtkObject 00040 { 00041 public: 00042 vtkTypeMacro(vtkInitialValueProblemSolver,vtkObject); 00043 virtual void PrintSelf(ostream& os, vtkIndent indent); 00044 00046 00060 virtual int ComputeNextStep(double* xprev, double* xnext, double t, 00061 double& delT, double maxError, 00062 double& error) 00063 { 00064 double minStep = delT; 00065 double maxStep = delT; 00066 double delTActual; 00067 return this->ComputeNextStep(xprev, 0, xnext, t, delT, delTActual, 00068 minStep, maxStep, maxError, error); 00069 } 00070 virtual int ComputeNextStep(double* xprev, double* dxprev, double* xnext, 00071 double t, double& delT, double maxError, 00072 double& error) 00073 { 00074 double minStep = delT; 00075 double maxStep = delT; 00076 double delTActual; 00077 return this->ComputeNextStep(xprev, dxprev, xnext, t, delT, delTActual, 00078 minStep, maxStep, maxError, error); 00079 } 00080 virtual int ComputeNextStep(double* xprev, double* xnext, 00081 double t, double& delT, double& delTActual, 00082 double minStep, double maxStep, 00083 double maxError, double& error) 00084 { 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, double& delTActual, 00090 double minStep, double maxStep, 00091 double maxError, double& error) = 0; 00093 00095 00096 virtual void SetFunctionSet(vtkFunctionSet* functionset); 00097 vtkGetObjectMacro(FunctionSet,vtkFunctionSet); 00099 00101 virtual int IsAdaptive() { return this->Adaptive; } 00102 00103 //BTX 00104 enum ErrorCodes 00105 { 00106 OUT_OF_DOMAIN = 1, 00107 NOT_INITIALIZED = 2, 00108 UNEXPECTED_VALUE = 3 00109 }; 00110 //ETX 00111 00112 protected: 00113 vtkInitialValueProblemSolver(); 00114 ~vtkInitialValueProblemSolver(); 00115 00116 virtual void Initialize(); 00117 00118 vtkFunctionSet* FunctionSet; 00119 00120 double* Vals; 00121 double* Derivs; 00122 int Initialized; 00123 int Adaptive; 00124 00125 private: 00126 vtkInitialValueProblemSolver(const vtkInitialValueProblemSolver&); // Not implemented. 00127 void operator=(const vtkInitialValueProblemSolver&); // Not implemented. 00128 }; 00129 00130 #endif 00131 00132 00133 00134