2014-10-15 21:47:39 +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-05-21 12:09:22 +00:00
|
|
|
// Copyright 2014 Los Alamos National Security.
|
2014-10-15 21:47:39 +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.
|
|
|
|
//============================================================================
|
|
|
|
#ifndef vtk_m_worklet_WorkletMapField_h
|
|
|
|
#define vtk_m_worklet_WorkletMapField_h
|
|
|
|
|
|
|
|
#include <vtkm/worklet/internal/WorkletBase.h>
|
|
|
|
|
2014-10-22 22:51:42 +00:00
|
|
|
#include <vtkm/TypeListTag.h>
|
|
|
|
|
2014-10-23 14:28:50 +00:00
|
|
|
#include <vtkm/cont/arg/ControlSignatureTagBase.h>
|
2014-10-15 21:47:39 +00:00
|
|
|
#include <vtkm/cont/arg/TransportTagArrayIn.h>
|
2015-08-12 18:58:53 +00:00
|
|
|
#include <vtkm/cont/arg/TransportTagArrayInOut.h>
|
2014-10-15 21:47:39 +00:00
|
|
|
#include <vtkm/cont/arg/TransportTagArrayOut.h>
|
2014-10-22 21:15:14 +00:00
|
|
|
#include <vtkm/cont/arg/TypeCheckTagArray.h>
|
2014-10-15 21:47:39 +00:00
|
|
|
|
|
|
|
#include <vtkm/exec/arg/FetchTagArrayDirectIn.h>
|
2015-08-12 18:58:53 +00:00
|
|
|
#include <vtkm/exec/arg/FetchTagArrayDirectInOut.h>
|
2014-10-15 21:47:39 +00:00
|
|
|
#include <vtkm/exec/arg/FetchTagArrayDirectOut.h>
|
|
|
|
|
|
|
|
namespace vtkm {
|
|
|
|
namespace worklet {
|
|
|
|
|
|
|
|
/// Base class for worklets that do a simple mapping of field arrays. All
|
|
|
|
/// inputs and outputs are on the same domain. That is, all the arrays are the
|
|
|
|
/// same size.
|
|
|
|
///
|
|
|
|
class WorkletMapField : public vtkm::worklet::internal::WorkletBase
|
|
|
|
{
|
|
|
|
public:
|
2014-10-22 22:51:42 +00:00
|
|
|
/// \brief A control signature tag for input fields.
|
|
|
|
///
|
|
|
|
/// This tag takes a template argument that is a type list tag that limits
|
|
|
|
/// the possible value types in the array.
|
|
|
|
///
|
|
|
|
template<typename TypeList = AllTypes>
|
2014-10-23 14:28:50 +00:00
|
|
|
struct FieldIn : vtkm::cont::arg::ControlSignatureTagBase {
|
2014-10-22 22:51:42 +00:00
|
|
|
typedef vtkm::cont::arg::TypeCheckTagArray<TypeList> TypeCheckTag;
|
2014-10-15 21:47:39 +00:00
|
|
|
typedef vtkm::cont::arg::TransportTagArrayIn TransportTag;
|
|
|
|
typedef vtkm::exec::arg::FetchTagArrayDirectIn FetchTag;
|
|
|
|
};
|
|
|
|
|
2014-10-22 22:51:42 +00:00
|
|
|
/// \brief A control signature tag for output fields.
|
|
|
|
///
|
|
|
|
/// This tag takes a template argument that is a type list tag that limits
|
|
|
|
/// the possible value types in the array.
|
|
|
|
///
|
|
|
|
template<typename TypeList = AllTypes>
|
2014-10-23 14:28:50 +00:00
|
|
|
struct FieldOut : vtkm::cont::arg::ControlSignatureTagBase {
|
2014-10-22 22:51:42 +00:00
|
|
|
typedef vtkm::cont::arg::TypeCheckTagArray<TypeList> TypeCheckTag;
|
2014-10-15 21:47:39 +00:00
|
|
|
typedef vtkm::cont::arg::TransportTagArrayOut TransportTag;
|
|
|
|
typedef vtkm::exec::arg::FetchTagArrayDirectOut FetchTag;
|
|
|
|
};
|
2015-08-12 18:58:53 +00:00
|
|
|
|
|
|
|
/// \brief A control signature tag for input-output (in-place) fields.
|
|
|
|
///
|
|
|
|
/// This tag takes a template argument that is a type list tag that limits
|
|
|
|
/// the possible value types in the array.
|
|
|
|
///
|
|
|
|
template<typename TypeList = AllTypes>
|
|
|
|
struct FieldInOut : vtkm::cont::arg::ControlSignatureTagBase {
|
|
|
|
typedef vtkm::cont::arg::TypeCheckTagArray<TypeList> TypeCheckTag;
|
|
|
|
typedef vtkm::cont::arg::TransportTagArrayInOut TransportTag;
|
|
|
|
typedef vtkm::exec::arg::FetchTagArrayDirectInOut FetchTag;
|
|
|
|
};
|
2014-10-15 21:47:39 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
} // namespace vtkm::worklet
|
|
|
|
|
|
|
|
#endif //vtk_m_worklet_WorkletMapField_h
|