VTK-m  2.0
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
vtkm::filter::Filter Class Referenceabstract

base class for all filters. More...

#include <Filter.h>

Inheritance diagram for vtkm::filter::Filter:
vtkm::filter::field_transform::GenerateIds vtkm::filter::FilterField vtkm::filter::geometry_refinement::Tetrahedralize vtkm::filter::geometry_refinement::Triangulate vtkm::filter::geometry_refinement::VertexClustering vtkm::filter::mesh_info::GhostCellClassify vtkm::filter::multi_block::AmrArrays vtkm::filter::scalar_topology::DistributedBranchDecompositionFilter

Public Member Functions

virtual VTKM_CONT ~Filter ()
 
virtual VTKM_CONT bool CanThread () const
 
VTKM_CONT void SetThreadsPerCPU (vtkm::Id numThreads)
 
VTKM_CONT void SetThreadsPerGPU (vtkm::Id numThreads)
 
VTKM_CONT vtkm::Id GetThreadsPerCPU () const
 
VTKM_CONT vtkm::Id GetThreadsPerGPU () const
 
VTKM_CONT bool GetRunMultiThreadedFilter () const
 
VTKM_CONT void SetRunMultiThreadedFilter (bool val)
 
void SetInvoker (vtkm::cont::Invoker inv)
 Specify the vtkm::cont::Invoker to be used to execute worklets by this filter instance. More...
 
VTKM_CONT void SetFieldsToPass (const vtkm::filter::FieldSelection &fieldsToPass)
 Specify which fields get passed from input to output. More...
 
VTKM_CONT void SetFieldsToPass (vtkm::filter::FieldSelection &&fieldsToPass)
 Specify which fields get passed from input to output. More...
 
VTKM_CONT void SetFieldsToPass (const vtkm::filter::FieldSelection &fieldsToPass, vtkm::filter::FieldSelection::Mode mode)
 Specify which fields get passed from input to output. More...
 
VTKM_CONT void SetFieldsToPass (std::initializer_list< std::string > fields, vtkm::filter::FieldSelection::Mode mode=vtkm::filter::FieldSelection::Mode::Select)
 Specify which fields get passed from input to output. More...
 
VTKM_CONT void SetFieldsToPass (std::initializer_list< std::pair< std::string, vtkm::cont::Field::Association >> fields, vtkm::filter::FieldSelection::Mode mode=vtkm::filter::FieldSelection::Mode::Select)
 Specify which fields get passed from input to output. More...
 
VTKM_CONT void SetFieldsToPass (const std::string &fieldname, vtkm::cont::Field::Association association, vtkm::filter::FieldSelection::Mode mode=vtkm::filter::FieldSelection::Mode::Select)
 Specify which fields get passed from input to output. More...
 
VTKM_CONT void SetFieldsToPass (const std::string &fieldname, vtkm::filter::FieldSelection::Mode mode)
 Specify which fields get passed from input to output. More...
 
const VTKM_CONT vtkm::filter::FieldSelectionGetFieldsToPass () const
 Specify which fields get passed from input to output. More...
 
VTKM_CONT vtkm::filter::FieldSelectionGetFieldsToPass ()
 Specify which fields get passed from input to output. More...
 
VTKM_CONT void SetPassCoordinateSystems (bool flag)
 Specify whether to always pass coordinate systems. More...
 
VTKM_CONT bool GetPassCoordinateSystems () const
 Specify whether to always pass coordinate systems. More...
 
VTKM_CONT vtkm::cont::DataSet Execute (const vtkm::cont::DataSet &input)
 
VTKM_CONT vtkm::cont::PartitionedDataSet Execute (const vtkm::cont::PartitionedDataSet &input)
 

Protected Member Functions

VTKM_CONT vtkm::cont::DataSet CreateResult (const vtkm::cont::DataSet &inDataSet) const
 Create the output data set for DoExecute. More...
 
VTKM_CONT vtkm::cont::PartitionedDataSet CreateResult (const vtkm::cont::PartitionedDataSet &input, const vtkm::cont::PartitionedDataSet &resultPartitions) const
 Create the output data set for DoExecute. More...
 
template<typename FieldMapper >
VTKM_CONT vtkm::cont::PartitionedDataSet CreateResult (const vtkm::cont::PartitionedDataSet &input, const vtkm::cont::PartitionedDataSet &resultPartitions, FieldMapper &&fieldMapper) const
 Create the output data set for DoExecute. More...
 
template<typename FieldMapper >
VTKM_CONT vtkm::cont::DataSet CreateResult (const vtkm::cont::DataSet &inDataSet, const vtkm::cont::UnknownCellSet &resultCellSet, FieldMapper &&fieldMapper) const
 Create the output data set for DoExecute. More...
 
