VTK  9.1.0
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 
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 
179 class vtkDataAssembly;
181 
182 class VTKIOIOSS_EXPORT vtkIOSSReader : public vtkReaderAlgorithm
183 {
184 public:
185  static vtkIOSSReader* New();
187  void PrintSelf(ostream& os, vtkIndent indent) override;
188 
190 
193  void AddFileName(VTK_FILEPATH const char* fname);
195  VTK_FILEPATH const char* GetFileName(int index) const;
196  int GetNumberOfFileNames() const;
198 
202  void SetFileName(VTK_FILEPATH const char* fname);
203 
205 
209  vtkSetStringMacro(DatabaseTypeOverride);
210  vtkGetStringMacro(DatabaseTypeOverride);
212 
214 
219  vtkGetMacro(ScanForRelatedFiles, bool);
220  vtkBooleanMacro(ScanForRelatedFiles, bool);
222 
224 
237  vtkSetVector2Macro(FileRange, int);
238  vtkGetVector2Macro(FileRange, int);
239  vtkSetClampMacro(FileStride, int, 1, VTK_INT_MAX);
240  vtkGetMacro(FileStride, int);
242 
244 
251  vtkSetMacro(GenerateFileId, bool);
252  vtkGetMacro(GenerateFileId, bool);
253  vtkBooleanMacro(GenerateFileId, bool);
255 
257 
261  vtkSetMacro(ReadIds, bool);
262  vtkGetMacro(ReadIds, bool);
263  vtkBooleanMacro(ReadIds, bool);
265 
267 
276  vtkGetMacro(RemoveUnusedPoints, bool);
277  vtkBooleanMacro(RemoveUnusedPoints, bool);
279 
281 
285  vtkSetMacro(ApplyDisplacements, bool);
286  vtkGetMacro(ApplyDisplacements, bool);
287  vtkBooleanMacro(ApplyDisplacements, bool);
289 
291 
294  vtkSetMacro(ReadGlobalFields, bool);
295  vtkGetMacro(ReadGlobalFields, bool);
296  vtkBooleanMacro(ReadGlobalFields, bool);
298 
300 
304  vtkSetMacro(ReadQAAndInformationRecords, bool);
305  vtkGetMacro(ReadQAAndInformationRecords, bool);
306  vtkBooleanMacro(ReadQAAndInformationRecords, bool);
308 
310 
322  vtkGetObjectMacro(Controller, vtkMultiProcessController);
324 
326 
332  void AddProperty(const char* name, int value);
333  void AddProperty(const char* name, double value);
334  void AddProperty(const char* name, void* value);
335  void AddProperty(const char* name, const char* value);
336  void RemoveProperty(const char* name);
339 
341  {
353 
354  BLOCK_START = NODEBLOCK,
355  BLOCK_END = NODESET,
356  SET_START = NODESET,
357  SET_END = NUMBER_OF_ENTITY_TYPES,
358  ENTITY_START = NODEBLOCK,
359  ENTITY_END = NUMBER_OF_ENTITY_TYPES,
360  };
361 
362  static bool GetEntityTypeIsBlock(int type) { return (type >= BLOCK_START && type < BLOCK_END); }
363  static bool GetEntityTypeIsSet(int type) { return (type >= SET_START && type < SET_END); }
365 
367  vtkDataArraySelection* GetNodeBlockSelection() { return this->GetEntitySelection(NODEBLOCK); }
368  vtkDataArraySelection* GetEdgeBlockSelection() { return this->GetEntitySelection(EDGEBLOCK); }
369  vtkDataArraySelection* GetFaceBlockSelection() { return this->GetEntitySelection(FACEBLOCK); }
371  {
372  return this->GetEntitySelection(ELEMENTBLOCK);
373  }
375  {
376  return this->GetEntitySelection(STRUCTUREDBLOCK);
377  }
378  vtkDataArraySelection* GetNodeSetSelection() { return this->GetEntitySelection(NODESET); }
379  vtkDataArraySelection* GetEdgeSetSelection() { return this->GetEntitySelection(EDGESET); }
380  vtkDataArraySelection* GetFaceSetSelection() { return this->GetEntitySelection(FACESET); }
381  vtkDataArraySelection* GetElementSetSelection() { return this->GetEntitySelection(ELEMENTSET); }
382  vtkDataArraySelection* GetSideSetSelection() { return this->GetEntitySelection(SIDESET); }
383 
385  vtkDataArraySelection* GetNodeBlockFieldSelection() { return this->GetFieldSelection(NODEBLOCK); }
386  vtkDataArraySelection* GetEdgeBlockFieldSelection() { return this->GetFieldSelection(EDGEBLOCK); }
387  vtkDataArraySelection* GetFaceBlockFieldSelection() { return this->GetFieldSelection(FACEBLOCK); }
389  {
390  return this->GetFieldSelection(ELEMENTBLOCK);
391  }
393  {
394  return this->GetFieldSelection(STRUCTUREDBLOCK);
395  }
396  vtkDataArraySelection* GetNodeSetFieldSelection() { return this->GetFieldSelection(NODESET); }
397  vtkDataArraySelection* GetEdgeSetFieldSelection() { return this->GetFieldSelection(EDGESET); }
398  vtkDataArraySelection* GetFaceSetFieldSelection() { return this->GetFieldSelection(FACESET); }
400  {
401  return this->GetFieldSelection(ELEMENTSET);
402  }
403  vtkDataArraySelection* GetSideSetFieldSelection() { return this->GetFieldSelection(SIDESET); }
404 
408  {
409  this->RemoveAllEntitySelections();
410  this->RemoveAllFieldSelections();
411  }
412 
414 
427 
435  vtkGetMacro(AssemblyTag, int);
436 
438 
442  bool AddSelector(const char* selector);
444  void SetSelector(const char* selector);
446 
448 
451  int GetNumberOfSelectors() const;
452  const char* GetSelector(int index) const;
454 
456 
459  int ReadMetaData(vtkInformation* metadata) override;
460  int ReadMesh(int piece, int npieces, int nghosts, int timestep, vtkDataObject* output) override;
461  int ReadPoints(int, int, int, int, vtkDataObject*) override { return 1; }
462  int ReadArrays(int, int, int, int, vtkDataObject*) override { return 1; }
464 
468  vtkMTimeType GetMTime() override;
469 
474 
479  vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo) override;
480 
481 protected:
483  ~vtkIOSSReader() override;
484 
486 
487 private:
488  vtkIOSSReader(const vtkIOSSReader&) = delete;
489  void operator=(const vtkIOSSReader&) = delete;
490  vtkNew<vtkDataArraySelection> EntitySelection[NUMBER_OF_ENTITY_TYPES];
491  vtkNew<vtkDataArraySelection> EntityFieldSelection[NUMBER_OF_ENTITY_TYPES];
492  vtkMultiProcessController* Controller;
493  bool GenerateFileId;
494  bool ScanForRelatedFiles;
495  bool ReadIds;
496  bool RemoveUnusedPoints;
497  bool ApplyDisplacements;
498  bool ReadGlobalFields;
499  bool ReadQAAndInformationRecords;
500  char* DatabaseTypeOverride;
501  int AssemblyTag;
502  int FileRange[2];
503  int FileStride;
504 
505  class vtkInternals;
506  vtkInternals* Internals;
507 
508  static vtkInformationIntegerKey* ENTITY_TYPE();
509 };
510 
511 #endif
vtkIOSSReader::GetSelector
const char * GetSelector(int index) const
API to access selectors.
vtkIOSSReader::NODESET
@ NODESET
Definition: vtkIOSSReader.h:347
vtkIOSSReader::ClearSelectors
void ClearSelectors()
API to specify selectors that indicate which branches on the assembly are chosen.
vtkDataAssembly
hierarchical representation to use with vtkPartitionedDataSetCollection
Definition: vtkDataAssembly.h:131
vtkIOSSReader::FACEBLOCK
@ FACEBLOCK
Definition: vtkIOSSReader.h:344
VTK_INT_MAX
#define VTK_INT_MAX
Definition: vtkType.h:155
vtkIOSSReader::GetStructuredBlockFieldSelection
vtkDataArraySelection * GetStructuredBlockFieldSelection()
Definition: vtkIOSSReader.h:392
vtkReaderAlgorithm.h
vtkReaderAlgorithm
Superclass for readers that implement a simplified API.
Definition: vtkReaderAlgorithm.h:38
vtkIOSSReader::GetDataAssemblyNodeNameForEntityType
static const char * GetDataAssemblyNodeNameForEntityType(int type)
vtkIOSSReader::AddProperty
void AddProperty(const char *name, double value)
IOSS databases support various properties that affect how the database is read.
vtkX3D::value
@ value
Definition: vtkX3D.h:226
VTK_FILEPATH
#define VTK_FILEPATH
Definition: vtkWrappingHints.h:46
vtkX3D::type
@ type
Definition: vtkX3D.h:522
vtkIOSSReader::AddProperty
void AddProperty(const char *name, void *value)
IOSS databases support various properties that affect how the database is read.
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:145
vtkIOSSReader::SetFileName
void SetFileName(VTK_FILEPATH const char *fname)
Set a single filename.
vtkIOSSReader::GetFileName
VTK_FILEPATH const char * GetFileName(int index) const
API to set the filenames.
vtkIOSSReader::GetSideSetSelection
vtkDataArraySelection * GetSideSetSelection()
Definition: vtkIOSSReader.h:382
vtkIOSSReader::GetFaceBlockSelection
vtkDataArraySelection * GetFaceBlockSelection()
Definition: vtkIOSSReader.h:369
vtkIOSSReader
Reader for IOSS (Sierra IO System)
Definition: vtkIOSSReader.h:183
vtkIOSSReader::GetFaceBlockFieldSelection
vtkDataArraySelection * GetFaceBlockFieldSelection()
Definition: vtkIOSSReader.h:387
vtkIOSSReader::ReadMesh
int ReadMesh(int piece, int npieces, int nghosts, int timestep, vtkDataObject *output) override
Implementation for vtkReaderAlgorithm API.
vtkIOSSReader::RemoveAllSelections
void RemoveAllSelections()
Definition: vtkIOSSReader.h:407
vtkIOSSReader::EDGESET
@ EDGESET
Definition: vtkIOSSReader.h:348
vtkIOSSReader::ClearProperties
void ClearProperties()
IOSS databases support various properties that affect how the database is read.
vtkIOSSReader::New
static vtkIOSSReader * New()
vtkIOSSReader::GetEdgeSetFieldSelection
vtkDataArraySelection * GetEdgeSetFieldSelection()
Definition: vtkIOSSReader.h:397
vtkIOSSReader::STRUCTUREDBLOCK
@ STRUCTUREDBLOCK
Definition: vtkIOSSReader.h:346
vtkDataArraySelection
Store on/off settings for data arrays for a vtkSource.
Definition: vtkDataArraySelection.h:35
vtkIOSSReader::SetSelector
void SetSelector(const char *selector)
API to specify selectors that indicate which branches on the assembly are chosen.
vtkIOSSReader::ELEMENTSET
@ ELEMENTSET
Definition: vtkIOSSReader.h:350
vtkX3D::port
@ port
Definition: vtkX3D.h:453
vtkIOSSReader::vtkIOSSReader
vtkIOSSReader()
vtkIOSSReader::AddProperty
void AddProperty(const char *name, const char *value)
IOSS databases support various properties that affect how the database is read.
vtkIOSSReader::GetNumberOfSelectors
int GetNumberOfSelectors() const
API to access selectors.
vtkIOSSReader::RemoveAllEntitySelections
void RemoveAllEntitySelections()
vtkIOSSReader::GetElementSetFieldSelection
vtkDataArraySelection * GetElementSetFieldSelection()
Definition: vtkIOSSReader.h:399
vtkIOSSReader::SetController
void SetController(vtkMultiProcessController *controller)
Get/Set the controller to use when working in parallel.
vtkIOSSReader::FillOutputPortInformation
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
vtkIOSSReader::RemoveProperty
void RemoveProperty(const char *name)
IOSS databases support various properties that affect how the database is read.
vtkIOSSReader::AddProperty
void AddProperty(const char *name, int value)
IOSS databases support various properties that affect how the database is read.
vtkMultiProcessController
Multiprocessing communication superclass.
Definition: vtkMultiProcessController.h:77
vtkInformationIntegerKey
Key for integer values in vtkInformation.
Definition: vtkInformationIntegerKey.h:32
vtkIOSSReader::GetEdgeSetSelection
vtkDataArraySelection * GetEdgeSetSelection()
Definition: vtkIOSSReader.h:379
vtkIOSSReader::~vtkIOSSReader
~vtkIOSSReader() override
vtkIOSSReader::ProcessRequest
vtkTypeBool ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo) override
Overridden to release handles at the end of each pass.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkIOSSReader::RemoveAllFieldSelections
void RemoveAllFieldSelections()
vtkIOSSReader::NUMBER_OF_ENTITY_TYPES
@ NUMBER_OF_ENTITY_TYPES
Definition: vtkIOSSReader.h:352
vtkIOSSReader::GetSideSetFieldSelection
vtkDataArraySelection * GetSideSetFieldSelection()
Definition: vtkIOSSReader.h:403
vtkIOSSReader::GetEdgeBlockSelection
vtkDataArraySelection * GetEdgeBlockSelection()
Definition: vtkIOSSReader.h:368
vtkIOSSReader::EDGEBLOCK
@ EDGEBLOCK
Definition: vtkIOSSReader.h:343
vtkIOSSReader::GetNodeBlockFieldSelection
vtkDataArraySelection * GetNodeBlockFieldSelection()
Definition: vtkIOSSReader.h:385
vtkIOSSReader::GetMTime
vtkMTimeType GetMTime() override
Overridden to take into account mtimes for vtkDataArraySelection instances.
vtkNew< vtkDataArraySelection >
vtkIOSSReader::ReadArrays
int ReadArrays(int, int, int, int, vtkDataObject *) override
Implementation for vtkReaderAlgorithm API.
Definition: vtkIOSSReader.h:462
vtkIOSSReader::GetFaceSetSelection
vtkDataArraySelection * GetFaceSetSelection()
Definition: vtkIOSSReader.h:380
vtkIOSSReader::GetStructuredBlockSelection
vtkDataArraySelection * GetStructuredBlockSelection()
Definition: vtkIOSSReader.h:374
vtkIOSSReader::GetEntityTypeIsSet
static bool GetEntityTypeIsSet(int type)
Definition: vtkIOSSReader.h:363
vtkIOSSReader::SIDESET
@ SIDESET
Definition: vtkIOSSReader.h:351
vtkIOSSReader::SetRemoveUnusedPoints
void SetRemoveUnusedPoints(bool)
Node related data, including point coordinates, point field data etc.
vtkIOSSReader::ELEMENTBLOCK
@ ELEMENTBLOCK
Definition: vtkIOSSReader.h:345
vtkIOSSReader::EntityType
EntityType
Definition: vtkIOSSReader.h:341
vtkX3D::name
@ name
Definition: vtkX3D.h:225
vtkIOSSReader::FACESET
@ FACESET
Definition: vtkIOSSReader.h:349
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:183
vtkX3D::info
@ info
Definition: vtkX3D.h:382
vtkIOSSReader::GetElementBlockSelection
vtkDataArraySelection * GetElementBlockSelection()
Definition: vtkIOSSReader.h:370
vtkIOSSReader::GetEdgeBlockFieldSelection
vtkDataArraySelection * GetEdgeBlockFieldSelection()
Definition: vtkIOSSReader.h:386
vtkIOSSReader::DoTestFilePatternMatching
static bool DoTestFilePatternMatching()
Runs a bunch of tests for file pattern matching.
vtkIOSSReader::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkNew.h
vtkIOSSReader::ClearFileNames
void ClearFileNames()
API to set the filenames.
vtkIOSSReader::AddFileName
void AddFileName(VTK_FILEPATH const char *fname)
API to set the filenames.
vtkIOSSReader::ReadMetaData
int ReadMetaData(vtkInformation *metadata) override
Implementation for vtkReaderAlgorithm API.
vtkIOSSReader::GetEntitySelection
vtkDataArraySelection * GetEntitySelection(int type)
vtkIOSSReader::GetFaceSetFieldSelection
vtkDataArraySelection * GetFaceSetFieldSelection()
Definition: vtkIOSSReader.h:398
vtkIOSSReader::GetNumberOfFileNames
int GetNumberOfFileNames() const
API to set the filenames.
vtkIOSSReader::AddSelector
bool AddSelector(const char *selector)
API to specify selectors that indicate which branches on the assembly are chosen.
vtkIOSSReader::GetElementBlockFieldSelection
vtkDataArraySelection * GetElementBlockFieldSelection()
Definition: vtkIOSSReader.h:388
vtkIOSSReader::GetFieldSelection
vtkDataArraySelection * GetFieldSelection(int type)
vtkIOSSReader::GetAssembly
vtkDataAssembly * GetAssembly()
Assemblies provide yet another way of selection blocks/sets to load, if available in the dataset.
vtkIOSSReader::ReadPoints
int ReadPoints(int, int, int, int, vtkDataObject *) override
Implementation for vtkReaderAlgorithm API.
Definition: vtkIOSSReader.h:461
vtkIOSSReader::NODEBLOCK
@ NODEBLOCK
Definition: vtkIOSSReader.h:342
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:169
vtkIOSSReader::GetEntityTypeIsBlock
static bool GetEntityTypeIsBlock(int type)
Definition: vtkIOSSReader.h:362
vtkIOSSReader::GetNodeSetSelection
vtkDataArraySelection * GetNodeSetSelection()
Definition: vtkIOSSReader.h:378
vtkX3D::index
@ index
Definition: vtkX3D.h:252
vtkIOSSReader::GetElementSetSelection
vtkDataArraySelection * GetElementSetSelection()
Definition: vtkIOSSReader.h:381
vtkIOSSReader::GetNodeBlockSelection
vtkDataArraySelection * GetNodeBlockSelection()
Definition: vtkIOSSReader.h:367
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkIOSSReader::GetNodeSetFieldSelection
vtkDataArraySelection * GetNodeSetFieldSelection()
Definition: vtkIOSSReader.h:396
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287
vtkIOSSReader::SetScanForRelatedFiles
void SetScanForRelatedFiles(bool value)
When set to true, the reader can automatically locate and load additional files that are part of the ...