3 #ifndef HDFTestUtilities_h
4 #define HDFTestUtilities_h
39 this->Descriptors = descriptors;
41 void SetMasks(
const std::vector<std::string>& masks) { this->Masks = masks; }
44 this->Dimensions = dimensions;
65 std::vector<double> timeSteps(this->Descriptors.size());
66 std::iota(timeSteps.begin(), timeSteps.end(), 0);
67 double timeRange[2] = { timeSteps.front(), timeSteps.back() };
69 static_cast<int>(timeSteps.size()));
71 static_cast<int>(
sizeof(timeRange) /
sizeof(timeRange[0])));
87 intSource->
SetMask(this->Masks.at(static_cast<int>(this->RequestedTime)).c_str());
90 intSource->
SetDescriptor(this->Descriptors.at(static_cast<int>(this->RequestedTime)).c_str());
114 if (outInfo->
Has(vtkSDDP::UPDATE_PIECE_NUMBER()))
116 intSource->
UpdatePiece(outInfo->
Get(vtkSDDP::UPDATE_PIECE_NUMBER()),
117 outInfo->
Get(vtkSDDP::UPDATE_NUMBER_OF_PIECES()), 0);
133 std::vector<std::string> Descriptors;
134 std::vector<std::string> Masks;
135 std::array<unsigned int, 3> Dimensions;
136 unsigned int BranchFactor = 2;
138 double RequestedTime = 0.0;
155 this->IntCols.insert({
name, values });
160 this->DoubleCols.insert({
name, values });
180 std::vector<double> timeSteps(this->IntCols.begin()->second.size());
181 std::iota(timeSteps.begin(), timeSteps.end(), 0);
182 double timeRange[2] = { timeSteps.front(), timeSteps.back() };
184 static_cast<int>(timeSteps.size()));
186 static_cast<int>(
sizeof(timeRange) /
sizeof(timeRange[0])));
201 for (
const auto& it : IntCols)
204 arr->
SetName(it.first.c_str());
208 arr->
SetValue(i, it.second.at(RequestedTime).at(i));
210 output->AddColumn(arr);
213 for (
const auto& it : DoubleCols)
216 arr->
SetName(it.first.c_str());
220 arr->
SetValue(i, it.second.at(RequestedTime).at(i));
222 output->AddColumn(arr);
232 std::map<std::string, std::vector<std::vector<int>>> IntCols;
233 std::map<std::string, std::vector<std::vector<double>>> DoubleCols;
void SetDescriptors(const std::vector< std::string > &descriptors)
vtkHTGChangingDescriptorSource()
virtual void SetNumberOfTuples(vtkIdType numTuples)
Set the number of tuples (a component group) in the array.
static vtkHyperTreeGrid * SafeDownCast(vtkObjectBase *o)
void AddTemporalColumn(const std::string &name, const std::vector< std::vector< int >> &values)
virtual void SetNumberOfInputPorts(int n)
Set the number of input ports used by the algorithm.
virtual bool Update(int port)
Bring this algorithm's outputs up-to-date.
A dataset containing a grid of vtkHyperTree instances arranged as a rectilinear grid.
virtual bool GetUseMask()
Set/get whether the material mask should be used.
static vtkHTGChangingDescriptorSource * New()
virtual int UpdatePiece(int piece, int numPieces, int ghostLevels, const int extents[6]=nullptr)
Convenience method to update an algorithm after passing requests to its first output port...
void AddTemporalColumn(const std::string &name, const std::vector< std::vector< double >> &values)
vtkDataObject * GetOutputDataObject(int port)
Get the data object that will contain the algorithm output for the given port.
virtual void SetNumberOfOutputPorts(int n)
Set the number of output ports provided by the algorithm.
void SetMaxDepth(unsigned int levels)
Set the maximum number of levels of the hypertrees.
virtual void SetName(const char *)
Set/get array's name.
void SetMasks(const std::vector< std::string > &masks)
void SetValue(vtkIdType valueIdx, ValueType value)
Set the value at valueIdx to value.
void SetBranchFactor(const unsigned int bf)
int FillOutputPortInformation(int, vtkInformation *info) override
Fill the output port information objects for this algorithm.
virtual void SetUseMask(bool)
Set/get whether the material mask should be used.
vtkIdType GetNumberOfTuples() const
Get the number of complete tuples (a component group) in the array.
virtual void SetBranchFactor(unsigned int)
Set/Get the subdivision factor in the grid refinement scheme.
Custom source to generate time-dependent vtkTable.
int FillOutputPortInformation(int, vtkInformation *info) override
Define default input and output port types.
void SetDimensions(const std::array< unsigned int, 3 > &dimensions)
virtual void SetDescriptor(const char *)
Set/Get the string used to describe the grid.
virtual void SetMask(const char *)
Set/Get the string used to as a material mask.
int ProcessTrees(vtkHyperTreeGrid *, vtkDataObject *) override
Main routine to process individual trees in the grid This is pure virtual method to be implemented by...
Superclass for algorithms that produce a hyper tree grid as output.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *outputVector) override
This is called by the superclass.
Superclass for algorithms that produce only vtkTables as output.
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *outputVector) override
static vtkTable * SafeDownCast(vtkObjectBase *o)
Executive supporting partial updates.
Custom source to generate time-dependent HTG.
general representation of visualization data
static vtkTemporalTableSource * New()
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *outputVector) override
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *outputVector) override
This is called by the superclass.
void SetDimensions(const unsigned int *dims)
Set/Get the number of root cells + 1 in each dimension of the grid.