VTK  9.4.20250114
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vtkDGOperation< InputIterator, OutputIterator > Class Template Reference

Invoke an operator on DG cells/sides. More...

#include <vtkDGOperation.h>

Inheritance diagram for vtkDGOperation< InputIterator, OutputIterator >:
[legend]
Collaboration diagram for vtkDGOperation< InputIterator, OutputIterator >:
[legend]

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
 

Detailed Description

template<typename InputIterator, typename OutputIterator>
class vtkDGOperation< InputIterator, OutputIterator >

Invoke an operator on DG cells/sides.

Definition at line 35 of file vtkDGOperation.h.

Member Typedef Documentation

◆ SelfType

template<typename InputIterator , typename OutputIterator >
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.

◆ OpEval

template<typename InputIterator , typename OutputIterator >
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.

◆ OpEvalEntry

template<typename InputIterator , typename OutputIterator >
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.

◆ EvaluatorMap

template<typename InputIterator , typename OutputIterator >
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.

Constructor & Destructor Documentation

◆ vtkDGOperation() [1/3]

template<typename InputIterator , typename OutputIterator >
vtkDGOperation< InputIterator, OutputIterator >::vtkDGOperation ( )
default

Construct an operation object.

The copy-constructor variant is what allows you to use vtkSMPThreadLocal<vtkDGOperation> in vtkSMPTools workers.

◆ vtkDGOperation() [2/3]

template<typename InputIterator , typename OutputIterator >
vtkDGOperation< InputIterator, OutputIterator >::vtkDGOperation ( const SelfType other)

◆ vtkDGOperation() [3/3]

template<typename InputIterator , typename OutputIterator >
vtkDGOperation< InputIterator, OutputIterator >::vtkDGOperation ( vtkDGCell cellType,
vtkCellAttribute cellAttribute,
vtkStringToken  operationName 
)

Member Function Documentation

◆ PrintSelf()

template<typename InputIterator , typename OutputIterator >
void vtkDGOperation< InputIterator, OutputIterator >::PrintSelf ( std::ostream &  os,
vtkIndent  indent 
)

◆ Prepare()

template<typename InputIterator , typename OutputIterator >
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.

◆ Evaluate()

template<typename InputIterator , typename OutputIterator >
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.

◆ GetEvaluatorForSideSpec()

template<typename InputIterator , typename OutputIterator >
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

auto a = cell->GetCellSource(sideSpecId).Offset;
auto b = cell->GetCellSource(sideSpecId).Connectivity->GetNumberOfTuples();

then you should only call the evaluator with IDs in [a, a+b[.

◆ GetNumberOfResultComponents()

template<typename InputIterator , typename OutputIterator >
int vtkDGOperation< InputIterator, OutputIterator >::GetNumberOfResultComponents ( ) const
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.

◆ AddSource()

template<typename InputIterator , typename OutputIterator >
void vtkDGOperation< InputIterator, OutputIterator >::AddSource ( vtkCellGrid grid,
vtkDGCell cellType,
std::size_t  sideSpecIdx,
vtkCellAttribute cellAtt,
const vtkCellAttribute::CellTypeInfo cellTypeInfo,
vtkDGOperatorEntry op,
bool  includeShape 
)
protected

◆ FindEvaluator()

template<typename InputIterator , typename OutputIterator >
EvaluatorMap::const_iterator vtkDGOperation< InputIterator, OutputIterator >::FindEvaluator ( RangeKey  cellKey,
const EvaluatorMap evaluators 
)
protected

Return the first iterator to an entry of evaluators that covers cellKey.

Member Data Documentation

◆ NumberOfResultComponents

template<typename InputIterator , typename OutputIterator >
int vtkDGOperation< InputIterator, OutputIterator >::NumberOfResultComponents { 0 }
protected

Definition at line 162 of file vtkDGOperation.h.

◆ Evaluators

template<typename InputIterator , typename OutputIterator >
EvaluatorMap vtkDGOperation< InputIterator, OutputIterator >::Evaluators
protected

Definition at line 163 of file vtkDGOperation.h.


The documentation for this class was generated from the following file: