VTK  9.7.20260828
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
14
15#ifndef vtkNek5000Reader_h
16#define vtkNek5000Reader_h
17
18#include "vtkIOParallelModule.h" // For export macro
20
21#include <cstdint>
22
23VTK_ABI_NAMESPACE_BEGIN
24
25class vtkPoints;
27
28class VTKIOPARALLEL_EXPORT vtkNek5000Reader : public vtkUnstructuredGridAlgorithm
29{
30public:
33 void PrintSelf(ostream& os, vtkIndent indent) override;
34
36
37 vtkSetStringMacro(FileName);
38 vtkGetStringMacro(FileName);
39
40 vtkSetStringMacro(DataFileName);
41 vtkGetStringMacro(DataFileName);
42
43 vtkGetMacro(NumberOfTimeSteps, int);
45
48 vtkGetVector2Macro(TimeStepRange, int);
49 vtkSetVector2Macro(TimeStepRange, int);
51
56
61 const char* GetPointArrayName(int index);
65 vtkSetMacro(CleanGrid, int);
66 vtkGetMacro(CleanGrid, int);
67 vtkBooleanMacro(CleanGrid, int);
68
70
73 vtkSetMacro(SpectralElementIds, int);
74 vtkGetMacro(SpectralElementIds, int);
75 vtkBooleanMacro(SpectralElementIds, int);
77
79
82 bool GetPointArrayStatus(const char* name);
83 bool GetPointArrayStatus(int index);
84 void SetPointArrayStatus(const char* name, int status);
86
88
94
98 size_t GetVariableNamesFromData(char* varTags);
99
100 int CanReadFile(const char* fname);
101
102protected:
105
106 char* FileName;
108 // int ElementResolution;
109 // int BoundaryResolution;
111 // int my_patch_id;
112
113 int num_vars; // all vars including Pressure, Velocity, Velocity Magnitude and Temperature
114 char** var_names;
115 float** dataArray;
117
119
122
123 // Tri* T;
124 class nek5KList;
125 class nek5KObject;
126 nek5KList* myList;
127 nek5KObject* curObj;
131
133
134 std::string datafile_format;
138
139 // void setActive(); // set my_patch_id as the active one
140 // static int getNextPatchID(){return(next_patch_id++);}
141
143
144 // update which fields from the data should be used, based on GUI
147 void readData(char* dfName);
148 // copy the data from nek5000 to pv
149 void updateVtuData(vtkUnstructuredGrid* pv_ugrid); //, vtkUnstructuredGrid* pv_boundary_ugrid);
151 void addSpectralElementId(int64_t nelements);
153 // void interpolateAndCopyContinuumData(vtkUnstructuredGrid* pv_ugrid, double **data_array, int
154 // interp_res, int num_verts);
156 // void interpolateAndCopyBoundaryPoints(int alloc_res, int interp_res, vtkPoints*
157 // boundary_points); void interpolateAndCopyBoundaryData(int alloc_res, int num_verts, int
158 // interp_res); void addCellsToBoundaryMesh(int * boundary_index, int qa); void
159 // generateBoundaryConnectivity(int * boundary_index, int res);
160 // see if the current object is missing data that was requested
162 // see if the current object matches the request
164 // see if the current object has extra data than was requested
166
168 // vtkUnstructuredGrid* Boundary_UGrid;
169 bool CALC_GEOM_FLAG; // true = need to calculate continuum geometry; false = geom is up to date
170 // bool CALC_BOUNDARY_GEOM_FLAG; // true = need to calculate boundary geometry; false = boundary
171 // geom is up to date bool HAVE_BOUNDARY_GEOM_FLAG; // true = we have boundary geometry; false =
172 // geom has not been read yet
173
174 bool READ_GEOM_FLAG; // true = need continuum geom from disk
175 // bool READ_BOUNDARY_GEOM_FLAG; // true = need boundary geom from disk
178
180 // int TimeStep;
182 int blockDims[3];
185 int64_t numBlocks;
186 int64_t myNumBlocks;
192 double TimeValue;
195
196 std::vector<double> TimeSteps;
197 // int UseProjection;
198 // int ExtractBoundary;
199 // int DynamicMesh;
200 // double DynamicMeshScale;
201
202 // Time query function. Called by ExecuteInformation().
203 // Fills the TimestepValues array.
205
207
208 // Description:
209 // This is called by the superclass.
210 // This is the method you should override.
212
213private:
214 vtkNek5000Reader(const vtkNek5000Reader&) = delete; // Not implemented.
215 void operator=(const vtkNek5000Reader&) = delete; // Not implemented.
216
217 int SpectralElementIds;
218 int CleanGrid;
219};
220
221VTK_ABI_NAMESPACE_END
222#endif
Store on/off settings for data arrays, etc.
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
std::vector< double > TimeSteps
void copyContinuumPoints(vtkPoints *points)
void updateVariableStatus()
nek5KObject * curObj
static vtkNek5000Reader * New()
void updateVtuData(vtkUnstructuredGrid *pv_ugrid)
void SetPointArrayStatus(const char *name, int status)
Get/Set whether the point array with the given name or index is to be read.
vtkUnstructuredGrid * UGrid
void DisableAllPointArrays()
Turn on/off all point arrays.
bool GetAllTimesAndVariableNames(vtkInformationVector *)
int CanReadFile(const char *fname)
void addCellsToContinuumMesh()
bool objectMatchesRequest()
bool isObjectMissingData()
vtkMTimeType GetMTime() override
Return this object's modified time.
vtkDataArraySelection * PointDataArraySelection
const char * GetPointArrayName(int index)
Get the name of the point array with the given index in the input.
size_t GetVariableNamesFromData(char *varTags)
Get the names of variables stored in the data.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
bool objectHasExtraData()
std::string datafile_format
bool GetPointArrayStatus(const char *name)
Get/Set whether the point array with the given name or index is to be read.
void partitionAndReadMesh()
void copyContinuumData(vtkUnstructuredGrid *pv_ugrid)
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
void addSpectralElementId(int64_t nelements)
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
int GetNumberOfPointArrays()
Get the number of point arrays available in the input.
void EnableAllPointArrays()
Turn on/off all point arrays.
~vtkNek5000Reader() override
void readData(char *dfName)
bool GetPointArrayStatus(int index)
Get/Set whether the point array with the given name or index is to be read.
represent and manipulate 3D points
Definition vtkPoints.h:140
dataset represents arbitrary combinations of all possible cell types
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:318