Commit b1cf8ce4 authored by John Biddiscombe's avatar John Biddiscombe
Browse files

BUG: 0005493 - This seems to fix the vector writing and read back issues with Paraview saving Xdmf.

ENH:Added a SetTimeValue method, for supporting multiple time steps in the same xdmf file.
Added lag AppendGridsToDomain, to allow multiple grids into one file.
Added a flag InputsArePieces, this allows blocks(pieces)  to be added one by one and then all written as one large dataset.
Added FullGridSize  method to support piece writing.
Various other small bug tweaks addressed with extents and hdf5 read/write issues
parent 067edbc3
This diff is collapsed.
......@@ -28,11 +28,19 @@
#include "vtkProcessObject.h"
// from "XdmfGrid.h"
#define XDMF_GRID_COLLECTION_TEMPORAL 0x0001
#define XDMF_GRID_COLLECTION_SPATIAL 0x0002
#define XDMF_GRID_COLLECTION_UNSET 0x0FFFF
class vtkDataSet;
class vtkPoints;
class vtkCellArray;
class vtkDataArray;
class vtkDataSetCollection;
//BTX
class XdmfDOM;
//ETX
class VTK_EXPORT vtkXdmfWriter : public vtkProcessObject
{
......@@ -90,6 +98,44 @@ public:
// Set the input data set.
virtual void SetInput(vtkDataSet* ds);
// Description:
// If InputsArePieces is set, the onpuits are considered to be parts/pieces
// of a larger grid and are joined together inside the hdf5 file
vtkSetClampMacro(InputsArePieces, int, 0, 1);
vtkBooleanMacro(InputsArePieces, int);
vtkGetMacro(InputsArePieces, int);
// Description:
// When InputsArePieces is set, this is the true size of the data
vtkSetVector3Macro(FullGridSize, int);
vtkGetVectorMacro(FullGridSize, int, 3);
// Description:
// If appending many time steps together into a single file
// you should set CollectionType to "Temporal",
// when appending grids into a multi-block type structure
// use collection type is "Spatial". By default, Collection type is Unset
vtkSetMacro(CollectionType, int);
vtkGetMacro(CollectionType, int);
void SetCollectionTypeToTemporal() {
this->SetCollectionType(XDMF_GRID_COLLECTION_TEMPORAL); }
void SetCollectionTypeToSpatial() {
this->SetCollectionType(XDMF_GRID_COLLECTION_SPATIAL); }
void CloseCollection();
// Description:
// Set the time value of this data
vtkSetMacro(TimeValue, double);
vtkGetMacro(TimeValue, double);
// Description:
// If AppendGridsToDomain is set, the existing xdmf xml file is opeded
// and new grid are added to the existing domain inside it.
// No checking is performed on the structuire of the file.
vtkSetClampMacro(AppendGridsToDomain, int, 0, 1);
vtkBooleanMacro(AppendGridsToDomain, int);
vtkGetMacro(AppendGridsToDomain, int);
// Description:
// Write the XDMF file.
void Write();
......@@ -146,7 +192,10 @@ protected:
virtual int WriteVTKArray( ostream& ost, vtkDataArray* array, vtkDataSet* dataSet,
int dims[3], int *extents, const char* name, const char* dataName, const char* gridName, int alllight,
int cellData = 0);
virtual bool ReadDocument(const char* filename);
virtual int ParseExistingFile(const char* filename);
vtkSetStringMacro(HeavyDataSetNameString);
char *HeavyDataSetNameString;
......@@ -163,6 +212,11 @@ protected:
int GridOnly;
int AppendGridsToDomain;
int InputsArePieces;
int FullGridSize[3];
double TimeValue;
vtkSetStringMacro(HDF5ArrayName);
char* HDF5ArrayName;
......@@ -170,6 +224,13 @@ protected:
// Here as a convenience. It is a copy of the input array.
vtkDataSetCollection *InputList;
char *DocString;
int CollectionType;
XdmfDOM *DOM;
public:
int CurrentInputNumber;
private:
vtkXdmfWriter(const vtkXdmfWriter&); // Not implemented
void operator=(const vtkXdmfWriter&); // Not implemented
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment