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

VTK  9.5.20251001
vtkMultiTimeStepAlgorithm.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
26#ifndef vtkMultiTimeStepAlgorithm_h
27#define vtkMultiTimeStepAlgorithm_h
28
29#include "vtkAlgorithm.h"
30#include "vtkCommonExecutionModelModule.h" // For export macro
31#include "vtkDeprecation.h" // For Deprecation macro
32#include "vtkSmartPointer.h" //needed for a private variable
33
34#include "vtkDataObject.h" // needed for the smart pointer
35#include <vector> //needed for a private variable
36
37VTK_ABI_NAMESPACE_BEGIN
40class VTKCOMMONEXECUTIONMODEL_EXPORT vtkMultiTimeStepAlgorithm : public vtkAlgorithm
41{
42public:
45 void PrintSelf(ostream& os, vtkIndent indent) override;
46
47protected:
49
50 ~vtkMultiTimeStepAlgorithm() override = default;
51
55 VTK_DEPRECATED_IN_9_6_0("Please use SetTimeSteps directly instead.")
56 static vtkInformationDoubleVectorKey* UPDATE_TIME_STEPS();
57
59
63 virtual int RequestDataObject(vtkInformation*, vtkInformationVector**, vtkInformationVector*)
64 {
65 return 1;
66 }
68
70
75 {
76 return 1;
77 }
79
88 virtual int Execute(vtkInformation* vtkNotUsed(request),
89 const std::vector<vtkSmartPointer<vtkDataObject>>& vtkNotUsed(inputs),
90 vtkInformationVector* vtkNotUsed(outputVector))
91 {
92 return -1;
93 }
94
100 {
101 return 1;
102 }
103
106
110 void SetTimeSteps(const std::vector<double>& values);
111
114
115private:
117 void operator=(const vtkMultiTimeStepAlgorithm&) = delete;
118 int RequestUpdateIndex; // keep track of the time looping index
119 std::vector<double> UpdateTimeSteps; // store the requested time steps
120 bool IsInCache(double time, size_t& idx);
121 struct TimeCache
122 {
123 TimeCache(double time, vtkDataObject* data)
124 : TimeValue(time)
125 , Data(data)
126 {
127 }
128 double TimeValue;
130 };
131 std::vector<TimeCache> Cache;
132};
133
134VTK_ABI_NAMESPACE_END
135#endif
Superclass for all sources, filters, and sinks in VTK.
general representation of visualization data
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Composite dataset that organizes datasets into blocks.
Superclass for algorithms that would like to make multiple time requests.
void SetTimeSteps(const std::vector< double > &values)
Set the list of time steps values.
static vtkMultiTimeStepAlgorithm * New()
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
~vtkMultiTimeStepAlgorithm() override=default
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTypeBool ProcessRequest(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Upstream/Downstream requests form the generalized interface through which executives invoke a algorit...
virtual int Execute(vtkInformation *request, const std::vector< vtkSmartPointer< vtkDataObject > > &inputs, vtkInformationVector *outputVector)
Subclasses should override this method to do the actual execution.
Hold a reference to a vtkObjectBase instance.
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_DEPRECATED_IN_9_6_0(reason)