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 "vtkObject.h" 00035 00036 class vtkFunctionSet; 00037 00038 class VTK_COMMON_EXPORT vtkInitialValueProblemSolver : public vtkObject 00039 { 00040 public: 00041 vtkTypeMacro(vtkInitialValueProblemSolver,vtkObject); 00042 virtual void PrintSelf(ostream& os, vtkIndent indent); 00043 00045 00059 virtual int ComputeNextStep(double* xprev, double* xnext, double t, 00060 double& delT, double maxError, 00061 double& error) 00062 { 00063 double minStep = delT; 00064 double maxStep = delT; 00065 double delTActual; 00066 return this->ComputeNextStep(xprev, 0, xnext, t, delT, delTActual, 00067 minStep, maxStep, maxError, error); 00068 } 00069 virtual int ComputeNextStep(double* xprev, double* dxprev, double* xnext, 00070 double t, double& delT, double maxError, 00071 double& error) 00072 { 00073 double minStep = delT; 00074 double maxStep = delT; 00075 double delTActual; 00076 return this->ComputeNextStep(xprev, dxprev, xnext, t, delT, delTActual, 00077 minStep, maxStep, maxError, error); 00078 } 00079 virtual int ComputeNextStep(double* xprev, double* xnext, 00080 double t, double& delT, double& delTActual, 00081 double minStep, double maxStep, 00082 double maxError, double& error) 00083 { 00084 return this->ComputeNextStep(xprev, 0, xnext, t, delT, delTActual, 00085 minStep, maxStep, maxError, error); 00086 } 00087 virtual int ComputeNextStep(double* xprev, double* dxprev, double* xnext, 00088 double t, double& delT, double& delTActual, 00089 double minStep, double maxStep, 00090 double maxError, double& error) = 0; 00092 00094 00095 virtual void SetFunctionSet(vtkFunctionSet* functionset); 00096 vtkGetObjectMacro(FunctionSet,vtkFunctionSet); 00098 00100 virtual int IsAdaptive() { return this->Adaptive; } 00101 00102 //BTX 00103 enum ErrorCodes 00104 { 00105 OUT_OF_DOMAIN = 1, 00106 NOT_INITIALIZED = 2, 00107 UNEXPECTED_VALUE = 3 00108 }; 00109 //ETX 00110 00111 protected: 00112 vtkInitialValueProblemSolver(); 00113 ~vtkInitialValueProblemSolver(); 00114 00115 virtual void Initialize(); 00116 00117 vtkFunctionSet* FunctionSet; 00118 00119 double* Vals; 00120 double* Derivs; 00121 int Initialized; 00122 int Adaptive; 00123 00124 private: 00125 vtkInitialValueProblemSolver(const vtkInitialValueProblemSolver&); // Not implemented. 00126 void operator=(const vtkInitialValueProblemSolver&); // Not implemented. 00127 }; 00128 00129 #endif 00130 00131 00132 00133