VTK
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 
38 class vtkFunctionSet;
39 
40 class VTKCOMMONMATH_EXPORT vtkInitialValueProblemSolver : public vtkObject
41 {
42 public:
44  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
45 
47 
68  virtual int ComputeNextStep(double* xprev, double* xnext, double t,
69  double& delT, double maxError,
70  double& error)
71  {
72  double minStep = delT;
73  double maxStep = delT;
74  double delTActual;
75  return this->ComputeNextStep(xprev, 0, xnext, t, delT, delTActual,
76  minStep, maxStep, maxError, error);
77  }
78  virtual int ComputeNextStep(double* xprev, double* dxprev, double* xnext,
79  double t, double& delT, double maxError,
80  double& error)
81  {
82  double minStep = delT;
83  double maxStep = delT;
84  double delTActual;
85  return this->ComputeNextStep(xprev, dxprev, xnext, t, delT, delTActual,
86  minStep, maxStep, maxError, error);
87  }
88  virtual int ComputeNextStep(double* xprev, double* xnext,
89  double t, double& delT, double& delTActual,
90  double minStep, double maxStep,
91  double maxError, double& error)
92  {
93  return this->ComputeNextStep(xprev, 0, xnext, t, delT, delTActual,
94  minStep, maxStep, maxError, error);
95  }
96  virtual int ComputeNextStep(double* xprev, double* dxprev, double* xnext,
97  double t, double& delT, double& delTActual,
98  double minStep, double maxStep,
99  double maxError, double& error) = 0;
101 
103 
106  virtual void SetFunctionSet(vtkFunctionSet* functionset);
107  vtkGetObjectMacro(FunctionSet,vtkFunctionSet);
109 
114  virtual int IsAdaptive() { return this->Adaptive; }
115 
117  {
118  OUT_OF_DOMAIN = 1,
119  NOT_INITIALIZED = 2,
120  UNEXPECTED_VALUE = 3
121  };
122 
123 protected:
125  ~vtkInitialValueProblemSolver() VTK_OVERRIDE;
126 
127  virtual void Initialize();
128 
129  vtkFunctionSet* FunctionSet;
130 
131  double* Vals;
132  double* Derivs;
133  int Initialized;
134  int Adaptive;
135 
136 private:
138  void operator=(const vtkInitialValueProblemSolver&) VTK_DELETE_FUNCTION;
139 };
140 
141 #endif
142 
143 
144 
145 
abstract base class for most VTK objects
Definition: vtkObject.h:59
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)
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...
a simple class to control print indentation
Definition: vtkIndent.h:39
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...
Abstract interface for sets of functions.
virtual int IsAdaptive()
Returns 1 if the solver uses adaptive stepsize control, 0 otherwise.
Integrate a set of ordinary differential equations (initial value problem) in time.