VTK  9.2.6
vtkIOSSReader.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkIOSSReader.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
15/*----------------------------------------------------------------------------
16 Copyright (c) Sandia Corporation
17 See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
18----------------------------------------------------------------------------*/
19
170
171#ifndef vtkIOSSReader_h
172#define vtkIOSSReader_h
173
174#include "vtkIOIOSSModule.h" // for export macros
175#include "vtkNew.h" // for vtkNew
176#include "vtkReaderAlgorithm.h"
177
178#include <map> // for std::map
179
181class vtkDataAssembly;
183class vtkStringArray;
184
185class VTKIOIOSS_EXPORT vtkIOSSReader : public vtkReaderAlgorithm
186{
187public:
190 void PrintSelf(ostream& os, vtkIndent indent) override;
191
193
196 void AddFileName(VTK_FILEPATH const char* fname);
198 VTK_FILEPATH const char* GetFileName(int index) const;
201
205 void SetFileName(VTK_FILEPATH const char* fname);
206
208
212 vtkSetStringMacro(DatabaseTypeOverride);
213 vtkGetStringMacro(DatabaseTypeOverride);
215
217
221 void SetDisplacementMagnitude(double magnitude);
224
226
230 void SetScanForRelatedFiles(bool value);
231 vtkGetMacro(ScanForRelatedFiles, bool);
232 vtkBooleanMacro(ScanForRelatedFiles, bool);
234
236
249 vtkSetVector2Macro(FileRange, int);
250 vtkGetVector2Macro(FileRange, int);
251 vtkSetClampMacro(FileStride, int, 1, VTK_INT_MAX);
252 vtkGetMacro(FileStride, int);
254
256
263 vtkSetMacro(GenerateFileId, bool);
264 vtkGetMacro(GenerateFileId, bool);
265 vtkBooleanMacro(GenerateFileId, bool);
267
269
273 vtkSetMacro(ReadIds, bool);
274 vtkGetMacro(ReadIds, bool);
275 vtkBooleanMacro(ReadIds, bool);
277
279
288 vtkGetMacro(RemoveUnusedPoints, bool);
289 vtkBooleanMacro(RemoveUnusedPoints, bool);
291
293
297 vtkSetMacro(ApplyDisplacements, bool);
298 vtkGetMacro(ApplyDisplacements, bool);
299 vtkBooleanMacro(ApplyDisplacements, bool);
301
303
306 vtkSetMacro(ReadGlobalFields, bool);
307 vtkGetMacro(ReadGlobalFields, bool);
308 vtkBooleanMacro(ReadGlobalFields, bool);
310
312
316 vtkSetMacro(ReadQAAndInformationRecords, bool);
317 vtkGetMacro(ReadQAAndInformationRecords, bool);
318 vtkBooleanMacro(ReadQAAndInformationRecords, bool);
320
322
334 vtkGetObjectMacro(Controller, vtkMultiProcessController);
336
338
344 void AddProperty(const char* name, int value);
345 void AddProperty(const char* name, double value);
346 void AddProperty(const char* name, void* value);
347 void AddProperty(const char* name, const char* value);
348 void RemoveProperty(const char* name);
351
373
374 static bool GetEntityTypeIsBlock(int type) { return (type >= BLOCK_START && type < BLOCK_END); }
375 static bool GetEntityTypeIsSet(int type) { return (type >= SET_START && type < SET_END); }
376 static const char* GetDataAssemblyNodeNameForEntityType(int type);
377
395
416
420 {
423 }
424
426
431 const std::map<std::string, vtkTypeInt64>& GetEntityIdMap(int type) const;
432 const std::map<std::string, vtkTypeInt64>& GetNodeBlockIdMap() const
433 {
434 return this->GetEntityIdMap(NODEBLOCK);
435 }
436 const std::map<std::string, vtkTypeInt64>& GetEdgeBlockIdMap() const
437 {
438 return this->GetEntityIdMap(EDGEBLOCK);
439 }
440 const std::map<std::string, vtkTypeInt64>& GetFaceBlockIdMap() const
441 {
442 return this->GetEntityIdMap(FACEBLOCK);
443 }
444 const std::map<std::string, vtkTypeInt64>& GetElementBlockIdMap() const
445 {
446 return this->GetEntityIdMap(ELEMENTBLOCK);
447 }
448 const std::map<std::string, vtkTypeInt64>& GetStructuredBlockIdMap() const
449 {
450 return this->GetEntityIdMap(STRUCTUREDBLOCK);
451 }
452 const std::map<std::string, vtkTypeInt64>& GetNodeSetIdMap() const
453 {
454 return this->GetEntityIdMap(NODESET);
455 }
456 const std::map<std::string, vtkTypeInt64>& GetEdgeSetIdMap() const
457 {
458 return this->GetEntityIdMap(EDGESET);
459 }
460 const std::map<std::string, vtkTypeInt64>& GetFaceSetIdMap() const
461 {
462 return this->GetEntityIdMap(FACESET);
463 }
464 const std::map<std::string, vtkTypeInt64>& GetElementSetIdMap() const
465 {
466 return this->GetEntityIdMap(ELEMENTSET);
467 }
468 const std::map<std::string, vtkTypeInt64>& GetSideSetIdMap() const
469 {
470 return this->GetEntityIdMap(SIDESET);
471 }
472
473
475
510
512
525
533 vtkGetMacro(AssemblyTag, int);
534
536
540 bool AddSelector(const char* selector);
542 void SetSelector(const char* selector);
544
546
550 const char* GetSelector(int index) const;
552
554
557 int ReadMetaData(vtkInformation* metadata) override;
558 int ReadMesh(int piece, int npieces, int nghosts, int timestep, vtkDataObject* output) override;
559 int ReadPoints(int, int, int, int, vtkDataObject*) override { return 1; }
560 int ReadArrays(int, int, int, int, vtkDataObject*) override { return 1; }
562
567
572
577 vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo) override;
578
579protected:
581 ~vtkIOSSReader() override;
582
583 int FillOutputPortInformation(int port, vtkInformation* info) override;
584
585private:
586 vtkIOSSReader(const vtkIOSSReader&) = delete;
587 void operator=(const vtkIOSSReader&) = delete;
590 std::map<std::string, vtkTypeInt64> EntityIdMap[NUMBER_OF_ENTITY_TYPES + 1];
591 vtkNew<vtkStringArray> EntityIdMapStrings[NUMBER_OF_ENTITY_TYPES + 1];
592
593 vtkMultiProcessController* Controller;
594 bool GenerateFileId;
595 bool ScanForRelatedFiles;
596 bool ReadIds;
597 bool RemoveUnusedPoints;
598 bool ApplyDisplacements;
599 bool ReadGlobalFields;
600 bool ReadQAAndInformationRecords;
601 char* DatabaseTypeOverride;
602 int AssemblyTag;
603 int FileRange[2];
604 int FileStride;
605
606 class vtkInternals;
607 vtkInternals* Internals;
608
609 static vtkInformationIntegerKey* ENTITY_TYPE();
610};
611
612#endif
Store on/off settings for data arrays, etc.
hierarchical representation to use with vtkPartitionedDataSetCollection
general representation of visualization data
vtkStringArray * GetFaceSetIdMapAsString() const
This API is not really meant for public use and may change without notices.
const std::map< std::string, vtkTypeInt64 > & GetFaceSetIdMap() const
In IOSS entity blocks/sets may have unique ids.
void RemoveAllEntitySelections()
vtkDataArraySelection * GetFaceSetSelection()
vtkStringArray * GetElementBlockIdMapAsString() const
This API is not really meant for public use and may change without notices.
static const char * GetDataAssemblyNodeNameForEntityType(int type)
void AddFileName(VTK_FILEPATH const char *fname)
API to set the filenames.
int GetNumberOfSelectors() const
API to access selectors.
int ReadArrays(int, int, int, int, vtkDataObject *) override
Implementation for vtkReaderAlgorithm API.
VTK_FILEPATH const char * GetFileName(int index) const
API to set the filenames.
void RemoveAllFieldSelections()
void RemoveAllSelections()
~vtkIOSSReader() override
vtkStringArray * GetEntityIdMapAsString(int type) const
This API is not really meant for public use and may change without notices.
int ReadPoints(int, int, int, int, vtkDataObject *) override
Implementation for vtkReaderAlgorithm API.
vtkDataArraySelection * GetSideSetFieldSelection()
vtkDataArraySelection * GetNodeBlockFieldSelection()
vtkDataArraySelection * GetEdgeSetFieldSelection()
vtkStringArray * GetStructuredBlockIdMapAsString() const
This API is not really meant for public use and may change without notices.
const std::map< std::string, vtkTypeInt64 > & GetEdgeSetIdMap() const
In IOSS entity blocks/sets may have unique ids.
vtkDataArraySelection * GetElementBlockSelection()
vtkStringArray * GetFaceBlockIdMapAsString() const
This API is not really meant for public use and may change without notices.
vtkDataArraySelection * GetEntitySelection(int type)
vtkStringArray * GetElementSetIdMapAsString() const
This API is not really meant for public use and may change without notices.
void ClearProperties()
IOSS databases support various properties that affect how the database is read.
static vtkIOSSReader * New()
vtkDataArraySelection * GetFaceSetFieldSelection()
const std::map< std::string, vtkTypeInt64 > & GetElementBlockIdMap() const
In IOSS entity blocks/sets may have unique ids.
vtkDataAssembly * GetAssembly()
Assemblies provide yet another way of selection blocks/sets to load, if available in the dataset.
vtkDataArraySelection * GetElementBlockFieldSelection()
const std::map< std::string, vtkTypeInt64 > & GetSideSetIdMap() const
In IOSS entity blocks/sets may have unique ids.
const std::map< std::string, vtkTypeInt64 > & GetEdgeBlockIdMap() const
In IOSS entity blocks/sets may have unique ids.
const std::map< std::string, vtkTypeInt64 > & GetNodeBlockIdMap() const
In IOSS entity blocks/sets may have unique ids.
static bool GetEntityTypeIsSet(int type)
const std::map< std::string, vtkTypeInt64 > & GetElementSetIdMap() const
In IOSS entity blocks/sets may have unique ids.
void AddProperty(const char *name, int value)
IOSS databases support various properties that affect how the database is read.
vtkDataArraySelection * GetElementSetFieldSelection()
vtkDataArraySelection * GetEdgeBlockFieldSelection()
void SetRemoveUnusedPoints(bool)
Node related data, including point coordinates, point field data etc.
vtkDataArraySelection * GetSideSetSelection()
vtkMTimeType GetMTime() override
Overridden to take into account mtimes for vtkDataArraySelection instances.
int ReadMesh(int piece, int npieces, int nghosts, int timestep, vtkDataObject *output) override
Implementation for vtkReaderAlgorithm API.
vtkDataArraySelection * GetFaceBlockSelection()
int ReadMetaData(vtkInformation *metadata) override
Implementation for vtkReaderAlgorithm API.
void SetFileName(VTK_FILEPATH const char *fname)
Set a single filename.
const char * GetSelector(int index) const
API to access selectors.
vtkTypeBool ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo) override
Overridden to release handles at the end of each pass.
void RemoveProperty(const char *name)
IOSS databases support various properties that affect how the database is read.
const std::map< std::string, vtkTypeInt64 > & GetEntityIdMap(int type) const
In IOSS entity blocks/sets may have unique ids.
vtkDataArraySelection * GetNodeBlockSelection()
vtkDataArraySelection * GetNodeSetFieldSelection()
vtkStringArray * GetNodeBlockIdMapAsString() const
This API is not really meant for public use and may change without notices.
void ClearFileNames()
API to set the filenames.
void AddProperty(const char *name, const char *value)
IOSS databases support various properties that affect how the database is read.
static bool GetEntityTypeIsBlock(int type)
void SetController(vtkMultiProcessController *controller)
Get/Set the controller to use when working in parallel.
vtkStringArray * GetEdgeSetIdMapAsString() const
This API is not really meant for public use and may change without notices.
int GetNumberOfFileNames() const
API to set the filenames.
const std::map< std::string, vtkTypeInt64 > & GetNodeSetIdMap() const
In IOSS entity blocks/sets may have unique ids.
vtkDataArraySelection * GetStructuredBlockFieldSelection()
bool AddSelector(const char *selector)
API to specify selectors that indicate which branches on the assembly are chosen.
vtkDataArraySelection * GetNodeSetSelection()
void SetDisplacementMagnitude(double magnitude)
When displacements are being applied, they are scaled by this amount.
void SetScanForRelatedFiles(bool value)
When set to true, the reader can automatically locate and load additional files that are part of the ...
const std::map< std::string, vtkTypeInt64 > & GetStructuredBlockIdMap() const
In IOSS entity blocks/sets may have unique ids.
vtkDataArraySelection * GetFieldSelection(int type)
double GetDisplacementMagnitude()
When displacements are being applied, they are scaled by this amount.
void AddProperty(const char *name, double value)
IOSS databases support various properties that affect how the database is read.
vtkDataArraySelection * GetFaceBlockFieldSelection()
vtkStringArray * GetSideSetIdMapAsString() const
This API is not really meant for public use and may change without notices.
const std::map< std::string, vtkTypeInt64 > & GetFaceBlockIdMap() const
In IOSS entity blocks/sets may have unique ids.
vtkStringArray * GetNodeSetIdMapAsString() const
This API is not really meant for public use and may change without notices.
vtkDataArraySelection * GetEdgeBlockSelection()
vtkDataArraySelection * GetEdgeSetSelection()
void ClearSelectors()
API to specify selectors that indicate which branches on the assembly are chosen.
static bool DoTestFilePatternMatching()
Runs a bunch of tests for file pattern matching.
void AddProperty(const char *name, void *value)
IOSS databases support various properties that affect how the database is read.
void SetSelector(const char *selector)
API to specify selectors that indicate which branches on the assembly are chosen.
vtkDataArraySelection * GetElementSetSelection()
vtkDataArraySelection * GetStructuredBlockSelection()
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
vtkStringArray * GetEdgeBlockIdMapAsString() const
This API is not really meant for public use and may change without notices.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a simple class to control print indentation
Definition vtkIndent.h:34
Key for integer values in vtkInformation.
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Multiprocessing communication superclass.
Allocate and hold a VTK object.
Definition vtkNew.h:56
a vtkAbstractArray subclass for strings
int vtkTypeBool
Definition vtkABI.h:69
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:287
#define VTK_INT_MAX
Definition vtkType.h:155
#define VTK_FILEPATH