VTK: IO/CGNS/vtkCGNSReaderInternal.h Source File

| VTK 9.3.1

vtkCGNSReaderInternal.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright 2013-2014 Mickael Philit
3 // SPDX-License-Identifier: BSD-3-Clause
13 #ifndef vtkCGNSReaderInternal_h
14 #define vtkCGNSReaderInternal_h
15
16 #include <iostream>
17 #include <map>
18 #include <string.h> // for inline strcmp
19 #include <string>
20 #include <vector>
21
22 #include "vtkCGNSReader.h"
23 #include "vtkDataArraySelection.h"
24 #include "vtkIdTypeArray.h"
25 #include "vtkMultiProcessController.h"
26 #include "vtkNew.h"
27 #include "vtkPoints.h"
28
29 // .clang-format off
30 #include "vtk_cgns.h"
31 #include VTK_CGNS(cgnslib.h)
32 #include VTK_CGNS(cgns_io.h)
33 // .clang-format on
34
35 namespace CGNSRead
36 {
37 namespace detail
38 {
39 VTK_ABI_NAMESPACE_BEGIN
40 template <typename T>
41 struct is_double
42 {
43 static const bool value = false;
44 };
45
46 template <>
47 struct is_double<double>
48 {
49 static const bool value = true;
50 };
51
52 template <typename T>
53 struct is_float
54 {
55 static const bool value = false;
56 };
57
58 template <>
59 struct is_float<float>
60 {
61 static const bool value = true;
62 };
63 VTK_ABI_NAMESPACE_END
64 }
65
66 namespace detail
67 {
68 VTK_ABI_NAMESPACE_BEGIN
69 template <typename T>
70 constexpr const char* cgns_type_name() noexcept
71 {
72 return "MT";
73 }
74
75 template <>
76 constexpr const char* cgns_type_name<float>() noexcept
77 {
78 return "R4";
79 }
80
81 template <>
82 constexpr const char* cgns_type_name<double>() noexcept
83 {
84 return "R8";
85 }
86
87 template <>
88 constexpr const char* cgns_type_name<vtkTypeInt32>() noexcept
89 {
90 return "I4";
91 }
92
93 template <>
94 constexpr const char* cgns_type_name<vtkTypeInt64>() noexcept
95 {
96 return "I8";
97 }
98 VTK_ABI_NAMESPACE_END
99 }
100
101 VTK_ABI_NAMESPACE_BEGIN
102 typedef char char_33[33];
103
104 //------------------------------------------------------------------------------
105 // Cell type to cell dimension
106 const std::map<CGNS_ENUMT(ElementType_t), int> CellDimensions = {
107 { CGNS_ENUMV(ElementTypeUserDefined), -1 }, { CGNS_ENUMV(ElementTypeNull), -1 },
108 { CGNS_ENUMV(NODE), 0 }, { CGNS_ENUMV(BAR_2), 1 }, { CGNS_ENUMV(BAR_3), 1 },
109 { CGNS_ENUMV(TRI_3), 2 }, { CGNS_ENUMV(TRI_6), 2 }, { CGNS_ENUMV(QUAD_4), 2 },
110 { CGNS_ENUMV(QUAD_8), 2 }, { CGNS_ENUMV(QUAD_9), 2 }, { CGNS_ENUMV(TETRA_4), 3 },
111 { CGNS_ENUMV(TETRA_10), 3 }, { CGNS_ENUMV(PYRA_5), 3 }, { CGNS_ENUMV(PYRA_14), 3 },
112 { CGNS_ENUMV(PENTA_6), 3 }, { CGNS_ENUMV(PENTA_15), 3 }, { CGNS_ENUMV(PENTA_18), 3 },
113 { CGNS_ENUMV(HEXA_8), 3 }, { CGNS_ENUMV(HEXA_20), 3 }, { CGNS_ENUMV(HEXA_27), 3 },
114 { CGNS_ENUMV(MIXED), -1 }, { CGNS_ENUMV(PYRA_13), 3 }, { CGNS_ENUMV(NGON_n), 2 },
115 { CGNS_ENUMV(NFACE_n), 3 }, { CGNS_ENUMV(BAR_4), 1 }, { CGNS_ENUMV(TRI_9), 2 },
116 { CGNS_ENUMV(TRI_10), 2 }, { CGNS_ENUMV(QUAD_12), 2 }, { CGNS_ENUMV(QUAD_16), 2 },
117 { CGNS_ENUMV(TETRA_16), 3 }, { CGNS_ENUMV(TETRA_20), 3 }, { CGNS_ENUMV(PYRA_21), 3 },
118 { CGNS_ENUMV(PYRA_29), 3 }, { CGNS_ENUMV(PYRA_30), 3 }, { CGNS_ENUMV(PENTA_24), 3 },
119 { CGNS_ENUMV(PENTA_38), 3 }, { CGNS_ENUMV(PENTA_40), 3 }, { CGNS_ENUMV(HEXA_32), 3 },
120 { CGNS_ENUMV(HEXA_56), 3 }, { CGNS_ENUMV(HEXA_64), 3 }, { CGNS_ENUMV(BAR_5), 1 },
121 { CGNS_ENUMV(TRI_12), 2 }, { CGNS_ENUMV(TRI_15), 2 }, { CGNS_ENUMV(QUAD_P4_16), 2 },
122 { CGNS_ENUMV(QUAD_25), 2 }, { CGNS_ENUMV(TETRA_22), 3 }, { CGNS_ENUMV(TETRA_34), 3 },
123 { CGNS_ENUMV(TETRA_35), 3 }, { CGNS_ENUMV(PYRA_P4_29), 3 }, { CGNS_ENUMV(PYRA_50), 3 },
124 { CGNS_ENUMV(PYRA_55), 3 }, { CGNS_ENUMV(PENTA_33), 3 }, { CGNS_ENUMV(PENTA_66), 3 },
125 { CGNS_ENUMV(PENTA_75), 3 }, { CGNS_ENUMV(HEXA_44), 3 }, { CGNS_ENUMV(HEXA_98), 3 },
126 { CGNS_ENUMV(HEXA_125), 3 }
127 };
128
129 //------------------------------------------------------------------------------
130 class vtkCGNSArraySelection : public std::map<std::string, bool>
131 {
132 public:
133 void Merge(const vtkCGNSArraySelection& other)
134 {
135 vtkCGNSArraySelection::const_iterator iter = other.begin();
136 for (; iter != other.end(); ++iter)
137 {
138 (*this)[iter->first] = iter->second;
139 }
140 }
141
142 void AddArray(const char* name, bool status = true) { (*this)[name] = status; }
143
144 bool ArrayIsEnabled(const char* name)
145 {
146 vtkCGNSArraySelection::iterator iter = this->find(name);
147 if (iter != this->end())
148 {
149 return iter->second;
150 }
151
152 // don't know anything about this array, enable it by default.
153 return true;
154 }
155
156 bool HasArray(const char* name)
157 {
158 vtkCGNSArraySelection::iterator iter = this->find(name);
159 return (iter != this->end());
160 }
161
162 int GetArraySetting(const char* name) { return this->ArrayIsEnabled(name) ? 1 : 0; }
163
164 void SetArrayStatus(const char* name, bool status) { this->AddArray(name, status); }
165
166 const char* GetArrayName(int index)
167 {
168 int cc = 0;
169 for (vtkCGNSArraySelection::iterator iter = this->begin(); iter != this->end(); ++iter)
170 {
171
172 if (cc == index)
173 {
174 return iter->first.c_str();
175 }
176 cc++;
177 }
178 return nullptr;
179 }
180
181 int GetNumberOfArrays() { return static_cast<int>(this->size()); }
182 };
183
184 //------------------------------------------------------------------------------
185 typedef struct
186 {
187 int cnt; // 0 1 or 3
188 int pos; // variable position in zone
189 int xyzIndex;
190 int owner_pos;
191 CGNS_ENUMT(DataType_t) dt;
192 char_33 name;
193 } Variable;
194
195 //------------------------------------------------------------------------------
196 typedef struct
197 {
198 int xyzIndex;
199 bool isComponent;
200 CGNS_ENUMT(DataType_t) dt;
201 char_33 name;
202 } CGNSVariable;
203
204 //------------------------------------------------------------------------------
205 typedef struct
206 {
207 int numComp;
208 char_33 name;
209 int xyzIndex[3];
210 } CGNSVector;
211
212 //------------------------------------------------------------------------------
213 typedef struct
214 {
215 bool isVector;
216 int xyzIndex;
217 char_33 name;
218 } VTKVariable;
219
220 //------------------------------------------------------------------------------
221 class ZoneBCInformation
222 {
223 public:
224 char_33 name;
225 std::string family;
226 ZoneBCInformation()
227 : family(32, '\0')
228 {
229 this->name[0] = '\0';
230 }
231 };
232
233 //------------------------------------------------------------------------------
234 class ZoneInformation
235 {
236 public:
237 char_33 name;
238 std::string family;
239 std::vector<CGNSRead::ZoneBCInformation> bcs;
240 ZoneInformation()
241 : family(32, '\0')
242 {
243 this->name[0] = '\0';
244 }
245 };
246
247 //------------------------------------------------------------------------------
248 class FamilyInformation
249 {
250 public:
251 std::string name;
252 bool isBC;
253 };
254
255 //------------------------------------------------------------------------------
256 class BaseInformation
257 {
258 public:
259 char_33 name;
260
261 int32_t cellDim;
262 int32_t physicalDim;
263 //
264 int baseNumber;
265
266 std::vector<int32_t> steps;
267 std::vector<double> times;
268
269 // For unsteady meshes :
270 // if useGridPointers == True:
271 // loadGridPointers for first zone
272 // and assume every zone use the same
273 // notation
274 // else :
275 // assume only one grid is stored
276 // only first grid is read
277 //
278 // For unsteady flow
279 // if useFlowPointers == True :
280 // same behavior as GridPointers
281 // else if ( nstates > 1 ) :
282 // assume flow_solution are sorted
283 // to keep VisIt like behavior
284 // else :
285 // only first solution is read
286 //
287
288 bool useGridPointers; // for unsteady mesh
289 bool useFlowPointers; // for unsteady flow
290
291 std::vector<CGNSRead::FamilyInformation> family;
292 std::map<std::string, double> referenceState;
293
294 std::vector<CGNSRead::ZoneInformation> zones;
295
296 int nzones;
297
298 // std::vector<CGNSRead::zone> zone;
299 vtkCGNSArraySelection PointDataArraySelection;
300 vtkCGNSArraySelection CellDataArraySelection;
301 vtkCGNSArraySelection FaceDataArraySelection;
302 };
303
304 //==============================================================================
305
307
311 bool ReadBase(vtkCGNSReader* reader, const BaseInformation& baseInfo);
312 bool ReadGridForZone(
313 vtkCGNSReader* reader, const BaseInformation& baseInfo, const ZoneInformation& zoneInfo);
314 bool ReadPatchesForBase(vtkCGNSReader* reader, const BaseInformation&);
315 bool ReadPatch(vtkCGNSReader* reader, const BaseInformation&, const ZoneInformation& zoneInfo,
316 const std::string& patchFamilyname);
318
319 //==============================================================================
320 class vtkCGNSMetaData
321 {
322 public:
327 bool Parse(const char* cgnsFileName);
328
332 int GetNumberOfBaseNodes() { return static_cast<int>(this->baseList.size()); }
333
337 const CGNSRead::BaseInformation& GetBase(int numBase) { return this->baseList[numBase]; }
338
342 std::vector<double>& GetTimes() { return this->GlobalTime; }
343
347 void PrintSelf(std::ostream& os);
348
349 void Broadcast(vtkMultiProcessController* controller, int rank);
350
352
355 vtkCGNSMetaData() = default;
356 ~vtkCGNSMetaData() = default;
358
359 private:
360 vtkCGNSMetaData(const vtkCGNSMetaData&) = delete;
361 void operator=(const vtkCGNSMetaData&) = delete;
362
363 std::vector<CGNSRead::BaseInformation> baseList;
364 std::string LastReadFilename;
365 // Not very elegant :
366 std::vector<double> GlobalTime;
367 };
368
369 //------------------------------------------------------------------------------
370 // compare name return true if name1 == name2
371 inline bool compareName(const char_33 nameOne, const char_33 nameTwo)
372 {
373 return (strncmp(nameOne, nameTwo, 32) == 0);
374 }
375
376 //------------------------------------------------------------------------------
377 // remove trailing whitespaces
378 inline void removeTrailingWhiteSpaces(char_33 name)
379 {
380 char* end = name + strlen(name) - 1;
381 while (end >= name && isspace(*end))
382 {
383 --end;
384 }
385 ++end;
386 assert(end >= name && end < name + 33);
387 *end = '\0';
388 }
389
390 //------------------------------------------------------------------------------
391 // get vector from name
392 inline std::vector<CGNSVector>::iterator getVectorFromName(
393 std::vector<CGNSVector>& vectorList, const char_33 name)
394 {
395 for (std::vector<CGNSVector>::iterator iter = vectorList.begin(); iter != vectorList.end();
396 ++iter)
397 {
398 if (strncmp(iter->name, name, 31) == 0)
399 {
400 return iter;
401 }
402 }
403 return vectorList.end();
404 }
405
406 //------------------------------------------------------------------------------
407 inline bool isACGNSVariable(const std::vector<CGNSVariable>& varList, const char_33 name)
408 {
409 for (std::vector<CGNSVariable>::const_iterator iter = varList.begin(); iter != varList.end();
410 ++iter)
411 {
412 if (strncmp(iter->name, name, 32) == 0)
413 {
414 return true;
415 }
416 }
417 return false;
418 }
419
420 //------------------------------------------------------------------------------
421 void fillVectorsFromVars(std::vector<CGNSRead::CGNSVariable>& vars,
422 std::vector<CGNSRead::CGNSVector>& vectors, int physicalDim);
423 //------------------------------------------------------------------------------
424 int setUpRind(int cgioNum, double rindId, int* rind);
425 //------------------------------------------------------------------------------
430 int getFirstNodeId(
431 int cgioNum, double parentId, const char* label, double* id, const char* name = nullptr);
432 //------------------------------------------------------------------------------
433 int get_section_connectivity(int cgioNum, double cgioSectionId, int dim, const cgsize_t* srcStart,
434 const cgsize_t* srcEnd, const cgsize_t* srcStride, const cgsize_t* memStart,
435 const cgsize_t* memEnd, const cgsize_t* memStride, const cgsize_t* memDim,
436 vtkIdType* localElements);
437 //------------------------------------------------------------------------------
438 int get_section_start_offset(int cgioNum, double cgioSectionId, int dim, const cgsize_t* srcStart,
439 const cgsize_t* srcEnd, const cgsize_t* srcStride, const cgsize_t* memStart,
440 const cgsize_t* memEnd, const cgsize_t* memStride, const cgsize_t* memDim,
441 vtkIdType* localElementsIdx);
442 //------------------------------------------------------------------------------
443 int get_section_parent_elements(int cgioNum, double cgioSectionId, int dim,
444 const cgsize_t* srcStart, const cgsize_t* srcEnd, const cgsize_t* srcStride,
445 const cgsize_t* memStart, const cgsize_t* memEnd, const cgsize_t* memStride,
446 const cgsize_t* memDim, vtkIdType* localElementsIdx);
447 //------------------------------------------------------------------------------
448 int GetVTKElemType(
449 CGNS_ENUMT(ElementType_t) elemType, bool& higherOrderWarning, bool& cgnsOrderFlag);
450 //------------------------------------------------------------------------------
451 void CGNS2VTKorder(vtkIdType size, const int* cells_types, vtkIdType* elements);
452 //------------------------------------------------------------------------------
453 void ReorderMonoCellPointsCGNS2VTK(
454 vtkIdType size, int cell_type, vtkIdType numPointsPerCell, vtkIdType* elements);
455 //------------------------------------------------------------------------------
456 template <typename T, typename Y>
457 int get_XYZ_mesh(int cgioNum, const std::vector<double>& gridChildId,
458 const std::size_t& nCoordsArray, int cellDim, vtkIdType nPts, const cgsize_t* srcStart,
459 const cgsize_t* srcEnd, const cgsize_t* srcStride, const cgsize_t* memStart,
460 const cgsize_t* memEnd, const cgsize_t* memStride, const cgsize_t* memDims, vtkPoints* points)
461 {
462 T* coords = static_cast<T*>(points->GetVoidPointer(0));
463 T* currentCoord = static_cast<T*>(&(coords[0]));
464
465 CGNSRead::char_33 coordName;
466 std::size_t len;
467 bool sameType = true;
468 double coordId;
469
470 memset(coords, 0, 3 * nPts * sizeof(T));
471
472 for (std::size_t c = 1; c <= nCoordsArray; ++c)
473 {
474 // Read CoordName
475 if (cgio_get_name(cgioNum, gridChildId[c - 1], coordName) != CG_OK)
476 {
477 char message[81];
478 cgio_error_message(message);
479 std::cerr << "get_XYZ_mesh : cgio_get_name :" << message;
480 }
481
482 // Read node data type
483 CGNSRead::char_33 dataType;
484 if (cgio_get_data_type(cgioNum, gridChildId[c - 1], dataType))
485 {
486 continue;
487 }
488
489 if (strcmp(dataType, "R8") == 0)
490 {
491 const bool doubleType = detail::is_double<T>::value;
492 sameType = doubleType;
493 }
494 else if (strcmp(dataType, "R4") == 0)
495 {
496 const bool floatType = detail::is_float<T>::value;
497 sameType = floatType;
498 }
499 else
500 {
501 std::cerr << "Invalid datatype for GridCoordinates\n";
502 continue;
503 }
504
505 // Determine direction X,Y,Z
506 len = strlen(coordName) - 1;
507 switch (coordName[len])
508 {
509 case 'X':
510 currentCoord = static_cast<T*>(&(coords[0]));
511 break;
512 case 'Y':
513 currentCoord = static_cast<T*>(&(coords[1]));
514 break;
515 case 'Z':
516 currentCoord = static_cast<T*>(&(coords[2]));
517 break;
518 }
519
520 coordId = gridChildId[c - 1];
521
522 // quick transfer of data if same data types
523 if (sameType == true)
524 {
525 constexpr const char* dtNameT = detail::cgns_type_name<T>();
526 if (cgio_read_data_type(cgioNum, coordId, srcStart, srcEnd, srcStride, dtNameT, cellDim,
527 memEnd, memStart, memEnd, memStride, (void*)currentCoord))
528 {
529 char message[81];
530 cgio_error_message(message);
531 std::cerr << "cgio_read_data_type :" << message;
532 }
533 }
534 else
535 {
536 constexpr const char* dtNameY = detail::cgns_type_name<Y>();
537 Y* dataArray = nullptr;
538 const cgsize_t memNoStride[3] = { 1, 1, 1 };
539
540 // need to read into temp array to convert data
541 dataArray = new Y[nPts];
542 if (dataArray == nullptr)
543 {
544 std::cerr << "Error allocating buffer array\n";
545 break;
546 }
547 if (cgio_read_data_type(cgioNum, coordId, srcStart, srcEnd, srcStride, dtNameY, cellDim,
548 memDims, memStart, memDims, memNoStride, (void*)dataArray))
549 {
550 delete[] dataArray;
551 char message[81];
552 cgio_error_message(message);
553 std::cerr << "Buffer array cgio_read_data_type :" << message;
554 break;
555 }
556 for (vtkIdType ii = 0; ii < nPts; ++ii)
557 {
558 currentCoord[memStride[0] * ii] = static_cast<T>(dataArray[ii]);
559 }
560 delete[] dataArray;
561 }
562 }
563 return 0;
564 }
565 VTK_ABI_NAMESPACE_END
566 }
567
568 #endif // vtkCGNSReaderInternal_h
569 // VTK-HeaderTest-Exclude: vtkCGNSReaderInternal.h
CGNSRead::BaseInformation
Definition: vtkCGNSReaderInternal.h:257
CGNSRead::BaseInformation::baseNumber
int baseNumber
Definition: vtkCGNSReaderInternal.h:264
CGNSRead::BaseInformation::family
std::vector< CGNSRead::FamilyInformation > family
Definition: vtkCGNSReaderInternal.h:291
CGNSRead::BaseInformation::cellDim
int32_t cellDim
Definition: vtkCGNSReaderInternal.h:261
CGNSRead::BaseInformation::useFlowPointers
bool useFlowPointers
Definition: vtkCGNSReaderInternal.h:289
CGNSRead::BaseInformation::times
std::vector< double > times
Definition: vtkCGNSReaderInternal.h:267
CGNSRead::BaseInformation::steps
std::vector< int32_t > steps
Definition: vtkCGNSReaderInternal.h:266
CGNSRead::BaseInformation::physicalDim
int32_t physicalDim
Definition: vtkCGNSReaderInternal.h:262
CGNSRead::BaseInformation::name
char_33 name
Definition: vtkCGNSReaderInternal.h:259
CGNSRead::BaseInformation::PointDataArraySelection
vtkCGNSArraySelection PointDataArraySelection
Definition: vtkCGNSReaderInternal.h:299
CGNSRead::BaseInformation::nzones
int nzones
Definition: vtkCGNSReaderInternal.h:296
CGNSRead::BaseInformation::CellDataArraySelection
vtkCGNSArraySelection CellDataArraySelection
Definition: vtkCGNSReaderInternal.h:300
CGNSRead::BaseInformation::referenceState
std::map< std::string, double > referenceState
Definition: vtkCGNSReaderInternal.h:292
CGNSRead::BaseInformation::zones
std::vector< CGNSRead::ZoneInformation > zones
Definition: vtkCGNSReaderInternal.h:294
CGNSRead::BaseInformation::FaceDataArraySelection
vtkCGNSArraySelection FaceDataArraySelection
Definition: vtkCGNSReaderInternal.h:301
CGNSRead::BaseInformation::useGridPointers
bool useGridPointers
Definition: vtkCGNSReaderInternal.h:288
CGNSRead::FamilyInformation
Definition: vtkCGNSReaderInternal.h:249
CGNSRead::FamilyInformation::name
std::string name
Definition: vtkCGNSReaderInternal.h:251
CGNSRead::FamilyInformation::isBC
bool isBC
Definition: vtkCGNSReaderInternal.h:252
CGNSRead::ZoneBCInformation
Definition: vtkCGNSReaderInternal.h:222
CGNSRead::ZoneBCInformation::family
std::string family
Definition: vtkCGNSReaderInternal.h:225
CGNSRead::ZoneBCInformation::ZoneBCInformation
ZoneBCInformation()
Definition: vtkCGNSReaderInternal.h:226
CGNSRead::ZoneBCInformation::name
char_33 name
Definition: vtkCGNSReaderInternal.h:224
CGNSRead::ZoneInformation
Definition: vtkCGNSReaderInternal.h:235
CGNSRead::ZoneInformation::ZoneInformation
ZoneInformation()
Definition: vtkCGNSReaderInternal.h:240
CGNSRead::ZoneInformation::family
std::string family
Definition: vtkCGNSReaderInternal.h:238
CGNSRead::ZoneInformation::name
char_33 name
Definition: vtkCGNSReaderInternal.h:237
CGNSRead::ZoneInformation::bcs
std::vector< CGNSRead::ZoneBCInformation > bcs
Definition: vtkCGNSReaderInternal.h:239
CGNSRead::vtkCGNSArraySelection
Definition: vtkCGNSReaderInternal.h:131
CGNSRead::vtkCGNSArraySelection::HasArray
bool HasArray(const char *name)
Definition: vtkCGNSReaderInternal.h:156
CGNSRead::vtkCGNSArraySelection::ArrayIsEnabled
bool ArrayIsEnabled(const char *name)
Definition: vtkCGNSReaderInternal.h:144
CGNSRead::vtkCGNSArraySelection::Merge
void Merge(const vtkCGNSArraySelection &other)
Definition: vtkCGNSReaderInternal.h:133
CGNSRead::vtkCGNSArraySelection::GetArraySetting
int GetArraySetting(const char *name)
Definition: vtkCGNSReaderInternal.h:162
CGNSRead::vtkCGNSArraySelection::AddArray
void AddArray(const char *name, bool status=true)
Definition: vtkCGNSReaderInternal.h:142
CGNSRead::vtkCGNSArraySelection::GetNumberOfArrays
int GetNumberOfArrays()
Definition: vtkCGNSReaderInternal.h:181
CGNSRead::vtkCGNSArraySelection::GetArrayName
const char * GetArrayName(int index)
Definition: vtkCGNSReaderInternal.h:166
CGNSRead::vtkCGNSArraySelection::SetArrayStatus
void SetArrayStatus(const char *name, bool status)
Definition: vtkCGNSReaderInternal.h:164
CGNSRead::vtkCGNSMetaData
Definition: vtkCGNSReaderInternal.h:321
CGNSRead::vtkCGNSMetaData::~vtkCGNSMetaData
~vtkCGNSMetaData()=default
Constructor/Destructor.
CGNSRead::vtkCGNSMetaData::GetNumberOfBaseNodes
int GetNumberOfBaseNodes()
return number of base nodes
Definition: vtkCGNSReaderInternal.h:332
CGNSRead::vtkCGNSMetaData::vtkCGNSMetaData
vtkCGNSMetaData()=default
Constructor/Destructor.
CGNSRead::vtkCGNSMetaData::Parse
bool Parse(const char *cgnsFileName)
quick parsing of cgns file to get interesting information from a VTK point of view
CGNSRead::vtkCGNSMetaData::Broadcast
void Broadcast(vtkMultiProcessController *controller, int rank)
CGNSRead::vtkCGNSMetaData::PrintSelf
void PrintSelf(std::ostream &os)
print object debugging purpose
CGNSRead::vtkCGNSMetaData::GetBase
const CGNSRead::BaseInformation & GetBase(int numBase)
return const reference to a base information
Definition: vtkCGNSReaderInternal.h:337
CGNSRead::vtkCGNSMetaData::GetTimes
std::vector< double > & GetTimes()
return reference to GlobalTime
Definition: vtkCGNSReaderInternal.h:342
vtkCGNSReader
vtkCGNSReader creates a multi-block dataset and reads unstructured grids and structured meshes from b...
Definition: vtkCGNSReader.h:41
vtkMultiProcessController
Multiprocessing communication superclass.
Definition: vtkMultiProcessController.h:72
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:38
CGNSRead::detail::cgns_type_name< double >
constexpr const char * cgns_type_name< double >() noexcept
Definition: vtkCGNSReaderInternal.h:82
CGNSRead::detail::cgns_type_name< vtkTypeInt64 >
constexpr const char * cgns_type_name< vtkTypeInt64 >() noexcept
Definition: vtkCGNSReaderInternal.h:94
CGNSRead::detail::cgns_type_name
constexpr const char * cgns_type_name() noexcept
Definition: vtkCGNSReaderInternal.h:70
CGNSRead::detail::cgns_type_name< vtkTypeInt32 >
constexpr const char * cgns_type_name< vtkTypeInt32 >() noexcept
Definition: vtkCGNSReaderInternal.h:88
CGNSRead::detail::cgns_type_name< float >
constexpr const char * cgns_type_name< float >() noexcept
Definition: vtkCGNSReaderInternal.h:76
CGNSRead
This file defines functions used by vtkCGNSReader and vtkCGNSReaderInternal.
Definition: cgio_helpers.h:19
CGNSRead::ReorderMonoCellPointsCGNS2VTK
void ReorderMonoCellPointsCGNS2VTK(vtkIdType size, int cell_type, vtkIdType numPointsPerCell, vtkIdType *elements)
CGNSRead::get_section_parent_elements
int get_section_parent_elements(int cgioNum, double cgioSectionId, int dim, const cgsize_t *srcStart, const cgsize_t *srcEnd, const cgsize_t *srcStride, const cgsize_t *memStart, const cgsize_t *memEnd, const cgsize_t *memStride, const cgsize_t *memDim, vtkIdType *localElementsIdx)
CGNSRead::CGNS2VTKorder
void CGNS2VTKorder(vtkIdType size, const int *cells_types, vtkIdType *elements)
CGNSRead::getFirstNodeId
int getFirstNodeId(int cgioNum, double parentId, const char *label, double *id, const char *name=nullptr)
Find the first node with the given label.
CGNSRead::get_XYZ_mesh
int get_XYZ_mesh(int cgioNum, const std::vector< double > &gridChildId, const std::size_t &nCoordsArray, int cellDim, vtkIdType nPts, const cgsize_t *srcStart, const cgsize_t *srcEnd, const cgsize_t *srcStride, const cgsize_t *memStart, const cgsize_t *memEnd, const cgsize_t *memStride, const cgsize_t *memDims, vtkPoints *points)
Definition: vtkCGNSReaderInternal.h:457
CGNSRead::removeTrailingWhiteSpaces
void removeTrailingWhiteSpaces(char_33 name)
Definition: vtkCGNSReaderInternal.h:378
CGNSRead::isACGNSVariable
bool isACGNSVariable(const std::vector< CGNSVariable > &varList, const char_33 name)
Definition: vtkCGNSReaderInternal.h:407
CGNSRead::ReadGridForZone
bool ReadGridForZone(vtkCGNSReader *reader, const BaseInformation &baseInfo, const ZoneInformation &zoneInfo)
Helpers to encapsulate all logic to read various nodes (zones, bc patches etc.).
CGNSRead::ReadBase
bool ReadBase(vtkCGNSReader *reader, const BaseInformation &baseInfo)
Helpers to encapsulate all logic to read various nodes (zones, bc patches etc.).
CGNSRead::CellDimensions
const std::map< CGNS_ENUMT(ElementType_t), int > CellDimensions
Definition: vtkCGNSReaderInternal.h:106
CGNSRead::get_section_connectivity
int get_section_connectivity(int cgioNum, double cgioSectionId, int dim, const cgsize_t *srcStart, const cgsize_t *srcEnd, const cgsize_t *srcStride, const cgsize_t *memStart, const cgsize_t *memEnd, const cgsize_t *memStride, const cgsize_t *memDim, vtkIdType *localElements)
CGNSRead::GetVTKElemType
int GetVTKElemType(CGNS_ENUMT(ElementType_t) elemType, bool &higherOrderWarning, bool &cgnsOrderFlag)
CGNSRead::fillVectorsFromVars
void fillVectorsFromVars(std::vector< CGNSRead::CGNSVariable > &vars, std::vector< CGNSRead::CGNSVector > &vectors, int physicalDim)
CGNSRead::get_section_start_offset
int get_section_start_offset(int cgioNum, double cgioSectionId, int dim, const cgsize_t *srcStart, const cgsize_t *srcEnd, const cgsize_t *srcStride, const cgsize_t *memStart, const cgsize_t *memEnd, const cgsize_t *memStride, const cgsize_t *memDim, vtkIdType *localElementsIdx)
CGNSRead::char_33
char char_33[33]
Definition: vtkCGNSReaderInternal.h:102
CGNSRead::setUpRind
int setUpRind(int cgioNum, double rindId, int *rind)
CGNSRead::getVectorFromName
std::vector< CGNSVector >::iterator getVectorFromName(std::vector< CGNSVector > &vectorList, const char_33 name)
Definition: vtkCGNSReaderInternal.h:392
CGNSRead::ReadPatchesForBase
bool ReadPatchesForBase(vtkCGNSReader *reader, const BaseInformation &)
Helpers to encapsulate all logic to read various nodes (zones, bc patches etc.).
CGNSRead::ReadPatch
bool ReadPatch(vtkCGNSReader *reader, const BaseInformation &, const ZoneInformation &zoneInfo, const std::string &patchFamilyname)
Helpers to encapsulate all logic to read various nodes (zones, bc patches etc.).
CGNSRead::compareName
bool compareName(const char_33 nameOne, const char_33 nameTwo)
Definition: vtkCGNSReaderInternal.h:371
detail
Definition: vtkCellTreeLocator.h:59
vtkX3D::points
@ points
Definition: vtkX3D.h:446
vtkX3D::name
@ name
Definition: vtkX3D.h:219
vtkX3D::size
@ size
Definition: vtkX3D.h:253
vtkX3D::index
@ index
Definition: vtkX3D.h:246
vtkX3D::string
@ string
Definition: vtkX3D.h:490
CGNSRead::CGNSVariable
Definition: vtkCGNSReaderInternal.h:197
CGNSRead::CGNSVariable::CGNS_ENUMT
CGNS_ENUMT(DataType_t) dt
CGNSRead::CGNSVariable::isComponent
bool isComponent
Definition: vtkCGNSReaderInternal.h:199
CGNSRead::CGNSVariable::xyzIndex
int xyzIndex
Definition: vtkCGNSReaderInternal.h:198
CGNSRead::CGNSVariable::name
char_33 name
Definition: vtkCGNSReaderInternal.h:201
CGNSRead::CGNSVector
Definition: vtkCGNSReaderInternal.h:206
CGNSRead::CGNSVector::numComp
int numComp
Definition: vtkCGNSReaderInternal.h:207
CGNSRead::CGNSVector::name
char_33 name
Definition: vtkCGNSReaderInternal.h:208
CGNSRead::VTKVariable
Definition: vtkCGNSReaderInternal.h:214
CGNSRead::VTKVariable::name
char_33 name
Definition: vtkCGNSReaderInternal.h:217
CGNSRead::VTKVariable::xyzIndex
int xyzIndex
Definition: vtkCGNSReaderInternal.h:216
CGNSRead::VTKVariable::isVector
bool isVector
Definition: vtkCGNSReaderInternal.h:215
CGNSRead::Variable
Definition: vtkCGNSReaderInternal.h:186
CGNSRead::Variable::owner_pos
int owner_pos
Definition: vtkCGNSReaderInternal.h:190
CGNSRead::Variable::xyzIndex
int xyzIndex
Definition: vtkCGNSReaderInternal.h:189
CGNSRead::Variable::cnt
int cnt
Definition: vtkCGNSReaderInternal.h:187
CGNSRead::Variable::pos
int pos
Definition: vtkCGNSReaderInternal.h:188
CGNSRead::Variable::CGNS_ENUMT
CGNS_ENUMT(DataType_t) dt
CGNSRead::Variable::name
char_33 name
Definition: vtkCGNSReaderInternal.h:192
CGNSRead::detail::is_double
Definition: vtkCGNSReaderInternal.h:42
CGNSRead::detail::is_double::value
static const bool value
Definition: vtkCGNSReaderInternal.h:43
CGNSRead::detail::is_float
Definition: vtkCGNSReaderInternal.h:54
CGNSRead::detail::is_float::value
static const bool value
Definition: vtkCGNSReaderInternal.h:55
vtkCGNSReader.h
vtkDataArraySelection.h
vtkIdTypeArray.h
vtkMultiProcessController.h
vtkNew.h
vtkPoints.h
vtkIdType
int vtkIdType
Definition: vtkType.h:315
NODE
#define NODE
Definition: vtkVRMLImporter_Yacc.h:1852