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 =========================================================================*/
35 #ifndef vtkRungeKutta45_h
36 #define vtkRungeKutta45_h
37 
38 #include "vtkCommonMathModule.h" // For export macro
40 
41 class VTKCOMMONMATH_EXPORT vtkRungeKutta45 : public vtkInitialValueProblemSolver
42 {
43 public:
45  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
46 
50  static vtkRungeKutta45 *New();
51 
53 
75  int ComputeNextStep(double* xprev, double* xnext,
76  double t, double& delT,
77  double maxError, double& error) VTK_OVERRIDE
78  {
79  double minStep = delT;
80  double maxStep = delT;
81  double delTActual;
82  return this->ComputeNextStep(xprev, 0, xnext, t, delT, delTActual,
83  minStep, maxStep, maxError, error);
84  }
85  int ComputeNextStep(double* xprev, double* dxprev, double* xnext,
86  double t, double& delT,
87  double maxError, double& error) VTK_OVERRIDE
88  {
89  double minStep = delT;
90  double maxStep = delT;
91  double delTActual;
92  return this->ComputeNextStep(xprev, dxprev, xnext, t, delT, delTActual,
93  minStep, maxStep, maxError, error);
94  }
95  int ComputeNextStep(double* xprev, double* xnext,
96  double t, double& delT, double& delTActual,
97  double minStep, double maxStep,
98  double maxError, double& error) VTK_OVERRIDE
99  {
100  return this->ComputeNextStep(xprev, 0, xnext, t, delT, delTActual,
101  minStep, maxStep, maxError, error);
102  }
103  int ComputeNextStep(double* xprev, double* dxprev, double* xnext,
104  double t, double& delT, double& delTActual,
105  double minStep, double maxStep,
106  double maxError, double& error) VTK_OVERRIDE;
108 
109 protected:
110  vtkRungeKutta45();
111  ~vtkRungeKutta45() VTK_OVERRIDE;
112 
113  void Initialize() VTK_OVERRIDE;
114 
115  // Cash-Karp parameters
116  static double A[5];
117  static double B[5][5];
118  static double C[6];
119  static double DC[6];
120 
121  double* NextDerivs[6];
122 
123  int ComputeAStep(double* xprev, double* dxprev, double* xnext, double t,
124  double& delT, double& delTActual, double& error);
125 
126 private:
127  vtkRungeKutta45(const vtkRungeKutta45&) VTK_DELETE_FUNCTION;
128  void operator=(const vtkRungeKutta45&) VTK_DELETE_FUNCTION;
129 };
130 
131 #endif
132 
virtual int ComputeNextStep(double *xprev, double *xnext, double t, double &delT, double maxError, double &error)
Given initial values, xprev , initial time, t and a requested time interval, delT calculate values of...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int ComputeNextStep(double *xprev, double *xnext, double t, double &delT, double &delTActual, double minStep, double maxStep, double maxError, double &error) override
Given initial values, xprev , initial time, t and a requested time interval, delT calculate values of...
a simple class to control print indentation
Definition: vtkIndent.h:33
Integrate an initial value problem using 5th order Runge-Kutta method with adaptive stepsize control...
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
int ComputeNextStep(double *xprev, double *dxprev, double *xnext, double t, double &delT, double maxError, double &error) override
Given initial values, xprev , initial time, t and a requested time interval, delT calculate values of...
Integrate a set of ordinary differential equations (initial value problem) in time.
int ComputeNextStep(double *xprev, double *xnext, double t, double &delT, double maxError, double &error) override
Given initial values, xprev , initial time, t and a requested time interval, delT calculate values of...