VTK  9.2.5
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 
174 #ifndef vtkIOSSReader_h
175 #define vtkIOSSReader_h
176 
177 #include "vtkIOIOSSModule.h" // for export macros
178 #include "vtkNew.h" // for vtkNew
179 #include "vtkReaderAlgorithm.h"
180 
181 #include <map> // for std::map
182 
184 class vtkDataAssembly;
186 class vtkStringArray;
187 
188 class VTKIOIOSS_EXPORT vtkIOSSReader : public vtkReaderAlgorithm
189 {
190 public:
191  static vtkIOSSReader* New();
193  void PrintSelf(ostream& os, vtkIndent indent) override;
194 
196 
199  void AddFileName(VTK_FILEPATH const char* fname);
201  VTK_FILEPATH const char* GetFileName(int index) const;
202  int GetNumberOfFileNames() const;
204 
208  void SetFileName(VTK_FILEPATH const char* fname);
209 
211 
215  vtkSetStringMacro(DatabaseTypeOverride);
216  vtkGetStringMacro(DatabaseTypeOverride);
218 
220 
224  void SetDisplacementMagnitude(double magnitude);
227 
229 
234  vtkGetMacro(ScanForRelatedFiles, bool);
235  vtkBooleanMacro(ScanForRelatedFiles, bool);
237 
239 
252  vtkSetVector2Macro(FileRange, int);
253  vtkGetVector2Macro(FileRange, int);
254  vtkSetClampMacro(FileStride, int, 1, VTK_INT_MAX);
255  vtkGetMacro(FileStride, int);
257 
259 
266  vtkSetMacro(GenerateFileId, bool);
267  vtkGetMacro(GenerateFileId, bool);
268  vtkBooleanMacro(GenerateFileId, bool);
270 
272 
276  vtkSetMacro(ReadIds, bool);
277  vtkGetMacro(ReadIds, bool);
278  vtkBooleanMacro(ReadIds, bool);
280 
282 
291  vtkGetMacro(RemoveUnusedPoints, bool);
292  vtkBooleanMacro(RemoveUnusedPoints, bool);
294 
296 
300  vtkSetMacro(ApplyDisplacements, bool);
301  vtkGetMacro(ApplyDisplacements, bool);
302  vtkBooleanMacro(ApplyDisplacements, bool);
304 
306 
309  vtkSetMacro(ReadGlobalFields, bool);
310  vtkGetMacro(ReadGlobalFields, bool);
311  vtkBooleanMacro(ReadGlobalFields, bool);
313 
315 
319  vtkSetMacro(ReadQAAndInformationRecords, bool);
320  vtkGetMacro(ReadQAAndInformationRecords, bool);
321  vtkBooleanMacro(ReadQAAndInformationRecords, bool);
323 
325 
337  vtkGetObjectMacro(Controller, vtkMultiProcessController);
339 
341 
347  void AddProperty(const char* name, int value);
348  void AddProperty(const char* name, double value);
349  void AddProperty(const char* name, void* value);
350  void AddProperty(const char* name, const char* value);
351  void RemoveProperty(const char* name);
354 
356  {
368 
369  BLOCK_START = NODEBLOCK,
370  BLOCK_END = NODESET,
371  SET_START = NODESET,
372  SET_END = NUMBER_OF_ENTITY_TYPES,
373  ENTITY_START = NODEBLOCK,
374  ENTITY_END = NUMBER_OF_ENTITY_TYPES,
375  };
376 
377  static bool GetEntityTypeIsBlock(int type) { return (type >= BLOCK_START && type < BLOCK_END); }
378  static bool GetEntityTypeIsSet(int type) { return (type >= SET_START && type < SET_END); }
380 
382  vtkDataArraySelection* GetNodeBlockSelection() { return this->GetEntitySelection(NODEBLOCK); }
383  vtkDataArraySelection* GetEdgeBlockSelection() { return this->GetEntitySelection(EDGEBLOCK); }
384  vtkDataArraySelection* GetFaceBlockSelection() { return this->GetEntitySelection(FACEBLOCK); }
386  {
387  return this->GetEntitySelection(ELEMENTBLOCK);
388  }
390  {
391  return this->GetEntitySelection(STRUCTUREDBLOCK);
392  }
393  vtkDataArraySelection* GetNodeSetSelection() { return this->GetEntitySelection(NODESET); }
394  vtkDataArraySelection* GetEdgeSetSelection() { return this->GetEntitySelection(EDGESET); }
395  vtkDataArraySelection* GetFaceSetSelection() { return this->GetEntitySelection(FACESET); }
396  vtkDataArraySelection* GetElementSetSelection() { return this->GetEntitySelection(ELEMENTSET); }
397  vtkDataArraySelection* GetSideSetSelection() { return this->GetEntitySelection(SIDESET); }
398 
400  vtkDataArraySelection* GetNodeBlockFieldSelection() { return this->GetFieldSelection(NODEBLOCK); }
401  vtkDataArraySelection* GetEdgeBlockFieldSelection() { return this->GetFieldSelection(EDGEBLOCK); }
402  vtkDataArraySelection* GetFaceBlockFieldSelection() { return this->GetFieldSelection(FACEBLOCK); }
404  {
405  return this->GetFieldSelection(ELEMENTBLOCK);
406  }
408  {
409  return this->GetFieldSelection(STRUCTUREDBLOCK);
410  }
411  vtkDataArraySelection* GetNodeSetFieldSelection() { return this->GetFieldSelection(NODESET); }
412  vtkDataArraySelection* GetEdgeSetFieldSelection() { return this->GetFieldSelection(EDGESET); }
413  vtkDataArraySelection* GetFaceSetFieldSelection() { return this->GetFieldSelection(FACESET); }
415  {
416  return this->GetFieldSelection(ELEMENTSET);
417  }
418  vtkDataArraySelection* GetSideSetFieldSelection() { return this->GetFieldSelection(SIDESET); }
419 
423  {
424  this->RemoveAllEntitySelections();
425  this->RemoveAllFieldSelections();
426  }
427 
429 
434  const std::map<std::string, vtkTypeInt64>& GetEntityIdMap(int type) const;
435  const std::map<std::string, vtkTypeInt64>& GetNodeBlockIdMap() const
436  {
437  return this->GetEntityIdMap(NODEBLOCK);
438  }
439  const std::map<std::string, vtkTypeInt64>& GetEdgeBlockIdMap() const
440  {
441  return this->GetEntityIdMap(EDGEBLOCK);
442  }
443  const std::map<std::string, vtkTypeInt64>& GetFaceBlockIdMap() const
444  {
445  return this->GetEntityIdMap(FACEBLOCK);
446  }
447  const std::map<std::string, vtkTypeInt64>& GetElementBlockIdMap() const
448  {
449  return this->GetEntityIdMap(ELEMENTBLOCK);
450  }
451  const std::map<std::string, vtkTypeInt64>& GetStructuredBlockIdMap() const
452  {
453  return this->GetEntityIdMap(STRUCTUREDBLOCK);
454  }
455  const std::map<std::string, vtkTypeInt64>& GetNodeSetIdMap() const
456  {
457  return this->GetEntityIdMap(NODESET);
458  }
459  const std::map<std::string, vtkTypeInt64>& GetEdgeSetIdMap() const
460  {
461  return this->GetEntityIdMap(EDGESET);
462  }
463  const std::map<std::string, vtkTypeInt64>& GetFaceSetIdMap() const
464  {
465  return this->GetEntityIdMap(FACESET);
466  }
467  const std::map<std::string, vtkTypeInt64>& GetElementSetIdMap() const
468  {
469  return this->GetEntityIdMap(ELEMENTSET);
470  }
471  const std::map<std::string, vtkTypeInt64>& GetSideSetIdMap() const
472  {
473  return this->GetEntityIdMap(SIDESET);
474  }
476 
478 
485  {
486  return this->GetEntityIdMapAsString(NODEBLOCK);
487  }
489  {
490  return this->GetEntityIdMapAsString(EDGEBLOCK);
491  }
493  {
494  return this->GetEntityIdMapAsString(FACEBLOCK);
495  }
497  {
498  return this->GetEntityIdMapAsString(ELEMENTBLOCK);
499  }
501  {
502  return this->GetEntityIdMapAsString(STRUCTUREDBLOCK);
503  }
504  vtkStringArray* GetNodeSetIdMapAsString() const { return this->GetEntityIdMapAsString(NODESET); }
505  vtkStringArray* GetEdgeSetIdMapAsString() const { return this->GetEntityIdMapAsString(EDGESET); }
506  vtkStringArray* GetFaceSetIdMapAsString() const { return this->GetEntityIdMapAsString(FACESET); }
508  {
509  return this->GetEntityIdMapAsString(ELEMENTSET);
510  }
511  vtkStringArray* GetSideSetIdMapAsString() const { return this->GetEntityIdMapAsString(SIDESET); }
513 
515 
528 
536  vtkGetMacro(AssemblyTag, int);
537 
539 
543  bool AddSelector(const char* selector);
545  void SetSelector(const char* selector);
547 
549 
552  int GetNumberOfSelectors() const;
553  const char* GetSelector(int index) const;
555 
557 
560  int ReadMetaData(vtkInformation* metadata) override;
561  int ReadMesh(int piece, int npieces, int nghosts, int timestep, vtkDataObject* output) override;
562  int ReadPoints(int, int, int, int, vtkDataObject*) override { return 1; }
563  int ReadArrays(int, int, int, int, vtkDataObject*) override { return 1; }
565 
569  vtkMTimeType GetMTime() override;
570 
575 
580  vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo) override;
581 
582 protected:
584  ~vtkIOSSReader() override;
585 
587 
588 private:
589  vtkIOSSReader(const vtkIOSSReader&) = delete;
590  void operator=(const vtkIOSSReader&) = delete;
591  vtkNew<vtkDataArraySelection> EntitySelection[NUMBER_OF_ENTITY_TYPES];
592  vtkNew<vtkDataArraySelection> EntityFieldSelection[NUMBER_OF_ENTITY_TYPES];
593  std::map<std::string, vtkTypeInt64> EntityIdMap[NUMBER_OF_ENTITY_TYPES + 1];
594  vtkNew<vtkStringArray> EntityIdMapStrings[NUMBER_OF_ENTITY_TYPES + 1];
595 
596  vtkMultiProcessController* Controller;
597  bool GenerateFileId;
598  bool ScanForRelatedFiles;
599  bool ReadIds;
600  bool RemoveUnusedPoints;
601  bool ApplyDisplacements;
602  bool ReadGlobalFields;
603  bool ReadQAAndInformationRecords;
604  char* DatabaseTypeOverride;
605  int AssemblyTag;
606  int FileRange[2];
607  int FileStride;
608 
609  class vtkInternals;
610  vtkInternals* Internals;
611 
612  static vtkInformationIntegerKey* ENTITY_TYPE();
613 };
614 
615 #endif
Store on/off settings for data arrays, etc.
hierarchical representation to use with vtkPartitionedDataSetCollection
general representation of visualization data
Reader for IOSS (Sierra IO System)
vtkStringArray * GetNodeBlockIdMapAsString() const
This API is not really meant for public use and may change without notices.
const std::map< std::string, vtkTypeInt64 > & GetSideSetIdMap() const
In IOSS entity blocks/sets may have unique ids.
vtkDataArraySelection * GetEdgeSetSelection()
void RemoveAllEntitySelections()
vtkDataArraySelection * GetEdgeBlockFieldSelection()
vtkDataArraySelection * GetNodeBlockFieldSelection()
const std::map< std::string, vtkTypeInt64 > & GetNodeSetIdMap() const
In IOSS entity blocks/sets may have unique ids.
void AddFileName(VTK_FILEPATH const char *fname)
API to set the filenames.
int GetNumberOfSelectors() const
API to access selectors.
vtkStringArray * GetEdgeBlockIdMapAsString() const
This API is not really meant for public use and may change without notices.
vtkDataArraySelection * GetNodeSetFieldSelection()
int ReadArrays(int, int, int, int, vtkDataObject *) override
Implementation for vtkReaderAlgorithm API.
void RemoveAllFieldSelections()
void RemoveAllSelections()
~vtkIOSSReader() override
int ReadPoints(int, int, int, int, vtkDataObject *) override
Implementation for vtkReaderAlgorithm API.
vtkDataArraySelection * GetElementSetFieldSelection()
vtkDataArraySelection * GetEntitySelection(int type)
vtkDataArraySelection * GetSideSetFieldSelection()
void ClearProperties()
IOSS databases support various properties that affect how the database is read.
const std::map< std::string, vtkTypeInt64 > & GetEdgeBlockIdMap() const
In IOSS entity blocks/sets may have unique ids.
vtkStringArray * GetFaceBlockIdMapAsString() const
This API is not really meant for public use and may change without notices.
vtkDataArraySelection * GetElementSetSelection()
const std::map< std::string, vtkTypeInt64 > & GetEdgeSetIdMap() const
In IOSS entity blocks/sets may have unique ids.
vtkDataArraySelection * GetFieldSelection(int type)
static const char * GetDataAssemblyNodeNameForEntityType(int type)
vtkDataArraySelection * GetFaceSetFieldSelection()
vtkDataArraySelection * GetFaceBlockSelection()
vtkDataArraySelection * GetStructuredBlockFieldSelection()
vtkStringArray * GetSideSetIdMapAsString() const
This API is not really meant for public use and may change without notices.
vtkStringArray * GetElementBlockIdMapAsString() const
This API is not really meant for public use and may change without notices.
vtkDataArraySelection * GetFaceBlockFieldSelection()
vtkStringArray * GetEdgeSetIdMapAsString() const
This API is not really meant for public use and may change without notices.
static bool GetEntityTypeIsSet(int type)
void AddProperty(const char *name, int value)
IOSS databases support various properties that affect how the database is read.
vtkDataArraySelection * GetEdgeSetFieldSelection()
const std::map< std::string, vtkTypeInt64 > & GetElementBlockIdMap() 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 * GetStructuredBlockSelection()
void SetRemoveUnusedPoints(bool)
Node related data, including point coordinates, point field data etc.
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.
int ReadMetaData(vtkInformation *metadata) override
Implementation for vtkReaderAlgorithm API.
vtkDataArraySelection * GetElementBlockSelection()
vtkStringArray * GetElementSetIdMapAsString() const
This API is not really meant for public use and may change without notices.
const char * GetSelector(int index) const
API to access selectors.
const std::map< std::string, vtkTypeInt64 > & GetStructuredBlockIdMap() const
In IOSS entity blocks/sets may have unique ids.
void SetFileName(VTK_FILEPATH const char *fname)
Set a single filename.
vtkDataArraySelection * GetNodeBlockSelection()
vtkTypeBool ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo) override
Overridden to release handles at the end of each pass.
vtkStringArray * GetEntityIdMapAsString(int type) const
This API is not really meant for public use and may change without notices.
vtkStringArray * GetStructuredBlockIdMapAsString() const
This API is not really meant for public use and may change without notices.
void RemoveProperty(const char *name)
IOSS databases support various properties that affect how the database is read.
vtkStringArray * GetFaceSetIdMapAsString() 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.
vtkDataArraySelection * GetElementBlockFieldSelection()
static bool GetEntityTypeIsBlock(int type)
void SetController(vtkMultiProcessController *controller)
Get/Set the controller to use when working in parallel.
int GetNumberOfFileNames() const
API to set the filenames.
vtkDataArraySelection * GetFaceSetSelection()
bool AddSelector(const char *selector)
API to specify selectors that indicate which branches on the assembly are chosen.
static vtkIOSSReader * New()
void SetDisplacementMagnitude(double magnitude)
When displacements are being applied, they are scaled by this amount.
vtkDataArraySelection * GetSideSetSelection()
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 > & GetFaceSetIdMap() const
In IOSS entity blocks/sets may have unique ids.
const std::map< std::string, vtkTypeInt64 > & GetElementSetIdMap() const
In IOSS entity blocks/sets may have unique ids.
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.
VTK_FILEPATH const char * GetFileName(int index) const
API to set the filenames.
vtkDataArraySelection * GetNodeSetSelection()
vtkDataArraySelection * GetEdgeBlockSelection()
vtkDataAssembly * GetAssembly()
Assemblies provide yet another way of selection blocks/sets to load, if available in the dataset.
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.
const std::map< std::string, vtkTypeInt64 > & GetNodeBlockIdMap() const
In IOSS entity blocks/sets may have unique ids.
void SetSelector(const char *selector)
API to specify selectors that indicate which branches on the assembly are chosen.
const std::map< std::string, vtkTypeInt64 > & GetFaceBlockIdMap() const
In IOSS entity blocks/sets may have unique ids.
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
const std::map< std::string, vtkTypeInt64 > & GetEntityIdMap(int type) const
In IOSS entity blocks/sets may have unique ids.
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:119
Key for integer values in vtkInformation.
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Multiprocessing communication superclass.
Superclass for readers that implement a simplified API.
a vtkAbstractArray subclass for strings
@ info
Definition: vtkX3D.h:382
@ value
Definition: vtkX3D.h:226
@ port
Definition: vtkX3D.h:453
@ type
Definition: vtkX3D.h:522
@ name
Definition: vtkX3D.h:225
@ index
Definition: vtkX3D.h:252
int vtkTypeBool
Definition: vtkABI.h:69
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287
#define VTK_INT_MAX
Definition: vtkType.h:155
#define VTK_FILEPATH