VTK  9.3.1
vtkNek5000Reader.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
15 #ifndef vtkNek5000Reader_h
16 #define vtkNek5000Reader_h
17 
18 #include "vtkIOParallelModule.h" // For export macro
20 
21 VTK_ABI_NAMESPACE_BEGIN
22 
23 class vtkPoints;
25 
26 class VTKIOPARALLEL_EXPORT vtkNek5000Reader : public vtkUnstructuredGridAlgorithm
27 {
28 public:
29  static vtkNek5000Reader* New();
31  void PrintSelf(ostream& os, vtkIndent indent) override;
32 
33  vtkMTimeType GetMTime() override;
34 
35  vtkSetStringMacro(FileName);
36  vtkGetStringMacro(FileName);
37 
38  vtkSetStringMacro(DataFileName);
39  vtkGetStringMacro(DataFileName);
40 
41  vtkGetMacro(NumberOfTimeSteps, int);
43 
46  vtkGetVector2Macro(TimeStepRange, int);
47  vtkSetVector2Macro(TimeStepRange, int);
49 
53  int GetNumberOfPointArrays();
54 
59  const char* GetPointArrayName(int index);
63  vtkSetMacro(CleanGrid, int);
64  vtkGetMacro(CleanGrid, int);
65  vtkBooleanMacro(CleanGrid, int);
66 
68 
71  vtkSetMacro(SpectralElementIds, int);
72  vtkGetMacro(SpectralElementIds, int);
73  vtkBooleanMacro(SpectralElementIds, int);
75 
77 
80  bool GetPointArrayStatus(const char* name);
81  bool GetPointArrayStatus(int index);
82  void SetPointArrayStatus(const char* name, int status);
84 
86 
89  void DisableAllPointArrays();
90  void EnableAllPointArrays();
92 
96  size_t GetVariableNamesFromData(char* varTags);
97 
98  int CanReadFile(const char* fname);
99 
100 protected:
102  ~vtkNek5000Reader() override;
103 
104  char* FileName;
106  // int ElementResolution;
107  // int BoundaryResolution;
108  int nfields;
109  // int my_patch_id;
110 
111  int num_vars; // all vars including Pressure, Velocity, Velocity Magnitude and Temperature
112  char** var_names;
113  float** dataArray;
115 
117 
120 
121  // Tri* T;
122  class nek5KList;
123  class nek5KObject;
124  nek5KList* myList;
125  nek5KObject* curObj;
129 
130  float* meshCoords;
131 
136 
137  // void setActive(); // set my_patch_id as the active one
138  // static int getNextPatchID(){return(next_patch_id++);}
139 
141 
142  // update which fields from the data should be used, based on GUI
143  void updateVariableStatus();
144  void partitionAndReadMesh();
145  void readData(char* dfName);
146  // copy the data from nek5000 to pv
147  void updateVtuData(vtkUnstructuredGrid* pv_ugrid); //, vtkUnstructuredGrid* pv_boundary_ugrid);
148  void addCellsToContinuumMesh();
149  void addSpectralElementId(int nelements);
150  void copyContinuumPoints(vtkPoints* points);
151  // void interpolateAndCopyContinuumData(vtkUnstructuredGrid* pv_ugrid, double **data_array, int
152  // interp_res, int num_verts);
153  void copyContinuumData(vtkUnstructuredGrid* pv_ugrid);
154  // void interpolateAndCopyBoundaryPoints(int alloc_res, int interp_res, vtkPoints*
155  // boundary_points); void interpolateAndCopyBoundaryData(int alloc_res, int num_verts, int
156  // interp_res); void addCellsToBoundaryMesh(int * boundary_index, int qa); void
157  // generateBoundaryConnectivity(int * boundary_index, int res);
158  // see if the current object is missing data that was requested
159  bool isObjectMissingData();
160  // see if the current object matches the request
161  bool objectMatchesRequest();
162  // see if the current object has extra data than was requested
163  bool objectHasExtraData();
164 
166  // vtkUnstructuredGrid* Boundary_UGrid;
167  bool CALC_GEOM_FLAG; // true = need to calculate continuum geometry; false = geom is up to date
168  // bool CALC_BOUNDARY_GEOM_FLAG; // true = need to calculate boundary geometry; false = boundary
169  // geom is up to date bool HAVE_BOUNDARY_GEOM_FLAG; // true = we have boundary geometry; false =
170  // geom has not been read yet
171 
172  bool READ_GEOM_FLAG; // true = need continuum geom from disk
173  // bool READ_BOUNDARY_GEOM_FLAG; // true = need boundary geom from disk
176 
177  bool MeshIs3D;
178  // int TimeStep;
180  int blockDims[3];
190  double TimeValue;
191  int TimeStepRange[2];
193 
194  std::vector<double> TimeSteps;
195  // int UseProjection;
196  // int ExtractBoundary;
197  // int DynamicMesh;
198  // double DynamicMeshScale;
199 
200  // Time query function. Called by ExecuteInformation().
201  // Fills the TimestepValues array.
202  bool GetAllTimesAndVariableNames(vtkInformationVector*);
203 
205 
206  // Description:
207  // This is called by the superclass.
208  // This is the method you should override.
210 
211 private:
212  vtkNek5000Reader(const vtkNek5000Reader&) = delete; // Not implemented.
213  void operator=(const vtkNek5000Reader&) = delete; // Not implemented.
214 
215  int SpectralElementIds;
216  int CleanGrid;
217 };
218 
219 VTK_ABI_NAMESPACE_END
220 #endif
std::string datafile_format
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270
nek5KObject * curObj
vtkDataArraySelection * PointDataArraySelection
static vtkUnstructuredGridAlgorithm * New()
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Reads Nek5000 format data files.
std::vector< double > TimeSteps
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a simple class to control print indentation
Definition: vtkIndent.h:28
Store on/off settings for data arrays, etc.
dataset represents arbitrary combinations of all possible cell types
virtual vtkMTimeType GetMTime()
Return this object's modified time.
Superclass for algorithms that produce only unstructured grid as output.
Store zero or more vtkInformation instances.
represent and manipulate 3D points
Definition: vtkPoints.h:28
vtkUnstructuredGrid * UGrid