VTK  9.5.20251218
vtkIOSSReader.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-FileCopyrightText: Copyright (c) Sandia Corporation
3// SPDX-License-Identifier: BSD-3-Clause
4
5#ifndef vtkIOSSReader_h
6#define vtkIOSSReader_h
7
164
165#include "vtkDeprecation.h" // for VTK_DEPRECATED_IN_9_6_0
166#include "vtkIOIOSSModule.h" // for export macros
167#include "vtkNew.h" // for vtkNew
168#include "vtkReaderAlgorithm.h"
169
170#include <map> // for std::map
171
172VTK_ABI_NAMESPACE_BEGIN
174class vtkDataAssembly;
177class vtkStringArray;
178
179class VTKIOIOSS_EXPORT vtkIOSSReader : public vtkReaderAlgorithm
180{
181public:
184 void PrintSelf(ostream& os, vtkIndent indent) override;
185
187
190 void AddFileName(VTK_FILEPATH const char* fname);
192 VTK_FILEPATH const char* GetFileName(int index) const;
195
199 void SetFileName(VTK_FILEPATH const char* fname);
200
202
206 vtkSetStringMacro(DatabaseTypeOverride);
207 vtkGetStringMacro(DatabaseTypeOverride);
209
211
215 void SetCatalystConduitChannelName(const std::string& newString);
218
220
224 void SetDisplacementMagnitude(double magnitude);
227
229
240 vtkBooleanMacro(GroupNumericVectorFieldComponents, bool);
242
244
253 vtkBooleanMacro(GroupAlphabeticVectorFieldComponents, bool);
255
257
260 void SetFieldSuffixSeparator(const char* value);
263
265
269 void SetScanForRelatedFiles(bool value);
270 vtkGetMacro(ScanForRelatedFiles, bool);
271 vtkBooleanMacro(ScanForRelatedFiles, bool);
273
275
288 vtkSetVector2Macro(FileRange, int);
289 vtkGetVector2Macro(FileRange, int);
290 vtkSetClampMacro(FileStride, int, 1, VTK_INT_MAX);
291 vtkGetMacro(FileStride, int);
293
295
300 void SetCaching(bool value);
301 vtkGetMacro(Caching, bool);
302 vtkBooleanMacro(Caching, bool);
304
306
312 vtkGetMacro(MergeExodusEntityBlocks, bool);
313 vtkBooleanMacro(MergeExodusEntityBlocks, bool);
315
317
327 void SetElementAndSideIds(bool value);
328 vtkGetMacro(ElementAndSideIds, bool);
329 vtkBooleanMacro(ElementAndSideIds, bool);
331
333
340 vtkSetMacro(GenerateFileId, bool);
341 vtkGetMacro(GenerateFileId, bool);
342 vtkBooleanMacro(GenerateFileId, bool);
344
346
350 vtkSetMacro(ReadIds, bool);
351 vtkGetMacro(ReadIds, bool);
352 vtkBooleanMacro(ReadIds, bool);
354
356
360 vtkSetMacro(IncludeGhostNodes, bool);
361 vtkGetMacro(IncludeGhostNodes, bool);
362 vtkBooleanMacro(IncludeGhostNodes, bool);
364
366
375 vtkGetMacro(RemoveUnusedPoints, bool);
376 vtkBooleanMacro(RemoveUnusedPoints, bool);
378
380
384 vtkSetMacro(ApplyDisplacements, bool);
385 vtkGetMacro(ApplyDisplacements, bool);
386 vtkBooleanMacro(ApplyDisplacements, bool);
388
390
393 VTK_DEPRECATED_IN_9_6_0("Use vtkDataArraySelection* GetGlobalFieldSelection() instead")
394 virtual void SetReadGlobalFields(bool value);
395 VTK_DEPRECATED_IN_9_6_0("Use vtkDataArraySelection* GetGlobalFieldSelection() instead")
396 virtual bool GetReadGlobalFields();
397 VTK_DEPRECATED_IN_9_6_0("Use vtkDataArraySelection* GetGlobalFieldSelection() instead")
398 virtual void ReadGlobalFieldsOn();
399 VTK_DEPRECATED_IN_9_6_0("Use vtkDataArraySelection* GetGlobalFieldSelection() instead")
400 virtual void ReadGlobalFieldsOff();
402
404
415 vtkGetMacro(ReadAllFilesToDetermineStructure, bool);
416 vtkBooleanMacro(ReadAllFilesToDetermineStructure, bool);
418
420
424 vtkSetMacro(ReadQAAndInformationRecords, bool);
425 vtkGetMacro(ReadQAAndInformationRecords, bool);
426 vtkBooleanMacro(ReadQAAndInformationRecords, bool);
428
430
442 vtkGetObjectMacro(Controller, vtkMultiProcessController);
444
446
452 void AddProperty(const char* name, int value);
453 void AddProperty(const char* name, double value);
454 void AddProperty(const char* name, void* value);
455 void AddProperty(const char* name, const char* value);
456 void RemoveProperty(const char* name);
459
481
482 static bool GetEntityTypeIsBlock(int type) { return (type >= BLOCK_START && type < BLOCK_END); }
483 static bool GetEntityTypeIsSet(int type) { return (type >= SET_START && type < SET_END); }
484 static const char* GetDataAssemblyNodeNameForEntityType(int type);
485 static const char* GetMergedEntityNameForEntityType(int type);
486
504
526
530 {
533 }
534
536
541 const std::map<std::string, vtkTypeInt64>& GetEntityIdMap(int type) const;
542 const std::map<std::string, vtkTypeInt64>& GetNodeBlockIdMap() const
543 {
544 return this->GetEntityIdMap(NODEBLOCK);
545 }
546 const std::map<std::string, vtkTypeInt64>& GetEdgeBlockIdMap() const
547 {
548 return this->GetEntityIdMap(EDGEBLOCK);
549 }
550 const std::map<std::string, vtkTypeInt64>& GetFaceBlockIdMap() const
551 {
552 return this->GetEntityIdMap(FACEBLOCK);
553 }
554 const std::map<std::string, vtkTypeInt64>& GetElementBlockIdMap() const
555 {
556 return this->GetEntityIdMap(ELEMENTBLOCK);
557 }
558 const std::map<std::string, vtkTypeInt64>& GetStructuredBlockIdMap() const
559 {
560 return this->GetEntityIdMap(STRUCTUREDBLOCK);
561 }
562 const std::map<std::string, vtkTypeInt64>& GetNodeSetIdMap() const
563 {
564 return this->GetEntityIdMap(NODESET);
565 }
566 const std::map<std::string, vtkTypeInt64>& GetEdgeSetIdMap() const
567 {
568 return this->GetEntityIdMap(EDGESET);
569 }
570 const std::map<std::string, vtkTypeInt64>& GetFaceSetIdMap() const
571 {
572 return this->GetEntityIdMap(FACESET);
573 }
574 const std::map<std::string, vtkTypeInt64>& GetElementSetIdMap() const
575 {
576 return this->GetEntityIdMap(ELEMENTSET);
577 }
578 const std::map<std::string, vtkTypeInt64>& GetSideSetIdMap() const
579 {
580 return this->GetEntityIdMap(SIDESET);
581 }
582
583
585
620
622
635
643 vtkGetMacro(AssemblyTag, int);
644
646
650 bool AddSelector(const char* selector);
652 void SetSelector(const char* selector);
654
656
660 const char* GetSelector(int index) const;
662
664
667 int ReadMetaData(vtkInformation* metadata) override;
668 int ReadMesh(int piece, int npieces, int nghosts, int timestep, vtkDataObject* output) override;
669 int ReadPoints(int, int, int, int, vtkDataObject*) override { return 1; }
670 int ReadArrays(int, int, int, int, vtkDataObject*) override { return 1; }
672
677
682
687 vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo) override;
688
690
691protected:
693
695 ~vtkIOSSReader() override;
696
697 // For use by vtkIOSSReaderInternal.
698 std::map<std::string, vtkTypeInt64>& GetEntityIdMap(int type);
699
700 int FillOutputPortInformation(int port, vtkInformation* info) override;
701
703
706
707private:
708 vtkIOSSReader(const vtkIOSSReader&) = delete;
709 void operator=(const vtkIOSSReader&) = delete;
712 vtkNew<vtkDataArraySelection> GlobalFieldSelection;
713 std::map<std::string, vtkTypeInt64> EntityIdMap[NUMBER_OF_ENTITY_TYPES + 1];
714 vtkNew<vtkStringArray> EntityIdMapStrings[NUMBER_OF_ENTITY_TYPES + 1];
715
716 vtkMultiProcessController* Controller;
717 bool Caching;
718 bool MergeExodusEntityBlocks;
719 bool ElementAndSideIds;
720 bool GenerateFileId;
721 bool ScanForRelatedFiles;
722 bool ReadIds;
723 bool RemoveUnusedPoints;
724 bool ApplyDisplacements;
725 bool ReadAllFilesToDetermineStructure;
726 bool ReadQAAndInformationRecords;
727 char* DatabaseTypeOverride;
728 int FileRange[2];
729 int FileStride;
730 bool IncludeGhostNodes;
731};
732
733VTK_ABI_NAMESPACE_END
734#endif
Store on/off settings for data arrays, etc.
hierarchical representation to use with vtkPartitionedDataSetCollection
general representation of visualization data
Internal methods and state for the IOSS reader.
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)
virtual bool GetReadGlobalFields()
When set to true (default), the reader will read global fields.
int GetNumberOfSelectors() const
API to access selectors.
int ReadArrays(int, int, int, int, vtkDataObject *) override
Implementation for vtkReaderAlgorithm API.
void RemoveAllFieldSelections()
void SetFileName(const char *fname)
Set a single filename.
void RemoveAllSelections()
void SetMergeExodusEntityBlocks(bool value)
When this flag is on, blocks/sets of exodus like types will be merged.
virtual void SetReadGlobalFields(bool value)
When set to true (default), the reader will read global fields.
~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.
std::string GetFieldSuffixSeparator()
Set the character used to separate suffix from the field.
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 SetCatalystConduitChannelName(const std::string &newString)
Get/Set the IOSS Catalyst Conduit channel name when reading from IOSS Catalyst Conduit.
void ClearProperties()
IOSS databases support various properties that affect how the database is read.
void AddFileName(const char *fname)
API to set the filenames.
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()
vtkDataArraySelection * GetGlobalFieldSelection()
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 const char * GetMergedEntityNameForEntityType(int type)
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 SetFieldSuffixSeparator(const char *value)
Set the character used to separate suffix from the field.
static vtkInformationIntegerKey * ENTITY_TYPE()
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()
void SetCaching(bool value)
When this flag is on, caching of data across time-steps is enabled.
int ReadMetaData(vtkInformation *metadata) override
Implementation for vtkReaderAlgorithm API.
std::map< std::string, vtkTypeInt64 > & GetEntityIdMap(int type)
const char * GetSelector(int index) const
API to access selectors.
const char * GetFileName(int index) const
API to set the filenames.
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.
virtual void ReadGlobalFieldsOff()
When set to true (default), the reader will read global fields.
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.
static vtkInformationIntegerKey * ENTITY_ID()
void SetElementAndSideIds(bool value)
When this flag is on and MergeExodusEntityBlocks is off, side sets of exodus data will be annotated w...
std::string GetCatalystConduitChannelName()
Get/Set the IOSS Catalyst Conduit channel name when reading from IOSS Catalyst Conduit.
bool GetGroupNumericVectorFieldComponents()
Set whether the reader should treat numeric suffixes for a vector field as vector components.
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)
vtkIOSSReaderInternal * Internals
double GetDisplacementMagnitude()
When displacements are being applied, they are scaled by this amount.
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.
friend class vtkIOSSReaderInternal
void SetGroupNumericVectorFieldComponents(bool value)
Set whether the reader should treat numeric suffixes for a vector field as vector components.
void SetSelector(const char *selector)
API to specify selectors that indicate which branches on the assembly are chosen.
bool GetGroupAlphabeticVectorFieldComponents()
Set whether the reader should recognize fields with suffixes such as X, Y, Z or x,...
vtkDataArraySelection * GetElementSetSelection()
virtual void ReadGlobalFieldsOn()
When set to true (default), the reader will read global fields.
vtkDataArraySelection * GetStructuredBlockSelection()
void SetReadAllFilesToDetermineStructure(bool)
When set to false (default), the reader will read only the first file to determine the structure,...
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 SetGroupAlphabeticVectorFieldComponents(bool value)
Set whether the reader should recognize fields with suffixes such as X, Y, Z or x,...
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:108
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:167
a vtkAbstractArray subclass for strings
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_DEPRECATED_IN_9_6_0(reason)
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:323
#define VTK_INT_MAX
Definition vtkType.h:197
#define VTK_FILEPATH