VTK  9.1.0
vtkRungeKutta2.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkRungeKutta2.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=========================================================================*/
29#ifndef vtkRungeKutta2_h
30#define vtkRungeKutta2_h
31
32#include "vtkCommonMathModule.h" // For export macro
34
35class VTKCOMMONMATH_EXPORT vtkRungeKutta2 : public vtkInitialValueProblemSolver
36{
37public:
39 void PrintSelf(ostream& os, vtkIndent indent) override;
40
45
46 using Superclass::ComputeNextStep;
48
61 int ComputeNextStep(double* xprev, double* xnext, double t, double& delT, double maxError,
62 double& error, void* userData) override
63 {
64 double minStep = delT;
65 double maxStep = delT;
66 double delTActual;
67 return this->ComputeNextStep(
68 xprev, nullptr, xnext, t, delT, delTActual, minStep, maxStep, maxError, error, userData);
69 }
70 int ComputeNextStep(double* xprev, double* dxprev, double* xnext, double t, double& delT,
71 double maxError, double& error, void* userData) override
72 {
73 double minStep = delT;
74 double maxStep = delT;
75 double delTActual;
76 return this->ComputeNextStep(
77 xprev, dxprev, xnext, t, delT, delTActual, minStep, maxStep, maxError, error, userData);
78 }
79 int ComputeNextStep(double* xprev, double* xnext, double t, double& delT, double& delTActual,
80 double minStep, double maxStep, double maxError, double& error, void* userData) override
81 {
82 return this->ComputeNextStep(
83 xprev, nullptr, xnext, t, delT, delTActual, minStep, maxStep, maxError, error, userData);
84 }
85 int ComputeNextStep(double* xprev, double* dxprev, double* xnext, double t, double& delT,
86 double& delTActual, double minStep, double maxStep, double maxError, double& error,
87 void* userData) override;
89
90protected:
92 ~vtkRungeKutta2() override;
93
94private:
95 vtkRungeKutta2(const vtkRungeKutta2&) = delete;
96 void operator=(const vtkRungeKutta2&) = delete;
97};
98
99#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 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...