VTK  9.3.20240424
vtkXdmf3LightDataHandler.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
15#ifndef vtkXdmf3LightDataHandler_h
16#define vtkXdmf3LightDataHandler_h
17
18#include "vtkIOXdmf3Module.h" // For export macro
19#include "vtkType.h"
20
21// clang-format off
22#include "vtk_xdmf3.h"
23#include VTKXDMF3_HEADER(core/XdmfItem.hpp)
24// clang-format on
25
26#include <set>
27
28class XdmfItem;
29class XdmfGraph;
30class XdmfGrid;
31
32VTK_ABI_NAMESPACE_BEGIN
35
36class VTKIOXDMF3_EXPORT vtkXdmf3LightDataHandler
37{
38public:
42 static shared_ptr<vtkXdmf3LightDataHandler> New(vtkXdmf3SILBuilder* sb, vtkXdmf3ArraySelection* f,
44 vtkXdmf3ArraySelection* sc, unsigned int processor, unsigned int nprocessors);
45
52 void InspectXDMF(shared_ptr<XdmfItem> item, vtkIdType parentVertex, unsigned int depth = 0);
53
57 void ClearGridsIfNeeded(shared_ptr<XdmfItem> domain);
58
63 std::set<double> getTimes();
64
65private:
70
74 void InspectArrays(shared_ptr<XdmfItem> item);
75
79 bool TooDeep(unsigned int depth);
80
84 std::string UniqueName(const std::string& name, bool ForGrid);
85
89 void AddNamedBlock(vtkIdType parentVertex, std::string originalName, std::string uniqueName);
90
94 void AddNamedSet(std::string uniqueName);
95
97
101 void InspectTime(shared_ptr<XdmfItem> item);
102 void GetSetTime(shared_ptr<XdmfGrid> child, unsigned int& cnt);
103 void GetSetTime(shared_ptr<XdmfGraph> child, unsigned int& cnt);
105
109 bool ShouldRead(unsigned int piece, unsigned int npieces);
110
111 vtkXdmf3SILBuilder* SILBuilder;
112 vtkXdmf3ArraySelection* FieldArrays;
113 vtkXdmf3ArraySelection* CellArrays; // ie EdgeArrays for Graphs
114 vtkXdmf3ArraySelection* PointArrays; // ie NodeArrays for Graphs
115 vtkXdmf3ArraySelection* GridsCache;
116 vtkXdmf3ArraySelection* SetsCache;
117 unsigned int MaxDepth;
118 unsigned int Rank;
119 unsigned int NumProcs;
120 std::set<double> times; // relying on implicit sort from set<double>
121};
122
123VTK_ABI_NAMESPACE_END
124#endif // vtkXdmf3LightDataHandler_h
125// VTK-HeaderTest-Exclude: vtkXdmf3LightDataHandler.h
helper to identify requested arrays with
internal helper for vtkXdmf3Reader
std::set< double > getTimes()
return the list of times that the xdmf file can provide data at only valid after InspectXDMF
static shared_ptr< vtkXdmf3LightDataHandler > New(vtkXdmf3SILBuilder *sb, vtkXdmf3ArraySelection *f, vtkXdmf3ArraySelection *ce, vtkXdmf3ArraySelection *pn, vtkXdmf3ArraySelection *gc, vtkXdmf3ArraySelection *sc, unsigned int processor, unsigned int nprocessors)
factory constructor
void ClearGridsIfNeeded(shared_ptr< XdmfItem > domain)
called to make sure overflown SIL doesn't give nonsensical results
void InspectXDMF(shared_ptr< XdmfItem > item, vtkIdType parentVertex, unsigned int depth=0)
recursively inspect XDMF data hierarchy to determine times that we can provide data at name of arrays...
helper to allow block selection
int vtkIdType
Definition vtkType.h:315