VTK  9.4.20241227
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
12VTK_ABI_NAMESPACE_BEGIN
13
31class VTKFILTERSCELLGRID_EXPORT vtkDGOperatorEntry
32{
33public:
34 using OperatorFunction = std::function<void(const std::array<double, 3>, std::vector<double>&)>;
35
36 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
80 std::string ShaderOp;
81};
82
83VTK_ABI_NAMESPACE_END
84#endif // vtkDGOperatorEntry_h
A record for a basis in a function space that is specific to one cell shape.
OperatorFunction Op
A function you may call to evaluate the operator.
std::string ShaderOp
A string holding the source code to evaluate all the basis functions.
std::function< void(const std::array< double, 3 >, std::vector< double > &)> OperatorFunction
vtkDGOperatorEntry()=default
vtkDGOperatorEntry(const vtkDGOperatorEntry &)=default
std::string GetShaderString(const std::string &functionName, const std::string &parameterName) const
Return a glsl string that defines this operator.
vtkDGOperatorEntry(int numFunc, int opSize, OperatorFunction op, const std::string &shader)