VTK  9.4.20241118
vtkRungeKutta4.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
49#ifndef vtkRungeKutta4_h
50#define vtkRungeKutta4_h
51
52#include "vtkCommonMathModule.h" // For export macro
54
55VTK_ABI_NAMESPACE_BEGIN
56class VTKCOMMONMATH_EXPORT vtkRungeKutta4 : public vtkInitialValueProblemSolver
57{
58public:
60 void PrintSelf(ostream& os, vtkIndent indent) override;
61
66
67 using Superclass::ComputeNextStep;
69
82 int ComputeNextStep(double* xprev, double* xnext, double t, double& delT, double maxError,
83 double& error, void* userData) override
84 {
85 double minStep = delT;
86 double maxStep = delT;
87 double delTActual;
88 return this->ComputeNextStep(
89 xprev, nullptr, xnext, t, delT, delTActual, minStep, maxStep, maxError, error, userData);
90 }
91 int ComputeNextStep(double* xprev, double* dxprev, double* xnext, double t, double& delT,
92 double maxError, double& error, void* userData) override
93 {
94 double minStep = delT;
95 double maxStep = delT;
96 double delTActual;
97 return this->ComputeNextStep(
98 xprev, dxprev, xnext, t, delT, delTActual, minStep, maxStep, maxError, error, userData);
99 }
100 int ComputeNextStep(double* xprev, double* xnext, double t, double& delT, double& delTActual,
101 double minStep, double maxStep, double maxError, double& error, void* userData) override
102 {
103 return this->ComputeNextStep(
104 xprev, nullptr, xnext, t, delT, delTActual, minStep, maxStep, maxError, error, userData);
105 }
106 int ComputeNextStep(double* xprev, double* dxprev, double* xnext, double t, double& delT,
107 double& delTActual, double minStep, double maxStep, double maxError, double& error,
108 void* userData) override;
110
111protected:
113 ~vtkRungeKutta4() override;
114
115 void Initialize() override;
116
117 double* NextDerivs[3];
118
119private:
120 vtkRungeKutta4(const vtkRungeKutta4&) = delete;
121 void operator=(const vtkRungeKutta4&) = delete;
122};
123
124VTK_ABI_NAMESPACE_END
125#endif
a simple class to control print indentation
Definition vtkIndent.h:108
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...