VTK
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 =========================================================================*/
31 #ifndef vtkPNetCDFPOPReader_h
32 #define vtkPNetCDFPOPReader_h
33 
34 #include "vtkIOParallelNetCDFModule.h" // For export macro
36 
38 class vtkCallbackCommand;
39 class vtkMPIController;
40 class vtkPNetCDFPOPReaderInternal;
41 
42 class VTKIOPARALLELNETCDF_EXPORT vtkPNetCDFPOPReader : public vtkRectilinearGridAlgorithm
43 {
44 public:
46  static vtkPNetCDFPOPReader *New();
47  void PrintSelf(ostream& os, vtkIndent indent) override;
48 
50 
53  vtkSetStringMacro(FileName);
54  vtkGetStringMacro(FileName);
56 
58 
61  vtkSetVector3Macro(Stride, int);
62  vtkGetVector3Macro(Stride, int);
64 
66 
69  virtual int GetNumberOfVariableArrays();
70  virtual const char *GetVariableArrayName(int idx);
71  virtual int GetVariableArrayStatus(const char *name);
72  virtual void SetVariableArrayStatus(const char *name, int status);
74 
79  void SetReaderRanks(vtkIdList*);
80 
81  // Set/Get the vtkMultiProcessController which will handle communications
82  // for the parallel rendering.
83  vtkGetObjectMacro(Controller, vtkMPIController);
84  void SetController(vtkMPIController *controller);
85 
86 protected:
89 
91  vtkInformationVector*) override;
92  virtual int RequestInformation(vtkInformation* request,
93  vtkInformationVector** inputVector,
94  vtkInformationVector* outputVector) override;
95 
96  // Helper function for RequestData: Reads part of the netCDF
97  // file and sends sub-arrays to all ranks that need that data
98  int ReadAndSend( vtkInformation* outInfo, int varID);
99 
100  // Returns the MPI rank of the process that should read the specified depth
101  int ReaderForDepth( unsigned depth);
102 
103  bool IsReaderRank();
104  bool IsFirstReaderRank();
105 
106  static void SelectionModifiedCallback(vtkObject *caller, unsigned long eid,
107  void *clientdata, void *calldata);
108 
109  static void EventCallback(vtkObject* caller, unsigned long eid,
110  void* clientdata, void* calldata);
111 
113 
114  char *FileName;
116  vtkSetStringMacro(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
vtkPNetCDFPOPReader::NCDFFD
int NCDFFD
Definition: vtkPNetCDFPOPReader.h:116
vtkRectilinearGridAlgorithm::RequestInformation
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
vtkRectilinearGridAlgorithm
Superclass for algorithms that produce only rectilinear grid as output.
Definition: vtkRectilinearGridAlgorithm.h:43
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkPNetCDFPOPReader::FileName
char * FileName
Definition: vtkPNetCDFPOPReader.h:114
vtkPNetCDFPOPReader::SelectionObserver
vtkCallbackCommand * SelectionObserver
Definition: vtkPNetCDFPOPReader.h:112
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:53
vtkPNetCDFPOPReader
read NetCDF files in parallel with MPI .Author Ross Miller 03.14.2011
Definition: vtkPNetCDFPOPReader.h:42
vtkDataArraySelection
Store on/off settings for data arrays for a vtkSource.
Definition: vtkDataArraySelection.h:34
vtkRectilinearGridAlgorithm::RequestData
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
vtkPNetCDFPOPReader::Controller
vtkMPIController * Controller
Definition: vtkPNetCDFPOPReader.h:122
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:30
vtkX3D::name
Definition: vtkX3D.h:219
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:80
vtkRectilinearGridAlgorithm::New
static vtkRectilinearGridAlgorithm * New()
vtkRectilinearGridAlgorithm.h
vtkCallbackCommand
supports function callbacks
Definition: vtkCallbackCommand.h:44
vtkMPIController
Process communication using MPI.
Definition: vtkMPIController.h:55
vtkRectilinearGridAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkPNetCDFPOPReader::OpenedFileName
char * OpenedFileName
Definition: vtkPNetCDFPOPReader.h:115