VTK
9.4.20250114
|
Invoke an operator on DG cells/sides. More...
#include <vtkDGOperation.h>
Classes | |
struct | Worker |
A vtkSMPTools worker class for evaluating an operation across a range of cells. More... | |
Public Types | |
using | SelfType = vtkDGOperation< InputIterator, OutputIterator > |
Type-alias for other objects matching our own type. | |
using | OpEval = vtkDGCellRangeEvaluator< InputIterator, OutputIterator > |
The signature for a function that evaluates iterators over a range. | |
using | OpEvalEntry = vtkDGOperationStateEntry< InputIterator, OutputIterator > |
Iterators affect the API offered by vtkDGOperationStateEntry, which has an OpEval. | |
using | EvaluatorMap = std::map< RangeKey, OpEvalEntry > |
Container for functions that evaluate data on a single vtkDGCell::Source instance. | |
Public Member Functions | |
vtkDGOperation ()=default | |
Construct an operation object. | |
vtkDGOperation (const SelfType &other) | |
vtkDGOperation (vtkDGCell *cellType, vtkCellAttribute *cellAttribute, vtkStringToken operationName) | |
void | PrintSelf (std::ostream &os, vtkIndent indent) |
bool | Prepare (vtkDGCell *cellType, vtkCellAttribute *cellAttribute, vtkStringToken operationName, bool includeShape=true) |
Prepare this instance of vtkDGOperation to evaluate operationName on the given cellType and cellAttribute. | |
bool | Evaluate (InputIterator &inIter, OutputIterator &outIter, vtkTypeUInt64 begin=0, vtkTypeUInt64 end=~0) |
Evaluate the prepared operator on the given cellIds at the given rst parameters, storing results in the result array. | |
OpEval | GetEvaluatorForSideSpec (vtkDGCell *cell, int sideSpecId) |
Return a function that can be called on the named sideSpecId. | |
int | GetNumberOfResultComponents () const |
Return the number of values generated per tuple each time an input cell-id and parameter-value are evaluated. | |
Protected Member Functions | |
void | AddSource (vtkCellGrid *grid, vtkDGCell *cellType, std::size_t sideSpecIdx, vtkCellAttribute *cellAtt, const vtkCellAttribute::CellTypeInfo &cellTypeInfo, vtkDGOperatorEntry &op, bool includeShape) |
EvaluatorMap::const_iterator | FindEvaluator (RangeKey cellKey, const EvaluatorMap &evaluators) |
Return the first iterator to an entry of evaluators that covers cellKey. | |
Protected Attributes | |
int | NumberOfResultComponents { 0 } |
EvaluatorMap | Evaluators |
Invoke an operator on DG cells/sides.
Definition at line 35 of file vtkDGOperation.h.
using vtkDGOperation< InputIterator, OutputIterator >::SelfType = vtkDGOperation<InputIterator, OutputIterator> |
Type-alias for other objects matching our own type.
Definition at line 39 of file vtkDGOperation.h.
using vtkDGOperation< InputIterator, OutputIterator >::OpEval = vtkDGCellRangeEvaluator<InputIterator, OutputIterator> |
The signature for a function that evaluates iterators over a range.
Definition at line 41 of file vtkDGOperation.h.
using vtkDGOperation< InputIterator, OutputIterator >::OpEvalEntry = vtkDGOperationStateEntry<InputIterator, OutputIterator> |
Iterators affect the API offered by vtkDGOperationStateEntry, which has an OpEval.
Definition at line 43 of file vtkDGOperation.h.
using vtkDGOperation< InputIterator, OutputIterator >::EvaluatorMap = std::map<RangeKey, OpEvalEntry> |
Container for functions that evaluate data on a single vtkDGCell::Source instance.
Definition at line 47 of file vtkDGOperation.h.
|
default |
Construct an operation object.
The copy-constructor variant is what allows you to use vtkSMPThreadLocal<vtkDGOperation> in vtkSMPTools workers.
vtkDGOperation< InputIterator, OutputIterator >::vtkDGOperation | ( | const SelfType & | other | ) |
vtkDGOperation< InputIterator, OutputIterator >::vtkDGOperation | ( | vtkDGCell * | cellType, |
vtkCellAttribute * | cellAttribute, | ||
vtkStringToken | operationName | ||
) |
void vtkDGOperation< InputIterator, OutputIterator >::PrintSelf | ( | std::ostream & | os, |
vtkIndent | indent | ||
) |
bool vtkDGOperation< InputIterator, OutputIterator >::Prepare | ( | vtkDGCell * | cellType, |
vtkCellAttribute * | cellAttribute, | ||
vtkStringToken | operationName, | ||
bool | includeShape = true |
||
) |
Prepare this instance of vtkDGOperation to evaluate operationName on the given cellType and cellAttribute.
This populates the Evaluators ivar with functors valid for a range of cells corresponding to non-blanked vtkDGCell::Source instances.
This method returns true upon success and false otherwise. This method returns false if operationName does not name an operator; other inputs are null pointers; or the cell attribute does not provide information on how the attribute should be evaluated on the given cell type.
You should not call the parenthesis operator () if Prepare() returns false.
If includeShape is true (the default), then any transformation of cellAttribute by the grid's shape-attribute that is needed will be factored into the evaluators. This avoids a double-lookup expense (i.e., once for cellAttribute and again for the shape attribute) when determining which entry in this->Evaluators to invoke for each ID.
For HGrad function spaces, includeShape has no effect. For HDiv and HCurl function spaces, this will transform vector values from reference coordinates into world coordinates.
bool vtkDGOperation< InputIterator, OutputIterator >::Evaluate | ( | InputIterator & | inIter, |
OutputIterator & | outIter, | ||
vtkTypeUInt64 | begin = 0 , |
||
vtkTypeUInt64 | end = ~0 |
||
) |
Evaluate the prepared operator on the given cellIds at the given rst parameters, storing results in the result array.
This method returns true upon success and false otherwise. If false is returned, partial results may have been written to result (for example, if an invalid cell ID is encountered after others have been processed).
The begin and end integers specify a sub-range of the iterators to process (allowing this method to be invoked in vtkSMPTools-style loops.
OpEval vtkDGOperation< InputIterator, OutputIterator >::GetEvaluatorForSideSpec | ( | vtkDGCell * | cell, |
int | sideSpecId | ||
) |
Return a function that can be called on the named sideSpecId.
This method may return a null evaluator if sideSpecId does not exist or if the sideSpecId is blanked.
If sideSpecId == -1, then a function for cell->GetCellSpec() is returned (assuming the cells are not blanked).
Note that the result may be null and, if non-null, should only be invoked with integers in the proper range. For example, if
then you should only call the evaluator with IDs in [a, a+b[.
|
inline |
Return the number of values generated per tuple each time an input cell-id and parameter-value are evaluated.
Definition at line 115 of file vtkDGOperation.h.
|
protected |
|
protected |
Return the first iterator to an entry of evaluators that covers cellKey.
|
protected |
Definition at line 162 of file vtkDGOperation.h.
|
protected |
Definition at line 163 of file vtkDGOperation.h.