23#ifndef vtkAMReXGridReaderInternal_h
24#define vtkAMReXGridReaderInternal_h
101 std::string vectorNamePrefix =
"amrexvec";
104 char nameDelim =
'_';
121 std::vector<std::vector<std::vector<std::vector<double>>>>
levelCells;
130 bool Parse(
const std::string& headerData);
140 std::string GetBaseVariableName(
const std::string& name);
143 int CheckComponent(
const std::string& name);
146 bool HasVectorPrefix(
const std::string& name);
166 NoFabHeaderMinMax_v1 = 3,
168 NoFabHeaderFAMinMax_v1 = 4
202 bool Parse(
int _level,
int _dim,
const std::string& headerData);
247 void* out,
const void* in,
long nitems,
const int* outord,
const int* inord,
int REALSIZE);
249 template <
typename T>
251 const RealDescriptor* ird,
const std::vector<std::vector<char>>& buffers,
252 const int numberOfPoints,
const std::string& attribute);
260 friend class vtkAMReXGridLeveHeader;
266 const std::vector<std::vector<char>>& buffers,
const int numberOfPoints,
267 const std::string& attribute)
269 int nComps =
static_cast<int>(this->Header->parsedVariableNames[attribute].size());
270 dataArray->
SetName(attribute.c_str());
273 T* arrayPtr =
new T[numberOfPoints];
274 for (
int j = 0; j < nComps; ++j)
276 this->Convert(arrayPtr, buffers[j].data(), numberOfPoints, *ord, *ird);
279 for (
int i = 0; i < numberOfPoints; ++i)
const int * order() const &
const std::vector< long > & formatarray() const &
const std::vector< int > & orderarray() const &
const long * format() const &
RealDescriptor(const long *format, const int *order, int order_length)
Consists of the low-level AMReX Reader used by the vtkAMReXGridReader.
void ReadFAB(std::istream &is)
void ReadFormat(std::istream &is, std::vector< long > &ar)
void Convert(void *out, const void *in, long nitems, const RealDescriptor &ord, const RealDescriptor &ird)
int GetOffsetOfAttribute(const char *attribute)
vtkAMReXGridReaderInternal()
int GetBlockLevel(const int blockIdx)
std::vector< vtkAMReXGridLevelHeader * > LevelHeader
void GetBlockAttribute(const char *attribute, int blockIdx, vtkDataSet *pDataSet)
void PrintSelf(std::ostream &os, vtkIndent indent)
void DestroyLevelHeader()
void ReadBlockAttribute(std::istream &is, int numberOfPoints, int size, char *buffer)
RealDescriptor * ReadRealDescriptor(std::istream &is)
int ReadBoxArray(std::istream &is, int *boxArray, int *boxArrayDim)
void PermuteOrder(void *out, const void *in, long nitems, const int *outord, const int *inord, int REALSIZE)
void PrintBoxArray(int *boxArray)
int GetBlockIndexWithinLevel(int blockIdx, int level)
int ReadNumberOfAttributes(std::istream &is)
void PrintOrder(std::vector< int > &ar)
void PrintFormat(std::vector< long > &ar)
int ReadVersion(std::istream &is)
void SetFileName(char *fName)
~vtkAMReXGridReaderInternal()
vtkAMReXGridHeader * Header
void CreateVTKAttributeArray(vtkAOSDataArrayTemplate< T > *dataArray, const RealDescriptor *ord, const RealDescriptor *ird, const std::vector< std::vector< char > > &buffers, const int numberOfPoints, const std::string &attribute)
void ReadOrder(std::istream &is, std::vector< int > &ar)
Array-Of-Structs implementation of vtkGenericDataArray.
void SetTypedComponent(vtkIdType tupleIdx, int comp, ValueType value)
Set component comp of the tuple at tupleIdx to value.
virtual void SetName(const char *)
Set/get array's name.
abstract class to specify dataset behavior
void SetNumberOfComponents(int num) override
Set/Get the dimension (n) of the components.
void SetNumberOfTuples(vtkIdType number) override
Set the number of tuples (a component group) in the array.
a simple class to control print indentation