VTK  9.3.1
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:
38  static vtkPNetCDFPOPReader* New();
39  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
42 
45  vtkSetFilePathMacro(FileName);
46  vtkGetFilePathMacro(FileName);
48 
50 
53  vtkSetVector3Macro(Stride, int);
54  vtkGetVector3Macro(Stride, int);
56 
58 
61  virtual int GetNumberOfVariableArrays();
62  virtual const char* GetVariableArrayName(int idx);
63  virtual int GetVariableArrayStatus(const char* name);
64  virtual void SetVariableArrayStatus(const char* name, int status);
66 
71  void SetReaderRanks(vtkIdList*);
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:
80  ~vtkPNetCDFPOPReader() override;
81 
83  int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector,
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();
94  bool IsFirstReaderRank();
95 
96  static void SelectionModifiedCallback(
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
Superclass for algorithms that produce only rectilinear grid as output.
abstract base class for most VTK objects
Definition: vtkObject.h:51
Store vtkAlgorithm input/output information.
static vtkRectilinearGridAlgorithm * New()
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
read NetCDF files in parallel with MPI .Author Ross Miller 03.14.2011
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
supports function callbacks
a simple class to control print indentation
Definition: vtkIndent.h:28
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
list of point or cell ids
Definition: vtkIdList.h:22
Store on/off settings for data arrays, etc.
Process communication using MPI.
vtkMPIController * Controller
vtkCallbackCommand * SelectionObserver
Store zero or more vtkInformation instances.