VTK  9.3.20240328
vtkAMReXParticlesReader.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
27 #ifndef vtkAMReXParticlesReader_h
28 #define vtkAMReXParticlesReader_h
29 
30 #include "vtkIOAMRModule.h" // For export macro
32 #include "vtkNew.h" // for vtkNew
33 
34 #include <string> // for std::string.
35 
36 VTK_ABI_NAMESPACE_BEGIN
40 
42 {
43 public:
46  void PrintSelf(ostream& os, vtkIndent indent) override;
47 
49 
53  void SetPlotFileName(VTK_FILEPATH const char* fname);
54  VTK_FILEPATH const char* GetPlotFileName() const;
56 
58 
61  void SetParticleType(const std::string& str);
62  const std::string& GetParticleType() const { return this->ParticleType; }
64 
72 
76  static int CanReadFile(VTK_FILEPATH const char* fname, const char* particlesType = nullptr);
77 
79 
84  vtkGetObjectMacro(Controller, vtkMultiProcessController);
86 
87 protected:
90 
93 
97 
98 private:
100  void operator=(const vtkAMReXParticlesReader&) = delete;
101 
105  bool ReadMetaData();
106 
111  bool ReadLevel(int level, vtkMultiPieceDataSet* pdataset, int piece_idx, int num_pieces) const;
112 
113  vtkTimeStamp PlotFileNameMTime;
114  vtkTimeStamp MetaDataMTime;
115  std::string ParticleType;
116  double dataTimeStep;
117  vtkNew<vtkDataArraySelection> PointDataArraySelection;
118 
119  class AMReXParticleHeader;
120  AMReXParticleHeader* Header;
121  friend class AMReXParticleHeader;
122 };
123 
124 VTK_ABI_NAMESPACE_END
125 #endif
reader for AMReX plotfiles particle data.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
void SetPlotFileName(VTK_FILEPATH const char *fname)
Get/Set the AMReX plotfile.
const std::string & GetParticleType() const
Get/Set the particle type to read.
vtkMultiProcessController * Controller
static int CanReadFile(VTK_FILEPATH const char *fname, const char *particlesType=nullptr)
Returns 1 is fname refers to a plotfile that the reader can read.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
VTK_FILEPATH const char * GetPlotFileName() const
Get/Set the AMReX plotfile.
~vtkAMReXParticlesReader() override
void SetParticleType(const std::string &str)
Get/Set the particle type to read.
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
static vtkAMReXParticlesReader * New()
vtkDataArraySelection * GetPointDataArraySelection() const
Get vtkDataArraySelection instance to select point arrays to read.
void SetController(vtkMultiProcessController *controller)
Get/Set the controller to use.
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.
Superclass for algorithms that produce only vtkMultiBlockDataSet as output.
composite dataset to encapsulates pieces of dataset.
Multiprocessing communication superclass.
record modification and/or execution time
Definition: vtkTimeStamp.h:44
@ level
Definition: vtkX3D.h:395
@ string
Definition: vtkX3D.h:490
#define VTK_FILEPATH