Commit f8821b26 authored by Robert Maynard's avatar Robert Maynard

Rename vtkmCellAverage to vtkmAverageToCells to clarify the name

CellAverage sounded like it would produce the averaging of cell fields,
not the averaging of point fields to cells.
parent e7b39312
......@@ -39,7 +39,7 @@ set(headers
vtkmExternalFaces.h
vtkmThreshold.h
vtkmLevelOfDetail.h
vtkmCellAverage.h
vtkmAverageToCells.h
vtkmGradient.h
)
......@@ -52,7 +52,7 @@ set(cpu_accelerator_srcs
vtkmExternalFaces.cxx
vtkmThreshold.cxx
vtkmLevelOfDetail.cxx
vtkmCellAverage.cxx
vtkmAverageToCells.cxx
vtkmCellSetExplicit.cxx
vtkmCellSetSingleType.cxx
vtkmConnectivityExec.cxx
......@@ -69,7 +69,7 @@ set(cuda_accelerator_srcs
vtkmExternalFaces.cu
vtkmThreshold.cu
vtkmLevelOfDetail.cu
vtkmCellAverage.cu
vtkmAverageToCells.cu
vtkmCellSetExplicit.cu
vtkmCellSetSingleType.cu
vtkmConnectivityExec.cu
......
vtk_add_test_python(
NO_DATA NO_VALID NO_OUTPUT
TestVTKMAverageToCells.py
TestVTKMAverageToPoints.py
)
import sys
try:
import numpy
except ImportError:
print("Numpy (http://numpy.scipy.org) not found.")
print("This test requires numpy!")
sys.exit(0)
import vtk
from vtk.numpy_interface import dataset_adapter as dsa
from vtk.numpy_interface import algorithms as algs
rt = vtk.vtkRTAnalyticSource()
p2c = vtk.vtkPointDataToCellData()
p2c.SetInputConnection(rt.GetOutputPort())
p2c.Update()
d1 = dsa.WrapDataObject(p2c.GetOutput())
vtkm_p2c = vtk.vtkmAverageToCells()
vtkm_p2c.SetInputData(rt.GetOutput())
vtkm_p2c.SetInputArrayToProcess(0, 0, 0, vtk.vtkDataObject.FIELD_ASSOCIATION_POINTS, "RTData")
vtkm_p2c.Update()
d2 = dsa.WrapDataObject(vtkm_p2c.GetOutput())
assert (algs.max(algs.abs(d1.CellData['RTData'] - d2.CellData['RTData'])) < 10E-4)
......@@ -13,4 +13,4 @@
// the U.S. Government retains certain rights in this software.
//
//=============================================================================
#include "vtkmCellAverage.cxx"
#include "vtkmAverageToCells.cxx"
......@@ -13,7 +13,7 @@
// the U.S. Government retains certain rights in this software.
//
//=============================================================================
#include "vtkmCellAverage.h"
#include "vtkmAverageToCells.h"
#include "vtkCellData.h"
#include "vtkDataSet.h"
......@@ -31,20 +31,20 @@
#include <vtkm/filter/CellAverage.h>
vtkStandardNewMacro(vtkmCellAverage)
vtkStandardNewMacro(vtkmAverageToCells)
//------------------------------------------------------------------------------
vtkmCellAverage::vtkmCellAverage()
vtkmAverageToCells::vtkmAverageToCells()
{
}
//------------------------------------------------------------------------------
vtkmCellAverage::~vtkmCellAverage()
vtkmAverageToCells::~vtkmAverageToCells()
{
}
//------------------------------------------------------------------------------
int vtkmCellAverage::RequestData(vtkInformation* vtkNotUsed(request),
int vtkmAverageToCells::RequestData(vtkInformation* vtkNotUsed(request),
vtkInformationVector** inputVector,
vtkInformationVector* outputVector)
{
......@@ -100,7 +100,7 @@ int vtkmCellAverage::RequestData(vtkInformation* vtkNotUsed(request),
}
//------------------------------------------------------------------------------
void vtkmCellAverage::PrintSelf(ostream& os, vtkIndent indent)
void vtkmAverageToCells::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os, indent);
}
......@@ -14,30 +14,30 @@
//
//=============================================================================
#ifndef vtkmCellAverage_h
#define vtkmCellAverage_h
#ifndef vtkmAverageToCells_h
#define vtkmAverageToCells_h
#include "vtkAcceleratorsVTKmModule.h" //required for correct implementation
#include "vtkDataSetAlgorithm.h"
class VTKACCELERATORSVTKM_EXPORT vtkmCellAverage : public vtkDataSetAlgorithm
class VTKACCELERATORSVTKM_EXPORT vtkmAverageToCells : public vtkDataSetAlgorithm
{
public:
vtkTypeMacro(vtkmCellAverage, vtkDataSetAlgorithm)
vtkTypeMacro(vtkmAverageToCells, vtkDataSetAlgorithm)
void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
static vtkmCellAverage* New();
static vtkmAverageToCells* New();
protected:
vtkmCellAverage();
~vtkmCellAverage();
vtkmAverageToCells();
~vtkmAverageToCells();
virtual int RequestData(vtkInformation*, vtkInformationVector**,
vtkInformationVector*) VTK_OVERRIDE;
private:
vtkmCellAverage(const vtkmCellAverage&) VTK_DELETE_FUNCTION;
void operator=(const vtkmCellAverage&) VTK_DELETE_FUNCTION;
vtkmAverageToCells(const vtkmAverageToCells&) VTK_DELETE_FUNCTION;
void operator=(const vtkmAverageToCells&) VTK_DELETE_FUNCTION;
};
#endif // vtkmCellAverage_h
// VTK-HeaderTest-Exclude: vtkmCellAverage.h
#endif // vtkmAverageToCells_h
// VTK-HeaderTest-Exclude: vtkmAverageToCells.h
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment