VTK  9.1.0
vtkInitialValueProblemSolver.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkInitialValueProblemSolver.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 vtkInitialValueProblemSolver_h
33#define vtkInitialValueProblemSolver_h
34
35#include "vtkCommonMathModule.h" // For export macro
36#include "vtkObject.h"
37
38class vtkFunctionSet;
39
40class VTKCOMMONMATH_EXPORT vtkInitialValueProblemSolver : public vtkObject
41{
42public:
44 void PrintSelf(ostream& os, vtkIndent indent) override;
45
47
68 virtual int ComputeNextStep(
69 double* xprev, double* xnext, double t, double& delT, double maxError, double& error)
70 {
71 return this->ComputeNextStep(xprev, xnext, t, delT, maxError, error, nullptr);
72 }
73
74 virtual int ComputeNextStep(double* xprev, double* xnext, double t, double& delT, double maxError,
75 double& error, void* userData)
76 {
77 double minStep = delT;
78 double maxStep = delT;
79 double delTActual;
80 return this->ComputeNextStep(
81 xprev, nullptr, xnext, t, delT, delTActual, minStep, maxStep, maxError, error, userData);
82 }
83
84 virtual int ComputeNextStep(double* xprev, double* dxprev, double* xnext, double t, double& delT,
85 double maxError, double& error)
86 {
87 return this->ComputeNextStep(xprev, dxprev, xnext, t, delT, maxError, error, nullptr);
88 }
89
90 virtual int ComputeNextStep(double* xprev, double* dxprev, double* xnext, double t, double& delT,
91 double maxError, double& error, void* userData)
92 {
93 double minStep = delT;
94 double maxStep = delT;
95 double delTActual;
96 return this->ComputeNextStep(
97 xprev, dxprev, xnext, t, delT, delTActual, minStep, maxStep, maxError, error, userData);
98 }
99 virtual int ComputeNextStep(double* xprev, double* xnext, double t, double& delT,
100 double& delTActual, double minStep, double maxStep, double maxError, double& error)
101 {
102 return this->ComputeNextStep(
103 xprev, xnext, t, delT, delTActual, minStep, maxStep, maxError, error, nullptr);
104 }
105
106 virtual int ComputeNextStep(double* xprev, double* xnext, double t, double& delT,
107 double& delTActual, double minStep, double maxStep, double maxError, double& error,
108 void* userData)
109 {
110 return this->ComputeNextStep(
111 xprev, nullptr, xnext, t, delT, delTActual, minStep, maxStep, maxError, error, userData);
112 }
113
114 virtual int ComputeNextStep(double* xprev, double* dxprev, double* xnext, double t, double& delT,
115 double& delTActual, double minStep, double maxStep, double maxError, double& error)
116 {
117 return this->ComputeNextStep(
118 xprev, dxprev, xnext, t, delT, delTActual, minStep, maxStep, maxError, error, nullptr);
119 }
120
121 virtual int ComputeNextStep(double* vtkNotUsed(xprev), double* vtkNotUsed(dxprev),
122 double* vtkNotUsed(xnext), double vtkNotUsed(t), double& vtkNotUsed(delT),
123 double& vtkNotUsed(delTActual), double vtkNotUsed(minStep), double vtkNotUsed(maxStep),
124 double vtkNotUsed(maxError), double& vtkNotUsed(error), void* vtkNotUsed(userData))
125 {
126 return 0;
127 }
129
131
134 virtual void SetFunctionSet(vtkFunctionSet* fset);
135 vtkGetObjectMacro(FunctionSet, vtkFunctionSet);
137
142 virtual vtkTypeBool IsAdaptive() { return this->Adaptive; }
143
145 {
146 OUT_OF_DOMAIN = 1,
147 NOT_INITIALIZED = 2,
148 UNEXPECTED_VALUE = 3
149 };
150
151protected:
154
155 virtual void Initialize();
156
158
159 double* Vals;
160 double* Derivs;
163
164private:
166 void operator=(const vtkInitialValueProblemSolver&) = delete;
167};
168
169#endif
Abstract interface for sets of functions.
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 *dxprev, double *xnext, double t, double &delT, double &delTActual, double minStep, double maxStep, double maxError, double &error)
Given initial values, xprev , initial time, t and a requested time interval, delT calculate values of...
virtual vtkTypeBool IsAdaptive()
Returns 1 if the solver uses adaptive stepsize control, 0 otherwise.
virtual void SetFunctionSet(vtkFunctionSet *fset)
Set / get the dataset used for the implicit function evaluation.
virtual int ComputeNextStep(double *xprev, double *dxprev, double *xnext, double t, double &delT, double maxError, double &error, void *userData)
Given initial values, xprev , initial time, t and a requested time interval, delT calculate values of...
virtual int ComputeNextStep(double *xprev, double *dxprev, 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...
virtual int ComputeNextStep(double *xprev, double *xnext, double t, double &delT, double &delTActual, double minStep, double maxStep, double maxError, double &error)
Given initial values, xprev , initial time, t and a requested time interval, delT calculate values of...
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...
~vtkInitialValueProblemSolver() override
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual int ComputeNextStep(double *xprev, double *xnext, double t, double &delT, double maxError, double &error, void *userData)
Given initial values, xprev , initial time, t and a requested time interval, delT calculate values of...
virtual int ComputeNextStep(double *xprev, double *xnext, double t, double &delT, double &delTActual, double minStep, double maxStep, double maxError, double &error, void *userData)
Given initial values, xprev , initial time, t and a requested time interval, delT calculate values of...
virtual int ComputeNextStep(double *vtkNotUsed(xprev), double *vtkNotUsed(dxprev), double *vtkNotUsed(xnext), double vtkNotUsed(t), double &vtkNotUsed(delT), double &vtkNotUsed(delTActual), double vtkNotUsed(minStep), double vtkNotUsed(maxStep), double vtkNotUsed(maxError), double &vtkNotUsed(error), void *vtkNotUsed(userData))
Given initial values, xprev , initial time, t and a requested time interval, delT calculate values of...
abstract base class for most VTK objects
Definition: vtkObject.h:73
int vtkTypeBool
Definition: vtkABI.h:69