VTK  9.7.1
vtkDGOperatorEntry.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 vtkDGOperatorEntry_h
4 #define vtkDGOperatorEntry_h
5 
6 #include "vtkFiltersCellGridModule.h" // For export macro.
7 #include "vtkStringToken.h" // For ivar.
8 
9 #include <array>
10 #include <vector>
11 
12 VTK_ABI_NAMESPACE_BEGIN
13 
31 class VTKFILTERSCELLGRID_EXPORT vtkDGOperatorEntry
32 {
33 public:
34  using OperatorFunction = std::function<void(const std::array<double, 3>, std::vector<double>&)>;
35 
36  vtkDGOperatorEntry() = default;
37  vtkDGOperatorEntry(const vtkDGOperatorEntry&) = default;
38  vtkDGOperatorEntry(int numFunc, int opSize, OperatorFunction op, const std::string& shader)
39  : NumberOfFunctions(numFunc)
40  , OperatorSize(opSize)
41  , Op(op)
42  , ShaderOp(shader)
43  {
44  }
45 
50  operator bool() const { return !!this->Op; }
51 
53  std::string GetShaderString(
54  const std::string& functionName, const std::string& parameterName) const;
55 
60  int NumberOfFunctions{ 0 };
61 
66  int OperatorSize{ 1 };
67 
78 
81 };
82 
83 VTK_ABI_NAMESPACE_END
84 #endif // vtkDGOperatorEntry_h
vtkDGOperatorEntry(int numFunc, int opSize, OperatorFunction op, const std::string &shader)
std::function< void(const std::array< double, 3 >, std::vector< double > &)> OperatorFunction
OperatorFunction Op
A function you may call to evaluate the operator.
A record for a basis in a function space that is specific to one cell shape.
std::string ShaderOp
A string holding the source code to evaluate all the basis functions.