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
179class vtkDataAssembly;
181
182class VTKIOIOSS_EXPORT vtkIOSSReader : public vtkReaderAlgorithm
183{
184public:
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;
198
202 void SetFileName(VTK_FILEPATH const char* fname);
203
205
209 vtkSetStringMacro(DatabaseTypeOverride);
210 vtkGetStringMacro(DatabaseTypeOverride);
212
214
218 void SetScanForRelatedFiles(bool value);
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); }
364 static const char* GetDataAssemblyNodeNameForEntityType(int type);
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
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
469
474
479 vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo) override;
480
481protected:
483 ~vtkIOSSReader() override;
484
485 int FillOutputPortInformation(int port, vtkInformation* info) override;
486
487private:
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
Store on/off settings for data arrays for a vtkSource.
hierarchical representation to use with vtkPartitionedDataSetCollection
general representation of visualization data
Reader for IOSS (Sierra IO System)
void RemoveAllEntitySelections()
vtkDataArraySelection * GetFaceSetSelection()
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
int ReadPoints(int, int, int, int, vtkDataObject *) override
Implementation for vtkReaderAlgorithm API.
vtkDataArraySelection * GetSideSetFieldSelection()
vtkDataArraySelection * GetNodeBlockFieldSelection()
vtkDataArraySelection * GetEdgeSetFieldSelection()
vtkDataArraySelection * GetElementBlockSelection()
vtkDataArraySelection * GetEntitySelection(int type)
void ClearProperties()
IOSS databases support various properties that affect how the database is read.
static vtkIOSSReader * New()
vtkDataArraySelection * GetFaceSetFieldSelection()
vtkDataAssembly * GetAssembly()
Assemblies provide yet another way of selection blocks/sets to load, if available in the dataset.
vtkDataArraySelection * GetElementBlockFieldSelection()
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 * 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.
vtkDataArraySelection * GetNodeBlockSelection()
vtkDataArraySelection * GetNodeSetFieldSelection()
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.
int GetNumberOfFileNames() const
API to set the filenames.
vtkDataArraySelection * GetStructuredBlockFieldSelection()
bool AddSelector(const char *selector)
API to specify selectors that indicate which branches on the assembly are chosen.
vtkDataArraySelection * GetNodeSetSelection()
void SetScanForRelatedFiles(bool value)
When set to true, the reader can automatically locate and load additional files that are part of the ...
vtkDataArraySelection * GetFieldSelection(int type)
void AddProperty(const char *name, double value)
IOSS databases support various properties that affect how the database is read.
vtkDataArraySelection * GetFaceBlockFieldSelection()
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.
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:113
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:165
Superclass for readers that implement a simplified API.
int vtkTypeBool
Definition: vtkABI.h:69
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287
#define VTK_INT_MAX
Definition: vtkType.h:155
#define VTK_FILEPATH