VTK  9.1.0
vtkXdmfWriter.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkXdmfWriter.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
15
26#ifndef vtkXdmfWriter_h
27#define vtkXdmfWriter_h
28
29#include "vtkIOXdmf2Module.h" // For export macro
30
32
33#include <string> // Needed for private members
34#include <vector> //
35
36class vtkExecutive;
37
39class vtkDataArray;
40class vtkDataSet;
41class vtkDataObject;
42class vtkFieldData;
43class vtkInformation;
45class vtkXdmfWriterDomainMemoryHandler;
46
47namespace xdmf2
48{
49class XdmfArray;
50class XdmfDOM;
51class XdmfElement;
52class XdmfGrid;
53class XdmfGeometry;
54class XdmfTopology;
55}
56
57class VTKIOXDMF2_EXPORT vtkXdmfWriter : public vtkDataObjectAlgorithm
58{
59public:
60 static vtkXdmfWriter* New();
62 void PrintSelf(ostream& os, vtkIndent indent) override;
63
67 virtual void SetInputData(vtkDataObject* dobj);
68
70
76
78
82 vtkSetFilePathMacro(HeavyDataFileName);
83 vtkGetFilePathMacro(HeavyDataFileName);
85
87
91 vtkSetStringMacro(HeavyDataGroupName);
92 vtkGetStringMacro(HeavyDataGroupName);
94
100 virtual int Write();
101
103
108 vtkSetMacro(LightDataLimit, int);
109 vtkGetMacro(LightDataLimit, int);
111
113
118 vtkSetMacro(WriteAllTimeSteps, int);
119 vtkGetMacro(WriteAllTimeSteps, int);
120 vtkBooleanMacro(WriteAllTimeSteps, int);
122
124
130 vtkSetMacro(MeshStaticOverTime, bool);
131 vtkGetMacro(MeshStaticOverTime, bool);
132 vtkBooleanMacro(MeshStaticOverTime, bool);
134
136
140 vtkSetMacro(Piece, int);
141 vtkSetMacro(NumberOfPieces, int);
143
144 // TODO: control choice of heavy data format (xml, hdf5, sql, raw)
145
146 // TODO: These controls are available in vtkXdmfWriter, but are not used here.
147 // GridsOnly
148 // Append to Domain
149
150protected:
152 ~vtkXdmfWriter() override;
153
154 // Choose composite executive by default for time.
156
157 // Can take any one data object
158 int FillInputPortInformation(int port, vtkInformation* info) override;
159
160 // Overridden to ...
162 // Overridden to ...
164 // Overridden to ...
166
167 // These do the work: recursively parse down input's structure all the way to arrays,
168 // use XDMF lib to dump everything to file.
169
170 virtual int CreateTopology(vtkDataSet* ds, xdmf2::XdmfGrid* grid, vtkIdType PDims[3],
171 vtkIdType CDims[3], vtkIdType& PRank, vtkIdType& CRank, void* staticdata);
172 virtual int CreateGeometry(vtkDataSet* ds, xdmf2::XdmfGrid* grid, void* staticdata);
173
174 virtual int WriteDataSet(vtkDataObject* dobj, xdmf2::XdmfGrid* grid);
175 virtual int WriteCompositeDataSet(vtkCompositeDataSet* dobj, xdmf2::XdmfGrid* grid);
176 virtual int WriteAtomicDataSet(vtkDataObject* dobj, xdmf2::XdmfGrid* grid);
177 virtual int WriteArrays(vtkFieldData* dsa, xdmf2::XdmfGrid* grid, int association, vtkIdType rank,
178 vtkIdType* dims, const char* name);
179 virtual void ConvertVToXArray(vtkDataArray* vda, xdmf2::XdmfArray* xda, vtkIdType rank,
180 vtkIdType* dims, int AllocStrategy, const char* heavyprefix);
181
182 virtual void SetupDataArrayXML(xdmf2::XdmfElement*, xdmf2::XdmfArray*) const;
183
184 char* FileName;
187 std::string WorkingDirectory;
188 std::string BaseFileName;
189
191
198
199 int Piece;
201
203
204 xdmf2::XdmfDOM* DOM;
205 xdmf2::XdmfGrid* TopTemporalGrid;
206
207 vtkXdmfWriterDomainMemoryHandler* DomainMemoryHandler;
208
209 std::vector<xdmf2::XdmfTopology*> TopologyAtT0;
210 std::vector<xdmf2::XdmfGeometry*> GeometryAtT0;
211
212private:
213 vtkXdmfWriter(const vtkXdmfWriter&) = delete;
214 void operator=(const vtkXdmfWriter&) = delete;
215};
216
217#endif /* vtkXdmfWriter_h */
abstract superclass for composite (multi-block or AMR) datasets
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:159
Superclass for algorithms that produce only data object as output.
general representation of visualization data
abstract class to specify dataset behavior
Definition: vtkDataSet.h:166
Superclass for all pipeline executives in VTK.
Definition: vtkExecutive.h:76
represent and manipulate fields of data
Definition: vtkFieldData.h:164
a simple class to control print indentation
Definition: vtkIndent.h:113
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
write eXtensible Data Model and Format files
Definition: vtkXdmfWriter.h:58
int UnlabelledDataArrayId
xdmf2::XdmfDOM * DOM
int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
bool MeshStaticOverTime
virtual void ConvertVToXArray(vtkDataArray *vda, xdmf2::XdmfArray *xda, vtkIdType rank, vtkIdType *dims, int AllocStrategy, const char *heavyprefix)
virtual int CreateGeometry(vtkDataSet *ds, xdmf2::XdmfGrid *grid, void *staticdata)
vtkSetFilePathMacro(HeavyDataFileName)
Set or get the file name of the hdf5 file.
vtkXdmfWriterDomainMemoryHandler * DomainMemoryHandler
vtkExecutive * CreateDefaultExecutive() override
Create a default executive.
xdmf2::XdmfGrid * TopTemporalGrid
virtual int WriteDataSet(vtkDataObject *dobj, xdmf2::XdmfGrid *grid)
vtkGetFilePathMacro(FileName)
Set or get the file name of the xdmf file.
virtual int CreateTopology(vtkDataSet *ds, xdmf2::XdmfGrid *grid, vtkIdType PDims[3], vtkIdType CDims[3], vtkIdType &PRank, vtkIdType &CRank, void *staticdata)
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
std::vector< xdmf2::XdmfGeometry * > GeometryAtT0
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
double CurrentTime
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
virtual void SetupDataArrayXML(xdmf2::XdmfElement *, xdmf2::XdmfArray *) const
virtual int Write()
Write data to output.
std::string WorkingDirectory
virtual int WriteCompositeDataSet(vtkCompositeDataSet *dobj, xdmf2::XdmfGrid *grid)
virtual int WriteAtomicDataSet(vtkDataObject *dobj, xdmf2::XdmfGrid *grid)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual int WriteArrays(vtkFieldData *dsa, xdmf2::XdmfGrid *grid, int association, vtkIdType rank, vtkIdType *dims, const char *name)
static vtkXdmfWriter * New()
~vtkXdmfWriter() override
std::vector< xdmf2::XdmfTopology * > TopologyAtT0
vtkSetFilePathMacro(FileName)
Set or get the file name of the xdmf file.
std::string BaseFileName
char * HeavyDataFileName
virtual void SetInputData(vtkDataObject *dobj)
Set the input data set.
vtkGetFilePathMacro(HeavyDataFileName)
Set or get the file name of the hdf5 file.
char * HeavyDataGroupName
int vtkIdType
Definition: vtkType.h:332