VTK  9.3.0
vtkExodusIIReaderVariableCheck.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
3 #ifndef vtkExodusIIReaderVariableCheck_h
4 #define vtkExodusIIReaderVariableCheck_h
5 
6 #include "vtkExodusIIReaderPrivate.h" // for ArrayInfoType
7 
8 #include <set> // STL Header for integration point names
9 #include <string> // STL Header for Start/StartInternal/Add
10 #include <vector> // STL Header for glommed array names
11 #include <vtksys/RegularExpression.hxx> // for integration point names
12 
19 VTK_ABI_NAMESPACE_BEGIN
21 {
22 public:
24  virtual bool Start(std::string name, const int* truth, int numTruth);
26  virtual bool StartInternal(std::string name, const int* truth, int numTruth) = 0;
28  virtual bool Add(std::string name, const int* truth) = 0;
30  virtual std::vector<std::string>::size_type Length();
32  virtual int Accept(std::vector<vtkExodusIIReaderPrivate::ArrayInfoType>& arr, int startIndex,
33  vtkExodusIIReaderPrivate* priv, int objtyp);
34 
35 protected:
41  bool CheckTruth(const int* truth);
43  std::vector<vtkExodusIIReaderPrivate::ArrayInfoType>& arrays);
44 
45  int GlomType;
46  std::vector<int> SeqTruth;
48  std::vector<std::string> OriginalNames;
49 };
50 
53 {
54 public:
56  bool StartInternal(std::string name, const int*, int) override;
57  bool Add(std::string, const int*) override;
58 };
59 
62 {
63 public:
64  vtkExodusIIReaderVectorCheck(const char* seq, int n);
65  bool StartInternal(std::string name, const int*, int) override;
66  bool Add(std::string name, const int* truth) override;
67  std::vector<std::string>::size_type Length() override;
68 
69 protected:
72 };
73 
81 {
82 public:
83  vtkExodusIIReaderTensorCheck(const char* seq, int n, int rank, int dim);
84  bool StartInternal(std::string name, const int*, int) override;
85  bool Add(std::string name, const int* truth) override;
86  std::vector<std::string>::size_type Length() override;
87 
88 protected:
90  vtkTypeUInt64 NumEndings;
91  int Dimension;
92  int Rank;
94 };
95 
99 {
100 public:
102  bool StartInternal(std::string name, const int*, int) override;
103  bool Add(std::string name, const int*) override;
104  std::vector<std::string>::size_type Length() override;
105  /*
106  virtual int Accept(
107  std::vector<vtkExodusIIReaderPrivate::ArrayInfoType>& arr, int startIndex,
108  vtkExodusIIReaderPrivate* priv, int objtyp )
109  {
110  }
111  */
112 protected:
115 
116  vtksys::RegularExpression RegExp;
119  std::vector<int> IntPtMin;
120  std::vector<int> IntPtMax;
121  std::set<std::string> IntPtNames;
122  vtkTypeUInt64 Rank;
124 };
125 
126 VTK_ABI_NAMESPACE_END
127 #endif // vtkExodusIIReaderVariableCheck_h
128 // VTK-HeaderTest-Exclude: vtkExodusIIReaderVariableCheck.h
This looks for integration-point variables whose names contain an element shape and digits specifying...
bool Add(std::string name, const int *) override
Add a name to the sequence. Returns true if any more names may be added.
bool StartInternal(std::string name, const int *, int) override
Subclasses implement this and returns true if any more names are acceptable.
bool AddIntegrationPoint(std::string iptName)
std::vector< std::string >::size_type Length() override
Returns the length of the sequence (or 0 if the match is incorrect or incomplete).
bool StartIntegrationPoints(std::string cellType, std::string iptName)
This class holds metadata for an Exodus file.
This always accepts a single array name as a scalar. It is the fallback for all other checkers.
bool Add(std::string, const int *) override
Add a name to the sequence. Returns true if any more names may be added.
bool StartInternal(std::string name, const int *, int) override
Subclasses implement this and returns true if any more names are acceptable.
This looks for symmetric tensors of a given rank and dimension.
vtkExodusIIReaderTensorCheck(const char *seq, int n, int rank, int dim)
bool StartInternal(std::string name, const int *, int) override
Subclasses implement this and returns true if any more names are acceptable.
bool Add(std::string name, const int *truth) override
Add a name to the sequence. Returns true if any more names may be added.
std::vector< std::string >::size_type Length() override
Returns the length of the sequence (or 0 if the match is incorrect or incomplete).
Abstract base class for glomming arrays of variable names.
bool CheckTruth(const int *truth)
Utility that subclasses may call from within Add() to verify that the new variable is defined on the ...
bool UniquifyName(vtkExodusIIReaderPrivate::ArrayInfoType &ainfo, std::vector< vtkExodusIIReaderPrivate::ArrayInfoType > &arrays)
virtual std::vector< std::string >::size_type Length()
Returns the length of the sequence (or 0 if the match is incorrect or incomplete).
virtual int Accept(std::vector< vtkExodusIIReaderPrivate::ArrayInfoType > &arr, int startIndex, vtkExodusIIReaderPrivate *priv, int objtyp)
Accept this sequence. (Add an entry to the end of arr.) Must return Length().
virtual bool Add(std::string name, const int *truth)=0
Add a name to the sequence. Returns true if any more names may be added.
virtual bool StartInternal(std::string name, const int *truth, int numTruth)=0
Subclasses implement this and returns true if any more names are acceptable.
virtual bool Start(std::string name, const int *truth, int numTruth)
Initialize a sequence of names. Returns true if any more names are acceptable.
This looks for n-D vectors whose names are identical except for a single final character.
bool Add(std::string name, const int *truth) override
Add a name to the sequence. Returns true if any more names may be added.
bool StartInternal(std::string name, const int *, int) override
Subclasses implement this and returns true if any more names are acceptable.
vtkExodusIIReaderVectorCheck(const char *seq, int n)
std::vector< std::string >::size_type Length() override
Returns the length of the sequence (or 0 if the match is incorrect or incomplete).
@ name
Definition: vtkX3D.h:219
@ string
Definition: vtkX3D.h:490
A struct to hold information about time-varying arrays.