VTK  9.3.20240327
VTXDataArray.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
3 
4 /*
5  * VTXDataArray.h : wrapper around vtkDataArray adding adios2 relevant
6  * information
7  *
8  * Created on: Jun 4, 2019
9  * Author: William F Godoy godoywf@ornl.gov
10  */
11 
12 #ifndef VTK_IO_ADIOS2_VTX_COMMON_VTXDataArray_h
13 #define VTK_IO_ADIOS2_VTX_COMMON_VTXDataArray_h
14 
15 #include "vtkDataArray.h"
16 #include "vtkSmartPointer.h"
17 
18 #include <map>
19 
20 #include <adios2.h>
21 
22 namespace vtx
23 {
24 namespace types
25 {
26 VTK_ABI_NAMESPACE_BEGIN
27 
28 class DataArray
29 {
30 public:
31  std::vector<std::string> VectorVariables;
33 
34  // required for global arrays
35  adios2::Dims Shape;
36  adios2::Dims Start;
37  adios2::Dims Count;
38 
39  // required for local arrays, using maps for now
41  std::map<size_t, adios2::Dims> BlockCounts;
42 
45  bool IsIdType = false;
46 
48  bool HasTuples = false;
49 
55  bool Persist = false;
56 
58  bool IsUpdated = true;
59 
64  bool IsSOA = false;
65 
66  DataArray() = default;
67  ~DataArray() = default;
68 
69  bool IsScalar() const noexcept;
70 
77  void ConvertTo3DVTK(const std::vector<double>& fillValues = std::vector<double>());
78 };
79 
80 VTK_ABI_NAMESPACE_END
81 } // end namespace types
82 } // end namespace vtx
83 
84 #endif /* VTK_IO_ADIOS2_VTX_COMMON_VTXDataArray_h */
adios2::Dims Shape
Definition: VTXDataArray.h:35
void ConvertTo3DVTK(const std::vector< double > &fillValues=std::vector< double >())
Convert internal vtkDataArray to a 3D VTK conforming array number of components = 3 filling the value...
std::map< size_t, adios2::Dims > BlockCounts
key: blockID, value: block count
Definition: VTXDataArray.h:41
adios2::Dims Start
Definition: VTXDataArray.h:36
bool HasTuples
true: tuples > 1, false: tuples = 1
Definition: VTXDataArray.h:48
vtkSmartPointer< vtkDataArray > Data
Definition: VTXDataArray.h:32
std::vector< std::string > VectorVariables
Definition: VTXDataArray.h:31
bool Persist
true: if variable doesn't exist in a step don't attempt to read, use the latest known values.
Definition: VTXDataArray.h:55
bool IsIdType
true : uses the special vtkIdType for indexing false : uses other VTK supported type
Definition: VTXDataArray.h:45
bool IsScalar() const noexcept
bool IsSOA
true: is struct of arrays (*x, *y, *z) or (XXXX, YYYY, ZZZZ) false (default): is array of structs (xy...
Definition: VTXDataArray.h:64
bool IsUpdated
true: new value is found and read, false: not updated
Definition: VTXDataArray.h:58
adios2::Dims Count
Definition: VTXDataArray.h:37
@ vector
Definition: vtkX3D.h:237