Commit a1a3ae26 authored by David Thompson's avatar David Thompson

Bump the VTK-m that VTK uses forward; fixes for API changes.

parent 5c48371e
......@@ -80,7 +80,7 @@ int vtkmAverageToCells::RequestData(vtkInformation* vtkNotUsed(request),
vtkmInputFilterPolicy policy;
vtkm::filter::CellAverage filter;
filter.SetActiveField(fieldName, vtkm::cont::Field::ASSOC_POINTS);
filter.SetActiveField(fieldName, vtkm::cont::Field::Association::POINTS);
filter.SetOutputFieldName(fieldName); // should we expose this control?
auto result = filter.Execute(in, policy);
......
......@@ -81,7 +81,7 @@ int vtkmAverageToPoints::RequestData(vtkInformation *vtkNotUsed(request),
vtkmInputFilterPolicy policy;
vtkm::filter::PointAverage filter;
filter.SetActiveField(fieldName, vtkm::cont::Field::ASSOC_CELL_SET);
filter.SetActiveField(fieldName, vtkm::cont::Field::Association::CELL_SET);
filter.SetOutputFieldName(fieldName); //should we expose this control?
auto result = filter.Execute(in, policy);
......
......@@ -85,19 +85,19 @@ public:
return *this;
}
vtkm::Id GetNumberOfCells() const
vtkm::Id GetNumberOfCells() const override
{
return this->Shapes.GetNumberOfValues();
}
vtkm::Id GetNumberOfPoints() const
vtkm::Id GetNumberOfPoints() const override
{
return this->NumberOfPoints;
}
virtual vtkm::Id GetNumberOfFaces() const { return -1; }
vtkm::Id GetNumberOfFaces() const override { return -1; }
virtual vtkm::Id GetNumberOfEdges() const { return -1; }
vtkm::Id GetNumberOfEdges() const override { return -1; }
vtkm::Id GetSchedulingRange(vtkm::TopologyElementTagCell) const
......@@ -171,7 +171,17 @@ public:
return this->IndexOffsets;
}
virtual void PrintSummary(std::ostream& out) const;
void PrintSummary(std::ostream& out) const override;
void ReleaseResourcesExecution() override
{
this->Shapes.ReleaseResourcesExecution();
this->Connectivity.ReleaseResourcesExecution();
this->IndexOffsets.ReleaseResourcesExecution();
this->RConn.ReleaseResourcesExecution();
this->RNumIndices.ReleaseResourcesExecution();
this->RIndexOffsets.ReleaseResourcesExecution();
}
private:
vtkm::cont::ArrayHandle<vtkm::UInt8, tovtkm::vtkAOSArrayContainerTag> Shapes;
......
......@@ -100,19 +100,19 @@ public:
return *this;
}
vtkm::Id GetNumberOfCells() const
vtkm::Id GetNumberOfCells() const override
{
return this->NumberOfCells;
}
vtkm::Id GetNumberOfPoints() const
vtkm::Id GetNumberOfPoints() const override
{
return this->NumberOfPoints;
}
virtual vtkm::Id GetNumberOfFaces() const { return -1; }
vtkm::Id GetNumberOfFaces() const override{ return -1; }
virtual vtkm::Id GetNumberOfEdges() const { return -1; }
vtkm::Id GetNumberOfEdges() const override{ return -1; }
vtkm::Id GetSchedulingRange(vtkm::TopologyElementTagCell) const
{
......@@ -165,7 +165,15 @@ public:
return this->Connectivity;
}
virtual void PrintSummary(std::ostream& out) const;
void PrintSummary(std::ostream& out) const override;
void ReleaseResourcesExecution() override
{
this->Connectivity.ReleaseResourcesExecution();
this->RConn.ReleaseResourcesExecution();
this->RNumIndices.ReleaseResourcesExecution();
this->RIndexOffsets.ReleaseResourcesExecution();
}
private:
template <typename CellShapeTag>
......
......@@ -162,7 +162,7 @@ int vtkmClip::RequestData(vtkInformation *,
vtkm::filter::FieldSelection(vtkm::filter::FieldSelection::MODE_NONE));
}
fieldFilter.SetActiveField(scalars->GetName(), vtkm::cont::Field::ASSOC_POINTS);
fieldFilter.SetActiveField(scalars->GetName(), vtkm::cont::Field::Association::POINTS);
fieldFilter.SetClipValue(this->ClipValue);
result = fieldFilter.Execute(in, policy);
}
......
......@@ -87,7 +87,7 @@ int vtkmContour::RequestData(vtkInformation* request,
try
{
vtkm::filter::MarchingCubes filter;
filter.SetActiveField(inputArray->GetName(), vtkm::cont::Field::ASSOC_POINTS);
filter.SetActiveField(inputArray->GetName(), vtkm::cont::Field::Association::POINTS);
filter.SetGenerateNormals(this->GetComputeNormals() != 0);
filter.SetNumberOfIsoValues(numContours);
for(int i = 0; i < numContours; ++i)
......
......@@ -136,8 +136,8 @@ int vtkmGradient::RequestData(vtkInformation* request,
vtkm::cont::Field field = tovtkm::Convert(inputArray, association);
in.AddField(field);
const bool fieldIsPoint = field.GetAssociation() == vtkm::cont::Field::ASSOC_POINTS;
const bool fieldIsCell = field.GetAssociation() == vtkm::cont::Field::ASSOC_CELL_SET;
const bool fieldIsPoint = field.GetAssociation() == vtkm::cont::Field::Association::POINTS;
const bool fieldIsCell = field.GetAssociation() == vtkm::cont::Field::Association::CELL_SET;
const bool fieldIsVec = (inputArray->GetNumberOfComponents() == 3);
const bool fieldIsScalar = inputArray->GetDataType() == VTK_FLOAT ||
inputArray->GetDataType() == VTK_DOUBLE;
......@@ -196,7 +196,7 @@ int vtkmGradient::RequestData(vtkInformation* request,
if (fieldIsPoint)
{
filter.SetComputePointGradient(!this->FasterApproximation);
filter.SetActiveField(field.GetName(), vtkm::cont::Field::ASSOC_POINTS);
filter.SetActiveField(field.GetName(), vtkm::cont::Field::Association::POINTS);
result = filter.Execute(in, policy);
//When we have faster approximation enabled the VTK-m gradient will output
......@@ -213,28 +213,28 @@ int vtkmGradient::RequestData(vtkInformation* request,
if (this->ComputeGradient)
{
cellToPoint.SetActiveField(
filter.GetOutputFieldName(), vtkm::cont::Field::ASSOC_CELL_SET);
filter.GetOutputFieldName(), vtkm::cont::Field::Association::CELL_SET);
auto ds = cellToPoint.Execute(c2pIn, policy);
result.AddField(ds.GetField(0));
}
if (this->ComputeDivergence && fieldIsVec)
{
cellToPoint.SetActiveField(
filter.GetDivergenceName(), vtkm::cont::Field::ASSOC_CELL_SET);
filter.GetDivergenceName(), vtkm::cont::Field::Association::CELL_SET);
auto ds = cellToPoint.Execute(c2pIn, policy);
result.AddField(ds.GetField(0));
}
if (this->ComputeVorticity && fieldIsVec)
{
cellToPoint.SetActiveField(filter.GetVorticityName(),
vtkm::cont::Field::ASSOC_CELL_SET);
vtkm::cont::Field::Association::CELL_SET);
auto ds = cellToPoint.Execute(c2pIn, policy);
result.AddField(ds.GetField(0));
}
if (this->ComputeQCriterion && fieldIsVec)
{
cellToPoint.SetActiveField(filter.GetQCriterionName(),
vtkm::cont::Field::ASSOC_CELL_SET);
vtkm::cont::Field::Association::CELL_SET);
auto ds = cellToPoint.Execute(c2pIn, policy);
result.AddField(ds.GetField(0));
}
......@@ -250,7 +250,7 @@ int vtkmGradient::RequestData(vtkInformation* request,
in = cellToPoint.Execute(in, policy);
filter.SetComputePointGradient(false);
filter.SetActiveField(field.GetName(), vtkm::cont::Field::ASSOC_POINTS);
filter.SetActiveField(field.GetName(), vtkm::cont::Field::Association::POINTS);
result = filter.Execute(in, policy);
}
......
......@@ -89,7 +89,7 @@ vtkm::cont::Field ConvertPointField(DataArrayType* input)
StorageType storage(input);
vtkm::cont::ArrayHandle<VType, TagType> handle(storage);
vtkm::cont::DynamicArrayHandle dhandle(handle);
return vtkm::cont::Field(name, vtkm::cont::Field::ASSOC_POINTS, dhandle);
return vtkm::cont::Field(name, vtkm::cont::Field::Association::POINTS, dhandle);
}
case 2:
{
......@@ -98,7 +98,7 @@ vtkm::cont::Field ConvertPointField(DataArrayType* input)
StorageType storage(input);
vtkm::cont::ArrayHandle<VType, TagType> handle(storage);
vtkm::cont::DynamicArrayHandle dhandle(handle);
return vtkm::cont::Field(name, vtkm::cont::Field::ASSOC_POINTS, dhandle);
return vtkm::cont::Field(name, vtkm::cont::Field::Association::POINTS, dhandle);
}
case 3:
{
......@@ -107,7 +107,7 @@ vtkm::cont::Field ConvertPointField(DataArrayType* input)
StorageType storage(input);
vtkm::cont::ArrayHandle<VType, TagType> handle(storage);
vtkm::cont::DynamicArrayHandle dhandle(handle);
return vtkm::cont::Field(name, vtkm::cont::Field::ASSOC_POINTS, dhandle);
return vtkm::cont::Field(name, vtkm::cont::Field::Association::POINTS, dhandle);
}
case 4:
{
......@@ -116,7 +116,7 @@ vtkm::cont::Field ConvertPointField(DataArrayType* input)
StorageType storage(input);
vtkm::cont::ArrayHandle<VType, TagType> handle(storage);
vtkm::cont::DynamicArrayHandle dhandle(handle);
return vtkm::cont::Field(name, vtkm::cont::Field::ASSOC_POINTS, dhandle);
return vtkm::cont::Field(name, vtkm::cont::Field::Association::POINTS, dhandle);
}
default:
break;
......@@ -149,7 +149,7 @@ vtkm::cont::Field ConvertCellField(DataArrayType* input)
StorageType storage(input);
vtkm::cont::ArrayHandle<VType, TagType> handle(storage);
vtkm::cont::DynamicArrayHandle dhandle(handle);
return vtkm::cont::Field(name, vtkm::cont::Field::ASSOC_CELL_SET, cname,
return vtkm::cont::Field(name, vtkm::cont::Field::Association::CELL_SET, cname,
dhandle);
}
case 2:
......@@ -159,7 +159,7 @@ vtkm::cont::Field ConvertCellField(DataArrayType* input)
StorageType storage(input);
vtkm::cont::ArrayHandle<VType, TagType> handle(storage);
vtkm::cont::DynamicArrayHandle dhandle(handle);
return vtkm::cont::Field(name, vtkm::cont::Field::ASSOC_CELL_SET, cname,
return vtkm::cont::Field(name, vtkm::cont::Field::Association::CELL_SET, cname,
dhandle);
}
case 3:
......@@ -169,7 +169,7 @@ vtkm::cont::Field ConvertCellField(DataArrayType* input)
StorageType storage(input);
vtkm::cont::ArrayHandle<VType, TagType> handle(storage);
vtkm::cont::DynamicArrayHandle dhandle(handle);
return vtkm::cont::Field(name, vtkm::cont::Field::ASSOC_CELL_SET, cname,
return vtkm::cont::Field(name, vtkm::cont::Field::Association::CELL_SET, cname,
dhandle);
}
case 4:
......@@ -179,7 +179,7 @@ vtkm::cont::Field ConvertCellField(DataArrayType* input)
StorageType storage(input);
vtkm::cont::ArrayHandle<VType, TagType> handle(storage);
vtkm::cont::DynamicArrayHandle dhandle(handle);
return vtkm::cont::Field(name, vtkm::cont::Field::ASSOC_CELL_SET, cname,
return vtkm::cont::Field(name, vtkm::cont::Field::Association::CELL_SET, cname,
dhandle);
}
default:
......@@ -427,12 +427,12 @@ bool ConvertArrays(const vtkm::cont::DataSet& input, vtkDataSet* output)
{
const vtkm::cont::Field& f = input.GetField(i);
vtkDataArray* vfield = Convert(f);
if (vfield && f.GetAssociation() == vtkm::cont::Field::ASSOC_POINTS)
if (vfield && f.GetAssociation() == vtkm::cont::Field::Association::POINTS)
{
pd->AddArray(vfield);
vfield->FastDelete();
}
else if (vfield && f.GetAssociation() == vtkm::cont::Field::ASSOC_CELL_SET)
else if (vfield && f.GetAssociation() == vtkm::cont::Field::Association::CELL_SET)
{
cd->AddArray(vfield);
vfield->FastDelete();
......
Subproject commit 7cf09261725ce848514185420b94e0d5655ec4fa
Subproject commit 0544ee6b71e30f80aa3ec5daa7a52e51b4d0249e
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