2015-02-04 22:40:31 +00:00
|
|
|
//============================================================================
|
|
|
|
// Copyright (c) Kitware, Inc.
|
|
|
|
// All rights reserved.
|
|
|
|
// See LICENSE.txt for details.
|
2019-04-15 23:24:21 +00:00
|
|
|
//
|
2015-02-04 22:40:31 +00:00
|
|
|
// 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.
|
|
|
|
//============================================================================
|
2019-07-30 16:53:51 +00:00
|
|
|
#ifndef vtk_m_exec_arg_IncidentElementCount_h
|
|
|
|
#define vtk_m_exec_arg_IncidentElementCount_h
|
2015-02-04 22:40:31 +00:00
|
|
|
|
|
|
|
#include <vtkm/exec/arg/ExecutionSignatureTagBase.h>
|
2017-05-18 14:51:24 +00:00
|
|
|
#include <vtkm/exec/arg/Fetch.h>
|
2015-02-04 22:40:31 +00:00
|
|
|
|
2017-05-18 14:29:41 +00:00
|
|
|
namespace vtkm
|
|
|
|
{
|
|
|
|
namespace exec
|
|
|
|
{
|
|
|
|
namespace arg
|
|
|
|
{
|
2015-02-04 22:40:31 +00:00
|
|
|
|
2019-07-30 16:53:51 +00:00
|
|
|
/// \brief Aspect tag to use for getting the incident element count.
|
2015-02-04 22:40:31 +00:00
|
|
|
///
|
2019-07-30 16:53:51 +00:00
|
|
|
/// The \c AspectTagIncidentElementCount aspect tag causes the \c Fetch class to
|
|
|
|
/// obtain the number of indices that map to the current topology element.
|
2015-02-04 22:40:31 +00:00
|
|
|
///
|
2019-07-30 16:53:51 +00:00
|
|
|
struct AspectTagIncidentElementCount
|
2017-05-18 14:29:41 +00:00
|
|
|
{
|
|
|
|
};
|
2015-02-04 22:40:31 +00:00
|
|
|
|
2019-07-30 16:53:51 +00:00
|
|
|
/// \brief The \c ExecutionSignature tag to get the number of incident elements.
|
2015-02-04 22:40:31 +00:00
|
|
|
///
|
2019-07-30 16:53:51 +00:00
|
|
|
/// In a topology map, there are \em visited and \em incident topology elements
|
|
|
|
/// specified. The scheduling occurs on the \em visited elements, and for each
|
|
|
|
/// \em visited element there is some number of incident \em incident elements
|
|
|
|
/// that are accessible. This \c ExecutionSignature tag provides the number of
|
|
|
|
/// these \em incident elements that are accessible.
|
2015-08-03 16:06:59 +00:00
|
|
|
///
|
2019-07-30 16:53:51 +00:00
|
|
|
struct IncidentElementCount : vtkm::exec::arg::ExecutionSignatureTagBase
|
2015-02-04 22:40:31 +00:00
|
|
|
{
|
2018-02-27 14:25:25 +00:00
|
|
|
static constexpr vtkm::IdComponent INDEX = 1;
|
2019-07-30 16:53:51 +00:00
|
|
|
using AspectTag = vtkm::exec::arg::AspectTagIncidentElementCount;
|
2015-02-04 22:40:31 +00:00
|
|
|
};
|
|
|
|
|
2020-04-14 15:00:46 +00:00
|
|
|
template <typename FetchTag, typename ExecObjectType>
|
|
|
|
struct Fetch<FetchTag, vtkm::exec::arg::AspectTagIncidentElementCount, ExecObjectType>
|
2015-02-04 22:40:31 +00:00
|
|
|
{
|
2017-08-16 15:34:21 +00:00
|
|
|
using ValueType = vtkm::IdComponent;
|
2015-02-04 22:40:31 +00:00
|
|
|
|
2015-09-24 14:39:48 +00:00
|
|
|
VTKM_SUPPRESS_EXEC_WARNINGS
|
2020-04-14 15:00:46 +00:00
|
|
|
template <typename ThreadIndicesType>
|
|
|
|
VTKM_EXEC ValueType Load(const ThreadIndicesType& indices, const ExecObjectType&) const
|
2015-02-04 22:40:31 +00:00
|
|
|
{
|
2019-07-30 16:53:51 +00:00
|
|
|
return indices.GetIndicesIncident().GetNumberOfComponents();
|
2015-02-04 22:40:31 +00:00
|
|
|
}
|
|
|
|
|
2020-04-14 15:00:46 +00:00
|
|
|
template <typename ThreadIndicesType>
|
|
|
|
VTKM_EXEC 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
|
|
|
|
|
2019-07-30 16:53:51 +00:00
|
|
|
#endif //vtk_m_exec_arg_IncidentElementCount_h
|