2015-06-03 19:06:43 +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.
|
|
|
|
//
|
2017-09-20 21:33:44 +00:00
|
|
|
// Copyright 2015 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
|
2015-06-03 19:06:43 +00:00
|
|
|
// Copyright 2015 UT-Battelle, LLC.
|
|
|
|
// Copyright 2015 Los Alamos National Security.
|
|
|
|
//
|
2017-09-20 21:33:44 +00:00
|
|
|
// Under the terms of Contract DE-NA0003525 with NTESS,
|
2015-06-03 19:06:43 +00:00
|
|
|
// 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-04-15 16:43:12 +00:00
|
|
|
#ifndef vtk_m_cont_CellSetStructured_h
|
|
|
|
#define vtk_m_cont_CellSetStructured_h
|
|
|
|
|
2016-12-16 22:04:58 +00:00
|
|
|
#include <vtkm/cont/vtkm_cont_export.h>
|
|
|
|
|
2017-05-18 14:51:24 +00:00
|
|
|
#include <vtkm/TopologyElementTag.h>
|
2015-04-15 16:43:12 +00:00
|
|
|
#include <vtkm/cont/CellSet.h>
|
2015-08-02 21:59:44 +00:00
|
|
|
#include <vtkm/cont/DeviceAdapter.h>
|
|
|
|
#include <vtkm/exec/ConnectivityStructured.h>
|
2017-05-18 14:51:24 +00:00
|
|
|
#include <vtkm/internal/ConnectivityStructuredInternals.h>
|
2015-04-15 16:43:12 +00:00
|
|
|
|
2017-05-18 14:29:41 +00:00
|
|
|
namespace vtkm
|
|
|
|
{
|
|
|
|
namespace cont
|
|
|
|
{
|
2015-04-15 16:43:12 +00:00
|
|
|
|
2017-05-18 14:29:41 +00:00
|
|
|
template <vtkm::IdComponent DIMENSION>
|
2017-03-01 22:11:23 +00:00
|
|
|
class VTKM_ALWAYS_EXPORT CellSetStructured : public CellSet
|
2015-04-15 16:43:12 +00:00
|
|
|
{
|
2015-08-02 21:59:44 +00:00
|
|
|
private:
|
2017-08-16 15:34:21 +00:00
|
|
|
using Thisclass = vtkm::cont::CellSetStructured<DIMENSION>;
|
|
|
|
using InternalsType = vtkm::internal::ConnectivityStructuredInternals<DIMENSION>;
|
2015-08-02 21:59:44 +00:00
|
|
|
|
2015-05-15 17:15:11 +00:00
|
|
|
public:
|
2017-05-18 14:29:41 +00:00
|
|
|
static const vtkm::IdComponent Dimension = DIMENSION;
|
2015-05-12 18:57:18 +00:00
|
|
|
|
2017-08-16 15:34:21 +00:00
|
|
|
using SchedulingRangeType = typename InternalsType::SchedulingRangeType;
|
2015-08-02 21:59:44 +00:00
|
|
|
|
2017-05-18 14:29:41 +00:00
|
|
|
CellSetStructured(const std::string& name = std::string())
|
|
|
|
: CellSet(name)
|
|
|
|
, Structure()
|
2015-05-12 18:57:18 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2017-05-18 14:29:41 +00:00
|
|
|
CellSetStructured(const Thisclass& src);
|
2015-10-21 22:27:09 +00:00
|
|
|
|
2017-05-18 14:29:41 +00:00
|
|
|
Thisclass& operator=(const Thisclass& src);
|
2015-05-12 18:57:18 +00:00
|
|
|
|
2017-05-18 14:29:41 +00:00
|
|
|
virtual vtkm::Id GetNumberOfCells() const { return this->Structure.GetNumberOfCells(); }
|
2015-05-12 18:57:18 +00:00
|
|
|
|
2017-05-18 14:29:41 +00:00
|
|
|
virtual vtkm::Id GetNumberOfPoints() const { return this->Structure.GetNumberOfPoints(); }
|
2015-08-02 21:59:44 +00:00
|
|
|
|
2016-12-16 22:04:58 +00:00
|
|
|
virtual vtkm::Id GetNumberOfFaces() const { return -1; }
|
|
|
|
|
|
|
|
virtual vtkm::Id GetNumberOfEdges() const { return -1; }
|
|
|
|
|
2015-08-02 21:59:44 +00:00
|
|
|
void SetPointDimensions(SchedulingRangeType dimensions)
|
|
|
|
{
|
|
|
|
this->Structure.SetPointDimensions(dimensions);
|
|
|
|
}
|
2015-07-28 23:33:52 +00:00
|
|
|
|
2017-05-23 19:13:30 +00:00
|
|
|
SchedulingRangeType GetPointDimensions() const { return this->Structure.GetPointDimensions(); }
|
2015-10-22 21:18:33 +00:00
|
|
|
|
2017-05-23 19:13:30 +00:00
|
|
|
SchedulingRangeType GetCellDimensions() const { return this->Structure.GetCellDimensions(); }
|
2016-01-20 16:24:31 +00:00
|
|
|
|
2017-05-18 14:29:41 +00:00
|
|
|
vtkm::IdComponent GetNumberOfPointsInCell(vtkm::Id vtkmNotUsed(cellIndex) = 0) const
|
2015-05-15 17:15:11 +00:00
|
|
|
{
|
2015-08-03 16:06:59 +00:00
|
|
|
return this->Structure.GetNumberOfPointsInCell();
|
2015-05-18 15:04:15 +00:00
|
|
|
}
|
|
|
|
|
2017-05-18 14:29:41 +00:00
|
|
|
vtkm::IdComponent GetCellShape() const { return this->Structure.GetCellShape(); }
|
2015-08-02 21:59:44 +00:00
|
|
|
|
2017-05-18 14:29:41 +00:00
|
|
|
template <typename TopologyElement>
|
2016-12-16 22:04:58 +00:00
|
|
|
SchedulingRangeType GetSchedulingRange(TopologyElement) const;
|
2015-08-02 21:59:44 +00:00
|
|
|
|
2017-05-18 14:29:41 +00:00
|
|
|
template <typename DeviceAdapter, typename FromTopology, typename ToTopology>
|
|
|
|
struct ExecutionTypes
|
|
|
|
{
|
2015-08-02 21:59:44 +00:00
|
|
|
VTKM_IS_DEVICE_ADAPTER_TAG(DeviceAdapter);
|
|
|
|
VTKM_IS_TOPOLOGY_ELEMENT_TAG(FromTopology);
|
|
|
|
VTKM_IS_TOPOLOGY_ELEMENT_TAG(ToTopology);
|
2017-08-16 15:34:21 +00:00
|
|
|
using ExecObjectType = vtkm::exec::ConnectivityStructured<FromTopology, ToTopology, Dimension>;
|
2015-08-02 21:59:44 +00:00
|
|
|
};
|
|
|
|
|
2017-05-18 14:29:41 +00:00
|
|
|
template <typename DeviceAdapter, typename FromTopology, typename ToTopology>
|
2017-05-26 17:53:28 +00:00
|
|
|
typename ExecutionTypes<DeviceAdapter, FromTopology, ToTopology>::ExecObjectType
|
|
|
|
PrepareForInput(DeviceAdapter, FromTopology, ToTopology) const;
|
2015-05-15 17:15:11 +00:00
|
|
|
|
2017-05-18 14:29:41 +00:00
|
|
|
virtual void PrintSummary(std::ostream& out) const;
|
2015-05-20 19:26:10 +00:00
|
|
|
|
2015-08-02 21:59:44 +00:00
|
|
|
private:
|
|
|
|
InternalsType Structure;
|
2015-04-15 16:43:12 +00:00
|
|
|
};
|
|
|
|
|
2016-12-16 22:04:58 +00:00
|
|
|
#ifndef vtkm_cont_CellSetStructured_cxx
|
|
|
|
extern template class VTKM_CONT_TEMPLATE_EXPORT CellSetStructured<1>;
|
|
|
|
extern template class VTKM_CONT_TEMPLATE_EXPORT CellSetStructured<2>;
|
|
|
|
extern template class VTKM_CONT_TEMPLATE_EXPORT CellSetStructured<3>;
|
|
|
|
#endif
|
2015-04-15 16:43:12 +00:00
|
|
|
}
|
|
|
|
} // namespace vtkm::cont
|
|
|
|
|
2016-12-16 22:04:58 +00:00
|
|
|
#include <vtkm/cont/CellSetStructured.hxx>
|
|
|
|
|
2015-04-15 16:43:12 +00:00
|
|
|
#endif //vtk_m_cont_CellSetStructured_h
|