virtual VTKM_CONT vtkm::cont::DataSet DoExecute (const vtkm::cont::DataSet &inData)=0
 
virtual VTKM_CONT vtkm::cont::PartitionedDataSet DoExecutePartitions (const vtkm::cont::PartitionedDataSet &inData)
 
template<typename FieldMapper >
VTKM_CONT vtkm::cont::DataSet CreateResultCoordinateSystem (const vtkm::cont::DataSet &inDataSet, const vtkm::cont::UnknownCellSet &resultCellSet, const vtkm::cont::CoordinateSystem &resultCoordSystem, FieldMapper &&fieldMapper) const
 Create the output data set for DoExecute. More...
 
template<typename FieldMapper >
VTKM_CONT vtkm::cont::DataSet CreateResultCoordinateSystem (const vtkm::cont::DataSet &inDataSet, const vtkm::cont::UnknownCellSet &resultCellSet, const std::string &coordsName, const vtkm::cont::UnknownArrayHandle &coordsData, FieldMapper &&fieldMapper) const
 Create the output data set for DoExecute. More...
 

Protected Attributes

vtkm::cont::Invoker Invoke
 

Private Member Functions

template<typename FieldMapper >
VTKM_CONT void MapFieldsOntoOutput (const vtkm::cont::DataSet &input, const vtkm::filter::FieldSelection &fieldSelection, vtkm::cont::DataSet &output, FieldMapper &&fieldMapper) const
 
template<typename FieldMapper >
VTKM_CONT void MapFieldsOntoOutput (const vtkm::cont::PartitionedDataSet &input, const vtkm::filter::FieldSelection &fieldSelection, vtkm::cont::PartitionedDataSet &output, FieldMapper &&fieldMapper) const
 
virtual VTKM_CONT vtkm::Id DetermineNumberOfThreads (const vtkm::cont::PartitionedDataSet &input)
 

Private Attributes

vtkm::filter::FieldSelection FieldsToPass = vtkm::filter::FieldSelection::Mode::All
 
bool PassCoordinateSystems = true
 
bool RunFilterWithMultipleThreads = false
 
vtkm::Id NumThreadsPerCPU = 4
 
vtkm::Id NumThreadsPerGPU = 8
 

Detailed Description

base class for all filters.

This is the base class for all filters. To add a new filter, one can subclass this (or any of the existing subclasses e.g. FilterField, FilterParticleAdvection, etc.) and implement relevant methods.

Usage

To execute a filter, one typically calls the auto result = filter.Execute(input). Typical usage is as follows:

// create the concrete subclass (e.g. Contour).
// select fields to map to the output, if different from default which is to map all input
// fields.
contour.SetFieldToPass({"var1", "var2"});
// execute the filter on vtkm::cont::DataSet.
vtkm::cont::DataSet dsInput = ...
auto outputDS = contour.Execute(dsInput);
// or, execute on a vtkm::cont::PartitionedDataSet
auto outputMB = contour.Execute(mbInput);

Execute methods take in the input DataSet or PartitionedDataSet to process and return the result. The type of the result is same as the input type, thus Execute(DataSet&) returns a DataSet while Execute(PartitionedDataSet&) returns a PartitionedDataSet.

Execute simply calls the pure virtual function DoExecute(DataSet&) which is the main extension point of the Filter interface. Filter developer needs to override DoExecute(DataSet) to implement the business logic of filtering operations on a single DataSet.

The default implementation of Execute(PartitionedDataSet&) is merely provided for convenience. Internally, it calls DoExecutePartitions(PartitionedDataSet) to iterate DataSets of a PartitionedDataSet and pass each individual DataSets to DoExecute(DataSet&), possibly in a multi-threaded setting. Developer of DoExecute(DataSet&) needs to indicate the thread-safeness of DoExecute(DataSet&) by overriding the CanThread() virtual method which by default returns true.

In the case that filtering on a PartitionedDataSet can not be simply implemented as a for-each loop on the component DataSets, filter implementor needs to override the DoExecutePartitions(PartitionedDataSet&). See the implementation of FilterParticleAdvection::Execute(PartitionedDataSet&) for an example.

Subclassing

In many uses cases, one subclasses one of the immediate subclasses of this class such as FilterField, FilterParticleAdvection, etc. Those may impose additional constraints on the methods to implement in the subclasses. Here, we describes the things to consider when directly subclassing vtkm::filter::Filter.

Execute

A concrete subclass of Filter must provide DoExecute implementation that provides the meat for the filter i.e. the implementation for the filter's data processing logic. There are two signatures available; which one to implement depends on the nature of the filter.

