VTK  9.7.1
vtkUnstructuredGridFieldAnnotations.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
15 #ifndef vtkUnstructuredGridFieldAnnotations_h
16 #define vtkUnstructuredGridFieldAnnotations_h
17 
18 #include "vtkCellGrid.h" // for API + ivars
19 #include "vtkFiltersCellGridModule.h" // For export macro
20 #include "vtkNew.h" // for ivar
21 #include "vtkObject.h"
22 #include "vtkStringToken.h" // for API + ivars
23 
24 #include <map>
25 #include <unordered_map>
26 #include <unordered_set>
27 #include <vector>
28 
29 VTK_ABI_NAMESPACE_BEGIN
30 
31 class vtkDataArray;
32 class vtkDataAssembly;
36 
37 class VTKFILTERSCELLGRID_EXPORT vtkUnstructuredGridFieldAnnotations : public vtkObject
38 {
39 public:
42  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
44  virtual void FetchAnnotations(vtkFieldData* fieldData, vtkDataAssembly* assembly);
45  virtual void AddAnnotations(vtkFieldData* fieldData, vtkDataAssembly* assembly);
46  virtual void Reset();
47 
50  {
53  bool operator<(const BlockAttributesKey& other) const
54  {
55  return this->DOFSharing.GetId() < other.DOFSharing.GetId() ||
56  (this->DOFSharing == other.DOFSharing &&
57  (this->FunctionSpace.GetId() < other.FunctionSpace.GetId()));
58  }
59  };
60 
62  struct FieldGlom
63  {
66  std::vector<vtkStringToken> Members;
67  };
68 
71  {
72  vtkStringToken BasisSource; // Currently always "Intrepid2"
73  vtkStringToken FunctionSpace; // "HDIV", "HGRAD", "HCURL"
74  vtkStringToken Shape; // "HEX", "QUAD", etc.
75  vtkStringToken QuadratureScheme; // "I1", "C2", etc.
76  vtkStringToken Formulation; // Currently always "FEM"
77  std::set<unsigned int> NodeIds; // Nodes in the vtkDataAssembly which reference this block.
78  mutable std::unordered_set<vtkStringToken> FieldNames; // Special fields for this block.
79  mutable std::unordered_map<vtkStringToken, FieldGlom>
80  FieldGloms; // Special fields that are glommed.
81  };
82 
91  std::unordered_map<unsigned int, std::map<BlockAttributesKey, BlockAttributesValue>> Data;
92 
93 protected:
95  ~vtkUnstructuredGridFieldAnnotations() override = default;
96 
97 private:
99  void operator=(const vtkUnstructuredGridFieldAnnotations&) = delete;
100 };
101 
102 VTK_ABI_NAMESPACE_END
103 
104 #endif // vtkUnstructuredGridFieldAnnotations_h
105 // VTK-HeaderTest-Exclude: vtkUnstructuredGridFieldAnnotations.h
abstract base class for most VTK objects
Definition: vtkObject.h:52
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
std::unordered_map< unsigned int, std::map< BlockAttributesKey, BlockAttributesValue > > Data
A map from dataset IDs (i.e., FlatIndex values in the collection) to a map keyed on function space an...
Gloms of multiple field names that represent vectors or tensors.
Hash GetId() const
Return the token's ID (usually its hash but possibly not in the case of collisions).
Fetch/add field annotations from/to an unstructured grid's field data.
Configuration hints for a partitioned dataset collection entry.
a simple class to control print indentation
Definition: vtkIndent.h:28
dataset represents arbitrary combinations of all possible cell types
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:44
represent and manipulate attribute data in a dataset
Represent a string by its integer hash.
hierarchical representation to use with vtkPartitionedDataSetCollection
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
std::vector< vtkStringToken > Members
An ordered list of single-component IOSS arrays that should be interleaved into a single...
Represents and manipulates a collection of data arrays.
Definition: vtkFieldData.h:51
Composite dataset that groups datasets as a collection.