migrate mesh info filters

This commit is contained in:
Li-Ta Lo 2022-02-08 07:18:24 -07:00
parent 569deda9b5
commit ee0f112f0e
56 changed files with 599 additions and 593 deletions

@ -22,7 +22,8 @@
#include <vector> #include <vector>
#include <vtkm/cont/DataSet.h> #include <vtkm/cont/DataSet.h>
#include <vtkm/cont/DataSetBuilderExplicit.h> #include <vtkm/cont/DataSetBuilderExplicit.h>
#include <vtkm/filter/MeshQuality.h> #include <vtkm/cont/ErrorExecution.h>
#include <vtkm/filter/mesh_info/MeshQuality.h>
#include <vtkm/io/VTKDataSetReader.h> #include <vtkm/io/VTKDataSetReader.h>
#include <vtkm/io/VTKDataSetWriter.h> #include <vtkm/io/VTKDataSetWriter.h>
@ -200,7 +201,7 @@ inline vtkm::cont::DataSet Make3DExplicitDataSet()
int TestMetrics(const char* outFileName, int TestMetrics(const char* outFileName,
vtkm::cont::DataSet data, vtkm::cont::DataSet data,
vtkm::filter::MeshQuality& filter) vtkm::filter::mesh_info::MeshQuality& filter)
{ {
vtkm::cont::DataSet outputData; vtkm::cont::DataSet outputData;
try try
@ -257,7 +258,7 @@ int main(int argc, char* argv[])
// A cell metric is now computed for every shape type that exists in the // A cell metric is now computed for every shape type that exists in the
// input dataset. // input dataset.
vtkm::filter::CellMetric shapeMetric = vtkm::filter::CellMetric::VOLUME; vtkm::filter::mesh_info::CellMetric shapeMetric = vtkm::filter::mesh_info::CellMetric::VOLUME;
try try
{ {
@ -270,7 +271,7 @@ int main(int argc, char* argv[])
return 1; return 1;
} }
vtkm::filter::MeshQuality filter(shapeMetric); vtkm::filter::mesh_info::MeshQuality filter(shapeMetric);
TestMetrics(outFileName, input, filter); TestMetrics(outFileName, input, filter);
return 0; return 0;
} }

