//============================================================================ // 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 2015 Sandia Corporation. // Copyright 2015 UT-Battelle, LLC. // Copyright 2015 Los Alamos National Security. // // 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_cont_CellSetStructured_h #define vtk_m_cont_CellSetStructured_h #include #include #include #include #include #include namespace vtkm { namespace cont { template class VTKM_ALWAYS_EXPORT CellSetStructured : public CellSet { private: typedef vtkm::cont::CellSetStructured Thisclass; typedef vtkm::internal::ConnectivityStructuredInternals InternalsType; public: static const vtkm::IdComponent Dimension=DIMENSION; typedef typename InternalsType::SchedulingRangeType SchedulingRangeType; CellSetStructured(const std::string &name = std::string()) : CellSet(name), Structure() { } CellSetStructured(const Thisclass &src); Thisclass &operator=(const Thisclass &src); virtual vtkm::Id GetNumberOfCells() const { return this->Structure.GetNumberOfCells(); } virtual vtkm::Id GetNumberOfPoints() const { return this->Structure.GetNumberOfPoints(); } virtual vtkm::Id GetNumberOfFaces() const { return -1; } virtual vtkm::Id GetNumberOfEdges() const { return -1; } void SetPointDimensions(SchedulingRangeType dimensions) { this->Structure.SetPointDimensions(dimensions); } SchedulingRangeType GetPointDimensions() { return this->Structure.GetPointDimensions(); } SchedulingRangeType GetCellDimensions() { return this->Structure.GetCellDimensions(); } vtkm::IdComponent GetNumberOfPointsInCell(vtkm::Id vtkmNotUsed(cellIndex)=0) const { return this->Structure.GetNumberOfPointsInCell(); } vtkm::IdComponent GetCellShape() const { return this->Structure.GetCellShape(); } template SchedulingRangeType GetSchedulingRange(TopologyElement) const; template struct ExecutionTypes { VTKM_IS_DEVICE_ADAPTER_TAG(DeviceAdapter); VTKM_IS_TOPOLOGY_ELEMENT_TAG(FromTopology); VTKM_IS_TOPOLOGY_ELEMENT_TAG(ToTopology); typedef vtkm::exec::ConnectivityStructured ExecObjectType; }; template typename ExecutionTypes::ExecObjectType PrepareForInput(DeviceAdapter, FromTopology, ToTopology) const; virtual void PrintSummary(std::ostream &out) const; private: InternalsType Structure; }; #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 } } // namespace vtkm::cont #include #endif //vtk_m_cont_CellSetStructured_h