2015-02-04 22:40:31 +00:00
|
|
|
//============================================================================
|
|
|
|
// 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 Sandia Corporation.
|
|
|
|
// Copyright 2014 UT-Battelle, LLC.
|
2015-06-03 19:06:43 +00:00
|
|
|
// Copyright 2014 Los Alamos National Security.
|
2015-02-04 22:40:31 +00:00
|
|
|
//
|
|
|
|
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
|
|
|
|
// 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.
|
|
|
|
//============================================================================
|
2015-08-03 16:06:59 +00:00
|
|
|
#ifndef vtk_m_exec_arg_CellShape_h
|
|
|
|
#define vtk_m_exec_arg_CellShape_h
|
2015-02-04 22:40:31 +00:00
|
|
|
|
|
|
|
#include <vtkm/exec/arg/Fetch.h>
|
|
|
|
#include <vtkm/exec/arg/ExecutionSignatureTagBase.h>
|
2015-10-07 18:14:00 +00:00
|
|
|
#include <vtkm/exec/arg/ThreadIndicesTopologyMap.h>
|
2015-02-04 22:40:31 +00:00
|
|
|
|
|
|
|
namespace vtkm {
|
|
|
|
namespace exec {
|
|
|
|
namespace arg {
|
|
|
|
|
2015-08-03 16:06:59 +00:00
|
|
|
/// \brief Aspect tag to use for getting the cell shape.
|
2015-02-04 22:40:31 +00:00
|
|
|
///
|
2015-08-03 16:06:59 +00:00
|
|
|
/// The \c AspectTagCellShape aspect tag causes the \c Fetch class to
|
|
|
|
/// obtain the type of element (e.g. cell cell) from the topology object.
|
2015-02-04 22:40:31 +00:00
|
|
|
///
|
2015-08-03 16:06:59 +00:00
|
|
|
struct AspectTagCellShape { };
|
2015-02-04 22:40:31 +00:00
|
|
|
|
2015-08-03 16:06:59 +00:00
|
|
|
/// \brief The \c ExecutionSignature tag to use to get the cell shape.
|
2015-02-04 22:40:31 +00:00
|
|
|
///
|
2015-08-03 16:06:59 +00:00
|
|
|
struct CellShape : vtkm::exec::arg::ExecutionSignatureTagBase
|
2015-02-04 22:40:31 +00:00
|
|
|
{
|
|
|
|
static const vtkm::IdComponent INDEX = 1;
|
2015-08-03 16:06:59 +00:00
|
|
|
typedef vtkm::exec::arg::AspectTagCellShape AspectTag;
|
2015-02-04 22:40:31 +00:00
|
|
|
};
|
|
|
|
|
2015-08-19 16:32:01 +00:00
|
|
|
template<typename FetchTag,
|
2015-10-07 18:14:00 +00:00
|
|
|
typename ConnectivityType,
|
|
|
|
typename ExecObjectType>
|
|
|
|
struct Fetch<FetchTag,
|
|
|
|
vtkm::exec::arg::AspectTagCellShape,
|
|
|
|
vtkm::exec::arg::ThreadIndicesTopologyMap<ConnectivityType>,
|
|
|
|
ExecObjectType>
|
2015-02-04 22:40:31 +00:00
|
|
|
{
|
2015-10-07 18:14:00 +00:00
|
|
|
typedef vtkm::exec::arg::ThreadIndicesTopologyMap<ConnectivityType>
|
|
|
|
ThreadIndicesType;
|
2015-02-04 22:40:31 +00:00
|
|
|
|
2015-10-07 18:14:00 +00:00
|
|
|
typedef typename ThreadIndicesType::CellShapeTag ValueType;
|
2015-02-04 22:40:31 +00:00
|
|
|
|
2015-09-24 14:39:48 +00:00
|
|
|
VTKM_SUPPRESS_EXEC_WARNINGS
|
2016-10-19 22:42:58 +00:00
|
|
|
VTKM_EXEC
|
2015-10-07 18:14:00 +00:00
|
|
|
ValueType Load(const ThreadIndicesType &indices, const ExecObjectType &) const
|
2015-08-19 16:32:01 +00:00
|
|
|
{
|
2015-10-07 18:14:00 +00:00
|
|
|
return indices.GetCellShape();
|
2015-02-04 22:40:31 +00:00
|
|
|
}
|
|
|
|
|
2016-10-19 22:42:58 +00:00
|
|
|
VTKM_EXEC
|
2015-10-07 18:14:00 +00:00
|
|
|
void Store(const ThreadIndicesType &,
|
|
|
|
const ExecObjectType &,
|
|
|
|
const ValueType &) const
|
2015-02-04 22:40:31 +00:00
|
|
|
{
|
|
|
|
// Store is a no-op.
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} // namespace vtkm::exec::arg
|
|
|
|
|
2015-08-03 16:06:59 +00:00
|
|
|
#endif //vtk_m_exec_arg_CellShape_h
|