OSDN Git Service

FIRST REPOSITORY
[eos/hostdependOTHERS.git] / I686LINUX / util / I686LINUX / include / vtk / vtkRungeKutta4.h
1 /*=========================================================================
2
3   Program:   Visualization Toolkit
4   Module:    $RCSfile: vtkRungeKutta4.h,v $
5   Language:  C++
6   Date:      $Date: 2002/11/06 20:10:00 $
7   Version:   $Revision: 1.13 $
8
9   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
10   All rights reserved.
11   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
12
13      This software is distributed WITHOUT ANY WARRANTY; without even 
14      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
15      PURPOSE.  See the above copyright notice for more information.
16
17 =========================================================================*/
18 // .NAME vtkRungeKutta4 - Integrate an initial value problem using 4th
19 // order Runge-Kutta method.
20
21 // .SECTION Description
22 // This is a concrete sub-class of vtkInitialValueProblemSolver.
23 // It uses a 4th order Runge-Kutta method to obtain the values of
24 // a set of functions at the next time step.
25
26 // .SECTION See Also
27 // vtkInitialValueProblemSolver vtkRungeKutta45 vtkRungeKutta2 vtkFunctionSet
28
29 #ifndef __vtkRungeKutta4_h
30 #define __vtkRungeKutta4_h
31
32 #include "vtkInitialValueProblemSolver.h"
33
34 class VTK_COMMON_EXPORT vtkRungeKutta4 : public vtkInitialValueProblemSolver
35 {
36 public:
37   vtkTypeRevisionMacro(vtkRungeKutta4,vtkInitialValueProblemSolver);
38   virtual void PrintSelf(ostream& os, vtkIndent indent);
39
40   // Description:
41   // Construct a vtkRungeKutta4 with no initial FunctionSet.
42   static vtkRungeKutta4 *New();
43
44
45   // Description:
46   // Given initial values, xprev , initial time, t and a requested time 
47   // interval, delT calculate values of x at t+delT (xnext).
48   // delTActual is always equal to delT.
49   // Since this class can not provide an estimate for the error error
50   // is set to 0.  
51   // maxStep, minStep and maxError are unused.
52   // This method returns an error code representing the nature of
53   // the failure:
54   // OutOfDomain = 1,
55   // NotInitialized = 2,
56   // UnexpectedValue = 3
57   virtual int ComputeNextStep(float* xprev, float* xnext, float t,
58                               float& delT, float maxError, float& error) 
59     {
60       float minStep = delT;
61       float maxStep = delT;
62       float delTActual;
63       return this->ComputeNextStep(xprev, 0, xnext, t, delT, delTActual,
64                                    minStep, maxStep, maxError, error);
65     }
66   virtual int ComputeNextStep(float* xprev, float* dxprev, float* xnext, 
67                               float t, float& delT, 
68                               float maxError, float& error)
69     {
70       float minStep = delT;
71       float maxStep = delT;
72       float delTActual;
73       return this->ComputeNextStep(xprev, dxprev, xnext, t, delT, delTActual,
74                                    minStep, maxStep, maxError, error);
75     }
76   virtual int ComputeNextStep(float* xprev, float* xnext, 
77                               float t, float& delT, float& delTActual,
78                               float minStep, float maxStep,
79                               float maxError, float& error)
80     {
81       return this->ComputeNextStep(xprev, 0, xnext, t, delT, delTActual,
82                                    minStep, maxStep, maxError, error);
83     }
84   virtual int ComputeNextStep(float* xprev, float* dxprev, float* xnext, 
85                               float t, float& delT, float& delTActual,
86                               float minStep, float maxStep, 
87                               float maxError, float& error);
88
89 protected:
90   vtkRungeKutta4();
91   ~vtkRungeKutta4();
92
93   virtual void Initialize();
94
95   float* NextDerivs[3];
96 private:
97   vtkRungeKutta4(const vtkRungeKutta4&);  // Not implemented.
98   void operator=(const vtkRungeKutta4&);  // Not implemented.
99 };
100
101 #endif
102
103
104
105
106
107
108
109