VTK
vtkRungeKutta45.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkRungeKutta45.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
37 #ifndef vtkRungeKutta45_h
38 #define vtkRungeKutta45_h
39 
40 #include "vtkCommonMathModule.h" // For export macro
42 
44 {
45 public:
47  void PrintSelf(ostream& os, vtkIndent indent);
48 
50  static vtkRungeKutta45 *New();
51 
53 
68  virtual int ComputeNextStep(double* xprev, double* xnext, double t,
69  double& delT, double maxError, double& error)
70  {
71  double minStep = delT;
72  double maxStep = delT;
73  double delTActual;
74  return this->ComputeNextStep(xprev, 0, xnext, t, delT, delTActual,
75  minStep, maxStep, maxError, error);
76  }
77  virtual int ComputeNextStep(double* xprev, double* dxprev, double* xnext,
78  double t, double& delT,
79  double maxError, double& error)
80  {
81  double minStep = delT;
82  double maxStep = delT;
83  double delTActual;
84  return this->ComputeNextStep(xprev, dxprev, xnext, t, delT, delTActual,
85  minStep, maxStep, maxError, error);
86  }
87  virtual int ComputeNextStep(double* xprev, double* xnext,
88  double t, double& delT, double& delTActual,
89  double minStep, double maxStep,
90  double maxError, double& error)
91  {
92  return this->ComputeNextStep(xprev, 0, xnext, t, delT, delTActual,
93  minStep, maxStep, maxError, error);
94  }
95  virtual int ComputeNextStep(double* xprev, double* dxprev, double* xnext,
96  double t, double& delT, double& delTActual,
97  double minStep, double maxStep,
98  double maxError, double& error);
100 
101 protected:
102  vtkRungeKutta45();
103  ~vtkRungeKutta45();
104 
105  virtual void Initialize();
106 
107  // Cash-Karp parameters
108  static double A[5];
109  static double B[5][5];
110  static double C[6];
111  static double DC[6];
112 
113  double* NextDerivs[6];
114 
115  int ComputeAStep(double* xprev, double* dxprev, double* xnext, double t,
116  double& delT, double& error);
117 
118 private:
119  vtkRungeKutta45(const vtkRungeKutta45&); // Not implemented.
120  void operator=(const vtkRungeKutta45&); // Not implemented.
121 };
122 
123 #endif
124 
virtual int ComputeNextStep(double *xprev, double *xnext, double t, double &delT, double maxError, double &error)
virtual void PrintSelf(ostream &os, vtkIndent indent)
virtual int ComputeNextStep(double *xprev, double *xnext, double t, double &delT, double maxError, double &error)
a simple class to control print indentation
Definition: vtkIndent.h:38
Integrate an initial value problem using 5th order Runge-Kutta method with adaptive stepsize control...
virtual int ComputeNextStep(double *xprev, double *dxprev, double *xnext, double t, double &delT, double maxError, double &error)
static vtkObject * New()
virtual int ComputeNextStep(double *xprev, double *xnext, double t, double &delT, double &delTActual, double minStep, double maxStep, double maxError, double &error)
#define VTKCOMMONMATH_EXPORT
Integrate a set of ordinary differential equations (initial value problem) in time.