VTK
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 =========================================================================*/
32 #ifndef vtkRungeKutta2_h
33 #define vtkRungeKutta2_h
34 
35 #include "vtkCommonMathModule.h" // For export macro
37 
38 class VTKCOMMONMATH_EXPORT vtkRungeKutta2 : public vtkInitialValueProblemSolver
39 {
40 public:
42 
46  static vtkRungeKutta2 *New();
47 
49 
62  int ComputeNextStep(double* xprev, double* xnext,
63  double t, double& delT,
64  double maxError, double& error) override
65  {
66  double minStep = delT;
67  double maxStep = delT;
68  double delTActual;
69  return this->ComputeNextStep(xprev, nullptr, xnext, t, delT, delTActual,
70  minStep, maxStep, maxError, error);
71  }
72  int ComputeNextStep(double* xprev, double* dxprev, double* xnext,
73  double t, double& delT,
74  double maxError, double& error) override
75  {
76  double minStep = delT;
77  double maxStep = delT;
78  double delTActual;
79  return this->ComputeNextStep(xprev, dxprev, xnext, t, delT, delTActual,
80  minStep, maxStep, maxError, error);
81  }
82  int ComputeNextStep(double* xprev, double* xnext,
83  double t, double& delT, double& delTActual,
84  double minStep, double maxStep,
85  double maxError, double& error) override
86  {
87  return this->ComputeNextStep(xprev, nullptr, xnext, t, delT, delTActual,
88  minStep, maxStep, maxError, error);
89  }
90  int ComputeNextStep(double* xprev, double* dxprev, double* xnext,
91  double t, double& delT, double& delTActual,
92  double minStep, double maxStep,
93  double maxError, double& error) override;
95 
96 protected:
98  ~vtkRungeKutta2() override;
99 private:
100  vtkRungeKutta2(const vtkRungeKutta2&) = delete;
101  void operator=(const vtkRungeKutta2&) = delete;
102 };
103 
104 #endif
105 
106 
107 
108 
109 
110 
111 
112 
113 // VTK-HeaderTest-Exclude: vtkRungeKutta2.h
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...
int ComputeNextStep(double *xprev, double *xnext, double t, double &delT, double &delTActual, double minStep, double maxStep, double maxError, double &error) 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 maxError, double &error) override
Given initial values, xprev , initial time, t and a requested time interval, delT calculate values of...
int ComputeNextStep(double *xprev, double *dxprev, double *xnext, double t, double &delT, double maxError, double &error) override
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.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
Integrate a set of ordinary differential equations (initial value problem) in time.