@ -10,6 +10,8 @@
#ifndef vtk_m_CellClassification_h #ifndef vtk_m_CellClassification_h
#define vtk_m_CellClassification_h #define vtk_m_CellClassification_h
#include <vtkm/Types.h>
namespace vtkm namespace vtkm
{ {

@ -10,6 +10,7 @@
set(deprecated_headers set(deprecated_headers
CellAverage.h CellAverage.h
CellMeasures.h
CellSetConnectivity.h CellSetConnectivity.h
CleanGrid.h CleanGrid.h
ClipWithField.h ClipWithField.h
@ -25,12 +26,14 @@ set(deprecated_headers
ExtractStructured.h ExtractStructured.h
FieldToColors.h FieldToColors.h
GenerateIds.h GenerateIds.h
GhostCellClassify.h
GhostCellRemove.h GhostCellRemove.h
Gradient.h Gradient.h
Histogram.h Histogram.h
ImageConnectivity.h ImageConnectivity.h
Mask.h Mask.h
MaskPoints.h MaskPoints.h
MeshQuality.h
NDEntropy.h NDEntropy.h
NDHistogram.h NDHistogram.h
ParticleDensityCloudInCell.h ParticleDensityCloudInCell.h
@ -50,7 +53,6 @@ set(deprecated_headers
vtkm_declare_headers(${deprecated_headers}) vtkm_declare_headers(${deprecated_headers})
set(common_headers set(common_headers
CellMeasures.h
FieldMetadata.h FieldMetadata.h
FilterCell.h FilterCell.h
FilterDataSet.h FilterDataSet.h
@ -69,7 +71,6 @@ set(common_headers
vtkm_declare_headers(${common_headers}) vtkm_declare_headers(${common_headers})
set(common_header_template_sources set(common_header_template_sources
CellMeasures.hxx
FilterDataSet.hxx FilterDataSet.hxx
FilterDataSetWithField.hxx FilterDataSetWithField.hxx
FilterField.hxx FilterField.hxx
@ -88,12 +89,10 @@ set(extra_headers
ContourTreeUniform.h ContourTreeUniform.h
CreateResult.h CreateResult.h
FieldSelection.h FieldSelection.h
GhostCellClassify.h
ImageDifference.h ImageDifference.h
ImageMedian.h ImageMedian.h
Lagrangian.h Lagrangian.h
LagrangianStructures.h LagrangianStructures.h
MeshQuality.h
MIRFilter.h MIRFilter.h
ParticleAdvection.h ParticleAdvection.h
Pathline.h Pathline.h
@ -120,12 +119,10 @@ set(extra_header_template_sources
ContourTreeUniformAugmented.hxx ContourTreeUniformAugmented.hxx
ContourTreeUniformDistributed.hxx ContourTreeUniformDistributed.hxx
ContourTreeUniform.hxx ContourTreeUniform.hxx
GhostCellClassify.hxx
ImageDifference.hxx ImageDifference.hxx
ImageMedian.hxx ImageMedian.hxx
Lagrangian.hxx Lagrangian.hxx
LagrangianStructures.hxx LagrangianStructures.hxx
MeshQuality.hxx
MIRFilter.hxx MIRFilter.hxx
ParticleAdvection.hxx ParticleAdvection.hxx
Pathline.hxx Pathline.hxx
@ -214,6 +211,7 @@ add_subdirectory(internal)
add_subdirectory(particleadvection) add_subdirectory(particleadvection)
add_subdirectory(field_conversion) add_subdirectory(field_conversion)
add_subdirectory(field_transform) add_subdirectory(field_transform)
add_subdirectory(mesh_info)
add_subdirectory(vector_analysis) add_subdirectory(vector_analysis)
#-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - #-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -

@ -7,48 +7,33 @@
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information. // PURPOSE. See the above copyright notice for more information.
//============================================================================ //============================================================================
#ifndef vtk_m_filter_CellMeasures_h #ifndef vtk_m_filter_CellMeasures_h
#define vtk_m_filter_CellMeasures_h #define vtk_m_filter_CellMeasures_h
#include <vtkm/filter/FilterField.h> #include <vtkm/Deprecated.h>
#include <vtkm/worklet/CellMeasure.h> #include <vtkm/filter/mesh_info/CellMeasures.h>
namespace vtkm namespace vtkm
{ {
namespace filter namespace filter
{ {
/// \brief Compute the measure of each (3D) cell in a dataset. VTKM_DEPRECATED(1.8,
/// "Use vtkm/filter/mesh_info/CellMeasures.h instead of vtkm/filter/CellMeasures.h.")
/// CellMeasures is a filter that generates a new cell data array (i.e., one value inline void CellMeasures_deprecated() {}
/// specified per cell) holding the signed measure of the cell
/// or 0 (if measure is not well defined or the cell type is unsupported). inline void CellMeasures_deprecated_warning()
///
/// By default, the new cell-data array is named "measure".
template <typename IntegrationType>
class CellMeasures : public vtkm::filter::FilterField<CellMeasures<IntegrationType>>
{ {
public: CellMeasures_deprecated();
using SupportedTypes = vtkm::TypeListFieldVec3; }
VTKM_CONT class VTKM_DEPRECATED(1.8, "Use vtkm::filter::mesh_info::CellMeasures.") CellMeasures
CellMeasures(); : public vtkm::filter::mesh_info::CellMeasures
{
/// Set/Get the name of the cell measure field. If not set, "measure" is used. using mesh_info::CellMeasures::CellMeasures;
void SetCellMeasureName(const std::string& name) { this->SetOutputFieldName(name); }
const std::string& GetCellMeasureName() const { return this->GetOutputFieldName(); }
template <typename T, typename StorageType, typename DerivedPolicy>
VTKM_CONT vtkm::cont::DataSet DoExecute(
const vtkm::cont::DataSet& input,
const vtkm::cont::ArrayHandle<vtkm::Vec<T, 3>, StorageType>& points,
const vtkm::filter::FieldMetadata& fieldMeta,
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
}; };
} }
} // namespace vtkm::filter } // namespace vtkm::filter
#include <vtkm/filter/CellMeasures.hxx> #endif //vtk_m_filter_CellMeasures_h
#endif // vtk_m_filter_CellMeasures_h

@ -10,46 +10,31 @@
#ifndef vtk_m_filter_GhostCellClassify_h #ifndef vtk_m_filter_GhostCellClassify_h
#define vtk_m_filter_GhostCellClassify_h #define vtk_m_filter_GhostCellClassify_h
#include <vtkm/filter/FilterDataSet.h> #include <vtkm/Deprecated.h>
#include <vtkm/filter/mesh_info/GhostCellClassify.h>
namespace vtkm namespace vtkm
{ {
namespace filter namespace filter
{ {
struct VTKM_DEPRECATED(1.6, VTKM_DEPRECATED(
"GhostCellClassifyPolicy no longer has an effect.") GhostCellClassifyPolicy 1.8,
: vtkm::filter::PolicyBase<GhostCellClassifyPolicy> "Use vtkm/filter/mesh_info/GhostCellClassify.h instead of vtkm/filter/GhostCellClassify.h.")
inline void GhostCellClassify_deprecated() {}
inline void GhostCellClassify_deprecated_warning()
{ {
using FieldTypeList = vtkm::List<vtkm::UInt8>; GhostCellClassify_deprecated();
}
class VTKM_DEPRECATED(1.8, "Use vtkm::filter::mesh_info::GhostCellClassify.") GhostCellClassify
: public vtkm::filter::mesh_info::GhostCellClassify
{
using mesh_info::GhostCellClassify::GhostCellClassify;
}; };
class GhostCellClassify : public vtkm::filter::FilterDataSet<GhostCellClassify>
{
public:
using SupportedTypes = vtkm::List<vtkm::UInt8>;
VTKM_CONT
GhostCellClassify();
template <typename Policy>
VTKM_CONT vtkm::cont::DataSet DoExecute(const vtkm::cont::DataSet& inData,
vtkm::filter::PolicyBase<Policy> policy);
template <typename DerivedPolicy>
VTKM_CONT bool MapFieldOntoOutput(vtkm::cont::DataSet& result,
const vtkm::cont::Field& field,
const vtkm::filter::PolicyBase<DerivedPolicy>&)
{
result.AddField(field);
return true;
}
private:
};
} }
} // namespace vtkm::filter } // namespace vtkm::filter
#include <vtkm/filter/GhostCellClassify.hxx>
#endif //vtk_m_filter_GhostCellClassify_h #endif //vtk_m_filter_GhostCellClassify_h

@ -39,7 +39,7 @@
#include <vtkm/worklet/WorkletMapTopology.h> #include <vtkm/worklet/WorkletMapTopology.h>
#include <vtkm/worklet/WorkletReduceByKey.h> #include <vtkm/worklet/WorkletReduceByKey.h>
#include <vtkm/filter/MeshQuality.h> #include <vtkm/filter/mesh_info/worklet/MeshQuality.h>
namespace vtkm namespace vtkm
{ {
@ -99,8 +99,9 @@ inline VTKM_CONT vtkm::cont::DataSet MIRFilter::DoExecute(
const vtkm::cont::CoordinateSystem inputCoords = const vtkm::cont::CoordinateSystem inputCoords =
input.GetCoordinateSystem(this->GetActiveCoordinateSystemIndex()); input.GetCoordinateSystem(this->GetActiveCoordinateSystemIndex());
vtkm::cont::ArrayHandle<vtkm::Float64> avgSizeTot; vtkm::cont::ArrayHandle<vtkm::Float64> avgSizeTot;
vtkm::worklet::MeshQuality<vtkm::filter::CellMetric> getVol; vtkm::worklet::MeshQuality getVol;
getVol.SetMetric(c3 > 0 ? vtkm::filter::CellMetric::VOLUME : vtkm::filter::CellMetric::AREA); getVol.SetMetric(c3 > 0 ? vtkm::filter::mesh_info::CellMetric::VOLUME
: vtkm::filter::mesh_info::CellMetric::AREA);
this->Invoke(getVol, this->Invoke(getVol,
vtkm::filter::ApplyPolicyCellSet(input.GetCellSet(), policy, *this), vtkm::filter::ApplyPolicyCellSet(input.GetCellSet(), policy, *this),
inputCoords.GetData(), inputCoords.GetData(),

@ -2,120 +2,38 @@
// Copyright (c) Kitware, Inc. // Copyright (c) Kitware, Inc.
// All rights reserved. // All rights reserved.
// See LICENSE.txt for details. // See LICENSE.txt for details.
//
// This software is distributed WITHOUT ANY WARRANTY; without even // This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information. // PURPOSE. See the above copyright notice for more information.
//
// Copyright 2014 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
// Copyright 2014 UT-Battelle, LLC.
// Copyright 2014 Los Alamos National Security.
//
// Under the terms of Contract DE-NA0003525 with NTESS,
// the U.S. Government retains certain rights in this software.
//
// Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================ //============================================================================
#ifndef vtk_m_filter_MeshQuality_h #ifndef vtk_m_filter_MeshQuality_h
#define vtk_m_filter_MeshQuality_h #define vtk_m_filter_MeshQuality_h
#include <vtkm/CellShape.h> #include <vtkm/Deprecated.h>
#include <vtkm/filter/FilterField.h> #include <vtkm/filter/mesh_info/MeshQuality.h>
#include <vtkm/worklet/MeshQuality.h>
namespace vtkm namespace vtkm
{ {
namespace filter namespace filter
{ {
//Names of the available cell metrics, for use in VTKM_DEPRECATED(1.8,
//the output dataset fields "Use vtkm/filter/mesh_info/MeshQuality.h instead of vtkm/filter/MeshQuality.h.")
static const std::string MetricNames[] = { "area", inline void MeshQuality_deprecated() {}
"aspectGamma",
"aspectRatio",
"condition",
"diagonalRatio",
"dimension",
"jacobian",
"maxAngle",
"maxDiagonal",
"minAngle",
"minDiagonal",
"oddy",
"relativeSizeSquared",
"scaledJacobian",
"shape",
"shapeAndSize",
"shear",
"skew",
"stretch",
"taper",
"volume",
"warpage" };
//Different cell metrics available to use inline void MeshQuality_deprecated_warning()
//This must follow the same order as the MetricNames above
enum class CellMetric
{ {
AREA, MeshQuality_deprecated();
ASPECT_GAMMA, }
ASPECT_RATIO,
CONDITION, class VTKM_DEPRECATED(1.8, "Use vtkm::filter::mesh_info::MeshQuality.") MeshQuality
DIAGONAL_RATIO, : public vtkm::filter::mesh_info::MeshQuality
DIMENSION, {
JACOBIAN, using mesh_info::MeshQuality::MeshQuality;
MAX_ANGLE,
MAX_DIAGONAL,
MIN_ANGLE,
MIN_DIAGONAL,
ODDY,
RELATIVE_SIZE_SQUARED,
SCALED_JACOBIAN,
SHAPE,
SHAPE_AND_SIZE,
SHEAR,
SKEW,
STRETCH,
TAPER,
VOLUME,
WARPAGE,
NUMBER_OF_CELL_METRICS,
EMPTY
}; };
/** \brief Computes the quality of an unstructured cell-based mesh. The quality is defined in terms of the }
* summary statistics (frequency, mean, variance, min, max) of metrics computed over the mesh } // namespace vtkm::filter
* cells. One of several different metrics can be specified for a given cell type, and the mesh
* can consist of one or more different cell types. The resulting mesh quality is stored as one
* or more new fields in the output dataset of this filter, with a separate field for each cell type.
* Each field contains the metric summary statistics for the cell type.
* Summary statists with all 0 values imply that the specified metric does not support the cell type.
*/
class MeshQuality : public vtkm::filter::FilterField<MeshQuality>
{
public:
using SupportedTypes = vtkm::TypeListFieldVec3;
using SupportedCellSets =
vtkm::List<vtkm::cont::CellSetExplicit<>, vtkm::cont::CellSetSingleType<>>;
VTKM_CONT MeshQuality(CellMetric); #endif //vtk_m_filter_MeshQuality_h
template <typename T, typename StorageType, typename DerivedPolicy>
VTKM_CONT vtkm::cont::DataSet DoExecute(
const vtkm::cont::DataSet& input,
const vtkm::cont::ArrayHandle<vtkm::Vec<T, 3>, StorageType>& points,
const vtkm::filter::FieldMetadata& fieldMeta,
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
private:
CellMetric MyMetric;
};
} // namespace filter
} // namespace vtkm
#include <vtkm/filter/MeshQuality.hxx>
#endif // vtk_m_filter_MeshQuality_h

@ -1,116 +0,0 @@
//============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//
// Copyright 2014 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
// Copyright 2014 UT-Battelle, LLC.
// Copyright 2014 Los Alamos National Security.
//
// Under the terms of Contract DE-NA0003525 with NTESS,
// the U.S. Government retains certain rights in this software.
//
// Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//=========================================================================
#ifndef vtk_m_filter_MeshQuality_hxx
#define vtk_m_filter_MeshQuality_hxx
#include <vtkm/cont/Algorithm.h>
#include <vtkm/cont/ErrorFilterExecution.h>
#include <vtkm/cont/Field.h>
#include <vtkm/filter/CellMeasures.h>
#include <vtkm/filter/CreateResult.h>
// #define DEBUG_PRINT
namespace vtkm
{
namespace filter
{
inline VTKM_CONT MeshQuality::MeshQuality(CellMetric metric)
: vtkm::filter::FilterField<MeshQuality>()
{
this->SetUseCoordinateSystemAsField(true);
this->MyMetric = metric;
if (this->MyMetric < CellMetric::AREA || this->MyMetric >= CellMetric::NUMBER_OF_CELL_METRICS)
{
VTKM_ASSERT(true);
}
this->SetOutputFieldName(MetricNames[(int)this->MyMetric]);
}
template <typename T, typename StorageType, typename DerivedPolicy>
inline VTKM_CONT vtkm::cont::DataSet MeshQuality::DoExecute(
const vtkm::cont::DataSet& input,
const vtkm::cont::ArrayHandle<vtkm::Vec<T, 3>, StorageType>& points,
const vtkm::filter::FieldMetadata& fieldMeta,
const vtkm::filter::PolicyBase<DerivedPolicy>& policy)
{
if (!fieldMeta.IsPointField())
{
throw vtkm::cont::ErrorBadValue("Active field for MeshQuality must be point coordinates. "
"But the active field is not a point field.");
}
vtkm::worklet::MeshQuality<CellMetric> qualityWorklet;
if (this->MyMetric == vtkm::filter::CellMetric::RELATIVE_SIZE_SQUARED ||
this->MyMetric == vtkm::filter::CellMetric::SHAPE_AND_SIZE)
{
vtkm::FloatDefault averageArea = 1.;
vtkm::worklet::MeshQuality<CellMetric> subWorklet;
vtkm::cont::ArrayHandle<T> array;
subWorklet.SetMetric(vtkm::filter::CellMetric::AREA);
this->Invoke(subWorklet,
vtkm::filter::ApplyPolicyCellSet(input.GetCellSet(), policy, *this),
points,
array);
T zero = 0.0;
vtkm::FloatDefault totalArea = (vtkm::FloatDefault)vtkm::cont::Algorithm::Reduce(array, zero);
vtkm::FloatDefault averageVolume = 1.;
subWorklet.SetMetric(vtkm::filter::CellMetric::VOLUME);
this->Invoke(subWorklet,
vtkm::filter::ApplyPolicyCellSet(input.GetCellSet(), policy, *this),
points,
array);
vtkm::FloatDefault totalVolume = (vtkm::FloatDefault)vtkm::cont::Algorithm::Reduce(array, zero);
vtkm::Id numVals = array.GetNumberOfValues();
if (numVals > 0)
{
averageArea = totalArea / static_cast<vtkm::FloatDefault>(numVals);
averageVolume = totalVolume / static_cast<vtkm::FloatDefault>(numVals);
}
qualityWorklet.SetAverageArea(averageArea);
qualityWorklet.SetAverageVolume(averageVolume);
}
//Invoke the MeshQuality worklet
vtkm::cont::ArrayHandle<T> outArray;
qualityWorklet.SetMetric(this->MyMetric);
this->Invoke(qualityWorklet,
vtkm::filter::ApplyPolicyCellSet(input.GetCellSet(), policy, *this),
points,
outArray);
vtkm::cont::DataSet result;
result.CopyStructure(input); //clone of the input dataset
//Append the metric values of all cells into the output
//dataset as a new field
result.AddField(vtkm::cont::make_FieldCell(this->GetOutputFieldName(), outArray));
return result;
}
} // namespace filter
} // namespace vtkm
#endif

@ -0,0 +1,37 @@
##============================================================================
## Copyright (c) Kitware, Inc.
## All rights reserved.
## See LICENSE.txt for details.
##
## This software is distributed WITHOUT ANY WARRANTY; without even
## the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
## PURPOSE. See the above copyright notice for more information.
##============================================================================
set(mesh_info_headers
CellMeasures.h
GhostCellClassify.h
MeshQuality.h
)
set(mesh_info_sources
CellMeasures.cxx
GhostCellClassify.cxx
MeshQuality.cxx
)
vtkm_library(
NAME vtkm_filter_mesh_info
HEADERS ${mesh_info_headers}
DEVICE_SOURCES ${mesh_info_sources}
USE_VTKM_JOB_POOL
)
target_link_libraries(vtkm_filter_mesh_info PUBLIC vtkm_worklet vtkm_filter_core)
target_link_libraries(vtkm_filter PUBLIC INTERFACE vtkm_filter_mesh_info)
add_subdirectory(worklet)
#-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -
if (VTKm_ENABLE_TESTING)
add_subdirectory(testing)
endif ()

@ -8,46 +8,41 @@
// PURPOSE. See the above copyright notice for more information. // PURPOSE. See the above copyright notice for more information.
//============================================================================ //============================================================================
#ifndef vtk_m_filter_CellMeasures_hxx
#define vtk_m_filter_CellMeasures_hxx
#include <vtkm/cont/ErrorFilterExecution.h> #include <vtkm/cont/ErrorFilterExecution.h>
#include <vtkm/filter/mesh_info/CellMeasures.h>
#include <vtkm/filter/mesh_info/worklet/CellMeasure.h>
namespace vtkm namespace vtkm
{ {
namespace filter namespace filter
{ {
namespace mesh_info
{
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
template <typename IntegrationType> VTKM_CONT CellMeasures::CellMeasures(IntegrationType m)
inline VTKM_CONT CellMeasures<IntegrationType>::CellMeasures() : measure(m)
: vtkm::filter::FilterField<CellMeasures<IntegrationType>>()
{ {
this->SetUseCoordinateSystemAsField(true); this->SetUseCoordinateSystemAsField(true);
this->SetCellMeasureName("measure"); this->SetCellMeasureName("measure");
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
template <typename IntegrationType>
template <typename T, typename StorageType, typename DerivedPolicy> VTKM_CONT vtkm::cont::DataSet CellMeasures::DoExecute(const vtkm::cont::DataSet& input)
inline VTKM_CONT vtkm::cont::DataSet CellMeasures<IntegrationType>::DoExecute(
const vtkm::cont::DataSet& input,
const vtkm::cont::ArrayHandle<vtkm::Vec<T, 3>, StorageType>& points,
const vtkm::filter::FieldMetadata& fieldMeta,
const vtkm::filter::PolicyBase<DerivedPolicy>& policy)
{ {
if (fieldMeta.IsPointField() == false) const auto& field = this->GetFieldFromDataSet(input);
if (!field.IsFieldPoint())
{ {
throw vtkm::cont::ErrorFilterExecution("CellMeasures expects point field input."); throw vtkm::cont::ErrorFilterExecution("CellMeasures expects point field input.");
} }
const auto& cellset = input.GetCellSet(); const auto& cellset = input.GetCellSet();
vtkm::cont::ArrayHandle<T> outArray; vtkm::cont::ArrayHandle<vtkm::FloatDefault> outArray;
this->Invoke(vtkm::worklet::CellMeasure<IntegrationType>{}, auto resolveType = [&](const auto& concrete) {
vtkm::filter::ApplyPolicyCellSet(cellset, policy, *this), this->Invoke(vtkm::worklet::CellMeasure{ this->measure }, cellset, concrete, outArray);
points, };
outArray); this->CastAndCallVecField<3>(field, resolveType);
std::string outputName = this->GetCellMeasureName(); std::string outputName = this->GetCellMeasureName();
if (outputName.empty()) if (outputName.empty())
@ -55,9 +50,8 @@ inline VTKM_CONT vtkm::cont::DataSet CellMeasures<IntegrationType>::DoExecute(
// Default name is name of input. // Default name is name of input.
outputName = "measure"; outputName = "measure";
} }
return CreateResultFieldCell(input, outArray, outputName); return this->CreateResultFieldCell(input, outputName, outArray);
} }
} } // namespace mesh_info
} // namespace vtkm::filter } // namespace filter
} // namespace vtkm
#endif

@ -0,0 +1,57 @@
//============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
//
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//============================================================================
#ifndef vtk_m_filter_mesh_info_CellMeasure_h
#define vtk_m_filter_mesh_info_CellMeasure_h
#include <vtkm/filter/NewFilterField.h>
#include <vtkm/filter/mesh_info/vtkm_filter_mesh_info_export.h>
namespace vtkm
{
namespace filter
{
namespace mesh_info
{
enum IntegrationType
{
ArcLength = 0x01,
Area = 0x02,
Volume = 0x04,
AllMeasures = ArcLength | Area | Volume
};
/// \brief Compute the measure of each (3D) cell in a dataset.
///
/// CellMeasures is a filter that generates a new cell data array (i.e., one value
/// specified per cell) holding the signed measure of the cell
/// or 0 (if measure is not well defined or the cell type is unsupported).
///
/// By default, the new cell-data array is named "measure".
class VTKM_FILTER_MESH_INFO_EXPORT CellMeasures : public vtkm::filter::NewFilterField
{
public:
VTKM_CONT
CellMeasures(IntegrationType);
/// Set/Get the name of the cell measure field. If not set, "measure" is used.
void SetCellMeasureName(const std::string& name) { this->SetOutputFieldName(name); }
const std::string& GetCellMeasureName() const { return this->GetOutputFieldName(); }
private:
VTKM_CONT vtkm::cont::DataSet DoExecute(const vtkm::cont::DataSet& input) override;
IntegrationType measure;
};
} // namespace mesh_info
} // namespace filter
} // namespace vtkm
#endif // vtk_m_filter_mesh_info_CellMeasure_h

@ -7,17 +7,11 @@
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information. // PURPOSE. See the above copyright notice for more information.
//============================================================================ //============================================================================
#ifndef vtk_m_filter_GhostCellClassify_hxx
#define vtk_m_filter_GhostCellClassify_hxx
#include <vtkm/CellClassification.h> #include <vtkm/CellClassification.h>
#include <vtkm/RangeId.h>
#include <vtkm/RangeId2.h>
#include <vtkm/RangeId3.h>
#include <vtkm/Types.h>
#include <vtkm/cont/ArrayCopy.h>
#include <vtkm/cont/ArrayHandle.h> #include <vtkm/cont/ArrayHandle.h>
#include <vtkm/cont/ErrorFilterExecution.h>
#include <vtkm/filter/mesh_info/GhostCellClassify.h>
#include <vtkm/worklet/WorkletPointNeighborhood.h> #include <vtkm/worklet/WorkletPointNeighborhood.h>
namespace vtkm namespace vtkm
@ -92,11 +86,9 @@ private:
}; };
} // namespace detail } // namespace detail
inline VTKM_CONT GhostCellClassify::GhostCellClassify() {} namespace mesh_info
{
template <typename Policy> VTKM_CONT vtkm::cont::DataSet GhostCellClassify::DoExecute(const vtkm::cont::DataSet& input)
inline VTKM_CONT vtkm::cont::DataSet GhostCellClassify::DoExecute(const vtkm::cont::DataSet& input,
vtkm::filter::PolicyBase<Policy>)
{ {
const vtkm::cont::UnknownCellSet& cellset = input.GetCellSet(); const vtkm::cont::UnknownCellSet& cellset = input.GetCellSet();
vtkm::cont::ArrayHandle<vtkm::UInt8> ghosts; vtkm::cont::ArrayHandle<vtkm::UInt8> ghosts;
@ -149,8 +141,10 @@ inline VTKM_CONT vtkm::cont::DataSet GhostCellClassify::DoExecute(const vtkm::co
throw vtkm::cont::ErrorFilterExecution("Unsupported cellset type for GhostCellClassify."); throw vtkm::cont::ErrorFilterExecution("Unsupported cellset type for GhostCellClassify.");
} }
return CreateResultFieldCell(input, ghosts, "vtkmGhostCells"); auto output = this->CreateResult(input);
output.AddCellField("vtkmGhostCells", ghosts);
return output;
} }
} }
} }
#endif }

@ -0,0 +1,30 @@
//============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
//
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//============================================================================
#ifndef vtk_m_filter_mesh_info_GhostCellClassify_h
#define vtk_m_filter_mesh_info_GhostCellClassify_h
#include <vtkm/filter/NewFilter.h>
#include <vtkm/filter/mesh_info/vtkm_filter_mesh_info_export.h>
namespace vtkm
{
namespace filter
{
namespace mesh_info
{
class VTKM_FILTER_MESH_INFO_EXPORT GhostCellClassify : public vtkm::filter::NewFilter
{
VTKM_CONT vtkm::cont::DataSet DoExecute(const vtkm::cont::DataSet& inData) override;
};
} // namespace mesh_info
} // namespace filter
} // namespace vtkm
#endif //vtk_m_filter_mesh_info_GhostCellClassify_h

@ -0,0 +1,132 @@
//============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//
// Copyright 2014 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
// Copyright 2014 UT-Battelle, LLC.
// Copyright 2014 Los Alamos National Security.
//
// Under the terms of Contract DE-NA0003525 with NTESS,
// the U.S. Government retains certain rights in this software.
//
// Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//=========================================================================
#include <vtkm/cont/Algorithm.h>
#include <vtkm/cont/ErrorFilterExecution.h>
#include <vtkm/cont/Field.h>
#include <vtkm/filter/CreateResult.h>
#include <vtkm/filter/mesh_info/MeshQuality.h>
#include <vtkm/filter/mesh_info/worklet/MeshQuality.h>
namespace vtkm
{
namespace filter
{
namespace mesh_info
{
namespace
{
//Names of the available cell metrics, for use in
//the output dataset fields
const std::map<CellMetric, std::string> MetricNames = {
{ CellMetric::AREA, "area" },
{ CellMetric::ASPECT_GAMMA, "aspectGamma" },
{ CellMetric::ASPECT_RATIO, "aspectRatio" },
{ CellMetric::CONDITION, "condition" },
{ CellMetric::DIAGONAL_RATIO, "diagonalRatio" },
{ CellMetric::DIMENSION, "dimension" },
{ CellMetric::JACOBIAN, "jacobian" },
{ CellMetric::MAX_ANGLE, "maxAngle" },
{ CellMetric::MAX_DIAGONAL, "maxDiagonal" },
{ CellMetric::MIN_ANGLE, "minAngle" },
{ CellMetric::MIN_DIAGONAL, "minDiagonal" },
{ CellMetric::ODDY, "oddy" },
{ CellMetric::RELATIVE_SIZE_SQUARED, "relativeSizeSquared" },
{ CellMetric::SCALED_JACOBIAN, "scaledJacobian" },
{ CellMetric::SHAPE, "shape" },
{ CellMetric::SHAPE_AND_SIZE, "shapeAndSize" },
{ CellMetric::SHEAR, "shear" },
{ CellMetric::SKEW, "skew" },
{ CellMetric::STRETCH, "stretch" },
{ CellMetric::TAPER, "taper" },
{ CellMetric::VOLUME, "volume" },
{ CellMetric::WARPAGE, "warpage" }
};
} // anonymous namespace
VTKM_CONT MeshQuality::MeshQuality(CellMetric metric)
: MyMetric(metric)
{
this->SetUseCoordinateSystemAsField(true);
this->SetOutputFieldName(MetricNames.at(this->MyMetric));
}
VTKM_CONT vtkm::cont::DataSet MeshQuality::DoExecute(const vtkm::cont::DataSet& input)
{
const auto& field = this->GetFieldFromDataSet(input);
if (!field.IsFieldPoint())
{
throw vtkm::cont::ErrorBadValue("Active field for MeshQuality must be point coordinates. "
"But the active field is not a point field.");
}
vtkm::cont::UnknownCellSet inputCellSet = input.GetCellSet();
vtkm::worklet::MeshQuality qualityWorklet;
if (this->MyMetric == CellMetric::RELATIVE_SIZE_SQUARED ||
this->MyMetric == CellMetric::SHAPE_AND_SIZE)
{
vtkm::worklet::MeshQuality subWorklet;
vtkm::FloatDefault totalArea;
vtkm::FloatDefault totalVolume;
auto resolveType = [&](const auto& concrete) {
// use std::decay to remove const ref from the decltype of concrete.
using T = typename std::decay_t<decltype(concrete)>::ValueType::ComponentType;
vtkm::cont::ArrayHandle<T> array;
subWorklet.SetMetric(CellMetric::AREA);
this->Invoke(subWorklet, inputCellSet, concrete, array);
totalArea = (vtkm::FloatDefault)vtkm::cont::Algorithm::Reduce(array, T{});
subWorklet.SetMetric(CellMetric::VOLUME);
this->Invoke(subWorklet, inputCellSet, concrete, array);
totalVolume = (vtkm::FloatDefault)vtkm::cont::Algorithm::Reduce(array, T{});
};
this->CastAndCallVecField<3>(field, resolveType);
vtkm::FloatDefault averageArea = 1.;
vtkm::FloatDefault averageVolume = 1.;
vtkm::Id numCells = inputCellSet.GetNumberOfCells();
if (numCells > 0)
{
averageArea = totalArea / static_cast<vtkm::FloatDefault>(numCells);
averageVolume = totalVolume / static_cast<vtkm::FloatDefault>(numCells);
}
qualityWorklet.SetAverageArea(averageArea);
qualityWorklet.SetAverageVolume(averageVolume);
}
vtkm::cont::UnknownArrayHandle outArray;
//Invoke the MeshQuality worklet
auto resolveType = [&](const auto& concrete) {
using T = typename std::decay_t<decltype(concrete)>::ValueType::ComponentType;
vtkm::cont::ArrayHandle<T> result;
qualityWorklet.SetMetric(this->MyMetric);
this->Invoke(qualityWorklet, inputCellSet, concrete, result);
outArray = result;
};
this->CastAndCallVecField<3>(field, resolveType);
return this->CreateResultFieldCell(input, this->GetOutputFieldName(), outArray);
}
} // namespace mesh_info
} // namespace filter
} // namespace vtkm

@ -0,0 +1,85 @@
//============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//
// Copyright 2014 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
// Copyright 2014 UT-Battelle, LLC.
// Copyright 2014 Los Alamos National Security.
//
// Under the terms of Contract DE-NA0003525 with NTESS,
// the U.S. Government retains certain rights in this software.
//
// Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtk_m_filter_mesh_info_MeshQuality_h
#define vtk_m_filter_mesh_info_MeshQuality_h
#include <vtkm/filter/NewFilterField.h>
#include <vtkm/filter/mesh_info/vtkm_filter_mesh_info_export.h>
namespace vtkm
{
namespace filter
{
namespace mesh_info
{
//Different cell metrics available to use
//This must follow the same order as the MetricNames above
enum class CellMetric
{
AREA,
ASPECT_GAMMA,
ASPECT_RATIO,
CONDITION,
DIAGONAL_RATIO,
DIMENSION,
JACOBIAN,
MAX_ANGLE,
MAX_DIAGONAL,
MIN_ANGLE,
MIN_DIAGONAL,
ODDY,
RELATIVE_SIZE_SQUARED,
SCALED_JACOBIAN,
SHAPE,
SHAPE_AND_SIZE,
SHEAR,
SKEW,
STRETCH,
TAPER,
VOLUME,
WARPAGE,
NUMBER_OF_CELL_METRICS,
EMPTY
};
/** \brief Computes the quality of an unstructured cell-based mesh. The quality is defined in terms of the
* summary statistics (frequency, mean, variance, min, max) of metrics computed over the mesh
* cells. One of several different metrics can be specified for a given cell type, and the mesh
* can consist of one or more different cell types. The resulting mesh quality is stored as one
* or more new fields in the output dataset of this filter, with a separate field for each cell type.
* Each field contains the metric summary statistics for the cell type.
* Summary statists with all 0 values imply that the specified metric does not support the cell type.
*/
class VTKM_FILTER_MESH_INFO_EXPORT MeshQuality : public vtkm::filter::NewFilterField
{
public:
VTKM_CONT MeshQuality(CellMetric);
private:
VTKM_CONT vtkm::cont::DataSet DoExecute(const vtkm::cont::DataSet& input) override;
CellMetric MyMetric;
};
} // namespace mesh_info
} // namespace filter
} // namespace vtkm
#endif // vtk_m_filter_mesh_info_MeshQuality_h

@ -0,0 +1,25 @@
##============================================================================
## Copyright (c) Kitware, Inc.
## All rights reserved.
## See LICENSE.txt for details.
##
## This software is distributed WITHOUT ANY WARRANTY; without even
## the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
## PURPOSE. See the above copyright notice for more information.
##============================================================================
set(unit_tests
UnitTestCellMeasuresFilter.cxx
UnitTestGhostCellClassify.cxx
UnitTestMeshQualityFilter.cxx
)
set(libraries
vtkm_filter_mesh_info
)
vtkm_unit_tests(
SOURCES ${unit_tests}
LIBRARIES ${libraries}
USE_VTKM_JOB_POOL
)

@ -8,12 +8,12 @@
// PURPOSE. See the above copyright notice for more information. // PURPOSE. See the above copyright notice for more information.
//============================================================================ //============================================================================
#include <vtkm/filter/CellMeasures.h>
#include <vtkm/cont/testing/MakeTestDataSet.h> #include <vtkm/cont/testing/MakeTestDataSet.h>
#include <vtkm/cont/testing/Testing.h> #include <vtkm/cont/testing/Testing.h>
#include <vector> #include <vector>
#include <vtkm/filter/mesh_info/CellMeasures.h>
//#include <vtkm/filter/mesh_info/worklet/CellMeasure.h>
namespace namespace
{ {
@ -37,15 +37,14 @@ struct CheckCellMeasuresFunctor
} }
}; };
template <typename IntegrationType>
void TestCellMeasuresFilter(vtkm::cont::DataSet& dataset, void TestCellMeasuresFilter(vtkm::cont::DataSet& dataset,
const char* msg, const char* msg,
const std::vector<vtkm::Float32>& expected, const std::vector<vtkm::Float32>& expected,
const IntegrationType&) const vtkm::filter::mesh_info::IntegrationType& type)
{ {
std::cout << "Testing CellMeasures Filter on " << msg << "\n"; std::cout << "Testing CellMeasures Filter on " << msg << "\n";
vtkm::filter::CellMeasures<IntegrationType> vols; vtkm::filter::mesh_info::CellMeasures vols{ type };
vtkm::cont::DataSet outputData = vols.Execute(dataset); vtkm::cont::DataSet outputData = vols.Execute(dataset);
VTKM_TEST_ASSERT(vols.GetCellMeasureName() == "measure"); VTKM_TEST_ASSERT(vols.GetCellMeasureName() == "measure");
@ -67,35 +66,36 @@ void TestCellMeasuresFilter(vtkm::cont::DataSet& dataset,
void TestCellMeasures() void TestCellMeasures()
{ {
using vtkm::AllMeasures; using vtkm::filter::mesh_info::IntegrationType;
using vtkm::Volume;
vtkm::cont::testing::MakeTestDataSet factory; vtkm::cont::testing::MakeTestDataSet factory;
vtkm::cont::DataSet data; vtkm::cont::DataSet data;
data = factory.Make3DExplicitDataSet2(); data = factory.Make3DExplicitDataSet2();
TestCellMeasuresFilter(data, "explicit dataset 2", { -1.f }, AllMeasures()); TestCellMeasuresFilter(data, "explicit dataset 2", { -1.f }, IntegrationType::AllMeasures);
data = factory.Make3DExplicitDataSet3(); data = factory.Make3DExplicitDataSet3();
TestCellMeasuresFilter(data, "explicit dataset 3", { -1.f / 6.f }, AllMeasures()); TestCellMeasuresFilter(data, "explicit dataset 3", { -1.f / 6.f }, IntegrationType::AllMeasures);
data = factory.Make3DExplicitDataSet4(); data = factory.Make3DExplicitDataSet4();
TestCellMeasuresFilter(data, "explicit dataset 4", { -1.f, -1.f }, AllMeasures()); TestCellMeasuresFilter(data, "explicit dataset 4", { -1.f, -1.f }, IntegrationType::AllMeasures);
data = factory.Make3DExplicitDataSet5(); data = factory.Make3DExplicitDataSet5();
TestCellMeasuresFilter( TestCellMeasuresFilter(data,
data, "explicit dataset 5", { 1.f, 1.f / 3.f, 1.f / 6.f, -1.f / 2.f }, AllMeasures()); "explicit dataset 5",
{ 1.f, 1.f / 3.f, 1.f / 6.f, -1.f / 2.f },
IntegrationType::AllMeasures);
data = factory.Make3DExplicitDataSet6(); data = factory.Make3DExplicitDataSet6();
TestCellMeasuresFilter(data, TestCellMeasuresFilter(data,
"explicit dataset 6 (only volume)", "explicit dataset 6 (only volume)",
{ 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.083426f, 0.25028f }, { 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.083426f, 0.25028f },
Volume()); IntegrationType::Volume);
TestCellMeasuresFilter( TestCellMeasuresFilter(
data, data,
"explicit dataset 6 (all)", "explicit dataset 6 (all)",
{ 0.999924f, 0.999924f, 0.f, 0.f, 3.85516f, 1.00119f, 0.083426f, 0.25028f }, { 0.999924f, 0.999924f, 0.f, 0.f, 3.85516f, 1.00119f, 0.083426f, 0.25028f },
AllMeasures()); IntegrationType::AllMeasures);
} }
} // anonymous namespace } // anonymous namespace

@ -9,12 +9,12 @@
//============================================================================ //============================================================================
#include <vtkm/cont/DataSet.h> #include <vtkm/cont/DataSet.h>
#include <vtkm/cont/DataSetBuilderExplicit.h>
#include <vtkm/cont/DataSetBuilderRectilinear.h> #include <vtkm/cont/DataSetBuilderRectilinear.h>
#include <vtkm/cont/DataSetBuilderUniform.h> #include <vtkm/cont/DataSetBuilderUniform.h>
#include <vtkm/cont/testing/Testing.h> #include <vtkm/cont/testing/Testing.h>
#include <vtkm/filter/GhostCellClassify.h> #include <vtkm/CellClassification.h>
#include <vtkm/filter/mesh_info/GhostCellClassify.h>
namespace namespace
{ {
@ -100,7 +100,7 @@ void TestStructured()
else if (dsType == "rectilinear") else if (dsType == "rectilinear")
ds = MakeRectilinear(nx, ny, nz); ds = MakeRectilinear(nx, ny, nz);
vtkm::filter::GhostCellClassify addGhost; vtkm::filter::mesh_info::GhostCellClassify addGhost;
auto output = addGhost.Execute(ds); auto output = addGhost.Execute(ds);

@ -26,8 +26,9 @@
#include <vtkm/cont/DataSet.h> #include <vtkm/cont/DataSet.h>
#include <vtkm/cont/DataSetBuilderExplicit.h> #include <vtkm/cont/DataSetBuilderExplicit.h>
#include <vtkm/cont/DeviceAdapterAlgorithm.h> #include <vtkm/cont/DeviceAdapterAlgorithm.h>
#include <vtkm/cont/ErrorExecution.h>
#include <vtkm/cont/testing/Testing.h> #include <vtkm/cont/testing/Testing.h>
#include <vtkm/filter/MeshQuality.h> #include <vtkm/filter/mesh_info/MeshQuality.h>
#include <vtkm/io/VTKDataSetReader.h> #include <vtkm/io/VTKDataSetReader.h>
namespace namespace
@ -142,7 +143,7 @@ inline vtkm::cont::DataSet MakeSingleTypeDataSet()
bool TestMeshQualityFilter(const vtkm::cont::DataSet& input, bool TestMeshQualityFilter(const vtkm::cont::DataSet& input,
const std::vector<vtkm::FloatDefault>& expectedVals, const std::vector<vtkm::FloatDefault>& expectedVals,
const std::string& outputname, const std::string& outputname,
vtkm::filter::MeshQuality& filter) vtkm::filter::mesh_info::MeshQuality& filter)
{ {
vtkm::cont::DataSet output; vtkm::cont::DataSet output;
try try
@ -193,162 +194,162 @@ int TestMeshQuality()
bool testFailed = false; bool testFailed = false;
std::vector<FloatVec> expectedValues; std::vector<FloatVec> expectedValues;
std::vector<vtkm::filter::CellMetric> metrics; std::vector<vtkm::filter::mesh_info::CellMetric> metrics;
std::vector<std::string> metricName; std::vector<std::string> metricName;
std::vector<vtkm::cont::DataSet> inputs; std::vector<vtkm::cont::DataSet> inputs;
expectedValues.push_back(FloatVec{ 0, 0, 1, 1.333333333f, 4, 4 }); expectedValues.push_back(FloatVec{ 0, 0, 1, 1.333333333f, 4, 4 });
metrics.push_back(vtkm::filter::CellMetric::VOLUME); metrics.push_back(vtkm::filter::mesh_info::CellMetric::VOLUME);
metricName.push_back("volume"); metricName.push_back("volume");
inputs.push_back(explicitInput); inputs.push_back(explicitInput);
expectedValues.push_back(FloatVec{ 3, 4, 0, 0, 0, 0 }); expectedValues.push_back(FloatVec{ 3, 4, 0, 0, 0, 0 });
metrics.push_back(vtkm::filter::CellMetric::AREA); metrics.push_back(vtkm::filter::mesh_info::CellMetric::AREA);
metricName.push_back("area"); metricName.push_back("area");
inputs.push_back(explicitInput); inputs.push_back(explicitInput);
expectedValues.push_back(FloatVec{ 3, 1 }); expectedValues.push_back(FloatVec{ 3, 1 });
metrics.push_back(vtkm::filter::CellMetric::AREA); metrics.push_back(vtkm::filter::mesh_info::CellMetric::AREA);
metricName.push_back("area"); metricName.push_back("area");
inputs.push_back(singleTypeInput); inputs.push_back(singleTypeInput);
expectedValues.push_back(FloatVec{ 1.164010f, 1.118034f, 1.648938f, 0, 0, 1.1547f }); expectedValues.push_back(FloatVec{ 1.164010f, 1.118034f, 1.648938f, 0, 0, 1.1547f });
metrics.push_back(vtkm::filter::CellMetric::ASPECT_RATIO); metrics.push_back(vtkm::filter::mesh_info::CellMetric::ASPECT_RATIO);
metricName.push_back("aspectRatio"); metricName.push_back("aspectRatio");
inputs.push_back(explicitInput); inputs.push_back(explicitInput);
expectedValues.push_back(FloatVec{ 1.164010f, 2.47582f }); expectedValues.push_back(FloatVec{ 1.164010f, 2.47582f });
metrics.push_back(vtkm::filter::CellMetric::ASPECT_RATIO); metrics.push_back(vtkm::filter::mesh_info::CellMetric::ASPECT_RATIO);
metricName.push_back("aspectRatio"); metricName.push_back("aspectRatio");
inputs.push_back(singleTypeInput); inputs.push_back(singleTypeInput);
expectedValues.push_back(FloatVec{ 0, 0, 1.52012f, 0, 0, 0 }); expectedValues.push_back(FloatVec{ 0, 0, 1.52012f, 0, 0, 0 });
metrics.push_back(vtkm::filter::CellMetric::ASPECT_GAMMA); metrics.push_back(vtkm::filter::mesh_info::CellMetric::ASPECT_GAMMA);
metricName.push_back("aspectGamma"); metricName.push_back("aspectGamma");
inputs.push_back(explicitInput); inputs.push_back(explicitInput);
expectedValues.push_back(FloatVec{ 1.058475f, 2.25f, 1.354007f, 0, 0, 1.563472f }); expectedValues.push_back(FloatVec{ 1.058475f, 2.25f, 1.354007f, 0, 0, 1.563472f });
metrics.push_back(vtkm::filter::CellMetric::CONDITION); metrics.push_back(vtkm::filter::mesh_info::CellMetric::CONDITION);
metricName.push_back("condition"); metricName.push_back("condition");
inputs.push_back(explicitInput); inputs.push_back(explicitInput);
expectedValues.push_back(FloatVec{ 1.058475f, 2.02073f }); expectedValues.push_back(FloatVec{ 1.058475f, 2.02073f });
metrics.push_back(vtkm::filter::CellMetric::CONDITION); metrics.push_back(vtkm::filter::mesh_info::CellMetric::CONDITION);
metricName.push_back("condition"); metricName.push_back("condition");
inputs.push_back(singleTypeInput); inputs.push_back(singleTypeInput);
expectedValues.push_back(FloatVec{ 45, 45, -1, -1, -1, -1 }); expectedValues.push_back(FloatVec{ 45, 45, -1, -1, -1, -1 });
metrics.push_back(vtkm::filter::CellMetric::MIN_ANGLE); metrics.push_back(vtkm::filter::mesh_info::CellMetric::MIN_ANGLE);
metricName.push_back("minAngle"); metricName.push_back("minAngle");
inputs.push_back(explicitInput); inputs.push_back(explicitInput);
expectedValues.push_back(FloatVec{ 45, 18.4348f }); expectedValues.push_back(FloatVec{ 45, 18.4348f });
metrics.push_back(vtkm::filter::CellMetric::MIN_ANGLE); metrics.push_back(vtkm::filter::mesh_info::CellMetric::MIN_ANGLE);
metricName.push_back("minAngle"); metricName.push_back("minAngle");
inputs.push_back(singleTypeInput); inputs.push_back(singleTypeInput);
expectedValues.push_back(FloatVec{ 71.56505f, 135, -1, -1, -1, -1 }); expectedValues.push_back(FloatVec{ 71.56505f, 135, -1, -1, -1, -1 });
metrics.push_back(vtkm::filter::CellMetric::MAX_ANGLE); metrics.push_back(vtkm::filter::mesh_info::CellMetric::MAX_ANGLE);
metricName.push_back("maxAngle"); metricName.push_back("maxAngle");
inputs.push_back(explicitInput); inputs.push_back(explicitInput);
expectedValues.push_back(FloatVec{ 71.56505f, 116.565f }); expectedValues.push_back(FloatVec{ 71.56505f, 116.565f });
metrics.push_back(vtkm::filter::CellMetric::MAX_ANGLE); metrics.push_back(vtkm::filter::mesh_info::CellMetric::MAX_ANGLE);
metricName.push_back("maxAngle"); metricName.push_back("maxAngle");
inputs.push_back(singleTypeInput); inputs.push_back(singleTypeInput);
expectedValues.push_back(FloatVec{ -1, -1, -1, -1, -1, 1.73205f }); expectedValues.push_back(FloatVec{ -1, -1, -1, -1, -1, 1.73205f });
metrics.push_back(vtkm::filter::CellMetric::MIN_DIAGONAL); metrics.push_back(vtkm::filter::mesh_info::CellMetric::MIN_DIAGONAL);
metricName.push_back("minDiagonal"); metricName.push_back("minDiagonal");
inputs.push_back(explicitInput); inputs.push_back(explicitInput);
expectedValues.push_back(FloatVec{ -1, -1, -1, -1, -1, 4.3589f }); expectedValues.push_back(FloatVec{ -1, -1, -1, -1, -1, 4.3589f });
metrics.push_back(vtkm::filter::CellMetric::MAX_DIAGONAL); metrics.push_back(vtkm::filter::mesh_info::CellMetric::MAX_DIAGONAL);
metricName.push_back("maxDiagonal"); metricName.push_back("maxDiagonal");
inputs.push_back(explicitInput); inputs.push_back(explicitInput);
expectedValues.push_back(FloatVec{ 0, 2, 6, 0, 0, 4 }); expectedValues.push_back(FloatVec{ 0, 2, 6, 0, 0, 4 });
metrics.push_back(vtkm::filter::CellMetric::JACOBIAN); metrics.push_back(vtkm::filter::mesh_info::CellMetric::JACOBIAN);
metricName.push_back("jacobian"); metricName.push_back("jacobian");
inputs.push_back(explicitInput); inputs.push_back(explicitInput);
expectedValues.push_back(FloatVec{ 0.816497f, 0.707107f, 0.408248f, -2, -2, 0.57735f }); expectedValues.push_back(FloatVec{ 0.816497f, 0.707107f, 0.408248f, -2, -2, 0.57735f });
metrics.push_back(vtkm::filter::CellMetric::SCALED_JACOBIAN); metrics.push_back(vtkm::filter::mesh_info::CellMetric::SCALED_JACOBIAN);
metricName.push_back("scaledJacobian"); metricName.push_back("scaledJacobian");
inputs.push_back(explicitInput); inputs.push_back(explicitInput);
expectedValues.push_back(FloatVec{ 0.816497f, 0.365148f }); expectedValues.push_back(FloatVec{ 0.816497f, 0.365148f });
metrics.push_back(vtkm::filter::CellMetric::SCALED_JACOBIAN); metrics.push_back(vtkm::filter::mesh_info::CellMetric::SCALED_JACOBIAN);
metricName.push_back("scaledJacobian"); metricName.push_back("scaledJacobian");
inputs.push_back(singleTypeInput); inputs.push_back(singleTypeInput);
expectedValues.push_back(FloatVec{ -1, 8.125f, -1, -1, -1, 2.62484f }); expectedValues.push_back(FloatVec{ -1, 8.125f, -1, -1, -1, 2.62484f });
metrics.push_back(vtkm::filter::CellMetric::ODDY); metrics.push_back(vtkm::filter::mesh_info::CellMetric::ODDY);
metricName.push_back("oddy"); metricName.push_back("oddy");
inputs.push_back(explicitInput); inputs.push_back(explicitInput);
expectedValues.push_back(FloatVec{ -1, 0.620174f, -1, -1, -1, 0.397360f }); expectedValues.push_back(FloatVec{ -1, 0.620174f, -1, -1, -1, 0.397360f });
metrics.push_back(vtkm::filter::CellMetric::DIAGONAL_RATIO); metrics.push_back(vtkm::filter::mesh_info::CellMetric::DIAGONAL_RATIO);
metricName.push_back("diagonalRatio"); metricName.push_back("diagonalRatio");
inputs.push_back(explicitInput); inputs.push_back(explicitInput);
expectedValues.push_back(FloatVec{ 0.944755f, 0.444444f, 0.756394f, -1, -1, 0.68723f }); expectedValues.push_back(FloatVec{ 0.944755f, 0.444444f, 0.756394f, -1, -1, 0.68723f });
metrics.push_back(vtkm::filter::CellMetric::SHAPE); metrics.push_back(vtkm::filter::mesh_info::CellMetric::SHAPE);
metricName.push_back("shape"); metricName.push_back("shape");
inputs.push_back(explicitInput); inputs.push_back(explicitInput);
expectedValues.push_back(FloatVec{ 0.944755f, 0.494872f }); expectedValues.push_back(FloatVec{ 0.944755f, 0.494872f });
metrics.push_back(vtkm::filter::CellMetric::SHAPE); metrics.push_back(vtkm::filter::mesh_info::CellMetric::SHAPE);
metricName.push_back("shape"); metricName.push_back("shape");
inputs.push_back(singleTypeInput); inputs.push_back(singleTypeInput);
expectedValues.push_back(FloatVec{ -1, 0.707107f, -1, -1, -1, 0.57735f }); expectedValues.push_back(FloatVec{ -1, 0.707107f, -1, -1, -1, 0.57735f });
metrics.push_back(vtkm::filter::CellMetric::SHEAR); metrics.push_back(vtkm::filter::mesh_info::CellMetric::SHEAR);
metricName.push_back("shear"); metricName.push_back("shear");
inputs.push_back(explicitInput); inputs.push_back(explicitInput);
expectedValues.push_back(FloatVec{ -1, 0.447214f, -1, -1, -1, 0.57735f }); expectedValues.push_back(FloatVec{ -1, 0.447214f, -1, -1, -1, 0.57735f });
metrics.push_back(vtkm::filter::CellMetric::SKEW); metrics.push_back(vtkm::filter::mesh_info::CellMetric::SKEW);
metricName.push_back("skew"); metricName.push_back("skew");
inputs.push_back(explicitInput); inputs.push_back(explicitInput);
expectedValues.push_back(FloatVec{ -1, (float)0.392232, -1, -1, -1, (float)0.688247 }); expectedValues.push_back(FloatVec{ -1, (float)0.392232, -1, -1, -1, (float)0.688247 });
metrics.push_back(vtkm::filter::CellMetric::STRETCH); metrics.push_back(vtkm::filter::mesh_info::CellMetric::STRETCH);
metricName.push_back("stretch"); metricName.push_back("stretch");
inputs.push_back(explicitInput); inputs.push_back(explicitInput);
expectedValues.push_back(FloatVec{ -1, 0.5, -1, -1, -1, 0 }); expectedValues.push_back(FloatVec{ -1, 0.5, -1, -1, -1, 0 });
metrics.push_back(vtkm::filter::CellMetric::TAPER); metrics.push_back(vtkm::filter::mesh_info::CellMetric::TAPER);
metricName.push_back("taper"); metricName.push_back("taper");
inputs.push_back(explicitInput); inputs.push_back(explicitInput);
expectedValues.push_back(FloatVec{ -1, 1, -1, -1, -1, -1 }); expectedValues.push_back(FloatVec{ -1, 1, -1, -1, -1, -1 });
metrics.push_back(vtkm::filter::CellMetric::WARPAGE); metrics.push_back(vtkm::filter::mesh_info::CellMetric::WARPAGE);
metricName.push_back("warpage"); metricName.push_back("warpage");
inputs.push_back(explicitInput); inputs.push_back(explicitInput);
expectedValues.push_back(FloatVec{ -1, -1, -1, -1, -1, 0.707107f }); expectedValues.push_back(FloatVec{ -1, -1, -1, -1, -1, 0.707107f });
metrics.push_back(vtkm::filter::CellMetric::DIMENSION); metrics.push_back(vtkm::filter::mesh_info::CellMetric::DIMENSION);
metricName.push_back("dimension"); metricName.push_back("dimension");
inputs.push_back(explicitInput); inputs.push_back(explicitInput);
expectedValues.push_back(FloatVec{ 0.151235f, 0.085069f, 0.337149f, -1, -1, 0.185378f }); expectedValues.push_back(FloatVec{ 0.151235f, 0.085069f, 0.337149f, -1, -1, 0.185378f });
metrics.push_back(vtkm::filter::CellMetric::RELATIVE_SIZE_SQUARED); metrics.push_back(vtkm::filter::mesh_info::CellMetric::RELATIVE_SIZE_SQUARED);
metricName.push_back("relativeSizeSquared"); metricName.push_back("relativeSizeSquared");
inputs.push_back(explicitInput); inputs.push_back(explicitInput);
expectedValues.push_back(FloatVec{ 0.444444f, 0.25f }); expectedValues.push_back(FloatVec{ 0.444444f, 0.25f });
metrics.push_back(vtkm::filter::CellMetric::RELATIVE_SIZE_SQUARED); metrics.push_back(vtkm::filter::mesh_info::CellMetric::RELATIVE_SIZE_SQUARED);
metricName.push_back("relativeSizeSquared"); metricName.push_back("relativeSizeSquared");
inputs.push_back(singleTypeInput); inputs.push_back(singleTypeInput);
expectedValues.push_back(FloatVec{ 0.142880f, 0.037809f, 0.255017f, -1, -1, 0.127397f }); expectedValues.push_back(FloatVec{ 0.142880f, 0.037809f, 0.255017f, -1, -1, 0.127397f });
metrics.push_back(vtkm::filter::CellMetric::SHAPE_AND_SIZE); metrics.push_back(vtkm::filter::mesh_info::CellMetric::SHAPE_AND_SIZE);
metricName.push_back("shapeAndSize"); metricName.push_back("shapeAndSize");
inputs.push_back(explicitInput); inputs.push_back(explicitInput);
expectedValues.push_back(FloatVec{ 0.419891f, 0.123718f }); expectedValues.push_back(FloatVec{ 0.419891f, 0.123718f });
metrics.push_back(vtkm::filter::CellMetric::SHAPE_AND_SIZE); metrics.push_back(vtkm::filter::mesh_info::CellMetric::SHAPE_AND_SIZE);
metricName.push_back("shapeAndSize"); metricName.push_back("shapeAndSize");
inputs.push_back(singleTypeInput); inputs.push_back(singleTypeInput);
@ -356,7 +357,7 @@ int TestMeshQuality()
for (unsigned long i = 0; i < numTests; i++) for (unsigned long i = 0; i < numTests; i++)
{ {
printf("Testing metric %s\n", metricName[i].c_str()); printf("Testing metric %s\n", metricName[i].c_str());
vtkm::filter::MeshQuality filter(metrics[i]); vtkm::filter::mesh_info::MeshQuality filter(metrics[i]);
testFailed = TestMeshQualityFilter(inputs[i], expectedValues[i], metricName[i], filter); testFailed = TestMeshQualityFilter(inputs[i], expectedValues[i], metricName[i], filter);
if (testFailed) if (testFailed)
{ {

@ -0,0 +1,18 @@
##============================================================================
## Copyright (c) Kitware, Inc.
## All rights reserved.
## See LICENSE.txt for details.
##
## This software is distributed WITHOUT ANY WARRANTY; without even
## the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
## PURPOSE. See the above copyright notice for more information.
##============================================================================
set(headers
CellMeasure.h
MeshQuality.h
)
vtkm_declare_headers(${headers})
add_subdirectory(cellmetrics)

@ -11,33 +11,13 @@
#ifndef vtk_m_worklet_CellMeasure_h #ifndef vtk_m_worklet_CellMeasure_h
#define vtk_m_worklet_CellMeasure_h #define vtk_m_worklet_CellMeasure_h
#include <vtkm/worklet/WorkletMapTopology.h>
#include <vtkm/exec/CellMeasure.h> #include <vtkm/exec/CellMeasure.h>
#include <vtkm/filter/mesh_info/CellMeasures.h>
#include <vtkm/worklet/WorkletMapTopology.h>
namespace vtkm namespace vtkm
{ {
// Tags used to choose which types of integration are performed on cells:
struct IntegrateOver
{
};
struct IntegrateOverCurve : IntegrateOver
{
};
struct IntegrateOverSurface : IntegrateOver
{
};
struct IntegrateOverSolid : IntegrateOver
{
};
// Lists of acceptable types of integration
using ArcLength = vtkm::List<IntegrateOverCurve>;
using Area = vtkm::List<IntegrateOverSurface>;
using Volume = vtkm::List<IntegrateOverSolid>;
using AllMeasures = vtkm::List<IntegrateOverSolid, IntegrateOverSurface, IntegrateOverCurve>;
namespace worklet namespace worklet
{ {
@ -51,7 +31,6 @@ namespace worklet
* *
* Note that the integrals are signed; inverted cells will report negative values. * Note that the integrals are signed; inverted cells will report negative values.
*/ */
template <typename IntegrationTypeList>
class CellMeasure : public vtkm::worklet::WorkletVisitCellsWithPoints class CellMeasure : public vtkm::worklet::WorkletVisitCellsWithPoints
{ {
public: public:
@ -61,6 +40,11 @@ public:
using ExecutionSignature = void(CellShape, PointCount, _2, _3); using ExecutionSignature = void(CellShape, PointCount, _2, _3);
using InputDomain = _1; using InputDomain = _1;
explicit CellMeasure(vtkm::filter::mesh_info::IntegrationType m)
: measure(m)
{
}
template <typename CellShape, typename PointCoordVecType, typename OutType> template <typename CellShape, typename PointCoordVecType, typename OutType>
VTKM_EXEC void operator()(CellShape shape, VTKM_EXEC void operator()(CellShape shape,
const vtkm::IdComponent& numPoints, const vtkm::IdComponent& numPoints,
@ -77,7 +61,7 @@ public:
} }
} }
protected: private:
template <typename OutType, typename PointCoordVecType, typename CellShapeType> template <typename OutType, typename PointCoordVecType, typename CellShapeType>
VTKM_EXEC OutType ComputeMeasure(const vtkm::IdComponent& numPts, VTKM_EXEC OutType ComputeMeasure(const vtkm::IdComponent& numPts,
const PointCoordVecType& pts, const PointCoordVecType& pts,
@ -91,6 +75,7 @@ protected:
#pragma push #pragma push
#pragma diag_suppress = code_is_unreachable #pragma diag_suppress = code_is_unreachable
#endif #endif
using vtkm::filter::mesh_info::IntegrationType;
vtkm::ErrorCode ec; vtkm::ErrorCode ec;
switch (vtkm::CellTraits<CellShapeType>::TOPOLOGICAL_DIMENSIONS) switch (vtkm::CellTraits<CellShapeType>::TOPOLOGICAL_DIMENSIONS)
@ -99,19 +84,19 @@ protected:
// Fall through to return 0 measure. // Fall through to return 0 measure.
break; break;
case 1: case 1:
if (vtkm::ListHas<IntegrationTypeList, IntegrateOverCurve>::value) if (this->measure & IntegrationType::ArcLength)
{ {
return vtkm::exec::CellMeasure<OutType>(numPts, pts, CellShapeType(), ec); return vtkm::exec::CellMeasure<OutType>(numPts, pts, CellShapeType(), ec);
} }
break; break;
case 2: case 2:
if (vtkm::ListHas<IntegrationTypeList, IntegrateOverSurface>::value) if (this->measure & IntegrationType::Area)
{ {
return vtkm::exec::CellMeasure<OutType>(numPts, pts, CellShapeType(), ec); return vtkm::exec::CellMeasure<OutType>(numPts, pts, CellShapeType(), ec);
} }
break; break;
case 3: case 3:
if (vtkm::ListHas<IntegrationTypeList, IntegrateOverSolid>::value) if (this->measure & IntegrationType::Volume)
{ {
return vtkm::exec::CellMeasure<OutType>(numPts, pts, CellShapeType(), ec); return vtkm::exec::CellMeasure<OutType>(numPts, pts, CellShapeType(), ec);
} }
@ -128,6 +113,8 @@ protected:
#pragma warning(pop) #pragma warning(pop)
#endif #endif
} }
vtkm::filter::mesh_info::IntegrationType measure;
}; };
} }
} // namespace vtkm::worklet } // namespace vtkm::worklet

@ -21,29 +21,30 @@
#ifndef vtk_m_worklet_MeshQuality_h #ifndef vtk_m_worklet_MeshQuality_h
#define vtk_m_worklet_MeshQuality_h #define vtk_m_worklet_MeshQuality_h
#include "vtkm/ErrorCode.h" #include <vtkm/ErrorCode.h>
#include "vtkm/worklet/CellMeasure.h" #include <vtkm/exec/CellMeasure.h>
#include "vtkm/worklet/WorkletMapTopology.h" #include <vtkm/filter/mesh_info/MeshQuality.h>
#include "vtkm/worklet/cellmetrics/CellAspectGammaMetric.h" #include <vtkm/filter/mesh_info/worklet/cellmetrics/CellAspectGammaMetric.h>
#include "vtkm/worklet/cellmetrics/CellAspectRatioMetric.h" #include <vtkm/filter/mesh_info/worklet/cellmetrics/CellAspectRatioMetric.h>
#include "vtkm/worklet/cellmetrics/CellConditionMetric.h" #include <vtkm/filter/mesh_info/worklet/cellmetrics/CellConditionMetric.h>
#include "vtkm/worklet/cellmetrics/CellDiagonalRatioMetric.h" #include <vtkm/filter/mesh_info/worklet/cellmetrics/CellDiagonalRatioMetric.h>
#include "vtkm/worklet/cellmetrics/CellDimensionMetric.h" #include <vtkm/filter/mesh_info/worklet/cellmetrics/CellDimensionMetric.h>
#include "vtkm/worklet/cellmetrics/CellJacobianMetric.h" #include <vtkm/filter/mesh_info/worklet/cellmetrics/CellJacobianMetric.h>
#include "vtkm/worklet/cellmetrics/CellMaxAngleMetric.h" #include <vtkm/filter/mesh_info/worklet/cellmetrics/CellMaxAngleMetric.h>
#include "vtkm/worklet/cellmetrics/CellMaxDiagonalMetric.h" #include <vtkm/filter/mesh_info/worklet/cellmetrics/CellMaxDiagonalMetric.h>
#include "vtkm/worklet/cellmetrics/CellMinAngleMetric.h" #include <vtkm/filter/mesh_info/worklet/cellmetrics/CellMinAngleMetric.h>
#include "vtkm/worklet/cellmetrics/CellMinDiagonalMetric.h" #include <vtkm/filter/mesh_info/worklet/cellmetrics/CellMinDiagonalMetric.h>
#include "vtkm/worklet/cellmetrics/CellOddyMetric.h" #include <vtkm/filter/mesh_info/worklet/cellmetrics/CellOddyMetric.h>
#include "vtkm/worklet/cellmetrics/CellRelativeSizeSquaredMetric.h" #include <vtkm/filter/mesh_info/worklet/cellmetrics/CellRelativeSizeSquaredMetric.h>
#include "vtkm/worklet/cellmetrics/CellScaledJacobianMetric.h" #include <vtkm/filter/mesh_info/worklet/cellmetrics/CellScaledJacobianMetric.h>
#include "vtkm/worklet/cellmetrics/CellShapeAndSizeMetric.h" #include <vtkm/filter/mesh_info/worklet/cellmetrics/CellShapeAndSizeMetric.h>
#include "vtkm/worklet/cellmetrics/CellShapeMetric.h" #include <vtkm/filter/mesh_info/worklet/cellmetrics/CellShapeMetric.h>
#include "vtkm/worklet/cellmetrics/CellShearMetric.h" #include <vtkm/filter/mesh_info/worklet/cellmetrics/CellShearMetric.h>
#include "vtkm/worklet/cellmetrics/CellSkewMetric.h" #include <vtkm/filter/mesh_info/worklet/cellmetrics/CellSkewMetric.h>
#include "vtkm/worklet/cellmetrics/CellStretchMetric.h" #include <vtkm/filter/mesh_info/worklet/cellmetrics/CellStretchMetric.h>
#include "vtkm/worklet/cellmetrics/CellTaperMetric.h" #include <vtkm/filter/mesh_info/worklet/cellmetrics/CellTaperMetric.h>
#include "vtkm/worklet/cellmetrics/CellWarpageMetric.h" #include <vtkm/filter/mesh_info/worklet/cellmetrics/CellWarpageMetric.h>
#include <vtkm/worklet/WorkletMapTopology.h>
namespace vtkm namespace vtkm
{ {
@ -56,7 +57,6 @@ namespace worklet
* and this metric is invoked over all cells of that cell type. An array of * and this metric is invoked over all cells of that cell type. An array of
* the computed metric values (one per cell) is returned as output. * the computed metric values (one per cell) is returned as output.
*/ */
template <typename MetricTagType>
class MeshQuality : public vtkm::worklet::WorkletVisitCellsWithPoints class MeshQuality : public vtkm::worklet::WorkletVisitCellsWithPoints
{ {
public: public:
@ -66,16 +66,13 @@ public:
using ExecutionSignature = void(CellShape, PointCount, _2, _3); using ExecutionSignature = void(CellShape, PointCount, _2, _3);
using InputDomain = _1; using InputDomain = _1;
void SetMetric(MetricTagType m) { this->Metric = m; } void SetMetric(vtkm::filter::mesh_info::CellMetric m) { this->Metric = m; }
void SetAverageArea(vtkm::FloatDefault a) { this->AverageArea = a; }; void SetAverageArea(vtkm::FloatDefault a) { this->AverageArea = a; };
void SetAverageVolume(vtkm::FloatDefault v) { this->AverageVolume = v; }; void SetAverageVolume(vtkm::FloatDefault v) { this->AverageVolume = v; };
template <typename CellShapeType, typename PointCoordVecType, typename OutType> template <typename CellShapeType, typename PointCoordVecType, typename OutType>
VTKM_EXEC void operator()(CellShapeType shape, VTKM_EXEC void operator()(CellShapeType shape,
const vtkm::IdComponent& numPoints, const vtkm::IdComponent& numPoints,
//const CountsArrayType& counts,
//const MetricsArrayType& metrics,
//MetricTagType metric,
const PointCoordVecType& pts, const PointCoordVecType& pts,
OutType& metricValue) const OutType& metricValue) const
{ {
@ -99,7 +96,7 @@ public:
protected: protected:
// data member // data member
MetricTagType Metric; vtkm::filter::mesh_info::CellMetric Metric;
vtkm::FloatDefault AverageArea; vtkm::FloatDefault AverageArea;
vtkm::FloatDefault AverageVolume; vtkm::FloatDefault AverageVolume;
@ -119,92 +116,92 @@ protected:
vtkm::ErrorCode ec{ vtkm::ErrorCode::Success }; vtkm::ErrorCode ec{ vtkm::ErrorCode::Success };
switch (this->Metric) switch (this->Metric)
{ {
case MetricTagType::AREA: case vtkm::filter::mesh_info::CellMetric::AREA:
metricValue = vtkm::exec::CellMeasure<OutType>(numPts, pts, tag, ec); metricValue = vtkm::exec::CellMeasure<OutType>(numPts, pts, tag, ec);
if (dims != 2) if (dims != 2)
metricValue = 0.; metricValue = 0.;
break; break;
case MetricTagType::ASPECT_GAMMA: case vtkm::filter::mesh_info::CellMetric::ASPECT_GAMMA:
metricValue = metricValue =
vtkm::worklet::cellmetrics::CellAspectGammaMetric<OutType>(numPts, pts, tag, ec); vtkm::worklet::cellmetrics::CellAspectGammaMetric<OutType>(numPts, pts, tag, ec);
break; break;
case MetricTagType::ASPECT_RATIO: case vtkm::filter::mesh_info::CellMetric::ASPECT_RATIO:
metricValue = metricValue =
vtkm::worklet::cellmetrics::CellAspectRatioMetric<OutType>(numPts, pts, tag, ec); vtkm::worklet::cellmetrics::CellAspectRatioMetric<OutType>(numPts, pts, tag, ec);
break; break;
case MetricTagType::CONDITION: case vtkm::filter::mesh_info::CellMetric::CONDITION:
metricValue = metricValue =
vtkm::worklet::cellmetrics::CellConditionMetric<OutType>(numPts, pts, tag, ec); vtkm::worklet::cellmetrics::CellConditionMetric<OutType>(numPts, pts, tag, ec);
break; break;
case MetricTagType::DIAGONAL_RATIO: case vtkm::filter::mesh_info::CellMetric::DIAGONAL_RATIO:
metricValue = metricValue =
vtkm::worklet::cellmetrics::CellDiagonalRatioMetric<OutType>(numPts, pts, tag, ec); vtkm::worklet::cellmetrics::CellDiagonalRatioMetric<OutType>(numPts, pts, tag, ec);
break; break;
case MetricTagType::DIMENSION: case vtkm::filter::mesh_info::CellMetric::DIMENSION:
metricValue = metricValue =
vtkm::worklet::cellmetrics::CellDimensionMetric<OutType>(numPts, pts, tag, ec); vtkm::worklet::cellmetrics::CellDimensionMetric<OutType>(numPts, pts, tag, ec);
break; break;
case MetricTagType::JACOBIAN: case vtkm::filter::mesh_info::CellMetric::JACOBIAN:
metricValue = metricValue =
vtkm::worklet::cellmetrics::CellJacobianMetric<OutType>(numPts, pts, tag, ec); vtkm::worklet::cellmetrics::CellJacobianMetric<OutType>(numPts, pts, tag, ec);
break; break;
case MetricTagType::MAX_ANGLE: case vtkm::filter::mesh_info::CellMetric::MAX_ANGLE:
metricValue = metricValue =
vtkm::worklet::cellmetrics::CellMaxAngleMetric<OutType>(numPts, pts, tag, ec); vtkm::worklet::cellmetrics::CellMaxAngleMetric<OutType>(numPts, pts, tag, ec);
break; break;
case MetricTagType::MAX_DIAGONAL: case vtkm::filter::mesh_info::CellMetric::MAX_DIAGONAL:
metricValue = metricValue =
vtkm::worklet::cellmetrics::CellMaxDiagonalMetric<OutType>(numPts, pts, tag, ec); vtkm::worklet::cellmetrics::CellMaxDiagonalMetric<OutType>(numPts, pts, tag, ec);
break; break;
case MetricTagType::MIN_ANGLE: case vtkm::filter::mesh_info::CellMetric::MIN_ANGLE:
metricValue = metricValue =
vtkm::worklet::cellmetrics::CellMinAngleMetric<OutType>(numPts, pts, tag, ec); vtkm::worklet::cellmetrics::CellMinAngleMetric<OutType>(numPts, pts, tag, ec);
break; break;
case MetricTagType::MIN_DIAGONAL: case vtkm::filter::mesh_info::CellMetric::MIN_DIAGONAL:
metricValue = metricValue =
vtkm::worklet::cellmetrics::CellMinDiagonalMetric<OutType>(numPts, pts, tag, ec); vtkm::worklet::cellmetrics::CellMinDiagonalMetric<OutType>(numPts, pts, tag, ec);
break; break;
case MetricTagType::ODDY: case vtkm::filter::mesh_info::CellMetric::ODDY:
metricValue = vtkm::worklet::cellmetrics::CellOddyMetric<OutType>(numPts, pts, tag, ec); metricValue = vtkm::worklet::cellmetrics::CellOddyMetric<OutType>(numPts, pts, tag, ec);
break; break;
case MetricTagType::RELATIVE_SIZE_SQUARED: case vtkm::filter::mesh_info::CellMetric::RELATIVE_SIZE_SQUARED:
metricValue = vtkm::worklet::cellmetrics::CellRelativeSizeSquaredMetric<OutType>( metricValue = vtkm::worklet::cellmetrics::CellRelativeSizeSquaredMetric<OutType>(
numPts, pts, static_cast<OutType>(average), tag, ec); numPts, pts, static_cast<OutType>(average), tag, ec);
break; break;
case MetricTagType::SHAPE_AND_SIZE: case vtkm::filter::mesh_info::CellMetric::SHAPE_AND_SIZE:
metricValue = vtkm::worklet::cellmetrics::CellShapeAndSizeMetric<OutType>( metricValue = vtkm::worklet::cellmetrics::CellShapeAndSizeMetric<OutType>(
numPts, pts, static_cast<OutType>(average), tag, ec); numPts, pts, static_cast<OutType>(average), tag, ec);
break; break;
case MetricTagType::SCALED_JACOBIAN: case vtkm::filter::mesh_info::CellMetric::SCALED_JACOBIAN:
metricValue = metricValue =
vtkm::worklet::cellmetrics::CellScaledJacobianMetric<OutType>(numPts, pts, tag, ec); vtkm::worklet::cellmetrics::CellScaledJacobianMetric<OutType>(numPts, pts, tag, ec);
break; break;
case MetricTagType::SHAPE: case vtkm::filter::mesh_info::CellMetric::SHAPE:
metricValue = vtkm::worklet::cellmetrics::CellShapeMetric<OutType>(numPts, pts, tag, ec); metricValue = vtkm::worklet::cellmetrics::CellShapeMetric<OutType>(numPts, pts, tag, ec);
break; break;
case MetricTagType::SHEAR: case vtkm::filter::mesh_info::CellMetric::SHEAR:
metricValue = vtkm::worklet::cellmetrics::CellShearMetric<OutType>(numPts, pts, tag, ec); metricValue = vtkm::worklet::cellmetrics::CellShearMetric<OutType>(numPts, pts, tag, ec);
break; break;
case MetricTagType::SKEW: case vtkm::filter::mesh_info::CellMetric::SKEW:
metricValue = vtkm::worklet::cellmetrics::CellSkewMetric<OutType>(numPts, pts, tag, ec); metricValue = vtkm::worklet::cellmetrics::CellSkewMetric<OutType>(numPts, pts, tag, ec);
break; break;
case MetricTagType::STRETCH: case vtkm::filter::mesh_info::CellMetric::STRETCH:
metricValue = metricValue =
vtkm::worklet::cellmetrics::CellStretchMetric<OutType>(numPts, pts, tag, ec); vtkm::worklet::cellmetrics::CellStretchMetric<OutType>(numPts, pts, tag, ec);
break; break;
case MetricTagType::TAPER: case vtkm::filter::mesh_info::CellMetric::TAPER:
metricValue = vtkm::worklet::cellmetrics::CellTaperMetric<OutType>(numPts, pts, tag, ec); metricValue = vtkm::worklet::cellmetrics::CellTaperMetric<OutType>(numPts, pts, tag, ec);
break; break;
case MetricTagType::VOLUME: case vtkm::filter::mesh_info::CellMetric::VOLUME:
metricValue = vtkm::exec::CellMeasure<OutType>(numPts, pts, tag, ec); metricValue = vtkm::exec::CellMeasure<OutType>(numPts, pts, tag, ec);
if (dims != 3) if (dims != 3)
metricValue = 0.; metricValue = 0.;
break; break;
case MetricTagType::WARPAGE: case vtkm::filter::mesh_info::CellMetric::WARPAGE:
metricValue = metricValue =
vtkm::worklet::cellmetrics::CellWarpageMetric<OutType>(numPts, pts, tag, ec); vtkm::worklet::cellmetrics::CellWarpageMetric<OutType>(numPts, pts, tag, ec);
break; break;
case MetricTagType::EMPTY: case vtkm::filter::mesh_info::CellMetric::EMPTY:
break; break;
default: default:
//Only call metric function if a metric is specified for this shape type //Only call metric function if a metric is specified for this shape type

@ -35,12 +35,12 @@
* See: vtk/ThirdParty/verdict/vtkverdict (for VTK code implementation of this metric) * See: vtk/ThirdParty/verdict/vtkverdict (for VTK code implementation of this metric)
*/ */
#include "CellAspectFrobeniusMetric.h"
#include "vtkm/CellShape.h" #include "vtkm/CellShape.h"
#include "vtkm/CellTraits.h" #include "vtkm/CellTraits.h"
#include "vtkm/VecTraits.h" #include "vtkm/VecTraits.h"
#include "vtkm/VectorAnalysis.h" #include "vtkm/VectorAnalysis.h"
#include "vtkm/exec/FunctorBase.h" #include "vtkm/exec/FunctorBase.h"
#include "vtkm/worklet/cellmetrics/CellAspectFrobeniusMetric.h"
#define UNUSED(expr) (void)(expr); #define UNUSED(expr) (void)(expr);

@ -31,12 +31,12 @@
* metric) * metric)
*/ */
#include "CellShapeMetric.h"
#include "vtkm/CellShape.h" #include "vtkm/CellShape.h"
#include "vtkm/CellTraits.h" #include "vtkm/CellTraits.h"
#include "vtkm/VecTraits.h" #include "vtkm/VecTraits.h"
#include "vtkm/VectorAnalysis.h" #include "vtkm/VectorAnalysis.h"
#include "vtkm/exec/FunctorBase.h" #include "vtkm/exec/FunctorBase.h"
#include "vtkm/worklet/cellmetrics/CellShapeMetric.h"
#define UNUSED(expr) (void)(expr); #define UNUSED(expr) (void)(expr);

@ -28,6 +28,8 @@
* See: vtk/ThirdParty/verdict/vtkverdict (for VTK code implementation of this metric) * See: vtk/ThirdParty/verdict/vtkverdict (for VTK code implementation of this metric)
*/ */
#include "CellConditionMetric.h"
#include "CellJacobianMetric.h"
#include "TypeOfCellHexahedral.h" #include "TypeOfCellHexahedral.h"
#include "TypeOfCellQuadrilateral.h" #include "TypeOfCellQuadrilateral.h"
#include "TypeOfCellTetrahedral.h" #include "TypeOfCellTetrahedral.h"
@ -37,8 +39,6 @@
#include "vtkm/VecTraits.h" #include "vtkm/VecTraits.h"
#include "vtkm/VectorAnalysis.h" #include "vtkm/VectorAnalysis.h"
#include "vtkm/exec/FunctorBase.h" #include "vtkm/exec/FunctorBase.h"
#include "vtkm/worklet/cellmetrics/CellConditionMetric.h"
#include "vtkm/worklet/cellmetrics/CellJacobianMetric.h"
namespace vtkm namespace vtkm
{ {

@ -22,6 +22,7 @@
/* /*
*/ */
#include "CellConditionMetric.h"
#include "TypeOfCellHexahedral.h" #include "TypeOfCellHexahedral.h"
#include "TypeOfCellQuadrilateral.h" #include "TypeOfCellQuadrilateral.h"
#include "TypeOfCellTetrahedral.h" #include "TypeOfCellTetrahedral.h"
@ -31,7 +32,6 @@
#include "vtkm/VecTraits.h" #include "vtkm/VecTraits.h"
#include "vtkm/VectorAnalysis.h" #include "vtkm/VectorAnalysis.h"
#include "vtkm/exec/FunctorBase.h" #include "vtkm/exec/FunctorBase.h"
#include "vtkm/worklet/cellmetrics/CellConditionMetric.h"
namespace vtkm namespace vtkm
{ {

@ -13,20 +13,17 @@ set(headers
) )
set(unit_tests set(unit_tests
UnitTestCellMeasuresFilter.cxx
UnitTestContourTreeUniformFilter.cxx UnitTestContourTreeUniformFilter.cxx
UnitTestContourTreeUniformAugmentedFilter.cxx UnitTestContourTreeUniformAugmentedFilter.cxx
UnitTestContourTreeUniformDistributedFilter.cxx UnitTestContourTreeUniformDistributedFilter.cxx
UnitTestFieldMetadata.cxx UnitTestFieldMetadata.cxx
UnitTestFieldSelection.cxx UnitTestFieldSelection.cxx
UnitTestGhostCellClassify.cxx
UnitTestImageDifferenceFilter.cxx UnitTestImageDifferenceFilter.cxx
UnitTestImageMedianFilter.cxx UnitTestImageMedianFilter.cxx
UnitTestLagrangianFilter.cxx UnitTestLagrangianFilter.cxx
UnitTestLagrangianStructuresFilter.cxx UnitTestLagrangianStructuresFilter.cxx
UnitTestMapFieldMergeAverage.cxx UnitTestMapFieldMergeAverage.cxx
UnitTestMapFieldPermutation.cxx UnitTestMapFieldPermutation.cxx
UnitTestMeshQualityFilter.cxx
UnitTestMIRFilter.cxx UnitTestMIRFilter.cxx
UnitTestMultiBlockFilter.cxx UnitTestMultiBlockFilter.cxx
UnitTestPartitionedDataSetFilters.cxx UnitTestPartitionedDataSetFilters.cxx

@ -13,7 +13,6 @@ set(headers
BoundaryTypes.h BoundaryTypes.h
AveragePointNeighborhood.h AveragePointNeighborhood.h
CellDeepCopy.h CellDeepCopy.h
CellMeasure.h
ContourTreeUniform.h ContourTreeUniform.h
ContourTreeUniformAugmented.h ContourTreeUniformAugmented.h
CosmoTools.h CosmoTools.h
@ -31,7 +30,6 @@ set(headers
MaskIndices.h MaskIndices.h
MaskNone.h MaskNone.h
MaskSelect.h MaskSelect.h
MeshQuality.h
MIR.h MIR.h
NDimsHistMarginalization.h NDimsHistMarginalization.h
Normalize.h Normalize.h
@ -91,7 +89,6 @@ set(sources_device
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
add_subdirectory(internal) add_subdirectory(internal)
add_subdirectory(cellmetrics)
add_subdirectory(colorconversion) add_subdirectory(colorconversion)
add_subdirectory(contourtree) add_subdirectory(contourtree)
add_subdirectory(contourtree_augmented) add_subdirectory(contourtree_augmented)

@ -17,7 +17,6 @@ set(unit_tests
UnitTestAverageByKey.cxx UnitTestAverageByKey.cxx
UnitTestBoundingIntervalHierarchy.cxx UnitTestBoundingIntervalHierarchy.cxx
UnitTestCellDeepCopy.cxx UnitTestCellDeepCopy.cxx
UnitTestCellMeasure.cxx
UnitTestContourTreeUniform.cxx UnitTestContourTreeUniform.cxx
UnitTestContourTreeUniformAugmented.cxx UnitTestContourTreeUniformAugmented.cxx
UnitTestContourTreeUniformDistributed.cxx UnitTestContourTreeUniformDistributed.cxx

@ -11,7 +11,7 @@
#include <vtkm/cont/DataSetBuilderExplicit.h> #include <vtkm/cont/DataSetBuilderExplicit.h>
#include <vtkm/cont/DataSetBuilderRectilinear.h> #include <vtkm/cont/DataSetBuilderRectilinear.h>
#include <vtkm/cont/DataSetBuilderUniform.h> #include <vtkm/cont/DataSetBuilderUniform.h>
#include <vtkm/filter/GhostCellClassify.h> #include <vtkm/filter/mesh_info/GhostCellClassify.h>
namespace vtkm namespace vtkm
{ {
@ -46,7 +46,7 @@ inline vtkm::cont::DataSet CreateUniformDataSet(const vtkm::Bounds& bounds,
if (addGhost) if (addGhost)
{ {
vtkm::filter::GhostCellClassify addGhostFilter; vtkm::filter::mesh_info::GhostCellClassify addGhostFilter;
return addGhostFilter.Execute(ds); return addGhostFilter.Execute(ds);
} }
return ds; return ds;
@ -84,7 +84,7 @@ inline vtkm::cont::DataSet CreateRectilinearDataSet(const vtkm::Bounds& bounds,
if (addGhost) if (addGhost)
{ {
vtkm::filter::GhostCellClassify addGhostFilter; vtkm::filter::mesh_info::GhostCellClassify addGhostFilter;
return addGhostFilter.Execute(ds); return addGhostFilter.Execute(ds);
} }
return ds; return ds;

@ -1,118 +0,0 @@
//============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
//
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//============================================================================
#include <vtkm/worklet/CellMeasure.h>
#include <vtkm/worklet/DispatcherMapTopology.h>
#include <vtkm/cont/testing/MakeTestDataSet.h>
#include <vtkm/cont/testing/Testing.h>
namespace
{
void TestCellMeasureUniform3D()
{
std::cout << "Testing CellMeasure Worklet on 3D structured data" << std::endl;
vtkm::cont::testing::MakeTestDataSet testDataSet;
vtkm::cont::DataSet dataSet = testDataSet.Make3DUniformDataSet0();
vtkm::cont::ArrayHandle<vtkm::FloatDefault> result;
vtkm::worklet::DispatcherMapTopology<vtkm::worklet::CellMeasure<vtkm::Volume>> dispatcher;
dispatcher.Invoke(
dataSet.GetCellSet(), dataSet.GetCoordinateSystem().GetDataAsMultiplexer(), result);
vtkm::Float32 expected[4] = { 1.f, 1.f, 1.f, 1.f };
for (int i = 0; i < 4; ++i)
{
VTKM_TEST_ASSERT(test_equal(result.ReadPortal().Get(vtkm::Id(i)), expected[i]),
"Wrong result for CellMeasure worklet on 3D uniform data");
}
}
template <typename IntegrationType>
void TestCellMeasureWorklet(vtkm::cont::DataSet& dataset,
const char* msg,
const std::vector<vtkm::Float32>& expected,
const IntegrationType&)
{
std::cout << "Testing CellMeasures Filter on " << msg << "\n";
vtkm::cont::ArrayHandle<vtkm::FloatDefault> result;
vtkm::worklet::DispatcherMapTopology<vtkm::worklet::CellMeasure<IntegrationType>> dispatcher;
dispatcher.Invoke(
dataset.GetCellSet(), dataset.GetCoordinateSystem().GetDataAsMultiplexer(), result);
VTKM_TEST_ASSERT(result.GetNumberOfValues() == static_cast<vtkm::Id>(expected.size()),
"Wrong number of values in the output array");
for (unsigned int i = 0; i < static_cast<unsigned int>(expected.size()); ++i)
{
VTKM_TEST_ASSERT(test_equal(result.ReadPortal().Get(vtkm::Id(i)), expected[i]),
"Wrong result for CellMeasure filter");
}
}
void TestCellMeasure()
{
using vtkm::AllMeasures;
using vtkm::ArcLength;
using vtkm::Area;
using vtkm::Volume;
TestCellMeasureUniform3D();
vtkm::cont::testing::MakeTestDataSet factory;
vtkm::cont::DataSet data;
data = factory.Make3DExplicitDataSet2();
TestCellMeasureWorklet(data, "explicit dataset 2", { -1.f }, Volume());
data = factory.Make3DExplicitDataSet3();
TestCellMeasureWorklet(data, "explicit dataset 3", { -1.f / 6.f }, Volume());
data = factory.Make3DExplicitDataSet4();
TestCellMeasureWorklet(data, "explicit dataset 4", { -1.f, -1.f }, Volume());
data = factory.Make3DExplicitDataSet5();
TestCellMeasureWorklet(
data, "explicit dataset 5", { 1.f, 1.f / 3.f, 1.f / 6.f, -1.f / 2.f }, Volume());
data = factory.Make3DExplicitDataSet6();
TestCellMeasureWorklet(
data,
"explicit dataset 6 (all)",
{ 0.999924f, 0.999924f, 0.f, 0.f, 3.85516f, 1.00119f, 0.083426f, 0.25028f },
AllMeasures());
TestCellMeasureWorklet(data,
"explicit dataset 6 (arc length)",
{ 0.999924f, 0.999924f, 0.f, 0.f, 0.0f, 0.0f, 0.0f, 0.0f },
ArcLength());
TestCellMeasureWorklet(data,
"explicit dataset 6 (area)",
{ 0.0f, 0.0f, 0.f, 0.f, 3.85516f, 1.00119f, 0.0f, 0.0f },
Area());
TestCellMeasureWorklet(data,
"explicit dataset 6 (volume)",
{ 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.083426f, 0.25028f },
Volume());
TestCellMeasureWorklet(data,
"explicit dataset 6 (empty)",
{ 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.0f, 0.0f },
vtkm::List<>());
}
}
int UnitTestCellMeasure(int argc, char* argv[])
{
return vtkm::cont::testing::Testing::Run(TestCellMeasure, argc, argv);
}

@ -13,7 +13,7 @@
#include <vtkm/cont/ArrayHandle.h> #include <vtkm/cont/ArrayHandle.h>
#include <vtkm/cont/DataSet.h> #include <vtkm/cont/DataSet.h>
#include <vtkm/cont/testing/Testing.h> #include <vtkm/cont/testing/Testing.h>
#include <vtkm/filter/GhostCellClassify.h> #include <vtkm/filter/mesh_info/GhostCellClassify.h>
#include <vtkm/io/VTKDataSetReader.h> #include <vtkm/io/VTKDataSetReader.h>
#include <vtkm/worklet/ParticleAdvection.h> #include <vtkm/worklet/ParticleAdvection.h>
#include <vtkm/worklet/particleadvection/EulerIntegrator.h> #include <vtkm/worklet/particleadvection/EulerIntegrator.h>