VTK  9.4.20241222
vtkInitialValueProblemSolver.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 vtkInitialValueProblemSolver_h
21#define vtkInitialValueProblemSolver_h
22
23#include "vtkCommonMathModule.h" // For export macro
24#include "vtkObject.h"
25
26VTK_ABI_NAMESPACE_BEGIN
27class vtkFunctionSet;
28
29class VTKCOMMONMATH_EXPORT vtkInitialValueProblemSolver : public vtkObject
30{
31public:
33 void PrintSelf(ostream& os, vtkIndent indent) override;
34
36
57 virtual int ComputeNextStep(
58 double* xprev, double* xnext, double t, double& delT, double maxError, double& error)
59 {
60 return this->ComputeNextStep(xprev, xnext, t, delT, maxError, error, nullptr);
61 }
62
63 virtual int ComputeNextStep(double* xprev, double* xnext, double t, double& delT, double maxError,
64 double& error, void* userData)
65 {
66 double minStep = delT;
67 double maxStep = delT;
68 double delTActual;
69 return this->ComputeNextStep(
70 xprev, nullptr, xnext, t, delT, delTActual, minStep, maxStep, maxError, error, userData);
71 }
72
73 virtual int ComputeNextStep(double* xprev, double* dxprev, double* xnext, double t, double& delT,
74 double maxError, double& error)
75 {
76 return this->ComputeNextStep(xprev, dxprev, xnext, t, delT, maxError, error, nullptr);
77 }
78
79 virtual int ComputeNextStep(double* xprev, double* dxprev, double* xnext, double t, double& delT,
80 double maxError, double& error, void* userData)
81 {
82 double minStep = delT;
83 double maxStep = delT;
84 double delTActual;
85 return this->ComputeNextStep(
86 xprev, dxprev, xnext, t, delT, delTActual, minStep, maxStep, maxError, error, userData);
87 }
88 virtual int ComputeNextStep(double* xprev, double* xnext, double t, double& delT,
89 double& delTActual, double minStep, double maxStep, double maxError, double& error)
90 {
91 return this->ComputeNextStep(
92 xprev, xnext, t, delT, delTActual, minStep, maxStep, maxError, error, nullptr);
93 }
94
95 virtual int ComputeNextStep(double* xprev, double* xnext, double t, double& delT,
96 double& delTActual, double minStep, double maxStep, double maxError, double& error,
97 void* userData)
98 {
99 return this->ComputeNextStep(
100 xprev, nullptr, xnext, t, delT, delTActual, minStep, maxStep, maxError, error, userData);
101 }
102
103 virtual int ComputeNextStep(double* xprev, double* dxprev, double* xnext, double t, double& delT,
104 double& delTActual, double minStep, double maxStep, double maxError, double& error)
105 {
106 return this->ComputeNextStep(
107 xprev, dxprev, xnext, t, delT, delTActual, minStep, maxStep, maxError, error, nullptr);
108 }
109
110 virtual int ComputeNextStep(double* vtkNotUsed(xprev), double* vtkNotUsed(dxprev),
111 double* vtkNotUsed(xnext), double vtkNotUsed(t), double& vtkNotUsed(delT),
112 double& vtkNotUsed(delTActual), double vtkNotUsed(minStep), double vtkNotUsed(maxStep),
113 double vtkNotUsed(maxError), double& vtkNotUsed(error), void* vtkNotUsed(userData))
114 {
115 return 0;
116 }
118
120
123 virtual void SetFunctionSet(vtkFunctionSet* fset);
124 vtkGetObjectMacro(FunctionSet, vtkFunctionSet);
126
131 virtual vtkTypeBool IsAdaptive() { return this->Adaptive; }
132
134 {
135 OUT_OF_DOMAIN = 1,
136 NOT_INITIALIZED = 2,
137 UNEXPECTED_VALUE = 3
138 };
139
140protected:
143
144 virtual void Initialize();
145
147
148 double* Vals;
149 double* Derivs;
152
153private:
155 void operator=(const vtkInitialValueProblemSolver&) = delete;
156};
157
158VTK_ABI_NAMESPACE_END
159#endif
Abstract interface for sets of functions.
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 *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:162
int vtkTypeBool
Definition vtkABI.h:64