Make CellClassification more clear

Previously, the CellClassification enum was stored in a header file
named GhostCell.h, which made it hard to find and obscured its purpose.
Moved it to an appropriately named file. Also, renamed the DUPLICATE
field to GHOST to make its intention more clear.
This commit is contained in:
Kenneth Moreland 2019-03-21 15:00:09 -06:00
parent 7fdc01a520
commit b81b2f817f
5 changed files with 14 additions and 14 deletions

@ -33,11 +33,11 @@ set(headers
BinaryOperators.h
Bitset.h
Bounds.h
CellClassification.h
CellShape.h
CellTraits.h
Flags.h
Geometry.h
GhostCell.h
Hash.h
ImplicitFunction.h
ListTag.h

@ -17,17 +17,17 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtk_m_Ghost_Cell_h
#define vtk_m_Ghost_Cell_h
#ifndef vtk_m_CellClassification_h
#define vtk_m_CellClassification_h
namespace vtkm
{
enum struct CellClassification
{
NORMAL = 0, //Valid cell
DUPLICATE = 1 << 0, //Ghost cell
INVALID = 1 << 1, //Cell is invalid
NORMAL = 0, //Valid cell
GHOST = 1 << 0, //Ghost cell
INVALID = 1 << 1, //Cell is invalid
UNUSED0 = 1 << 2,
UNUSED1 = 1 << 3,
UNUSED3 = 1 << 4,
@ -36,4 +36,4 @@ enum struct CellClassification
};
}
#endif // vtk_m_Ghost_Cell_h
#endif // vtk_m_CellClassification_h

@ -18,7 +18,7 @@
// this software.
//============================================================================
#include <vtkm/GhostCell.h>
#include <vtkm/CellClassification.h>
#include <vtkm/RangeId.h>
#include <vtkm/RangeId2.h>
#include <vtkm/RangeId3.h>
@ -62,7 +62,7 @@ private:
static constexpr vtkm::UInt8 NormalCell =
static_cast<vtkm::UInt8>(vtkm::CellClassification::NORMAL);
static constexpr vtkm::UInt8 DuplicateCell =
static_cast<vtkm::UInt8>(vtkm::CellClassification::DUPLICATE);
static_cast<vtkm::UInt8>(vtkm::CellClassification::GHOST);
};
class SetStructuredGhostZones2D : public vtkm::worklet::WorkletMapField
@ -93,7 +93,7 @@ private:
static constexpr vtkm::UInt8 NormalCell =
static_cast<vtkm::UInt8>(vtkm::CellClassification::NORMAL);
static constexpr vtkm::UInt8 DuplicateCell =
static_cast<vtkm::UInt8>(vtkm::CellClassification::DUPLICATE);
static_cast<vtkm::UInt8>(vtkm::CellClassification::GHOST);
};
class SetStructuredGhostZones3D : public vtkm::worklet::WorkletMapField
@ -130,7 +130,7 @@ private:
static constexpr vtkm::UInt8 NormalCell =
static_cast<vtkm::UInt8>(vtkm::CellClassification::NORMAL);
static constexpr vtkm::UInt8 DuplicateCell =
static_cast<vtkm::UInt8>(vtkm::CellClassification::DUPLICATE);
static_cast<vtkm::UInt8>(vtkm::CellClassification::GHOST);
};
};

@ -21,7 +21,7 @@
#ifndef vtk_m_filter_GhostZone_h
#define vtk_m_filter_GhostZone_h
#include <vtkm/GhostCell.h>
#include <vtkm/CellClassification.h>
#include <vtkm/filter/FilterDataSetWithField.h>
#include <vtkm/filter/Threshold.h>

@ -44,7 +44,7 @@ static vtkm::cont::ArrayHandle<vtkm::UInt8> StructuredGhostZoneArray(vtkm::Id nx
numCells *= nz;
vtkm::UInt8 normalCell = static_cast<vtkm::UInt8>(vtkm::CellClassification::NORMAL);
vtkm::UInt8 duplicateCell = static_cast<vtkm::UInt8>(vtkm::CellClassification::DUPLICATE);
vtkm::UInt8 duplicateCell = static_cast<vtkm::UInt8>(vtkm::CellClassification::GHOST);
vtkm::cont::ArrayHandle<vtkm::UInt8> ghosts;
ghosts.Allocate(numCells);
@ -272,7 +272,7 @@ void TestGhostZone()
ghostZoneRemoval.RemoveAllGhost();
else if (rt == "byType")
ghostZoneRemoval.RemoveByType(
static_cast<vtkm::UInt8>(vtkm::CellClassification::DUPLICATE));
static_cast<vtkm::UInt8>(vtkm::CellClassification::GHOST));
std::vector<std::string> outputType = { "permutation", "explicit" };
for (auto& ot : outputType)