VTK  9.7.20260711
vtkFidesReader.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
24
25#ifndef vtkFidesReader_h
26#define vtkFidesReader_h
27
28#include "vtkAlgorithm.h"
29#include "vtkIOFidesModule.h" // For export macro
30#include <memory> // for std::unique_ptr
31#include <string> // for std::string
32
33#ifdef __VTK_WRAP__
34#define vtkPyObjectFwd PyObject
35#else
36struct _object;
37#define vtkPyObjectFwd _object
38#endif
39
40// Forward declare the Conduit C-API opaque pointer type exactly as
41// Conduit does to avoid struct vs typedef collisions in C++.
42struct conduit_node_impl;
43typedef struct conduit_node_impl conduit_node;
44
45VTK_ABI_NAMESPACE_BEGIN
48class vtkStringArray;
49
50class VTKIOFIDES_EXPORT vtkFidesReader : public vtkAlgorithm
51{
52public:
63
65 void PrintSelf(ostream& os, vtkIndent indent) override;
66
71
76 int CanReadFile(VTK_FILEPATH const std::string& name);
77
81 void SetFileName(VTK_FILEPATH const std::string& fname);
82
84
89 void ParseDataModel(VTK_FILEPATH const std::string& fname);
92
100 void SetSchema(const std::string& jsonText);
101
108
114 void SetDataSourcePath(const std::string& name, VTK_FILEPATH const std::string& path);
115
119 void SetDataSourceEngine(const std::string& name, const std::string& engine);
120
127 void SetDataSourceIO(const std::string& name, const std::string& ioAddress);
128
143 bool SetDataSourceNode(const std::string& name, conduit_node* node);
144
161 bool SetDataSourceNode(const std::string& name, vtkPyObjectFwd* conduitNode);
162
172 void RemoveDataSourceNode(const std::string& name);
173
185
190
199
207
215 void SetTimeValue(double t);
216
222
224
227 vtkBooleanMacro(StreamSteps, bool);
228 vtkSetMacro(StreamSteps, bool);
229 vtkGetMacro(StreamSteps, bool);
231
233
237 vtkBooleanMacro(CreateSharedPoints, bool);
238 vtkSetMacro(CreateSharedPoints, bool);
239 vtkGetMacro(CreateSharedPoints, bool);
241
246
251
256
258
265
267
271 const char* GetPointArrayName(int index);
272 const char* GetCellArrayName(int index);
273 const char* GetFieldArrayName(int index);
275
277
281 int GetPointArrayStatus(const char* name);
282 int GetCellArrayStatus(const char* name);
283 int GetFieldArrayStatus(const char* name);
284 void SetPointArrayStatus(const char* name, int status);
285 void SetCellArrayStatus(const char* name, int status);
286 void SetFieldArrayStatus(const char* name, int status);
288
295
297
301 const char* GetCellGridAttributeArrayName(int index);
302 int GetCellGridAttributeArrayStatus(const char* name);
303 void SetCellGridAttributeArrayStatus(const char* name, int status);
305
310
312
316 virtual void SetController(vtkMultiProcessController* controller);
319
320protected:
322 ~vtkFidesReader() override;
323
324 struct vtkFidesReaderImpl;
325 std::unique_ptr<vtkFidesReaderImpl> Impl;
326
327 std::string FileName;
328 std::string SchemaString;
332 double CurrentTime{ 0.0 };
333 bool HasCurrentTime{ false };
334
335 virtual int RequestDataObject(vtkInformation* request, vtkInformationVector** inputVector,
336 vtkInformationVector* outputVector);
337 virtual int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector,
338 vtkInformationVector* outputVector);
339 virtual int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
340 vtkInformationVector* outputVector);
341
342 int FillOutputPortInformation(int port, vtkInformation* info) override;
343
348
350
351 int ADIOSAttributeCheck(const std::string& name);
352
353private:
354 vtkFidesReader(const vtkFidesReader&) = delete;
355 void operator=(const vtkFidesReader&) = delete;
356};
357
358VTK_ABI_NAMESPACE_END
359#endif
Store on/off settings for data arrays, etc.
void ParseDataModel()
Given a json filename, parse and internally store a data model.
int ProcessRequest(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Implements various pipeline passes.
const char * GetCellArrayName(int index)
Get the name of the point or cell array with the given index in the input.
void SetFieldArrayStatus(const char *name, int status)
Get/Set whether the point or cell array with the given name is to be read.
const char * GetPointArrayName(int index)
Get the name of the point or cell array with the given index in the input.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
const char * GetFieldArrayName(int index)
Get the name of the point or cell array with the given index in the input.
void RemoveAllDataSourceNodes()
Remove all associated Conduit nodes from the reader.
void RemoveDataSourceNode(const std::string &name)
Remove a specific Conduit node associated with the named datasource.
int GetCellArrayStatus(const char *name)
Get/Set whether the point or cell array with the given name is to be read.
std::string SchemaString
vtkMTimeType GetMTime() override
Overridden to take into account mtimes for vtkDataArraySelection instances.
void SetFileName(const std::string &fname)
Set the filename to be read.
void PrepareNextStep()
This method has to be called before each step when streaming.
void SetCellGridAttributeArrayStatus(const char *name, int status)
Get/Set whether the cell-grid attribute with the given name is to be read.
void ParseDataModel(const std::string &fname)
Given a json filename, parse and internally store a data model.
static vtkFidesReader * New()
Construct a new reader instance.
void SetPointArrayStatus(const char *name, int status)
Get/Set whether the point or cell array with the given name is to be read.
virtual void SetController(vtkMultiProcessController *controller)
Set/Get the multiprocess controller.
void SetCellArrayStatus(const char *name, int status)
Get/Set whether the point or cell array with the given name is to be read.
int GetPointArrayStatus(const char *name)
Get/Set whether the point or cell array with the given name is to be read.
StepStatus NextStepStatus
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
vtkDataArraySelection * CellDataArraySelection
vtkStringArray * GetDataSourceNames()
Return the names of the data sources declared in the data model.
vtkDataArraySelection * CellGridAttributeArraySelection
vtkDataArraySelection * FieldDataArraySelection
std::string FileName
int GetCellGridAttributeArrayStatus(const char *name)
Get/Set whether the cell-grid attribute with the given name is to be read.
bool SetDataSourceNode(const std::string &name, conduit_node *node)
Set the Conduit node to be associated with the named datasource.
int CanReadFile(const std::string &name)
Test whether or not a given file should even be attempted for use with this reader.
const char * GetCellGridAttributeArrayName(int index)
Get/Set whether the cell-grid attribute with the given name is to be read.
std::unique_ptr< vtkFidesReaderImpl > Impl
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
StepStatus
When using streaming mode instead of random access, PrepareNextStep receives a step status from Fides...
int GetNumberOfCellGridAttributeArrays()
Get/Set whether the cell-grid attribute with the given name is to be read.
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
int GetFieldArrayStatus(const char *name)
Get/Set whether the point or cell array with the given name is to be read.
void SetTimeValue(double t)
Set the time value to stamp on the output as DATA_TIME_STEP().
int GetNextStepStatus()
Get the StepStatus of the next step reported by Fides.
int GetNumberOfPointArrays()
Get the number of point or cell arrays available in the input.
void SetDataSourcePath(const std::string &name, const std::string &path)
Set the path for a Fides data source.
double GetTimeOfCurrentStep()
Gets the time (from the specified ADIOS variable) of the current step.
bool SetDataSourceNode(const std::string &name, vtkPyObjectFwd *conduitNode)
Set the Conduit node to be associated with the named datasource.
void SetDataSourceIO(const std::string &name, const std::string &ioAddress)
Set the ADIOS2::IO object to be used for setting up the Inline engine reader.
void SetDataSourceEngine(const std::string &name, const std::string &engine)
Set the engine for a Fides data source.
virtual int RequestDataObject(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
vtkMultiProcessController * Controller
int GetNumberOfCellArrays()
Get the number of point or cell arrays available in the input.
int GetNumberOfFieldArrays()
Get the number of point or cell arrays available in the input.
int ADIOSAttributeCheck(const std::string &name)
~vtkFidesReader() override
vtkDataArraySelection * PointDataArraySelection
void SetSchema(const std::string &jsonText)
Set the data model directly from an in-memory JSON string instead of from a file.
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Multiprocessing communication superclass.
a vtkAbstractArray subclass for strings
#define vtkPyObjectFwd
struct conduit_node_impl conduit_node
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:318
#define VTK_FILEPATH