VTK: Common/Math/vtkRungeKutta4.h Source File

| VTK 9.3.1

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
29 #ifndef vtkRungeKutta4_h
30 #define vtkRungeKutta4_h
31
32 #include "vtkCommonMathModule.h" // For export macro
33 #include "vtkInitialValueProblemSolver.h"
34
35 VTK_ABI_NAMESPACE_BEGIN
36 class VTKCOMMONMATH_EXPORT vtkRungeKutta4 : public vtkInitialValueProblemSolver
37 {
38 public:
39 vtkTypeMacro(vtkRungeKutta4, vtkInitialValueProblemSolver);
40 void PrintSelf(ostream& os, vtkIndent indent) override;
41
45 static vtkRungeKutta4* New();
46
47 using Superclass::ComputeNextStep;
49
62 int ComputeNextStep(double* xprev, double* xnext, double t, double& delT, double maxError,
63 double& error, void* userData) override
64 {
65 double minStep = delT;
66 double maxStep = delT;
67 double delTActual;
68 return this->ComputeNextStep(
69 xprev, nullptr, xnext, t, delT, delTActual, minStep, maxStep, maxError, error, userData);
70 }
71 int ComputeNextStep(double* xprev, double* dxprev, double* xnext, double t, double& delT,
72 double maxError, double& error, void* userData) override
73 {
74 double minStep = delT;
75 double maxStep = delT;
76 double delTActual;
77 return this->ComputeNextStep(
78 xprev, dxprev, xnext, t, delT, delTActual, minStep, maxStep, maxError, error, userData);
79 }
80 int ComputeNextStep(double* xprev, double* xnext, double t, double& delT, double& delTActual,
81 double minStep, double maxStep, double maxError, double& error, void* userData) override
82 {
83 return this->ComputeNextStep(
84 xprev, nullptr, xnext, t, delT, delTActual, minStep, maxStep, maxError, error, userData);
85 }
86 int ComputeNextStep(double* xprev, double* dxprev, double* xnext, double t, double& delT,
87 double& delTActual, double minStep, double maxStep, double maxError, double& error,
88 void* userData) override;
90
91 protected:
92 vtkRungeKutta4();
93 ~vtkRungeKutta4() override;
94
95 void Initialize() override;
96
97 double* NextDerivs[3];
98
99 private:
100 vtkRungeKutta4(const vtkRungeKutta4&) = delete;
101 void operator=(const vtkRungeKutta4&) = delete;
102 };
103
104 VTK_ABI_NAMESPACE_END
105 #endif
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkInitialValueProblemSolver
Integrate a set of ordinary differential equations (initial value problem) in time.
Definition: vtkInitialValueProblemSolver.h:30
vtkInitialValueProblemSolver::ComputeNextStep
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...
Definition: vtkInitialValueProblemSolver.h:57
vtkRungeKutta4
Integrate an initial value problem using 4th order Runge-Kutta method.
Definition: vtkRungeKutta4.h:37
vtkRungeKutta4::Initialize
void Initialize() override
vtkRungeKutta4::vtkRungeKutta4
vtkRungeKutta4()
vtkRungeKutta4::~vtkRungeKutta4
~vtkRungeKutta4() override
vtkRungeKutta4::ComputeNextStep
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...
vtkRungeKutta4::ComputeNextStep
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...
Definition: vtkRungeKutta4.h:62
vtkRungeKutta4::ComputeNextStep
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...
Definition: vtkRungeKutta4.h:80
vtkRungeKutta4::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkRungeKutta4::New
static vtkRungeKutta4 * New()
Construct a vtkRungeKutta4 with no initial FunctionSet.
vtkRungeKutta4::ComputeNextStep
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...
Definition: vtkRungeKutta4.h:71
vtkInitialValueProblemSolver.h