VTK  9.2.6
vtkPNetCDFPOPReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtPkNetCDFPOPReader.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
34 #ifndef vtkPNetCDFPOPReader_h
35 #define vtkPNetCDFPOPReader_h
36 
37 #include "vtkIOParallelNetCDFModule.h" // For export macro
39 
41 class vtkCallbackCommand;
42 class vtkMPIController;
43 class vtkPNetCDFPOPReaderInternal;
44 
45 class VTKIOPARALLELNETCDF_EXPORT vtkPNetCDFPOPReader : public vtkRectilinearGridAlgorithm
46 {
47 public:
50  void PrintSelf(ostream& os, vtkIndent indent) override;
51 
53 
59 
61 
64  vtkSetVector3Macro(Stride, int);
65  vtkGetVector3Macro(Stride, int);
67 
69 
73  virtual const char* GetVariableArrayName(int idx);
74  virtual int GetVariableArrayStatus(const char* name);
75  virtual void SetVariableArrayStatus(const char* name, int status);
77 
83 
84  // Set/Get the vtkMultiProcessController which will handle communications
85  // for the parallel rendering.
86  vtkGetObjectMacro(Controller, vtkMPIController);
87  void SetController(vtkMPIController* controller);
88 
89 protected:
92 
94  virtual int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector,
95  vtkInformationVector* outputVector) override;
96 
97  // Helper function for RequestData: Reads part of the netCDF
98  // file and sends sub-arrays to all ranks that need that data
99  int ReadAndSend(vtkInformation* outInfo, int varID);
100 
101  // Returns the MPI rank of the process that should read the specified depth
102  int ReaderForDepth(unsigned depth);
103 
104  bool IsReaderRank();
106 
108  vtkObject* caller, unsigned long eid, void* clientdata, void* calldata);
109 
110  static void EventCallback(vtkObject* caller, unsigned long eid, void* clientdata, void* calldata);
111 
113 
114  char* FileName;
116  vtkSetFilePathMacro(OpenedFileName);
117 
118  int NCDFFD; // netcdf file descriptor
119 
120  int Stride[3];
121 
123 
124 private:
125  vtkPNetCDFPOPReader(const vtkPNetCDFPOPReader&) = delete;
126  void operator=(const vtkPNetCDFPOPReader&) = delete;
127 
128  vtkPNetCDFPOPReaderInternal* Internals;
129 };
130 #endif
supports function callbacks
Store on/off settings for data arrays, etc.
list of point or cell ids
Definition: vtkIdList.h:143
a simple class to control print indentation
Definition: vtkIndent.h:119
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:82
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.
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
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.
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:225