VTK  9.3.20240328
vtkPNetCDFPOPReader.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
22 #ifndef vtkPNetCDFPOPReader_h
23 #define vtkPNetCDFPOPReader_h
24 
25 #include "vtkIOParallelNetCDFModule.h" // For export macro
27 
28 VTK_ABI_NAMESPACE_BEGIN
30 class vtkCallbackCommand;
31 class vtkMPIController;
32 class vtkPNetCDFPOPReaderInternal;
33 
34 class VTKIOPARALLELNETCDF_EXPORT vtkPNetCDFPOPReader : public vtkRectilinearGridAlgorithm
35 {
36 public:
39  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
42 
48 
50 
53  vtkSetVector3Macro(Stride, int);
54  vtkGetVector3Macro(Stride, int);
56 
58 
62  virtual const char* GetVariableArrayName(int idx);
63  virtual int GetVariableArrayStatus(const char* name);
64  virtual void SetVariableArrayStatus(const char* name, int status);
66 
72 
73  // Set/Get the vtkMultiProcessController which will handle communications
74  // for the parallel rendering.
75  vtkGetObjectMacro(Controller, vtkMPIController);
76  void SetController(vtkMPIController* controller);
77 
78 protected:
81 
84  vtkInformationVector* outputVector) override;
85 
86  // Helper function for RequestData: Reads part of the netCDF
87  // file and sends sub-arrays to all ranks that need that data
88  int ReadAndSend(vtkInformation* outInfo, int varID);
89 
90  // Returns the MPI rank of the process that should read the specified depth
91  int ReaderForDepth(unsigned depth);
92 
93  bool IsReaderRank();
95 
97  vtkObject* caller, unsigned long eid, void* clientdata, void* calldata);
98 
99  static void EventCallback(vtkObject* caller, unsigned long eid, void* clientdata, void* calldata);
100 
102 
103  char* FileName;
105  vtkSetFilePathMacro(OpenedFileName);
106 
107  int NCDFFD; // netcdf file descriptor
108 
109  int Stride[3];
110 
112 
113 private:
114  vtkPNetCDFPOPReader(const vtkPNetCDFPOPReader&) = delete;
115  void operator=(const vtkPNetCDFPOPReader&) = delete;
116 
117  vtkPNetCDFPOPReaderInternal* Internals;
118 };
119 VTK_ABI_NAMESPACE_END
120 #endif
supports function callbacks
Store on/off settings for data arrays, etc.
list of point or cell ids
Definition: vtkIdList.h:132
a simple class to control print indentation
Definition: vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Process communication using MPI.
abstract base class for most VTK objects
Definition: vtkObject.h:161
read NetCDF files in parallel with MPI .Author Ross Miller 03.14.2011
static vtkPNetCDFPOPReader * New()
virtual int GetNumberOfVariableArrays()
Variable array selection.
vtkCallbackCommand * SelectionObserver
vtkSetFilePathMacro(FileName)
The file to open.
vtkGetFilePathMacro(FileName)
The file to open.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
void SetReaderRanks(vtkIdList *)
Set ranks that will actually open and read the netCDF files.
int ReadAndSend(vtkInformation *outInfo, int varID)
virtual int GetVariableArrayStatus(const char *name)
Variable array selection.
int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int ReaderForDepth(unsigned depth)
static void SelectionModifiedCallback(vtkObject *caller, unsigned long eid, void *clientdata, void *calldata)
void SetController(vtkMPIController *controller)
~vtkPNetCDFPOPReader() override
virtual void SetVariableArrayStatus(const char *name, int status)
Variable array selection.
static void EventCallback(vtkObject *caller, unsigned long eid, void *clientdata, void *calldata)
vtkSetFilePathMacro(OpenedFileName)
vtkMPIController * Controller
virtual const char * GetVariableArrayName(int idx)
Variable array selection.
Superclass for algorithms that produce only rectilinear grid as output.
@ name
Definition: vtkX3D.h:219