VTK: IO/AMR/vtkAMReXParticlesReader.h Source File

| VTK 9.3.1

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
31 #include "vtkMultiBlockDataSetAlgorithm.h"
32 #include "vtkNew.h" // for vtkNew
33
34 #include <string> // for std::string.
35
36 VTK_ABI_NAMESPACE_BEGIN
37 class vtkDataArraySelection;
38 class vtkMultiPieceDataSet;
39 class vtkMultiProcessController;
40
41 class VTKIOAMR_EXPORT vtkAMReXParticlesReader : public vtkMultiBlockDataSetAlgorithm
42 {
43 public:
44 static vtkAMReXParticlesReader* New();
45 vtkTypeMacro(vtkAMReXParticlesReader, vtkMultiBlockDataSetAlgorithm);
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
71 vtkDataArraySelection* GetPointDataArraySelection() const;
72
76 static int CanReadFile(VTK_FILEPATH const char* fname, const char* particlesType = nullptr);
77
79
83 void SetController(vtkMultiProcessController* controller);
84 vtkGetObjectMacro(Controller, vtkMultiProcessController);
86
87 protected:
88 vtkAMReXParticlesReader();
89 ~vtkAMReXParticlesReader() override;
90
91 int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
92 int RequestInformation(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
93
94 vtkMultiProcessController* Controller;
95 std::string PlotFileName;
96 bool GenerateGlobalIds;
97
98 private:
99 vtkAMReXParticlesReader(const vtkAMReXParticlesReader&) = delete;
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
vtkAMReXParticlesReader
reader for AMReX plotfiles particle data.
Definition: vtkAMReXParticlesReader.h:42
vtkAMReXParticlesReader::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkAMReXParticlesReader::PlotFileName
std::string PlotFileName
Definition: vtkAMReXParticlesReader.h:95
vtkAMReXParticlesReader::SetPlotFileName
void SetPlotFileName(VTK_FILEPATH const char *fname)
Get/Set the AMReX plotfile.
vtkAMReXParticlesReader::GetParticleType
const std::string & GetParticleType() const
Get/Set the particle type to read.
Definition: vtkAMReXParticlesReader.h:62
vtkAMReXParticlesReader::Controller
vtkMultiProcessController * Controller
Definition: vtkAMReXParticlesReader.h:94
vtkAMReXParticlesReader::CanReadFile
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.
vtkAMReXParticlesReader::vtkAMReXParticlesReader
vtkAMReXParticlesReader()
vtkAMReXParticlesReader::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkAMReXParticlesReader::GetPlotFileName
VTK_FILEPATH const char * GetPlotFileName() const
Get/Set the AMReX plotfile.
vtkAMReXParticlesReader::~vtkAMReXParticlesReader
~vtkAMReXParticlesReader() override
vtkAMReXParticlesReader::SetParticleType
void SetParticleType(const std::string &str)
Get/Set the particle type to read.
vtkAMReXParticlesReader::RequestInformation
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkAMReXParticlesReader::New
static vtkAMReXParticlesReader * New()
vtkAMReXParticlesReader::GenerateGlobalIds
bool GenerateGlobalIds
Definition: vtkAMReXParticlesReader.h:96
vtkAMReXParticlesReader::GetPointDataArraySelection
vtkDataArraySelection * GetPointDataArraySelection() const
Get vtkDataArraySelection instance to select point arrays to read.
vtkAMReXParticlesReader::SetController
void SetController(vtkMultiProcessController *controller)
Get/Set the controller to use.
vtkDataArraySelection
Store on/off settings for data arrays, etc.
Definition: vtkDataArraySelection.h:37
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
vtkMultiBlockDataSetAlgorithm
Superclass for algorithms that produce only vtkMultiBlockDataSet as output.
Definition: vtkMultiBlockDataSetAlgorithm.h:25
vtkMultiPieceDataSet
composite dataset to encapsulates pieces of dataset.
Definition: vtkMultiPieceDataSet.h:33
vtkMultiProcessController
Multiprocessing communication superclass.
Definition: vtkMultiProcessController.h:72
vtkNew< vtkDataArraySelection >
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:34
vtkX3D::level
@ level
Definition: vtkX3D.h:395
vtkX3D::string
@ string
Definition: vtkX3D.h:490
vtkMultiBlockDataSetAlgorithm.h
vtkNew.h
VTK_FILEPATH
#define VTK_FILEPATH
Definition: vtkWrappingHints.h:34