VTK  9.4.20250130
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
29VTK_ABI_NAMESPACE_BEGIN
30
31class vtkDataArray;
32class vtkDataAssembly;
36
37class VTKFILTERSCELLGRID_EXPORT vtkUnstructuredGridFieldAnnotations : public vtkObject
38{
39public:
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
93protected:
96
97private:
99 void operator=(const vtkUnstructuredGridFieldAnnotations&) = delete;
100};
101
102VTK_ABI_NAMESPACE_END
103
104#endif // vtkUnstructuredGridFieldAnnotations_h
105// VTK-HeaderTest-Exclude: vtkUnstructuredGridFieldAnnotations.h
abstract superclass for arrays of numeric data
hierarchical representation to use with vtkPartitionedDataSetCollection
represent and manipulate attribute data in a dataset
represent and manipulate fields of data
a simple class to control print indentation
Definition vtkIndent.h:108
abstract base class for most VTK objects
Definition vtkObject.h:162
Composite dataset that groups datasets as a collection.
Represent a string by its integer hash.
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.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkUnstructuredGridFieldAnnotations * New()
virtual void AddAnnotations(vtkFieldData *fieldData, vtkDataAssembly *assembly)
~vtkUnstructuredGridFieldAnnotations() override=default
virtual void FetchAnnotations(vtkFieldData *fieldData, vtkDataAssembly *assembly)
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...
dataset represents arbitrary combinations of all possible cell types
Configuration hints for a partitioned dataset collection entry.
Gloms of multiple field names that represent vectors or tensors.
std::vector< vtkStringToken > Members
An ordered list of single-component IOSS arrays that should be interleaved into a single,...