VTK  9.4.20241219
vtkRungeKutta2.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
20#ifndef vtkRungeKutta2_h
21#define vtkRungeKutta2_h
22
23#include "vtkCommonMathModule.h" // For export macro
25
26VTK_ABI_NAMESPACE_BEGIN
27class VTKCOMMONMATH_EXPORT vtkRungeKutta2 : public vtkInitialValueProblemSolver
28{
29public:
31 void PrintSelf(ostream& os, vtkIndent indent) override;
32
37
38 using Superclass::ComputeNextStep;
40
53 int ComputeNextStep(double* xprev, double* xnext, double t, double& delT, double maxError,
54 double& error, void* userData) override
55 {
56 double minStep = delT;
57 double maxStep = delT;
58 double delTActual;
59 return this->ComputeNextStep(
60 xprev, nullptr, xnext, t, delT, delTActual, minStep, maxStep, maxError, error, userData);
61 }
62 int ComputeNextStep(double* xprev, double* dxprev, double* xnext, double t, double& delT,
63 double maxError, double& error, void* userData) override
64 {
65 double minStep = delT;
66 double maxStep = delT;
67 double delTActual;
68 return this->ComputeNextStep(
69 xprev, dxprev, xnext, t, delT, delTActual, minStep, maxStep, maxError, error, userData);
70 }
71 int ComputeNextStep(double* xprev, double* xnext, double t, double& delT, double& delTActual,
72 double minStep, double maxStep, double maxError, double& error, void* userData) override
73 {
74 return this->ComputeNextStep(
75 xprev, nullptr, xnext, t, delT, delTActual, minStep, maxStep, maxError, error, userData);
76 }
77 int ComputeNextStep(double* xprev, double* dxprev, double* xnext, double t, double& delT,
78 double& delTActual, double minStep, double maxStep, double maxError, double& error,
79 void* userData) override;
81
82protected:
84 ~vtkRungeKutta2() override;
85
86private:
87 vtkRungeKutta2(const vtkRungeKutta2&) = delete;
88 void operator=(const vtkRungeKutta2&) = delete;
89};
90
91VTK_ABI_NAMESPACE_END
92#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 2nd order Runge-Kutta method.
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...
static vtkRungeKutta2 * New()
Construct a vtkRungeKutta2 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...
~vtkRungeKutta2() override
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 &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...