VTK  9.1.0
vtkRungeKutta4.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkRungeKutta4.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=========================================================================*/
58#ifndef vtkRungeKutta4_h
59#define vtkRungeKutta4_h
60
61#include "vtkCommonMathModule.h" // For export macro
63
64class VTKCOMMONMATH_EXPORT vtkRungeKutta4 : public vtkInitialValueProblemSolver
65{
66public:
68 void PrintSelf(ostream& os, vtkIndent indent) override;
69
74
75 using Superclass::ComputeNextStep;
77
90 int ComputeNextStep(double* xprev, double* xnext, double t, double& delT, double maxError,
91 double& error, void* userData) override
92 {
93 double minStep = delT;
94 double maxStep = delT;
95 double delTActual;
96 return this->ComputeNextStep(
97 xprev, nullptr, xnext, t, delT, delTActual, minStep, maxStep, maxError, error, userData);
98 }
99 int ComputeNextStep(double* xprev, double* dxprev, double* xnext, double t, double& delT,
100 double maxError, double& error, void* userData) override
101 {
102 double minStep = delT;
103 double maxStep = delT;
104 double delTActual;
105 return this->ComputeNextStep(
106 xprev, dxprev, xnext, t, delT, delTActual, minStep, maxStep, maxError, error, userData);
107 }
108 int ComputeNextStep(double* xprev, double* xnext, double t, double& delT, double& delTActual,
109 double minStep, double maxStep, double maxError, double& error, void* userData) override
110 {
111 return this->ComputeNextStep(
112 xprev, nullptr, xnext, t, delT, delTActual, minStep, maxStep, maxError, error, userData);
113 }
114 int ComputeNextStep(double* xprev, double* dxprev, double* xnext, double t, double& delT,
115 double& delTActual, double minStep, double maxStep, double maxError, double& error,
116 void* userData) override;
118
119protected:
121 ~vtkRungeKutta4() override;
122
123 void Initialize() override;
124
125 double* NextDerivs[3];
126
127private:
128 vtkRungeKutta4(const vtkRungeKutta4&) = delete;
129 void operator=(const vtkRungeKutta4&) = delete;
130};
131
132#endif
a simple class to control print indentation
Definition: vtkIndent.h:113
Integrate a set of ordinary differential equations (initial value problem) in time.
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...
Integrate an initial value problem using 4th order Runge-Kutta method.
void Initialize() override
~vtkRungeKutta4() override
int ComputeNextStep(double *xprev, double *dxprev, double *xnext, double t, double &delT, double &delTActual, double minStep, double maxStep, double maxError, double &error, void *userData) override
Given initial values, xprev , initial time, t and a requested time interval, delT calculate values of...
static vtkRungeKutta4 * New()
Construct a vtkRungeKutta4 with no initial FunctionSet.
int ComputeNextStep(double *xprev, double *xnext, double t, double &delT, double maxError, double &error, void *userData) override
Given initial values, xprev , initial time, t and a requested time interval, delT calculate values of...
int ComputeNextStep(double *xprev, double *xnext, double t, double &delT, double &delTActual, double minStep, double maxStep, double maxError, double &error, void *userData) override
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 *dxprev, double *xnext, double t, double &delT, double maxError, double &error, void *userData) override
Given initial values, xprev , initial time, t and a requested time interval, delT calculate values of...