Thanks to visit codestin.com
Credit goes to vtk.org

VTK  9.5.20250922
vtkTemporalAlgorithm.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
82#ifndef vtkTemporalAlgorithm_h
83#define vtkTemporalAlgorithm_h
84
85#include "vtkAlgorithm.h"
86#include "vtkCommonExecutionModelModule.h" // For export macro
87#include "vtkNew.h" // For TimeSteps
88
89VTK_ABI_NAMESPACE_BEGIN
90
91class vtkDoubleArray;
92class vtkInformation;
94
95template <class AlgorithmT>
96class vtkTemporalAlgorithm : public AlgorithmT
97{
98public:
100
105
110 static const char* TimeStepsArrayName() { return "time_steps"; }
111
112 static_assert(std::is_base_of<vtkAlgorithm, AlgorithmT>::value,
113 "Template argument must inherit vtkAlgorithm");
114
115protected:
117
119 vtkInformationVector* outputVector) override;
121 vtkInformationVector* outputVector) override;
123 vtkInformationVector* outputVector) override;
125 vtkInformationVector* outputVector) override;
126
135 virtual int Initialize(vtkInformation* request, vtkInformationVector** inputVector,
136 vtkInformationVector* outputVector) = 0;
137
143 virtual int Execute(vtkInformation* request, vtkInformationVector** inputVector,
144 vtkInformationVector* outputVector) = 0;
145
150 virtual int Finalize(vtkInformation* request, vtkInformationVector** inputVector,
151 vtkInformationVector* outputVector) = 0;
152
157
161 double GetCurrentTimeStep() const;
162
169
171
175 std::vector<double> InputTimeSteps;
179
183 bool MustReset() const;
184
188 bool MustContinue() const;
189
196
202
203private:
205 void operator=(const vtkTemporalAlgorithm&) = delete;
206};
207
208VTK_ABI_NAMESPACE_END
209
210#define vtkCreateWrappedTemporalAlgorithmInterface() \
211 static const char* TimeStepsArrayName(); \
212 \
213protected: \
214 int GetCurrentTimeIndex() const; \
215 double GetCurrentTimeStep() const; \
216 bool IntegrateFullTimeSeries; \
217 \
218public:
219
220#include "vtkTemporalAlgorithm.txx"
221#endif
dynamic, self-adjusting array of double
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Allocate and hold a VTK object.
Definition vtkNew.h:167
Base class for temporal algorithms.
virtual int Initialize(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)=0
Method called at first temporal iteration.
int TerminationTimeIndex
When the information key NO_PRIOR_TEMPORAL_ACCESS() is not set on the input port, this is used to kee...
int RequestUpdateExtent(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
bool MustContinue() const
Returns true if there are time steps missing that must be requested upstream.
int GetCurrentTimeIndex() const
Returns the current time index being executed (or finalized).
vtkNew< vtkDoubleArray > ProcessedTimeSteps
Array only used when the information key NO_PRIOR_TEMPORAL_ACCESS() is set.
vtkTemplateTypeMacro(vtkTemporalAlgorithm, AlgorithmT)
Standard methods for instantiation, type information, and printing.
double GetCurrentTimeStep() const
Returns the current time step being executed (or finalized).
int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
virtual int Execute(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)=0
Method called at each time step.
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
std::vector< double > InputTimeSteps
When the information key NO_PRIOR_TEMPORAL_ACCESS() is not set on the input port, this is used to kee...
int RequestUpdateTime(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
bool IntegrateFullTimeSeries
To be set in the constructor.
int CurrentTimeIndex
When the information key NO_PRIOR_TEMPORAL_ACCESS() is not set on the input port, this is used to kee...
static const char * TimeStepsArrayName()
When vtkStreamingDemandDrivenPipeline::NO_PRIOR_TEMPORAL_ACCESS() is set, an array with this name is ...
bool NoPriorTimeStepAccess
When true, the algorithm calls Finalize at each iteration.
bool MustReset() const
Returns true if the cache must be reinitialized before executing the current time step.
virtual int Finalize(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)=0
Method that converts the temporal cache into the outputs.