Let's consider simple filters that do not need to do anything special to handle PartitionedDataSet e.g. clip, contour, etc. These are the filters where executing the filter on a PartitionedDataSet simply means executing the filter on one partition at a time and packing the output for each iteration info the result PartitionedDataSet. For such filters, one must implement the following signature.

The role of this method is to execute on the input dataset and generate the result and return it. If there are any errors, the subclass must throw an exception (e.g. vtkm::cont::ErrorFilterExecution).

In this simple case, the Filter superclass handles iterating over multiple partitions in the input PartitionedDataSet and calling DoExecute(DataSet&) iteratively.

The aforementioned approach is also suitable for filters that need special handling for PartitionedDataSets that requires certain cross DataSet operations (usually scatter/gather and reduction on DataSets) before and/or after the per DataSet operation. This can be done by overriding DoExecutePartitions(PartitionedDataSet&) while calling to the base class `DoExecutePartitions(PartitionedDataSet&) as helper function for iteration on DataSets.

vtkm::cont::PartitionedDataSet FooFilter::DoExecutePartitions(
{
// Do pre execute stuff, e.g. scattering to each DataSet
auto output = this->Filter::DoExecutePartitions(input);
// Do post execute stuff, e.g gather/reduce from DataSets
return output;
}

For more complex filters, like streamlines, particle tracking, where the processing of PartitionedDataSets cannot be modelled as mapping and reduction operation on DataSet, one needs fully implement DoExecutePartitions(PartitionedDataSet&). Now the subclass is given full control over the execution, including any mapping of fields to output (described in next sub-section).

results and mapping fields

For subclasses that map input fields into output fields, the implementation of its DoExecute(DataSet&) should create the DataSet to be returned with a call to Filter::CreateResult or a similar method in a subclass (such as FilterField::CreateResultField).

VTKM_CONT DataSet SomeFilter::DoExecute(const vtkm::cont::DataSet& input)
{
outCellSet = ... // Generation of the new CellSet
// Mapper is a callable object (function object, lambda, etc.) that takes an input Field
// and maps it to an output Field and then add the output Field to the output DataSet
auto mapper = [](auto& outputDs, const auto& inputField) {
auto outputField = ... // Business logic for mapping input field to output field
output.AddField(outputField);
};
// This passes coordinate systems directly from input to output. If the points of
// the cell set change at all, they will have to be mapped by hand.
return this->CreateResult(input, outCellSet, mapper);
}

In addition to creating a new DataSet filled with the proper cell structure and coordinate systems, CreateResult iterates through each FieldToPass in the input DataSet and calls the FieldMapper to map the input Field to output Field. For simple filters that just pass on input fields to the output DataSet without any computation, an overload of CreateResult(const vtkm::cont::DataSet& input) is also provided as a convenience that uses the default mapper which trivially adds input Field to output DataSet (via a shallow copy).

CanThread

By default, the implementation of DoExecute(DataSet&) should model a pure function, i.e. it does not have any mutable shared state. This makes it thread-safe by default and allows the default implementation of DoExecutePartitions(PartitionedDataSet&) to be simply a parallel for-each, thus facilitates multi-threaded execution without any lock.

Many legacy (VTKm 1.x) filter implementations needed to store states between the mesh generation phase and field mapping phase of filter execution, for example, parameters for field interpolation. The shared mutable states were mostly stored as mutable data members of the filter class (either in terms of ArrayHandle or some kind of Worket). The new filter interface, by combining the two phases into a single call to DoExecute(DataSet&), we have eliminated most of the cases that require such shared mutable states. New implementations of filters that require passing information between these two phases can now use local variables within the DoExecute(DataSet&). For example:

struct SharedState; // shared states between mesh generation and field mapping.
VTKM_CONT DataSet ThreadSafeFilter::DoExecute(const vtkm::cont::DataSet& input)
{
// Mutable states that was a data member of the filter is now a local variable.
// Each invocation of Execute(DataSet) in the multi-threaded execution of
// Execute(PartitionedDataSet&) will have a copy of `states` on each thread's stack
// thus making it thread-safe.
SharedStates states;
cellSet = ... // Generation of the new DataSet and store interpolation parameters in `states`
// Lambda capture of `states`, effectively passing the shared states to the Mapper.
auto mapper = [&states](auto& outputDs, const auto& inputField) {
auto outputField = ... // Use `states` for mapping input field to output field
output.AddField(outputField);
};
this->CreateOutput(input, cellSet, mapper);
return output;
}

In the rare cases that filter implementation can not be made thread-safe, the implementation needs to override the CanThread() virtual method to return false. The default Execute(PartitionedDataSet&) implementation will fallback to a serial for loop execution.

DoExecute

The default multi-threaded execution of Execute(PartitionedDataSet&) uses a simple FIFO queue of DataSet and pool of worker threads. Implementation of Filter subclass can override the DoExecutePartitions(PartitionedDataSet) virtual method to provide implementation specific scheduling policy. The default number of worker threads in the pool are determined by the DetermineNumberOfThreads() virtual method using several backend dependent heuristic. Implementations of Filter subclass can also override DetermineNumberOfThreads() to provide implementation specific heuristic.

Constructor & Destructor Documentation

◆ ~Filter()

virtual VTKM_CONT vtkm::filter::Filter::~Filter ( )
virtual

Member Function Documentation

◆ CanThread()

virtual VTKM_CONT bool vtkm::filter::Filter::CanThread ( ) const
virtual

◆ CreateResult() [1/4]

VTKM_CONT vtkm::cont::DataSet vtkm::filter::Filter::CreateResult ( const vtkm::cont::DataSet inDataSet) const
protected

Create the output data set for DoExecute.

This form of CreateResult will create an output data set with the same cell structure and coordinate system as the input and pass all fields (as requested by the Filter state).

Parameters
[in]inDataSetThe input data set being modified (usually the one passed into DoExecute). The returned DataSet is filled with the cell set, coordinate system, and fields of inDataSet (as selected by the FieldsToPass state of the filter).

◆ CreateResult() [2/4]

template<typename FieldMapper >
VTKM_CONT vtkm::cont::DataSet vtkm::filter::Filter::CreateResult ( const vtkm::cont::DataSet inDataSet,
const vtkm::cont::UnknownCellSet resultCellSet,
FieldMapper &&  fieldMapper 
) const
inlineprotected

Create the output data set for DoExecute.

This form of CreateResult will create an output data set with the given CellSet. You must also provide a field mapper function, which is a function that takes the output DataSet being created and a Field from the input and then applies any necessary transformations to the field array and adds it to the DataSet.

Parameters
[in]inDataSetThe input data set being modified (usually the one passed into DoExecute). The returned DataSet is filled with fields of inDataSet (as selected by the FieldsToPass state of the filter).
[in]resultCellSetThe CellSet of the output will be set to this.
[in]fieldMapperA function or functor that takes a DataSet as its first argument and a Field as its second argument. The DataSet is the data being created and will eventually be returned by CreateResult. The Field comes from inDataSet. The function should map the Field to match resultCellSet and then add the resulting field to the DataSet. If the mapping is not possible, then the function should do nothing.

◆ CreateResult() [3/4]

VTKM_CONT vtkm::cont::PartitionedDataSet vtkm::filter::Filter::CreateResult ( const vtkm::cont::PartitionedDataSet input,
const vtkm::cont::PartitionedDataSet resultPartitions 
) const
protected

Create the output data set for DoExecute.

This form of CreateResult will create an output PartitionedDataSet with the same partitions and pass all PartitionedDataSet fields (as requested by the Filter state).

Parameters
[in]inputThe input data set being modified (usually the one passed into DoExecute).
[in]resultPartitionsThe output data created by the filter. Fields from the input are passed onto the return result partition as requested by the Filter state.

◆ CreateResult() [4/4]

template<typename FieldMapper >
VTKM_CONT vtkm::cont::PartitionedDataSet vtkm::filter::Filter::CreateResult ( const vtkm::cont::PartitionedDataSet input,
const vtkm::cont::PartitionedDataSet resultPartitions,
FieldMapper &&  fieldMapper 
) const
inlineprotected

Create the output data set for DoExecute.

This form of CreateResult will create an output PartitionedDataSet with the same partitions and pass all PartitionedDataSet fields (as requested by the Filter state).

Parameters
[in]inputThe input data set being modified (usually the one passed into DoExecute).
[in]resultPartitionsThe output data created by the filter. Fields from the input are passed onto the return result partition as requested by the Filter state.
[in]fieldMapperA function or functor that takes a PartitionedDataSet as its first argument and a Field as its second argument. The PartitionedDataSet is the data being created and will eventually be returned by CreateResult. The Field comes from input.

◆ CreateResultCoordinateSystem() [1/2]

template<typename FieldMapper >
VTKM_CONT vtkm::cont::DataSet vtkm::filter::Filter::CreateResultCoordinateSystem ( const vtkm::cont::DataSet inDataSet,
const vtkm::cont::UnknownCellSet resultCellSet,
const std::string &  coordsName,
const vtkm::cont::UnknownArrayHandle coordsData,
FieldMapper &&  fieldMapper 
) const
inlineprotected

Create the output data set for DoExecute.

This form of CreateResult will create an output data set with the given CellSet and CoordinateSystem. You must also provide a field mapper function, which is a function that takes the output DataSet being created and a Field from the input and then applies any necessary transformations to the field array and adds it to the DataSet.

Parameters
[in]inDataSetThe input data set being modified (usually the one passed into DoExecute). The returned DataSet is filled with fields of inDataSet (as selected by the FieldsToPass state of the filter).
[in]resultCellSetThe CellSet of the output will be set to this.
[in]resultCoordSystemThis CoordinateSystem will be added to the output.
[in]fieldMapperA function or functor that takes a DataSet as its first argument and a Field as its second argument. The DataSet is the data being created and will eventually be returned by CreateResult. The Field comes from inDataSet. The function should map the Field to match resultCellSet and then add the resulting field to the DataSet. If the mapping is not possible, then the function should do nothing.

◆ CreateResultCoordinateSystem() [2/2]

template<typename FieldMapper >
VTKM_CONT vtkm::cont::DataSet vtkm::filter::Filter::CreateResultCoordinateSystem ( const vtkm::cont::DataSet inDataSet,
const vtkm::cont::UnknownCellSet resultCellSet,
const vtkm::cont::CoordinateSystem resultCoordSystem,
FieldMapper &&  fieldMapper 
) const
inlineprotected

Create the output data set for DoExecute.

This form of CreateResult will create an output data set with the given CellSet and CoordinateSystem. You must also provide a field mapper function, which is a function that takes the output DataSet being created and a Field from the input and then applies any necessary transformations to the field array and adds it to the DataSet.

Parameters
[in]inDataSetThe input data set being modified (usually the one passed into DoExecute). The returned DataSet is filled with fields of inDataSet (as selected by the FieldsToPass state of the filter).
[in]resultCellSetThe CellSet of the output will be set to this.
[in]resultCoordSystemThis CoordinateSystem will be added to the output.
[in]fieldMapperA function or functor that takes a DataSet as its first argument and a Field as its second argument. The DataSet is the data being created and will eventually be returned by CreateResult. The Field comes from inDataSet. The function should map the Field to match resultCellSet and then add the resulting field to the DataSet. If the mapping is not possible, then the function should do nothing.

◆ DetermineNumberOfThreads()

virtual VTKM_CONT vtkm::Id vtkm::filter::Filter::DetermineNumberOfThreads ( const vtkm::cont::PartitionedDataSet input)
privatevirtual

◆ DoExecute()

virtual VTKM_CONT vtkm::cont::DataSet vtkm::filter::Filter::DoExecute ( const vtkm::cont::DataSet inData)
protectedpure virtual

Implemented in vtkm::filter::contour::Contour, vtkm::filter::image_processing::ImageDifference, vtkm::filter::vector_analysis::SurfaceNormals, vtkm::filter::vector_analysis::Gradient, vtkm::filter::scalar_topology::ContourTreeUniformDistributed, vtkm::filter::scalar_topology::ContourTreeAugmented, vtkm::filter::vector_analysis::CrossProduct, vtkm::filter::vector_analysis::DotProduct, vtkm::filter::field_transform::PointTransform, vtkm::filter::scalar_topology::ContourTreeMesh3D, vtkm::filter::field_transform::GenerateIds, vtkm::filter::entity_extraction::Threshold, vtkm::filter::entity_extraction::ExtractStructured, vtkm::filter::scalar_topology::ContourTreeMesh2D, vtkm::filter::field_transform::WarpScalar, vtkm::filter::entity_extraction::ExtractGeometry, vtkm::filter::field_transform::FieldToColors, vtkm::filter::mesh_info::MeshQuality, vtkm::filter::contour::MIRFilter, vtkm::filter::density_estimate::Histogram, vtkm::filter::entity_extraction::ExternalFaces, vtkm::filter::geometry_refinement::VertexClustering, vtkm::filter::mesh_info::CellMeasures, vtkm::filter::entity_extraction::ExtractPoints, vtkm::filter::entity_extraction::GhostCellRemove, vtkm::filter::field_transform::WarpVector, vtkm::filter::field_transform::PointElevation, vtkm::filter::entity_extraction::ThresholdPoints, vtkm::filter::field_transform::LogValues, vtkm::filter::density_estimate::NDHistogram, vtkm::filter::mesh_info::MeshQualityArea, vtkm::filter::mesh_info::MeshQualityVolume, vtkm::filter::density_estimate::ParticleDensityCloudInCell, vtkm::filter::density_estimate::ParticleDensityNearestGridPoint, vtkm::filter::geometry_refinement::SplitSharpEdges, vtkm::filter::entity_extraction::Mask, vtkm::filter::density_estimate::Entropy, vtkm::filter::entity_extraction::MaskPoints, vtkm::filter::contour::ClipWithField, vtkm::filter::contour::ClipWithImplicitFunction, vtkm::filter::image_processing::ImageMedian, vtkm::filter::geometry_refinement::Tube, vtkm::filter::connected_components::ImageConnectivity, vtkm::filter::mesh_info::MeshQualityAspectGamma, vtkm::filter::mesh_info::MeshQualityAspectRatio, vtkm::filter::mesh_info::MeshQualityCondition, vtkm::filter::mesh_info::MeshQualityDiagonalRatio, vtkm::filter::mesh_info::MeshQualityDimension, vtkm::filter::mesh_info::MeshQualityJacobian, vtkm::filter::mesh_info::MeshQualityMaxAngle, vtkm::filter::mesh_info::MeshQualityMaxDiagonal, vtkm::filter::mesh_info::MeshQualityMinAngle, vtkm::filter::mesh_info::MeshQualityMinDiagonal, vtkm::filter::mesh_info::MeshQualityOddy, vtkm::filter::mesh_info::MeshQualityRelativeSizeSquared, vtkm::filter::mesh_info::MeshQualityScaledJacobian, vtkm::filter::mesh_info::MeshQualityShape, vtkm::filter::mesh_info::MeshQualityShapeAndSize, vtkm::filter::mesh_info::MeshQualityShear, vtkm::filter::mesh_info::MeshQualitySkew, vtkm::filter::mesh_info::MeshQualityStretch, vtkm::filter::mesh_info::MeshQualityTaper, vtkm::filter::mesh_info::MeshQualityWarpage, vtkm::filter::resampling::Probe, vtkm::filter::connected_components::CellSetConnectivity, vtkm::filter::field_transform::CylindricalCoordinateTransform, vtkm::filter::zfp::ZFPCompressor2D, vtkm::filter::zfp::ZFPCompressor3D, vtkm::filter::zfp::ZFPDecompressor1D, vtkm::filter::zfp::ZFPDecompressor2D, vtkm::filter::zfp::ZFPDecompressor3D, vtkm::filter::contour::Slice, vtkm::filter::field_transform::SphericalCoordinateTransform, vtkm::filter::image_processing::ComputeMoments, vtkm::filter::density_estimate::NDEntropy, vtkm::filter::field_conversion::CellAverage, vtkm::filter::field_conversion::PointAverage, vtkm::filter::vector_analysis::VectorMagnitude, vtkm::filter::geometry_refinement::Tetrahedralize, vtkm::filter::geometry_refinement::Triangulate, vtkm::filter::zfp::ZFPCompressor1D, vtkm::filter::flow::FilterParticleAdvection, vtkm::filter::flow::Lagrangian, vtkm::filter::clean_grid::CleanGrid, vtkm::filter::flow::LagrangianStructures, vtkm::filter::flow::StreamSurface, vtkm::filter::mesh_info::GhostCellClassify, vtkm::filter::scalar_topology::DistributedBranchDecompositionFilter, and vtkm::filter::multi_block::AmrArrays.

◆ DoExecutePartitions()

virtual VTKM_CONT vtkm::cont::PartitionedDataSet vtkm::filter::Filter::DoExecutePartitions ( const vtkm::cont::PartitionedDataSet inData)
protectedvirtual

◆ Execute() [1/2]

VTKM_CONT vtkm::cont::DataSet vtkm::filter::Filter::Execute ( const vtkm::cont::DataSet input)

Executes the filter on the input and produces a result dataset.

On success, this the dataset produced. On error, vtkm::cont::ErrorExecution will be thrown.

◆ Execute() [2/2]

VTKM_CONT vtkm::cont::PartitionedDataSet vtkm::filter::Filter::Execute ( const vtkm::cont::PartitionedDataSet input)

Executes the filter on the input PartitionedDataSet and produces a result PartitionedDataSet.

On success, this the dataset produced. On error, vtkm::cont::ErrorExecution will be thrown.

◆ GetFieldsToPass() [1/2]

VTKM_CONT vtkm::filter::FieldSelection& vtkm::filter::Filter::GetFieldsToPass ( )
inline

Specify which fields get passed from input to output.

After a filter successfully executes and returns a new data set, fields are mapped from input to output. Depending on what operation the filter does, this could be a simple shallow copy of an array, or it could be a computed operation. You can control which fields are passed (and equivalently which are not) with this parameter.

By default, all fields are passed during execution.

◆ GetFieldsToPass() [2/2]

const VTKM_CONT vtkm::filter::FieldSelection& vtkm::filter::Filter::GetFieldsToPass ( ) const
inline

Specify which fields get passed from input to output.

After a filter successfully executes and returns a new data set, fields are mapped from input to output. Depending on what operation the filter does, this could be a simple shallow copy of an array, or it could be a computed operation. You can control which fields are passed (and equivalently which are not) with this parameter.

By default, all fields are passed during execution.

◆ GetPassCoordinateSystems()

VTKM_CONT bool vtkm::filter::Filter::GetPassCoordinateSystems ( ) const
inline

Specify whether to always pass coordinate systems.

CoordinateSystems in a DataSet are really just point fields marked as being a coordinate system. Thus, a coordinate system is passed if and only if the associated field is passed.

By default, the filter will pass all fields associated with a coordinate system regardless of the FieldsToPass marks the field as passing. If this option is set to false, then coordinate systems will only be passed if it is marked so by FieldsToPass.

◆ GetRunMultiThreadedFilter()

VTKM_CONT bool vtkm::filter::Filter::GetRunMultiThreadedFilter ( ) const
inline

◆ GetThreadsPerCPU()

VTKM_CONT vtkm::Id vtkm::filter::Filter::GetThreadsPerCPU ( ) const
inline

◆ GetThreadsPerGPU()

VTKM_CONT vtkm::Id vtkm::filter::Filter::GetThreadsPerGPU ( ) const
inline

◆ MapFieldsOntoOutput() [1/2]

template<typename FieldMapper >
VTKM_CONT void vtkm::filter::Filter::MapFieldsOntoOutput ( const vtkm::cont::DataSet input,
const vtkm::filter::FieldSelection fieldSelection,
vtkm::cont::DataSet output,
FieldMapper &&  fieldMapper 
) const
inlineprivate

◆ MapFieldsOntoOutput() [2/2]

template<typename FieldMapper >
VTKM_CONT void vtkm::filter::Filter::MapFieldsOntoOutput ( const vtkm::cont::PartitionedDataSet input,
const vtkm::filter::FieldSelection fieldSelection,
vtkm::cont::PartitionedDataSet output,
FieldMapper &&  fieldMapper 
) const
inlineprivate

◆ SetFieldsToPass() [1/7]

VTKM_CONT void vtkm::filter::Filter::SetFieldsToPass ( const std::string &  fieldname,
vtkm::cont::Field::Association  association,
vtkm::filter::FieldSelection::Mode  mode = vtkm::filter::FieldSelection::Mode::Select 
)

Specify which fields get passed from input to output.

After a filter successfully executes and returns a new data set, fields are mapped from input to output. Depending on what operation the filter does, this could be a simple shallow copy of an array, or it could be a computed operation. You can control which fields are passed (and equivalently which are not) with this parameter.

By default, all fields are passed during execution.

◆ SetFieldsToPass() [2/7]

VTKM_CONT void vtkm::filter::Filter::SetFieldsToPass ( const std::string &  fieldname,
vtkm::filter::FieldSelection::Mode  mode 
)
inline

Specify which fields get passed from input to output.

After a filter successfully executes and returns a new data set, fields are mapped from input to output. Depending on what operation the filter does, this could be a simple shallow copy of an array, or it could be a computed operation. You can control which fields are passed (and equivalently which are not) with this parameter.

By default, all fields are passed during execution.

◆ SetFieldsToPass() [3/7]

VTKM_CONT void vtkm::filter::Filter::SetFieldsToPass ( const vtkm::filter::FieldSelection fieldsToPass)

Specify which fields get passed from input to output.

After a filter successfully executes and returns a new data set, fields are mapped from input to output. Depending on what operation the filter does, this could be a simple shallow copy of an array, or it could be a computed operation. You can control which fields are passed (and equivalently which are not) with this parameter.

By default, all fields are passed during execution.

◆ SetFieldsToPass() [4/7]

VTKM_CONT void vtkm::filter::Filter::SetFieldsToPass ( const vtkm::filter::FieldSelection fieldsToPass,
vtkm::filter::FieldSelection::Mode  mode 
)

Specify which fields get passed from input to output.

After a filter successfully executes and returns a new data set, fields are mapped from input to output. Depending on what operation the filter does, this could be a simple shallow copy of an array, or it could be a computed operation. You can control which fields are passed (and equivalently which are not) with this parameter.

By default, all fields are passed during execution.

◆ SetFieldsToPass() [5/7]

VTKM_CONT void vtkm::filter::Filter::SetFieldsToPass ( std::initializer_list< std::pair< std::string, vtkm::cont::Field::Association >>  fields,
vtkm::filter::FieldSelection::Mode  mode = vtkm::filter::FieldSelection::Mode::Select 
)

Specify which fields get passed from input to output.

After a filter successfully executes and returns a new data set, fields are mapped from input to output. Depending on what operation the filter does, this could be a simple shallow copy of an array, or it could be a computed operation. You can control which fields are passed (and equivalently which are not) with this parameter.

By default, all fields are passed during execution.

◆ SetFieldsToPass() [6/7]

VTKM_CONT void vtkm::filter::Filter::SetFieldsToPass ( std::initializer_list< std::string >  fields,
vtkm::filter::FieldSelection::Mode  mode = vtkm::filter::FieldSelection::Mode::Select 
)

Specify which fields get passed from input to output.

After a filter successfully executes and returns a new data set, fields are mapped from input to output. Depending on what operation the filter does, this could be a simple shallow copy of an array, or it could be a computed operation. You can control which fields are passed (and equivalently which are not) with this parameter.

By default, all fields are passed during execution.

◆ SetFieldsToPass() [7/7]

VTKM_CONT void vtkm::filter::Filter::SetFieldsToPass ( vtkm::filter::FieldSelection &&  fieldsToPass)

Specify which fields get passed from input to output.

After a filter successfully executes and returns a new data set, fields are mapped from input to output. Depending on what operation the filter does, this could be a simple shallow copy of an array, or it could be a computed operation. You can control which fields are passed (and equivalently which are not) with this parameter.

By default, all fields are passed during execution.

◆ SetInvoker()

void vtkm::filter::Filter::SetInvoker ( vtkm::cont::Invoker  inv)
inline

Specify the vtkm::cont::Invoker to be used to execute worklets by this filter instance.

Overriding the default allows callers to control which device adapters a filter uses.

◆ SetPassCoordinateSystems()

VTKM_CONT void vtkm::filter::Filter::SetPassCoordinateSystems ( bool  flag)
inline

Specify whether to always pass coordinate systems.

CoordinateSystems in a DataSet are really just point fields marked as being a coordinate system. Thus, a coordinate system is passed if and only if the associated field is passed.

By default, the filter will pass all fields associated with a coordinate system regardless of the FieldsToPass marks the field as passing. If this option is set to false, then coordinate systems will only be passed if it is marked so by FieldsToPass.

◆ SetRunMultiThreadedFilter()

VTKM_CONT void vtkm::filter::Filter::SetRunMultiThreadedFilter ( bool  val)
inline

◆ SetThreadsPerCPU()

VTKM_CONT void vtkm::filter::Filter::SetThreadsPerCPU ( vtkm::Id  numThreads)
inline

◆ SetThreadsPerGPU()

VTKM_CONT void vtkm::filter::Filter::SetThreadsPerGPU ( vtkm::Id  numThreads)
inline

Member Data Documentation

◆ FieldsToPass

vtkm::filter::FieldSelection vtkm::filter::Filter::FieldsToPass = vtkm::filter::FieldSelection::Mode::All
private

◆ Invoke

vtkm::cont::Invoker vtkm::filter::Filter::Invoke
protected

◆ NumThreadsPerCPU

vtkm::Id vtkm::filter::Filter::NumThreadsPerCPU = 4
private

◆ NumThreadsPerGPU

vtkm::Id vtkm::filter::Filter::NumThreadsPerGPU = 8
private

◆ PassCoordinateSystems

bool vtkm::filter::Filter::PassCoordinateSystems = true
private

◆ RunFilterWithMultipleThreads

bool vtkm::filter::Filter::RunFilterWithMultipleThreads = false
private

The documentation for this class was generated from the following file:
vtkm::filter::Filter::DoExecute
virtual VTKM_CONT vtkm::cont::DataSet DoExecute(const vtkm::cont::DataSet &inData)=0
vtkm::filter::Filter::Execute
VTKM_CONT vtkm::cont::DataSet Execute(const vtkm::cont::DataSet &input)
vtkm::cont::DataSet
Definition: DataSet.h:34
vtkm::cont::UnknownCellSet
A CellSet of an unknown type.
Definition: UnknownCellSet.h:48
vtkm::filter::Filter::CreateResult
VTKM_CONT vtkm::cont::DataSet CreateResult(const vtkm::cont::DataSet &inDataSet) const
Create the output data set for DoExecute.
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::filter::contour::Contour
generate isosurface(s) from a Volume
Definition: Contour.h:30
vtkm::cont::CellSetExplicit
Definition: CastAndCall.h:36
vtkm::filter::Filter::DoExecutePartitions
virtual VTKM_CONT vtkm::cont::PartitionedDataSet DoExecutePartitions(const vtkm::cont::PartitionedDataSet &inData)
vtkm::cont::PartitionedDataSet
Definition: PartitionedDataSet.h:25