21 #ifndef vtkPEnSightReader_h 22 #define vtkPEnSightReader_h 41 class vtkPEnSightReaderCellIdsType;
43 #define NEXTMODULO3(x) (x == 0) ? 1 : ((x == 1) ? 2 : 0) 66 , cellLocalNumberOfIds(-1)
68 , ImplicitDimensions(nullptr)
69 , ImplicitLocalDimensions(nullptr)
70 , ImplicitSplitDimension(-1)
71 , ImplicitSplitDimensionBeginIndex(-1)
72 , ImplicitSplitDimensionEndIndex(-1)
80 , cellLocalNumberOfIds(-1)
82 , ImplicitDimensions(nullptr)
83 , ImplicitLocalDimensions(nullptr)
84 , ImplicitSplitDimension(-1)
85 , ImplicitSplitDimensionBeginIndex(-1)
86 , ImplicitSplitDimensionEndIndex(-1)
91 this->cellMap =
new IntIntMap;
92 this->cellNumberOfIds = 0;
93 this->cellVector =
nullptr;
97 this->ImplicitDimensions =
new int[3];
98 this->ImplicitSplitDimension = -1;
99 this->ImplicitSplitDimensionBeginIndex = -1;
100 this->ImplicitSplitDimensionEndIndex = -1;
104 this->cellMap =
nullptr;
105 this->cellVector =
new IntVector;
106 this->cellNumberOfIds = -1;
107 this->cellLocalNumberOfIds = -1;
113 delete this->cellMap;
114 delete this->cellVector;
115 delete[] this->ImplicitDimensions;
123 this->cellMap =
new IntIntMap;
124 this->cellNumberOfIds = 0;
125 this->cellVector =
nullptr;
129 this->ImplicitDimensions =
new int[3];
130 this->ImplicitSplitDimension = -1;
131 this->ImplicitSplitDimensionBeginIndex = -1;
132 this->ImplicitSplitDimensionEndIndex = -1;
136 this->cellMap =
nullptr;
137 this->cellVector =
new IntVector;
138 this->cellNumberOfIds = -1;
139 this->cellLocalNumberOfIds = -1;
145 this->ImplicitDimensions[0] = dim1;
146 this->ImplicitDimensions[1] = dim2;
147 this->ImplicitDimensions[2] = dim3;
154 this->ImplicitSplitDimensionBeginIndex = begin;
172 if (this->ImplicitSplitDimension == -1)
178 index[2] =
id / (this->ImplicitDimensions[0] * this->ImplicitDimensions[1]);
179 index[1] = (
id - (index[2] * this->ImplicitDimensions[0] * this->ImplicitDimensions[1])) /
180 this->ImplicitDimensions[0];
181 index[0] =
id - index[1] * this->ImplicitDimensions[0] -
182 index[2] * this->ImplicitDimensions[1] * this->ImplicitDimensions[0];
183 if ((index[this->ImplicitSplitDimension] < this->ImplicitSplitDimensionBeginIndex) ||
184 (index[this->ImplicitSplitDimension] >= this->ImplicitSplitDimensionEndIndex))
194 int dim = this->ImplicitSplitDimension;
195 localIndex[dim] = index[dim] - this->ImplicitSplitDimensionBeginIndex;
197 this->ImplicitSplitDimensionEndIndex - this->ImplicitSplitDimensionBeginIndex;
199 localIndex[dim] = index[dim];
200 localDim[dim] = this->ImplicitDimensions[dim];
202 localDim[dim] = this->ImplicitDimensions[dim];
203 localIndex[dim] = index[dim];
204 return localIndex[0] + localDim[0] * localIndex[1] +
205 localDim[0] * localDim[1] * localIndex[2];
210 std::map<int, int>::iterator it = this->cellMap->find(
id);
211 if (it == this->cellMap->end())
214 return (*this->cellMap)[id];
219 if (this->cellVector->size() > (
unsigned int)(
id))
220 return (*this->cellVector)[id];
240 std::map<int, int>::iterator it = this->cellMap->find(
id);
241 if (it == this->cellMap->end())
242 this->cellNumberOfIds++;
244 (*this->cellMap)[
id] = value;
249 if (this->cellVector->size() < (
unsigned int)(
id + 1))
252 int currentSize =
static_cast<int>(this->cellVector->size());
253 this->cellVector->resize(
id + 1);
254 for (k = currentSize; k < id; k++)
256 (*this->cellVector)[k] = -1;
258 (*this->cellVector)[
id] = value;
262 (*this->cellVector)[
id] = value;
285 (*this->cellMap)[this->cellNumberOfIds] =
id;
288 this->cellNumberOfIds++;
289 return this->cellNumberOfIds - 1;
294 this->cellVector->push_back(
id);
295 return static_cast<int>(this->cellVector->size() - 1);
299 return static_cast<int>(this->cellVector->size() - 1);
309 return this->cellNumberOfIds;
314 return this->cellNumberOfIds;
318 return this->cellNumberOfIds;
332 if (this->cellNumberOfIds >= 0)
334 return this->cellNumberOfIds;
337 return static_cast<int>(this->cellVector->size());
350 this->cellNumberOfIds = n;
364 this->cellLocalNumberOfIds = n;
372 this->cellMap->clear();
373 this->cellNumberOfIds = 0;
378 this->cellVector->clear();
379 if (this->cellNumberOfIds >= 0)
380 this->cellNumberOfIds = -1;
381 if (this->cellLocalNumberOfIds >= 0)
382 this->cellLocalNumberOfIds = -1;
393 return this->cellNumberOfIds;
398 return this->cellLocalNumberOfIds;
402 return static_cast<int>(this->cellMap->size());
412 if (this->cellLocalNumberOfIds >= 0)
414 return this->cellLocalNumberOfIds;
419 for (
unsigned int i = 0; i < this->cellVector->size(); i++)
421 if ((*this->cellVector)[i] != -1)
465 NUMBER_OF_ELEMENT_TYPES = 17
472 TENSOR_SYMM_PER_NODE = 2,
473 SCALAR_PER_ELEMENT = 3,
474 VECTOR_PER_ELEMENT = 4,
475 TENSOR_SYMM_PER_ELEMENT = 5,
476 SCALAR_PER_MEASURED_NODE = 6,
477 VECTOR_PER_MEASURED_NODE = 7,
478 COMPLEX_SCALAR_PER_NODE = 8,
479 COMPLEX_VECTOR_PER_NODE = 9,
480 COMPLEX_SCALAR_PER_ELEMENT = 10,
481 COMPLEX_VECTOR_PER_ELEMENT = 11
496 vtkGetStringMacro(MeasuredFileName);
504 vtkGetStringMacro(MatchFileName);
524 vtkSetStringMacro(MeasuredFileName);
531 vtkSetStringMacro(MatchFileName);
539 int ReadCaseFileGeometry(
char* line);
540 int ReadCaseFileVariable(
char* line);
541 int ReadCaseFileTime(
char* line);
542 int ReadCaseFileFile(
char* line);
551 virtual int ReadGeometryFile(
558 virtual int ReadMeasuredGeometryFile(
570 virtual int ReadScalarsPerNode(
const char* fileName,
const char* description,
int timeStep,
572 int component = 0) = 0;
578 virtual int ReadVectorsPerNode(
const char* fileName,
const char* description,
int timeStep,
585 virtual int ReadTensorsPerNode(
592 virtual int ReadScalarsPerElement(
const char* fileName,
const char* description,
int timeStep,
599 virtual int ReadVectorsPerElement(
606 virtual int ReadTensorsPerElement(
613 virtual int CreateUnstructuredGridOutput(
620 virtual int CreateStructuredGridOutput(
626 void AddVariableFileName(
const char* fileName1,
const char* fileName2 =
nullptr);
631 void AddVariableDescription(
const char* description);
636 void AddVariableType();
642 int GetElementType(
const char* line);
648 int GetSectionType(
const char* line);
653 void ReplaceWildcards(
char* filename,
int num);
658 void RemoveLeadingBlanks(
char* line);
670 vtkIdType GetTotalNumberOfCellIds(
int index);
671 vtkIdType GetLocalTotalNumberOfCellIds(
int index);
705 const std::vector<vtkIdType>& faces = {});
706 void InsertVariableComponent(
vtkFloatArray* array,
int i,
int component,
float* content,
707 int partId,
int ensightCellType,
int insertionType);
722 void PrepareStructuredDimensionsForDistribution(
int partId,
int* oldDimensions,
723 int* newDimensions,
int* splitDimension,
int* splitDimensionBeginIndex,
int ghostLevel,
783 vtkSetMacro(UseTimeSets,
int);
784 vtkGetMacro(UseTimeSets,
int);
785 vtkBooleanMacro(UseTimeSets,
int);
788 vtkSetMacro(UseFileSets,
int);
789 vtkGetMacro(UseFileSets,
int);
790 vtkBooleanMacro(UseFileSets,
int);
800 int CheckOutputConsistency();
void SetMode(EnsightReaderCellIdMode amode)
std::vector< int > IntVector
vtkPEnSightReaderCellIds(EnsightReaderCellIdMode amode)
void SetImplicitSplitDimensionEndIndex(int end)
vtkIdList * VariableTimeSetIds
EnsightReaderCellIdMode mode
Superclass for EnSight file parallel readers.
vtkIdList * TimeSetsWithFilenameNumbers
vtkIdList * ComplexVariableFileSetIds
int NumberOfGeometryParts
std::map< int, int > IntIntMap
int ImplicitSplitDimensionBeginIndex
void SetImplicitSplitDimensionBeginIndex(int begin)
char ** ComplexVariableFileNames
vtkIdList * UnstructuredPartIds
class to read any type of EnSight files
vtkPEnSightReaderCellIdsType * CellIds
void PrintSelf(ostream &os, vtkIndent indent) override
void SetImplicitSplitDimension(int dim)
void SetLocalNumberOfIds(int n)
vtkIdList * VariableFileSetIds
int GetLocalNumberOfIds()
int * ImplicitLocalDimensions
bool InjectGlobalElementIds
vtkPEnSightReaderCellIds()
vtkIdListCollection * FileSetFileNameNumbers
int ImplicitSplitDimensionEndIndex
void SetImplicitDimensions(int dim1, int dim2, int dim3)
~vtkPEnSightReaderCellIds()
char ** VariableFileNames
void SetId(int id, int value)
vtkIdListCollection * TimeSetFileNameNumbers
vtkIdList * ComplexVariableTimeSetIds
int ImplicitSplitDimension
void SetNumberOfIds(int n)
vtkIdListCollection * FileSetNumberOfSteps
#define VTKPVVTKEXTENSIONSIOENSIGHT_EXPORT
vtkIdList * StructuredPartIds
std::map< std::string, std::map< int, long > > FileOffsets
int NumberOfMeasuredPoints
vtkPEnSightReaderCellIdsType * PointIds
vtkIdList * FileSetsWithFilenameNumbers