VTK: IO/ParallelNetCDF/vtkPNetCDFPOPReader.h Source File

| 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
26 #include "vtkRectilinearGridAlgorithm.h"
27
28 VTK_ABI_NAMESPACE_BEGIN
29 class vtkDataArraySelection;
30 class vtkCallbackCommand;
31 class vtkMPIController;
32 class vtkPNetCDFPOPReaderInternal;
33
34 class VTKIOPARALLELNETCDF_EXPORT vtkPNetCDFPOPReader : public vtkRectilinearGridAlgorithm
35 {
36 public:
37 vtkTypeMacro(vtkPNetCDFPOPReader, vtkRectilinearGridAlgorithm);
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:
79 vtkPNetCDFPOPReader();
80 ~vtkPNetCDFPOPReader() override;
81
82 int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
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
101 vtkCallbackCommand* SelectionObserver;
102
103 char* FileName;
104 char* OpenedFileName;
105 vtkSetFilePathMacro(OpenedFileName);
106
107 int NCDFFD; // netcdf file descriptor
108
109 int Stride[3];
110
111 vtkMPIController* Controller;
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
vtkCallbackCommand
supports function callbacks
Definition: vtkCallbackCommand.h:49
vtkDataArraySelection
Store on/off settings for data arrays, etc.
Definition: vtkDataArraySelection.h:37
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:32
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:40
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:72
vtkMPIController
Process communication using MPI.
Definition: vtkMPIController.h:51
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:61
vtkPNetCDFPOPReader
read NetCDF files in parallel with MPI .Author Ross Miller 03.14.2011
Definition: vtkPNetCDFPOPReader.h:35
vtkPNetCDFPOPReader::OpenedFileName
char * OpenedFileName
Definition: vtkPNetCDFPOPReader.h:104
vtkPNetCDFPOPReader::IsReaderRank
bool IsReaderRank()
vtkPNetCDFPOPReader::New
static vtkPNetCDFPOPReader * New()
vtkPNetCDFPOPReader::GetNumberOfVariableArrays
virtual int GetNumberOfVariableArrays()
Variable array selection.
vtkPNetCDFPOPReader::SelectionObserver
vtkCallbackCommand * SelectionObserver
Definition: vtkPNetCDFPOPReader.h:101
vtkPNetCDFPOPReader::vtkSetFilePathMacro
vtkSetFilePathMacro(FileName)
The file to open.
vtkPNetCDFPOPReader::vtkGetFilePathMacro
vtkGetFilePathMacro(FileName)
The file to open.
vtkPNetCDFPOPReader::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkPNetCDFPOPReader::FileName
char * FileName
Definition: vtkPNetCDFPOPReader.h:103
vtkPNetCDFPOPReader::SetReaderRanks
void SetReaderRanks(vtkIdList *)
Set ranks that will actually open and read the netCDF files.
vtkPNetCDFPOPReader::NCDFFD
int NCDFFD
Definition: vtkPNetCDFPOPReader.h:107
vtkPNetCDFPOPReader::vtkPNetCDFPOPReader
vtkPNetCDFPOPReader()
vtkPNetCDFPOPReader::ReadAndSend
int ReadAndSend(vtkInformation *outInfo, int varID)
vtkPNetCDFPOPReader::GetVariableArrayStatus
virtual int GetVariableArrayStatus(const char *name)
Variable array selection.
vtkPNetCDFPOPReader::RequestInformation
int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
vtkPNetCDFPOPReader::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkPNetCDFPOPReader::ReaderForDepth
int ReaderForDepth(unsigned depth)
vtkPNetCDFPOPReader::SelectionModifiedCallback
static void SelectionModifiedCallback(vtkObject *caller, unsigned long eid, void *clientdata, void *calldata)
vtkPNetCDFPOPReader::SetController
void SetController(vtkMPIController *controller)
vtkPNetCDFPOPReader::~vtkPNetCDFPOPReader
~vtkPNetCDFPOPReader() override
vtkPNetCDFPOPReader::SetVariableArrayStatus
virtual void SetVariableArrayStatus(const char *name, int status)
Variable array selection.
vtkPNetCDFPOPReader::EventCallback
static void EventCallback(vtkObject *caller, unsigned long eid, void *clientdata, void *calldata)
vtkPNetCDFPOPReader::IsFirstReaderRank
bool IsFirstReaderRank()
vtkPNetCDFPOPReader::vtkSetFilePathMacro
vtkSetFilePathMacro(OpenedFileName)
vtkPNetCDFPOPReader::Controller
vtkMPIController * Controller
Definition: vtkPNetCDFPOPReader.h:111
vtkPNetCDFPOPReader::GetVariableArrayName
virtual const char * GetVariableArrayName(int idx)
Variable array selection.
vtkRectilinearGridAlgorithm
Superclass for algorithms that produce only rectilinear grid as output.
Definition: vtkRectilinearGridAlgorithm.h:33
vtkX3D::name
@ name
Definition: vtkX3D.h:219
vtkRectilinearGridAlgorithm.h